Documentation ¶
Index ¶
- Constants
- type App
- type Camera
- func (c *Camera) GLTextureData() (*GLTextureData, error)
- func (c *Camera) IsRecordingVideo() (isRecording bool, err error)
- func (c *Camera) RecordingTimeInSeconds() (recordingTime int64)
- func (c *Camera) RenderNextFrame()
- func (c *Camera) StartRecordingVideo() (err error)
- func (c *Camera) StartVideo() (err error)
- func (c *Camera) StopRecordingVideo() (err error)
- func (c *Camera) StopVideo() (err error)
- type Chassis
- type Client
- type Connection
- type GLTextureData
- type GamePad
- type QRCode
- type Robot
- type SDCard
- func (s *SDCard) AvailablePhotoCount() (int64, error)
- func (s *SDCard) AvailableRecordingTimeInSeconds() (int64, error)
- func (s *SDCard) Format() error
- func (s *SDCard) HasError() (bool, error)
- func (s *SDCard) IsFormatting() (bool, error)
- func (s *SDCard) IsFull() (bool, error)
- func (s *SDCard) IsInserted() (bool, error)
- func (s *SDCard) RemainingSpaceInMB() (int64, error)
- func (s *SDCard) TotalSpaceInMB() (int64, error)
- type StickPosition
Constants ¶
const ( CameraHorizontalResolutionPoints = camera.HorizontalResolutionPoints CameraVerticalResolutionPoints = camera.VerticalResolutionPoints CameraHorizontalFOVDegrees = camera.HorizontalFOVDegrees CameraVerticalFOVDegrees = camera.VerticalFOVDegrees )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App holds the ID for a specific app.
type Camera ¶
type Camera struct {
// contains filtered or unexported fields
}
Camera allows controlling the robot camera.
func (*Camera) GLTextureData ¶
func (c *Camera) GLTextureData() (*GLTextureData, error)
GLTextureData returns information about the current texture used for rendering frames. See RenderNextFrame() above.
func (*Camera) IsRecordingVideo ¶
IsRecordingVideo returns true if the camera is currently recording video.
func (*Camera) RecordingTimeInSeconds ¶
RecordingTimeInSeconds returns the current recording time in seconds.
func (*Camera) RenderNextFrame ¶
func (c *Camera) RenderNextFrame()
RenderNextFrame requests the next frame to be rendered. This is used by iOS and the frame will be rendered to a texture associated with an OpenGLES 2.0 context that was current when Start() is called. This should be called for for each frame to be rendered (up to 60 times per second).
func (*Camera) StartRecordingVideo ¶
StartRecordingVideo starts recording video from the camera to the robot's SD card.
func (*Camera) StartVideo ¶
StartVideo starts the camera video stream.
func (*Camera) StopRecordingVideo ¶
StopRecordingVideo stops recording video from the camera to the robot's SD card.
type Chassis ¶
type Chassis struct {
// contains filtered or unexported fields
}
Chassis allows controlling the robot chassis. It also works as the robot main controller interface.
func (*Chassis) Move ¶
func (c *Chassis) Move(ls *StickPosition, rs *StickPosition) error
Move moves the robot using the given stick positions. The left stick controls the robot's gimbal and chassis rotation and the right stick controls the robot's chassis (up/down/left/right).
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the main entry point for the mobile SDK.
func NewClient ¶
NewClient creates a new Client instance. If appID is 0, the client will try to connect to the first available Robomaster robot. If it is non-zero, it will only connect to a robot that is broadcasting the given appID. The appID can be configured in the robot through a qrcode.
func NewWifiDirectClient ¶
NewWifiDirectClient creates a new Client instance that will connect to a Robomaster robot using Wifi Direct.
func (*Client) Connection ¶
func (c *Client) Connection() *Connection
Connnection returns the Connection instance for the client.
func (*Client) GamePad ¶
GamePad returns the GamePad instance for the client. The GamePad is optional and may be nil.
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
Camera allows controlling the robot's connection.
func (*Connection) SignalQualityBars ¶
func (c *Connection) SignalQualityBars() int8
SignalQualityBars returns the current signal quality bars (1 to 4).
func (*Connection) SignalQualityLevel ¶
func (c *Connection) SignalQualityLevel() int8
SignalQualityLevel returns the current signal quality level (0 to 60).
type GLTextureData ¶
type GamePad ¶
type GamePad struct {
// contains filtered or unexported fields
}
GamePad allows controlling the DJI Robomaster gamepad accessory.
func (*GamePad) FirePressed ¶
FirePressed returns whether the fire button is pressed.
type QRCode ¶
type QRCode struct {
// contains filtered or unexported fields
}
QRCode allows generating QRCodes that can be read by a Robomaster robot.
type Robot ¶
type Robot struct {
// contains filtered or unexported fields
}
Robot allows reading the robot parameters.
func (*Robot) BatteryPowerPercent ¶
BatteryPowerPercent returns the current battery power percent (0 to 100).
func (*Robot) ChassisSpeedLevel ¶
ChassisSpeedLevel returns the current chassis speed level.
func (*Robot) SetChassisSpeedLevel ¶
SetChassisSpeedLevel sets the chassis speed level. Valid values are 0 (Fast), 1 (Medium) and 2 (Slow).
type SDCard ¶
type SDCard struct {
// contains filtered or unexported fields
}
SDCard allows handling an SD card inserted into the robot.
func (*SDCard) AvailablePhotoCount ¶
AvailablePhotoCount returns the estimated available photo count in the SD card.
func (*SDCard) AvailableRecordingTimeInSeconds ¶
AvailableRecordingTimeInSeconds returns the estimated available recording time in seconds.
func (*SDCard) IsFormatting ¶
IsFormatting returns true if the SD card is being formatted.
func (*SDCard) IsInserted ¶
IsInserted returns true if an SD card is inserted into the robot.
func (*SDCard) RemainingSpaceInMB ¶
RemainingSpaceInMB returns the remaining space in MB of the SD card.
func (*SDCard) TotalSpaceInMB ¶
TotalSpaceInMB returns the total space in MB of the SD card.
type StickPosition ¶
type StickPosition struct {
// contains filtered or unexported fields
}
StickPosition represents the position of a stick controller.
func NewStickPosition ¶
func NewStickPosition(x, y float64) *StickPosition
NewStickPosition creates a new StickPosition with the given X and Y positions.
func (*StickPosition) InterpolatedX ¶
func (s *StickPosition) InterpolatedX() int64
InterpolatedX returns the interpolated X position of the stick controller.
func (*StickPosition) InterpolatedY ¶
func (s *StickPosition) InterpolatedY() int64
InterpolatedY returns the interpolated Y position of the stick controller.
func (*StickPosition) Set ¶
func (s *StickPosition) Set(x, y float64)
Set sets the position of the stick controller. X and Y must be between 0.0 and 1.0.