Documentation ¶
Index ¶
- Constants
- Variables
- type ARStreamACK
- type ARStreamFrame
- type Bebop
- func (b *Bebop) Backward(val int) error
- func (b *Bebop) Clockwise(val int) error
- func (b *Bebop) Connect() error
- func (b *Bebop) CounterClockwise(val int) error
- func (b *Bebop) Discover() error
- func (b *Bebop) Down(val int) error
- func (b *Bebop) FlatTrim() error
- func (b *Bebop) Forward(val int) error
- func (b *Bebop) GenerateAllStates() error
- func (b *Bebop) HullProtection(protect bool) error
- func (b *Bebop) Land() error
- func (b *Bebop) Left(val int) error
- func (b *Bebop) Outdoor(outdoor bool) error
- func (b *Bebop) Right(val int) error
- func (b *Bebop) StartRecording() error
- func (b *Bebop) Stop() error
- func (b *Bebop) StopRecording() error
- func (b *Bebop) StopTelemetry() error
- func (b *Bebop) TakeOff() error
- func (b *Bebop) Telemetry() chan bbtelem.TelemetryPacket
- func (b *Bebop) Up(val int) error
- func (b *Bebop) Video() chan []byte
- type NetworkFrame
- type Pcmd
Constants ¶
const ( // libARNetworkAL/Includes/libARNetworkAL/ARNETWORKAL_Manager.h ARNETWORKAL_MANAGER_DEFAULT_ID_MAX uint16 = 256 // ARNETWORKAL_Frame_t identifiers BD_NET_CD_NONACK_ID byte = 10 BD_NET_CD_ACK_ID byte = 11 BD_NET_CD_EMERGENCY_ID byte = 12 BD_NET_CD_VIDEO_ACK_ID byte = 13 BD_NET_DC_VIDEO_DATA_ID byte = 125 // Following two, along with byte(0) (PING), BD_NET_DC_EVENT_ID byte = 126 // 0x7E BD_NET_DC_NAVDATA_ID byte = 127 // 0x7F // eARCOMMANDS_ID_PROJECT ARCOMMANDS_ID_PROJECT_COMMON byte = 0 ARCOMMANDS_ID_PROJECT_ARDRONE3 byte = 1 // eARCOMMANDS_ID_ARDRONE3_CLASS ARCOMMANDS_ID_ARDRONE3_CLASS_PILOTING byte = 0 ARCOMMANDS_ID_ARDRONE3_CLASS_CAMERA byte = 1 ARCOMMANDS_ID_ARDRONE3_CLASS_PILOTINGSETTINGS byte = 2 ARCOMMANDS_ID_ARDRONE3_CLASS_MEDIARECORDEVENT byte = 3 ARCOMMANDS_ID_ARDRONE3_CLASS_PILOTINGSTATE byte = 4 ARCOMMANDS_ID_ARDRONE3_CLASS_ANIMATIONS byte = 5 ARCOMMANDS_ID_ARDRONE3_CLASS_PILOTINGSETTINGSSTATE byte = 6 ARCOMMANDS_ID_ARDRONE3_CLASS_MEDIARECORD byte = 7 ARCOMMANDS_ID_ARDRONE3_CLASS_MEDIARECORDSTATE byte = 8 ARCOMMANDS_ID_ARDRONE3_CLASS_NETWORKSETTINGS byte = 9 ARCOMMANDS_ID_ARDRONE3_CLASS_NETWORKSETTINGSSTATE byte = 10 ARCOMMANDS_ID_ARDRONE3_CLASS_SPEEDSETTINGS byte = 11 ARCOMMANDS_ID_ARDRONE3_CLASS_SPEEDSETTINGSSTATE byte = 12 ARCOMMANDS_ID_ARDRONE3_CLASS_NETWORK byte = 13 ARCOMMANDS_ID_ARDRONE3_CLASS_NETWORKSTATE byte = 14 ARCOMMANDS_ID_ARDRONE3_CLASS_SETTINGS byte = 15 ARCOMMANDS_ID_ARDRONE3_CLASS_SETTINGSSTATE byte = 16 ARCOMMANDS_ID_ARDRONE3_CLASS_DIRECTORMODE byte = 17 ARCOMMANDS_ID_ARDRONE3_CLASS_DIRECTORMODESTATE byte = 18 ARCOMMANDS_ID_ARDRONE3_CLASS_PICTURESETTINGS byte = 19 ARCOMMANDS_ID_ARDRONE3_CLASS_PICTURESETTINGSSTATE byte = 20 ARCOMMANDS_ID_ARDRONE3_CLASS_MEDIASTREAMING byte = 21 ARCOMMANDS_ID_ARDRONE3_CLASS_MEDIASTREAMINGSTATE byte = 22 ARCOMMANDS_ID_ARDRONE3_CLASS_GPSSETTINGS byte = 23 ARCOMMANDS_ID_ARDRONE3_CLASS_GPSSETTINGSSTATE byte = 24 ARCOMMANDS_ID_ARDRONE3_CLASS_CAMERASTATE byte = 25 ARCOMMANDS_ID_ARDRONE3_CLASS_ANTIFLICKERING byte = 29 ARCOMMANDS_ID_ARDRONE3_CLASS_ANTIFLICKERINGSTATE byte = 30 // eARCOMMANDS_ID_ARDRONE3_PILOTINGSTATE_CMD ARCOMMANDS_ID_ARDRONE3_PILOTINGSTATE_CMD_FLATTRIMCHANGED byte = 0 ARCOMMANDS_ID_ARDRONE3_PILOTINGSTATE_CMD_FLYINGSTATECHANGED byte = 1 ARCOMMANDS_ID_ARDRONE3_PILOTINGSTATE_CMD_ALERTSTATECHANGED byte = 2 ARCOMMANDS_ID_ARDRONE3_PILOTINGSTATE_CMD_NAVIGATEHOMESTATECHANGED byte = 3 ARCOMMANDS_ID_ARDRONE3_PILOTINGSTATE_CMD_POSITIONCHANGED byte = 4 ARCOMMANDS_ID_ARDRONE3_PILOTINGSTATE_CMD_SPEEDCHANGED byte = 5 ARCOMMANDS_ID_ARDRONE3_PILOTINGSTATE_CMD_ATTITUDECHANGED byte = 6 ARCOMMANDS_ID_ARDRONE3_PILOTINGSTATE_CMD_AUTOTAKEOFFMODECHANGED byte = 7 ARCOMMANDS_ID_ARDRONE3_PILOTINGSTATE_CMD_ALTITUDECHANGED byte = 8 ARCOMMANDS_ID_ARDRONE3_PILOTINGSTATE_CMD_MAX byte = 9 // eARCOMMANDS_ID_ARDRONE3_ANIMATIONS_CMD; ARCOMMANDS_ID_ARDRONE3_ANIMATIONS_CMD_FLIP byte = 0 ARCOMMANDS_ID_ARDRONE3_ANIMATIONS_CMD_MAX byte = 1 // eARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE; ARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE_LANDED byte = 0 ARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE_TAKINGOFF byte = 1 ARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE_HOVERING byte = 2 ARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE_FLYING byte = 3 ARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE_LANDING byte = 4 ARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE_EMERGENCY byte = 5 ARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE_MAX byte = 6 // Manually added from: https://github.com/Parrot-Developers/libARCommands/blob/master/Xml/ARDrone3_commands.xml#L974 // ARCOMMANDS_ID_ARDRONE3_CLASS_NETWORKSETTINGSSTATE // See telemetry.go for handling and variable-decoding code. ARCOMMANDS_ARDRONE3_NETWORKSETTINGSSTATECHANGED_STATE_WIFISELECTIONCHANGED byte = 0 // Manually added from: https://github.com/Parrot-Developers/libARCommands/blob/master/Xml/ARDrone3_commands.xml#L1250 // See telemetry.go for handling and variable-decoding code. ARCOMMANDS_ARDRONE3_PICTURESETTINGSSTATECHANGED_STATE_PICTUREFORMATCHANGED byte = 0 ARCOMMANDS_ARDRONE3_PICTURESETTINGSSTATECHANGED_STATE_AUTOWHITEBALANCECHANGED byte = 1 ARCOMMANDS_ARDRONE3_PICTURESETTINGSSTATECHANGED_STATE_EXPOSITIONCHANGED byte = 2 ARCOMMANDS_ARDRONE3_PICTURESETTINGSSTATECHANGED_STATE_SATURATIONCHANGED byte = 3 ARCOMMANDS_ARDRONE3_PICTURESETTINGSSTATECHANGED_STATE_TIMELAPSECHANGED byte = 4 ARCOMMANDS_ARDRONE3_PICTURESETTINGSSTATECHANGED_STATE_VIDEOAUTORECORDCHANGED byte = 5 // eARCOMMANDS_ARDRONE3_ANIMATIONS_FLIP_DIRECTION; ARCOMMANDS_ARDRONE3_ANIMATIONS_FLIP_DIRECTION_FRONT byte = 0 ARCOMMANDS_ARDRONE3_ANIMATIONS_FLIP_DIRECTION_BACK byte = 1 ARCOMMANDS_ARDRONE3_ANIMATIONS_FLIP_DIRECTION_RIGHT byte = 2 ARCOMMANDS_ARDRONE3_ANIMATIONS_FLIP_DIRECTION_LEFT byte = 3 ARCOMMANDS_ARDRONE3_ANIMATIONS_FLIP_DIRECTION_MAX byte = 4 // eARCOMMANDS_ID_COMMON_CLASS ARCOMMANDS_ID_COMMON_CLASS_NETWORK byte = 0 ARCOMMANDS_ID_COMMON_CLASS_NETWORKEVENT byte = 1 ARCOMMANDS_ID_COMMON_CLASS_SETTINGS byte = 2 ARCOMMANDS_ID_COMMON_CLASS_SETTINGSSTATE byte = 3 ARCOMMANDS_ID_COMMON_CLASS_COMMON byte = 4 ARCOMMANDS_ID_COMMON_CLASS_COMMONSTATE byte = 5 ARCOMMANDS_ID_COMMON_CLASS_OVERHEAT byte = 6 ARCOMMANDS_ID_COMMON_CLASS_OVERHEATSTATE byte = 7 ARCOMMANDS_ID_COMMON_CLASS_CONTROLLERSTATE byte = 8 ARCOMMANDS_ID_COMMON_CLASS_WIFISETTINGS byte = 9 ARCOMMANDS_ID_COMMON_CLASS_WIFISETTINGSSTATE byte = 10 ARCOMMANDS_ID_COMMON_CLASS_MAVLINK byte = 11 ARCOMMANDS_ID_COMMON_CLASS_MAVLINKSTATE byte = 12 ARCOMMANDS_ID_COMMON_CLASS_CALIBRATION byte = 13 ARCOMMANDS_ID_COMMON_CLASS_CALIBRATIONSTATE byte = 14 ARCOMMANDS_ID_COMMON_CLASS_CAMERASETTINGSSTATE byte = 15 ARCOMMANDS_ID_COMMON_CLASS_GPS byte = 16 ARCOMMANDS_ID_COMMON_CLASS_FLIGHTPLANSTATE byte = 17 ARCOMMANDS_ID_COMMON_CLASS_ARLIBSVERSIONSSTATE byte = 18 ARCOMMANDS_ID_COMMON_CLASS_FLIGHTPLANEVENT byte = 19 // eARCOMMANDS_ID_ARDRONE3_PILOTING_CMD ARCOMMANDS_ID_ARDRONE3_PILOTING_CMD_FLATTRIM byte = 0 ARCOMMANDS_ID_ARDRONE3_PILOTING_CMD_TAKEOFF byte = 1 ARCOMMANDS_ID_ARDRONE3_PILOTING_CMD_PCMD byte = 2 ARCOMMANDS_ID_ARDRONE3_PILOTING_CMD_LANDING byte = 3 ARCOMMANDS_ID_ARDRONE3_PILOTING_CMD_EMERGENCY byte = 4 ARCOMMANDS_ID_ARDRONE3_PILOTING_CMD_NAVIGATEHOME byte = 5 ARCOMMANDS_ID_ARDRONE3_PILOTING_CMD_AUTOTAKEOFFMODE byte = 6 ARCOMMANDS_ID_ARDRONE3_PILOTING_CMD_MAX byte = 7 // eARCOMMANDS_ID_ARDRONE3_MEDIARECORD_CMD ARCOMMANDS_ID_ARDRONE3_MEDIARECORD_CMD_PICTURE byte = 0 ARCOMMANDS_ID_ARDRONE3_MEDIARECORD_CMD_VIDEO byte = 1 ARCOMMANDS_ID_ARDRONE3_MEDIARECORD_CMD_PICTUREV2 byte = 2 ARCOMMANDS_ID_ARDRONE3_MEDIARECORD_CMD_VIDEOV2 byte = 3 ARCOMMANDS_ID_ARDRONE3_MEDIARECORD_CMD_MAX byte = 4 // eARCOMMANDS_ARDRONE3_MEDIARECORD_VIDEO_RECORD ARCOMMANDS_ARDRONE3_MEDIARECORD_VIDEO_RECORD_STOP byte = 0 ARCOMMANDS_ARDRONE3_MEDIARECORD_VIDEO_RECORD_START byte = 1 ARCOMMANDS_ARDRONE3_MEDIARECORD_VIDEO_RECORD_MAX byte = 2 // eARCOMMANDS_ID_COMMON_COMMON_CMD ARCOMMANDS_ID_COMMON_COMMON_CMD_ALLSTATES byte = 0 ARCOMMANDS_ID_COMMON_COMMON_CMD_CURRENTDATE byte = 1 ARCOMMANDS_ID_COMMON_COMMON_CMD_CURRENTTIME byte = 2 ARCOMMANDS_ID_COMMON_COMMON_CMD_REBOOT byte = 3 ARCOMMANDS_ID_COMMON_COMMON_CMD_MAX byte = 4 // eARCOMMANDS_ID_COMMON_COMMONSTATE_CMD; ARCOMMANDS_ID_COMMON_COMMONSTATE_CMD_ALLSTATESCHANGED byte = 0 ARCOMMANDS_ID_COMMON_COMMONSTATE_CMD_BATTERYSTATECHANGED byte = 1 ARCOMMANDS_ID_COMMON_COMMONSTATE_CMD_MASSSTORAGESTATELISTCHANGED byte = 2 ARCOMMANDS_ID_COMMON_COMMONSTATE_CMD_MASSSTORAGEINFOSTATELISTCHANGED byte = 3 ARCOMMANDS_ID_COMMON_COMMONSTATE_CMD_CURRENTDATECHANGED byte = 4 ARCOMMANDS_ID_COMMON_COMMONSTATE_CMD_CURRENTTIMECHANGED byte = 5 ARCOMMANDS_ID_COMMON_COMMONSTATE_CMD_MASSSTORAGEINFOREMAININGLISTCHANGED byte = 6 ARCOMMANDS_ID_COMMON_COMMONSTATE_CMD_WIFISIGNALCHANGED byte = 7 ARCOMMANDS_ID_COMMON_COMMONSTATE_CMD_SENSORSSTATESLISTCHANGED byte = 8 ARCOMMANDS_ID_COMMON_COMMONSTATE_CMD_PRODUCTMODEL byte = 9 ARCOMMANDS_ID_COMMON_COMMONSTATE_CMD_COUNTRYLISTKNOWN byte = 10 ARCOMMANDS_ID_COMMON_COMMONSTATE_CMD_MAX byte = 11 // eARMEDIA_ENCAPSULER_CODEC CODEC_UNKNNOWN byte = 0 CODEC_VLIB byte = 1 CODEC_P264 byte = 2 CODEC_MPEG4_VISUAL byte = 3 CODEC_MPEG4_AVC byte = 4 CODEC_MOTION_JPEG byte = 5 // eARMEDIA_ENCAPSULER_FRAME_TYPE; ARMEDIA_ENCAPSULER_FRAME_TYPE_UNKNNOWN byte = 0 ARMEDIA_ENCAPSULER_FRAME_TYPE_I_FRAME byte = 1 ARMEDIA_ENCAPSULER_FRAME_TYPE_P_FRAME byte = 2 ARMEDIA_ENCAPSULER_FRAME_TYPE_JPEG byte = 3 ARMEDIA_ENCAPSULER_FRAME_TYPE_MAX byte = 4 // eARNETWORK_MANAGER_INTERNAL_BUFFER_ID ARNETWORK_MANAGER_INTERNAL_BUFFER_ID_PING byte = 0 ARNETWORK_MANAGER_INTERNAL_BUFFER_ID_PONG byte = 1 ARNETWORK_MANAGER_INTERNAL_BUFFER_ID_MAX byte = 3 // 2? // eARNETWORKAL_FRAME_TYPE ARNETWORKAL_FRAME_TYPE_UNINITIALIZED byte = 0 ARNETWORKAL_FRAME_TYPE_ACK byte = 1 ARNETWORKAL_FRAME_TYPE_DATA byte = 2 ARNETWORKAL_FRAME_TYPE_DATA_LOW_LATENCY byte = 3 ARNETWORKAL_FRAME_TYPE_DATA_WITH_ACK byte = 4 ARNETWORKAL_FRAME_TYPE_MAX byte = 5 ARCOMMANDS_ID_ARDRONE3_SPEEDSETTINGS_CMD_MAXVERTICALSPEED byte = 0 ARCOMMANDS_ID_ARDRONE3_SPEEDSETTINGS_CMD_MAXROTATIONSPEED byte = 1 ARCOMMANDS_ID_ARDRONE3_SPEEDSETTINGS_CMD_HULLPROTECTION byte = 2 ARCOMMANDS_ID_ARDRONE3_SPEEDSETTINGS_CMD_OUTDOOR byte = 3 )
Variables ¶
var ErrEnumBadSize = errors.New("Wrong size binary given for a Bebop enum. Expected 4.")
ErrEnumBadSize can be returned by decodeEnum, an internal function, and may be propagated elsewhere.
var ErrEnumOutOfRange = errors.New("Enum value fell outside expected range.")
ErrEnumOutOfRange can be returned by decodeEnum, an internal function, and may be propagated elsewhere.
var ErrNotString = errors.New("Could not locate a NUL byte in presumed NUL-terminated string")
ErrNotString is returned if a string expected to end in NUL, didn't (returned from internal function parseNullTermedString).
var ErrTelemSend = errors.New("Failed to send telemetry; channel full.")
ErrTelemSend occurs in dispatchTelemetry, an internal method, and may be propagated. It is sent when the internal channel for telemetry is full.
Functions ¶
This section is empty.
Types ¶
type ARStreamACK ¶
ARStreamACK is a decoded stream ACK from a Bebop.
type ARStreamFrame ¶
type ARStreamFrame struct { FrameNumber int FrameFlags int FragmentNumber int FragmentsPerFrame int Frame []byte }
ARStreamFrame is a decoded frame as received from the Bebop.
func NewARStreamFrame ¶
func NewARStreamFrame(buf []byte) ARStreamFrame
NewARStreamFrame decodes a buffer into an ARStreamFrame for further processing.
type Bebop ¶
type Bebop struct { IP string Pcmd Pcmd C2dPort int D2cPort int DiscoveryPort int // contains filtered or unexported fields }
Bebop represents a Bebop drone at a low-enough level to mediate connecting and communicating over Wifi.
func (*Bebop) CounterClockwise ¶
CounterClockwise issues a yaw instruction counter-clockwise
func (*Bebop) GenerateAllStates ¶
GenerateAllStates sends a Project:Common:AllStates command to the Bebop.
func (*Bebop) HullProtection ¶
HullProtection modifies onboard flight settings to account for the hull shield
func (*Bebop) StartRecording ¶
StartRecording instructs the Bebop to begin recording to built-in memory
func (*Bebop) StopRecording ¶
StopRecording instructs the Bebop to cease recording.
func (*Bebop) StopTelemetry ¶
StopTelemetry stops further telemetry from being sent
func (*Bebop) Telemetry ¶
func (b *Bebop) Telemetry() chan bbtelem.TelemetryPacket
Telemetry returns a channel on which to receive telemetry packets.
type NetworkFrame ¶
NetworkFrame is decoded from the Bebop.
func NewNetworkFrame ¶
func NewNetworkFrame(buf []byte) NetworkFrame
NewNetworkFrame decodes a buffer to a NetworkFrame