Documentation ¶
Index ¶
- Variables
- func Log(message string)
- func Sleep(milliseconds int)
- type Engine
- func (e *Engine) AddKeyboardDevice()
- func (e *Engine) BackFlip()
- func (e *Engine) Backward(speed int)
- func (e *Engine) Bounce()
- func (e *Engine) Down(speed int)
- func (e *Engine) Forward(speed int)
- func (e *Engine) FrontFlip()
- func (e *Engine) GetLastKeyPressed() string
- func (e *Engine) Land()
- func (e *Engine) Left(speed int)
- func (e *Engine) LeftFlip()
- func (e *Engine) ResetMovement()
- func (e *Engine) Right(speed int)
- func (e *Engine) RightFlip()
- func (e *Engine) RotateLeft(speed int)
- func (e *Engine) RotateRight(speed int)
- func (e *Engine) Start(autoRun bool)
- func (e *Engine) StartVideoStream()
- func (e *Engine) Stop()
- func (e *Engine) TakeOff()
- func (e *Engine) Up(speed int)
Constants ¶
This section is empty.
Variables ¶
var Debug = false
Debug flag. Set to true to view debug logs.
Functions ¶
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine is the main structure for controlling a drone.
func (*Engine) AddKeyboardDevice ¶
func (e *Engine) AddKeyboardDevice()
AddKeyboardDevice will add the keyboard device and start handling key presses. This MUST be called before Start.
func (*Engine) BackFlip ¶
func (e *Engine) BackFlip()
BackFlip will cause the drone to perform a back flip.
func (*Engine) Bounce ¶
func (e *Engine) Bounce()
Bounce will toggle "bouncing" the drone up and down.
func (*Engine) FrontFlip ¶
func (e *Engine) FrontFlip()
FrontFlip will cause the drone to perform a front flip.
func (*Engine) GetLastKeyPressed ¶
GetLastKeyPressed will return the last key that was pressed or an empty string if none.
func (*Engine) Land ¶
func (e *Engine) Land()
Land will lower the drone to the ground and stop the blades.
func (*Engine) LeftFlip ¶
func (e *Engine) LeftFlip()
LeftFlip will cause the drone to perform a left flip.
func (*Engine) ResetMovement ¶
func (e *Engine) ResetMovement()
ResetMovement will set all drone movement to 0.
func (*Engine) RightFlip ¶
func (e *Engine) RightFlip()
RightFlip will cause the drone to perform a right flip.
func (*Engine) RotateLeft ¶
RotateLeft will rotate the drone left at the given speed.
func (*Engine) RotateRight ¶
RotateRight will rotate the drone right at the given speed.
func (*Engine) Start ¶
Start the drone and allow input. If autoRun is true, this function will block.
func (*Engine) StartVideoStream ¶
func (e *Engine) StartVideoStream()
StartVideoStream will initialize the video player and begin streaming from the drone.