sensors

package
v0.0.7 Latest Latest
Warning

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

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

Documentation

Overview

Package sensors contains a gRPC based sensors service client

Package sensors implements a sensors service.

Package sensors contains a gRPC based sensors service server

Index

Constants

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

SubtypeName is the name of the type of service.

Variables

Name is the SensorService's typed resource name.

Subtype is a constant that identifies the sensor service resource subtype.

Functions

func Named

func Named(name string) resource.Name

Named is a helper for getting the named sensor's typed resource name. RSDK-347 Implements senors's Named.

func NewServer

NewServer constructs a sensors gRPC service server.

func WrapWithReconfigurable

func WrapWithReconfigurable(s interface{}) (resource.Reconfigurable, error)

WrapWithReconfigurable wraps a Sensors service as a Reconfigurable.

Types

type Readings

type Readings struct {
	Name     resource.Name
	Readings []interface{}
}

A Readings ties both the sensor name and its reading together.

type Service

type Service interface {
	GetSensors(ctx context.Context) ([]resource.Name, error)
	GetReadings(ctx context.Context, sensorNames []resource.Name) ([]Readings, error)
}

A Service centralizes all sensors into one place.

func FromRobot

func FromRobot(r robot.Robot) (Service, error)

FromRobot retrieves the sensor service of a robot.

func New

func New(ctx context.Context, r robot.Robot, config config.Service, logger golog.Logger) (Service, error)

New returns a new sensor service for the given robot.

func NewClientFromConn

func NewClientFromConn(ctx context.Context, conn rpc.ClientConn, name string, logger golog.Logger) Service

NewClientFromConn constructs a new Client from connection passed in.

Jump to

Keyboard shortcuts

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