sdk2

package module
v0.0.0-...-7a59755 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2024 License: Apache-2.0 Imports: 16 Imported by: 3

Documentation

Index

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

func New(l *logger.Logger, appID uint64) (*Client, error)

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

func NewWifiDirect(l *logger.Logger) (*Client, error)

NewWifiDirect creates a new Client instance with the given logger. This client will connect to the robot using WiFi Direct.

func NewWifiDirectWithModules

func NewWifiDirectWithModules(l *logger.Logger,
	modules module.Type) (*Client, error)

func NewWithModules

func NewWithModules(l *logger.Logger, appID uint64,
	modules module.Type) (*Client, error)

NewWithModules is like New but allows selecting which mkodules to enable. The Connection and Robot modules are required.

func (*Client) Camera

func (c *Client) Camera() *camera.Camera

Camera returns the Camera module.

func (*Client) Chassis

func (c *Client) Chassis() *chassis.Chassis

Chassis returns the Chassis module.

func (*Client) Connection

func (c *Client) Connection() *connection.Connection

Connection returns the Connection module.

func (*Client) GamePad

func (c *Client) GamePad() *gamepad.GamePad

GamePad returns the GamePad module. The GamePad is optional and may be nil.

func (*Client) Gimbal

func (c *Client) Gimbal() *gimbal.Gimbal

Gimbal returns the Gimbal module.

func (*Client) Gun

func (c *Client) Gun() *gun.Gun

Gun returns the Gun module.

func (*Client) Robot

func (c *Client) Robot() *robot.Robot

Robot returns the Robot module.

func (*Client) Start

func (c *Client) Start() error

Start starts the client and all associated modules.

func (*Client) Stop

func (c *Client) Stop() error

Stop stops the client and all associated modules.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL