Documentation ¶
Overview ¶
Package movementsensor defines the interfaces of a MovementSensor
Index ¶
- Constants
- Variables
- func GetHeading(gps1 *geo.Point, gps2 *geo.Point, yawOffset float64) (float64, float64, float64)
- func GetReadings(ctx context.Context, g MovementSensor) ([]interface{}, error)
- func Named(name string) resource.Name
- func NamesFromRobot(r robot.Robot) []string
- func NewServer(s subtype.Service) pb.MovementSensorServiceServer
- func WrapWithReconfigurable(r interface{}) (resource.Reconfigurable, error)
- type MovementSensor
- type Properties
Constants ¶
const SubtypeName = resource.SubtypeName("movement_sensor")
SubtypeName is a constant that identifies the component resource subtype string "movement_sensor".
Variables ¶
var Subtype = resource.NewSubtype( resource.ResourceNamespaceRDK, resource.ResourceTypeComponent, SubtypeName, )
Subtype is a constant that identifies the component resource subtype.
Functions ¶
func GetHeading ¶
GetHeading calculates bearing and absolute heading angles given 2 MovementSensor coordinates 0 degrees indicate North, 90 degrees indicate East and so on.
func GetReadings ¶
func GetReadings(ctx context.Context, g MovementSensor) ([]interface{}, error)
GetReadings is a helper for getting all readings from a MovementSensor.
func NamesFromRobot ¶
NamesFromRobot is a helper for getting all MovementSensor names from the given Robot.
func NewServer ¶
func NewServer(s subtype.Service) pb.MovementSensorServiceServer
NewServer constructs an MovementSensor gRPC service subtypeServer.
func WrapWithReconfigurable ¶
func WrapWithReconfigurable(r interface{}) (resource.Reconfigurable, error)
WrapWithReconfigurable - if MovementSensor is already a reconfigurableMovementSensor, then nothing is done. Otherwise wraps in a Reconfigurable.
Types ¶
type MovementSensor ¶
type MovementSensor interface { GetPosition(ctx context.Context) (*geo.Point, float64, error) // (lat, long), altitide (mm) GetLinearVelocity(ctx context.Context) (r3.Vector, error) // mm / sec GetAngularVelocity(ctx context.Context) (spatialmath.AngularVelocity, error) // radians / sec GetCompassHeading(ctx context.Context) (float64, error) // [0->360) GetOrientation(ctx context.Context) (spatialmath.Orientation, error) GetProperties(ctx context.Context) (*Properties, error) GetAccuracy(ctx context.Context) (map[string]float32, error) // in mm generic.Generic sensor.Sensor }
A MovementSensor reports information about the robot's direction, position and speed.
func FromDependencies ¶
func FromDependencies(deps registry.Dependencies, name string) (MovementSensor, error)
FromDependencies is a helper for getting the named movementsensor from a collection of dependencies.
func FromRobot ¶
func FromRobot(r robot.Robot, name string) (MovementSensor, error)
FromRobot is a helper for getting the named MovementSensor from the given Robot.
func NewClientFromConn ¶
func NewClientFromConn(ctx context.Context, conn rpc.ClientConn, name string, logger golog.Logger) MovementSensor
NewClientFromConn constructs a new Client from connection passed in.
type Properties ¶
type Properties pb.GetPropertiesResponse
Properties tells you what a MovementSensor supports.
Directories ¶
Path | Synopsis |
---|---|
Package fake is a fake MovementSensor for testing
|
Package fake is a fake MovementSensor for testing |
Package imuvectornav implement vectornav imu
|
Package imuvectornav implement vectornav imu |
Package imuwit implements a wit IMU.
|
Package imuwit implements a wit IMU. |
Package nmea implements an NMEA serial gps.
|
Package nmea implements an NMEA serial gps. |
Package register registers all relevant MovementSensors
|
Package register registers all relevant MovementSensors |
Package rtk defines the rtk correction receiver which sends rtcm data to child gps's
|
Package rtk defines the rtk correction receiver which sends rtcm data to child gps's |