movementsensor

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: AGPL-3.0 Imports: 23 Imported by: 14

Documentation

Overview

Package movementsensor defines the interfaces of a MovementSensor

Index

Constants

View Source
const SubtypeName = resource.SubtypeName("movement_sensor")

SubtypeName is a constant that identifies the component resource subtype string "movement_sensor".

Variables

Subtype is a constant that identifies the component resource subtype.

Functions

func DependencyTypeError

func DependencyTypeError(name, actual interface{}) error

DependencyTypeError is used when a resource doesn't implement the expected interface.

func GetHeading

func GetHeading(gps1, gps2 *geo.Point, yawOffset float64) (float64, float64, float64)

GetHeading calculates bearing and absolute heading angles given 2 MovementSensor coordinates 0 degrees indicate North, 90 degrees indicate East and so on.

func Named

func Named(name string) resource.Name

Named is a helper for getting the named MovementSensor's typed resource name.

func NamesFromRobot

func NamesFromRobot(r robot.Robot) []string

NamesFromRobot is a helper for getting all MovementSensor names from the given Robot.

func NewServer

NewServer constructs an MovementSensor gRPC service subtypeServer.

func NewUnimplementedInterfaceError

func NewUnimplementedInterfaceError(actual interface{}) error

NewUnimplementedInterfaceError is used when there is a failed interface check.

func Readings

func Readings(ctx context.Context, g MovementSensor) (map[string]interface{}, error)

Readings is a helper for getting all readings from a MovementSensor.

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 {
	Position(ctx context.Context) (*geo.Point, float64, error)                // (lat, long), altitide (mm)
	LinearVelocity(ctx context.Context) (r3.Vector, error)                    // mm / sec
	AngularVelocity(ctx context.Context) (spatialmath.AngularVelocity, error) // radians / sec
	CompassHeading(ctx context.Context) (float64, error)                      // [0->360)
	Orientation(ctx context.Context) (spatialmath.Orientation, error)
	Properties(ctx context.Context) (*Properties, error)
	Accuracy(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 gpsnmea implements an NMEA serial gps.
Package gpsnmea implements an NMEA serial gps.
Package gpsrtk defines a gps and an rtk correction source which sends rtcm data to a child gps Experimental package
Package gpsrtk defines a gps and an rtk correction source which sends rtcm data to a child gps Experimental package
Package imuvectornav implement vectornav imu
Package imuvectornav implement vectornav imu
Package imuwit implements a wit IMU.
Package imuwit implements a wit IMU.
Package register registers all relevant MovementSensors
Package register registers all relevant MovementSensors

Jump to

Keyboard shortcuts

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