movementsensor

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2022 License: AGPL-3.0 Imports: 22 Imported by: 0

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 GetHeading

func GetHeading(gps1 *geo.Point, 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 GetReadings

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

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

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 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

Jump to

Keyboard shortcuts

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