Documentation ¶
Index ¶
- type AnimationId
- type Client
- func (client *Client) Animate(id AnimationId, arg int)
- func (client *Client) Apply(state State)
- func (client *Client) ApplyFor(duration time.Duration, state State)
- func (client *Client) Backward(speed float64)
- func (client *Client) Clockwise(speed float64)
- func (client *Client) Connect() error
- func (client *Client) Counterclockwise(speed float64)
- func (client *Client) Down(speed float64)
- func (client *Client) Forward(speed float64)
- func (client *Client) Hover()
- func (client *Client) Land()
- func (client *Client) Left(speed float64)
- func (client *Client) Pitch(duration time.Duration, speed float64)
- func (client *Client) Right(speed float64)
- func (client *Client) Roll(duration time.Duration, speed float64)
- func (client *Client) Takeoff() bool
- func (client *Client) Up(speed float64)
- func (client *Client) Vertical(duration time.Duration, speed float64)
- func (client *Client) Yaw(duration time.Duration, speed float64)
- type Config
- type KeyVal
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnimationId ¶
type AnimationId int
const ( PHI_M30_DEG AnimationId = iota PHI_30_DEG THETA_M30_DEG THETA_30_DEG THETA_20_DEG_YAW_200_DEG THETA_20_DEG_YAWM_200_DEG TURNAROUND TURNAROUND_GODOWN YAW_SHAKE YAW_DANCE PHI_DANCE THETA_DANCE VZ_DANCE WAVE PHI_THETA_MIXED DOUBLE_PHI_THETA_MIXED FLIP_AHEAD FLIP_BEHIND FLIP_LEFT FLIP_RIGHT )
type Client ¶
type Client struct { Config Config // contains filtered or unexported fields }
func (*Client) Animate ¶
func (client *Client) Animate(id AnimationId, arg int)
func (*Client) Apply ¶
Apply sets the desired state of the drone. Internally this is turned into one or more commands that the sendLoop transmits to the drone every 30ms.
func (*Client) ApplyFor ¶
Applies a given state for a certain duration, and resets the state to its zero value (hover) before returning.
func (*Client) Counterclockwise ¶
type Config ¶
func DefaultConfig ¶
func DefaultConfig() Config
type State ¶
type State struct { Pitch float64 // -1 = max back, 1 = max forward Roll float64 // -1 = max left, 1 = max right Yaw float64 // -1 = max counter clockwise, 1 = max clockwise Vertical float64 // -1 = max down, 1 = max up Fly bool // Set to false for landing. Emergency bool // Used to disable / trigger emergency mode Config []KeyVal // Config values to send }
Click to show internal directories.
Click to hide internal directories.