Documentation
¶
Overview ¶
Package dimensionengineering contains implementations of the dimensionengineering motor controls
Index ¶
- func NewMotor(ctx context.Context, c *Config, logger golog.Logger) (motor.LocalMotor, error)
- type Config
- type Motor
- func (m *Motor) Close()
- func (m *Motor) DoCommand(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error)
- func (m *Motor) GoFor(ctx context.Context, rpm, revolutions float64, extra map[string]interface{}) error
- func (m *Motor) GoTillStop(ctx context.Context, rpm float64, stopFunc func(ctx context.Context) bool) error
- func (m *Motor) GoTo(ctx context.Context, rpm, position float64, extra map[string]interface{}) error
- func (m *Motor) IsMoving(ctx context.Context) (bool, error)
- func (m *Motor) IsPowered(ctx context.Context, extra map[string]interface{}) (bool, error)
- func (m *Motor) Position(ctx context.Context, extra map[string]interface{}) (float64, error)
- func (m *Motor) Properties(ctx context.Context, extra map[string]interface{}) (map[motor.Feature]bool, error)
- func (m *Motor) ResetZeroPosition(ctx context.Context, offset float64, extra map[string]interface{}) error
- func (m *Motor) SetPower(ctx context.Context, powerPct float64, extra map[string]interface{}) error
- func (m *Motor) Stop(ctx context.Context, extra map[string]interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { SerialDevice string `json:"serial_device"` // path to /dev/ttyXXXX file Channel int `json:"channel"` // 1/2 // TestChan is a fake "serial" path for test use only TestChan chan []byte `json:"-,omitempty"` Address int `json:"address"` // 128-135 }
Config adds DimensionEngineering-specific config options.
type Motor ¶
type Motor struct { Channel int // contains filtered or unexported fields }
Motor is a single axis/motor/component instance.
func (*Motor) DoCommand ¶
func (m *Motor) DoCommand(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error)
DoCommand executes additional commands beyond the Motor{} interface.
func (*Motor) GoFor ¶
func (m *Motor) GoFor(ctx context.Context, rpm, revolutions float64, extra map[string]interface{}) error
GoFor Not supported.
func (*Motor) GoTillStop ¶
func (m *Motor) GoTillStop(ctx context.Context, rpm float64, stopFunc func(ctx context.Context) bool) error
GoTillStop moves a motor until stopped by the controller (due to switch or function) or stopFunc.
func (*Motor) GoTo ¶
func (m *Motor) GoTo(ctx context.Context, rpm, position float64, extra map[string]interface{}) error
GoTo instructs the motor to go to a specific position (provided in revolutions from home/zero), at a specific speed. Regardless of the directionality of the RPM this function will move the motor towards the specified target/position.
func (*Motor) Properties ¶
func (m *Motor) Properties(ctx context.Context, extra map[string]interface{}) (map[motor.Feature]bool, error)
Properties returns the additional features supported by this motor.
func (*Motor) ResetZeroPosition ¶
func (m *Motor) ResetZeroPosition(ctx context.Context, offset float64, extra map[string]interface{}) error
ResetZeroPosition defines the current position to be zero (+/- offset).