sensor

package
v0.51.2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: AGPL-3.0 Imports: 12 Imported by: 82

Documentation

Overview

Package sensor contains a gRPC based sensor client.

Package sensor defines an abstract sensing device that can provide measurement readings. For more information, see the sensor component docs.

Package sensor contains a gRPC based Sensor service serviceServer.

Index

Constants

View Source
const SubtypeName = "sensor"

SubtypeName is a constant that identifies the component resource API string "Sensor".

Variables

View Source
var API = resource.APINamespaceRDK.WithComponentType(SubtypeName)

API is a variable that identifies the component resource API.

Functions

func Named

func Named(name string) resource.Name

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

func NamesFromRobot

func NamesFromRobot(r robot.Robot) []string

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

func NewRPCServiceServer added in v0.2.36

func NewRPCServiceServer(coll resource.APIResourceCollection[Sensor]) interface{}

NewRPCServiceServer constructs an sensor gRPC service serviceServer.

Types

type Sensor

type Sensor interface {
	resource.Resource
	resource.Sensor
}

A Sensor represents a general purpose sensors that can give arbitrary readings of some thing that it is sensing.

func FromDependencies added in v0.3.0

func FromDependencies(deps resource.Dependencies, name string) (Sensor, error)

FromDependencies is a helper for getting the named sensor from a collection of dependencies.

func FromRobot

func FromRobot(r robot.Robot, name string) (Sensor, error)

FromRobot is a helper for getting the named Sensor from the given Robot.

func NewClientFromConn

func NewClientFromConn(
	ctx context.Context,
	conn rpc.ClientConn,
	remoteName string,
	name resource.Name,
	logger logging.Logger,
) (Sensor, error)

NewClientFromConn constructs a new Client from connection passed in.

Directories

Path Synopsis
Package fake implements a fake Sensor.
Package fake implements a fake Sensor.
Package register registers all relevant Sensors
Package register registers all relevant Sensors

Jump to

Keyboard shortcuts

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