Documentation ¶
Index ¶
- type Client
- func (c *Client) Camera() *camera.Camera
- func (c *Client) Chassis() *chassis.Chassis
- func (c *Client) Connection() *connection.Connection
- func (c *Client) GamePad() *gamepad.GamePad
- func (c *Client) Gimbal() *gimbal.Gimbal
- func (c *Client) Gun() *gun.Gun
- func (c *Client) Robot() *robot.Robot
- func (c *Client) Start() error
- func (c *Client) Stop() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func New ¶
New creates a new Client instance with the given logger and appID. The appID parameter is used to determine which robot to connect to (i.e. it will only connect to robots broadcasting the given appID). If appID is 0, the client will connect to the first robot it finds.
To get a robot to broadcast a given appID, use a QRCode to configure it (see https://github.com/brunoga/robomaster/sdk2/unitybridge/blob/main/support/qrcode/qrcode.go).
func NewWifiDirect ¶
NewWifiDirect creates a new Client instance with the given logger. This client will connect to the robot using WiFi Direct.
func NewWithModules ¶
NewWithModules is like New but allows selecting which mkodules to enable. The Connection and Robot modules are required.
func (*Client) Connection ¶
func (c *Client) Connection() *connection.Connection
Connection returns the Connection module.
func (*Client) GamePad ¶
GamePad returns the GamePad module. The GamePad is optional and may be nil.