Documentation
¶
Index ¶
- Constants
- Variables
- func StateEventHandler(f func(s State)) astikit.EventerHandler
- func VideoPacketEventHandler(f func(p []byte)) astikit.EventerHandler
- type Acceleration
- type Attitude
- type Drone
- func (d *Drone) Back(x int) (err error)
- func (d *Drone) Close()
- func (d *Drone) Curve(x1, y1, z1, x2, y2, z2, speed int) (err error)
- func (d *Drone) Down(x int) (err error)
- func (d *Drone) Emergency() (err error)
- func (d *Drone) Flip(x string) (err error)
- func (d *Drone) Forward(x int) (err error)
- func (d *Drone) Go(x, y, z, speed int) (err error)
- func (d *Drone) Land() (err error)
- func (d *Drone) Left(x int) (err error)
- func (d *Drone) On(name string, h astikit.EventerHandler)
- func (d *Drone) Right(x int) (err error)
- func (d *Drone) RotateClockwise(x int) (err error)
- func (d *Drone) RotateCounterClockwise(x int) (err error)
- func (d *Drone) SetSpeed(x int) (err error)
- func (d *Drone) SetSticks(lr, fb, ud, y int) (err error)
- func (d *Drone) SetWifi(ssid, password string) (err error)
- func (d *Drone) Speed() (x int, err error)
- func (d *Drone) Start() (err error)
- func (d *Drone) StartVideo() (err error)
- func (d *Drone) State() State
- func (d *Drone) StopVideo() (err error)
- func (d *Drone) TakeOff() (err error)
- func (d *Drone) Up(x int) (err error)
- func (d *Drone) Wifi() (snr int, err error)
- type Speed
- type State
Constants ¶
const ( LandEvent = "land" StateEvent = "state" TakeOffEvent = "take.off" VideoPacketEvent = "video.packet" )
Events
const ( FlipBack = "b" FlipForward = "f" FlipLeft = "l" FlipRight = "r" )
Flip directions
Variables ¶
var ErrNotConnected = errors.New("astitello: not connected")
ErrNotConnected is the error thrown when trying to send a cmd while not connected to the drone
Functions ¶
func StateEventHandler ¶
func StateEventHandler(f func(s State)) astikit.EventerHandler
StateEventHandler returns the proper EventHandler for the State event
func VideoPacketEventHandler ¶
func VideoPacketEventHandler(f func(p []byte)) astikit.EventerHandler
VideoPacketEventHandler returns the proper EventHandler for the VideoPacket event
Types ¶
type Acceleration ¶
Acceleration represents the drone's acceleration
type Attitude ¶
type Attitude struct {
Pitch int // The degree of the attitude pitch
Roll int // The degree of the attitude roll
Yaw int // The degree of the attitude yaw
}
Attitude represents the drone's attitude
type Drone ¶
type Drone struct {
// contains filtered or unexported fields
}
Drone represents an object capable of interacting with the SDK
func (*Drone) Curve ¶
Curve makes Tello fly a curve defined by the current and two given coordinates with speed (cm/s)
func (*Drone) Emergency ¶
Emergency makes Tello stop all motors immediately This cmd doesn't seem to be receiving any response, that's why we don't provide any handler
func (*Drone) Flip ¶
Flip makes Tello flip in the specified direction Check out Flip... constants for available flip directions
func (*Drone) On ¶
func (d *Drone) On(name string, h astikit.EventerHandler)
On adds an event handler
func (*Drone) RotateClockwise ¶
RotateClockwise makes Tello rotate x degree clockwise
func (*Drone) RotateCounterClockwise ¶
RotateCounterClockwise makes Tello rotate x degree counter-clockwise
func (*Drone) SetSticks ¶
SetSticks sends RC control via four channels All values are between -100 and 100 lr: left/right fb: forward/backward ud: up/down y: yawn This cmd doesn't seem to be receiving any response, that's why we don't provide any handler
func (*Drone) SetWifi ¶
SetWifi sets Wi-Fi with SSID password I couldn't make this work (it returned 'error' even though the SSID was changed but the password was not) If anyone manages to make it work, create an issue in github, I'm really interested in how you managed that :D
func (*Drone) StartVideo ¶
StartVideo makes Tello start streaming video
type State ¶
type State struct {
Acceleration Acceleration // The acceleration
Attitude Attitude // The attitude
Barometer float64 // The barometer measurement in cm
Battery int // The percentage of the current battery level
FlightDistance int // The time of flight distance in cm
FlightTime int // The amount of time the motor has been used
Height int // The height in cm
HighestTemperature int // The highest temperature in degree Celsius
LowestTemperature int // The lowest temperature in degree Celsius
Speed Speed // The speed
}
State represents the drone's state