controller

package
v0.0.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2024 License: Apache-2.0 Imports: 10 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	*internal.BaseModule
}

Controller is the robot's main controller interface. It is also responsibe for movement using the dual stick interface.

func New

New creates a new Controller instance.

func (*Controller) Move

func (c *Controller) Move(chassisStick *StickPosition,
	gimbalStick *StickPosition, m Mode) error

Move moves the robot using the given stick positions and control mode.

func (*Controller) SetMode

func (c *Controller) SetMode(m Mode) error

SetMode sets the controller mode for the robot.

type Mode

type Mode uint8

Mode is the type of control mode for the robot.

const (
	// ModeFPV enables the dual stick controller type.
	ModeFPV Mode = iota
	// ModeSDK enables the SDK controller type.
	ModeSDK
)

func (Mode) String

func (m Mode) String() string

func (Mode) Valid

func (m Mode) Valid() bool

type StickPosition

type StickPosition struct {
	X float64
	Y float64
}

func (*StickPosition) InterpolatedX

func (s *StickPosition) InterpolatedX() uint64

func (*StickPosition) InterpolatedY

func (s *StickPosition) InterpolatedY() uint64

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL