Documentation
¶
Overview ¶
Package inject provides dependency injected structures for mocking interfaces.
Index ¶
- type AnalogReader
- type Arm
- func (a *Arm) Close(ctx context.Context) error
- func (a *Arm) DoCommand(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error)
- func (a *Arm) EndPosition(ctx context.Context, extra map[string]interface{}) (*commonpb.Pose, error)
- func (a *Arm) IsMoving(ctx context.Context) (bool, error)
- func (a *Arm) JointPositions(ctx context.Context, extra map[string]interface{}) (*pb.JointPositions, error)
- func (a *Arm) MoveToJointPositions(ctx context.Context, jp *pb.JointPositions, extra map[string]interface{}) error
- func (a *Arm) MoveToPosition(ctx context.Context, to *commonpb.Pose, worldState *commonpb.WorldState, ...) error
- func (a *Arm) Stop(ctx context.Context, extra map[string]interface{}) error
- type AudioInput
- func (ai *AudioInput) Close(ctx context.Context) error
- func (ai *AudioInput) DoCommand(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error)
- func (ai *AudioInput) MediaProperties(ctx context.Context) (prop.Audio, error)
- func (ai *AudioInput) Stream(ctx context.Context, errHandlers ...gostream.ErrorHandler) (gostream.AudioStream, error)
- type Base
- func (b *Base) Close(ctx context.Context) error
- func (b *Base) DoCommand(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error)
- func (b *Base) IsMoving(ctx context.Context) (bool, error)
- func (b *Base) MoveStraight(ctx context.Context, distanceMm int, mmPerSec float64, ...) error
- func (b *Base) Spin(ctx context.Context, angleDeg, degsPerSec float64, ...) error
- func (b *Base) Stop(ctx context.Context, extra map[string]interface{}) error
- func (b *Base) Width(ctx context.Context) (int, error)
- type Board
- func (b *Board) AnalogReaderByName(name string) (board.AnalogReader, bool)
- func (b *Board) AnalogReaderByNameCap() []interface{}
- func (b *Board) AnalogReaderNames() []string
- func (b *Board) Close(ctx context.Context) error
- func (b *Board) DigitalInterruptByName(name string) (board.DigitalInterrupt, bool)
- func (b *Board) DigitalInterruptByNameCap() []interface{}
- func (b *Board) DigitalInterruptNames() []string
- func (b *Board) DoCommand(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error)
- func (b *Board) GPIOPinByName(name string) (board.GPIOPin, error)
- func (b *Board) GPIOPinByNameCap() []interface{}
- func (b *Board) GPIOPinNames() []string
- func (b *Board) I2CByName(name string) (board.I2C, bool)
- func (b *Board) I2CNames() []string
- func (b *Board) SPIByName(name string) (board.SPI, bool)
- func (b *Board) SPINames() []string
- func (b *Board) Status(ctx context.Context, extra map[string]interface{}) (*commonpb.BoardStatus, error)
- func (b *Board) StatusCap() []interface{}
- type Camera
- func (c *Camera) Close(ctx context.Context) error
- func (c *Camera) DoCommand(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error)
- func (c *Camera) NextPointCloud(ctx context.Context) (pointcloud.PointCloud, error)
- func (c *Camera) Projector(ctx context.Context) (transform.Projector, error)
- func (c *Camera) Properties(ctx context.Context) (camera.Properties, error)
- func (c *Camera) Stream(ctx context.Context, errHandlers ...gostream.ErrorHandler) (gostream.VideoStream, error)
- type DataManagerService
- type DigitalInterrupt
- func (d *DigitalInterrupt) AddCallback(c chan bool)
- func (d *DigitalInterrupt) AddPostProcessor(pp board.PostProcessor)
- func (d *DigitalInterrupt) Tick(ctx context.Context, high bool, nanos uint64) error
- func (d *DigitalInterrupt) TickCap() []interface{}
- func (d *DigitalInterrupt) Value(ctx context.Context, extra map[string]interface{}) (int64, error)
- func (d *DigitalInterrupt) ValueCap() []interface{}
- type GPIOPin
- func (gp *GPIOPin) Get(ctx context.Context, extra map[string]interface{}) (bool, error)
- func (gp *GPIOPin) GetCap() []interface{}
- func (gp *GPIOPin) PWM(ctx context.Context, extra map[string]interface{}) (float64, error)
- func (gp *GPIOPin) PWMCap() []interface{}
- func (gp *GPIOPin) PWMFreq(ctx context.Context, extra map[string]interface{}) (uint, error)
- func (gp *GPIOPin) PWMFreqCap() []interface{}
- func (gp *GPIOPin) Set(ctx context.Context, high bool, extra map[string]interface{}) error
- func (gp *GPIOPin) SetCap() []interface{}
- func (gp *GPIOPin) SetPWM(ctx context.Context, dutyCyclePct float64, extra map[string]interface{}) error
- func (gp *GPIOPin) SetPWMCap() []interface{}
- func (gp *GPIOPin) SetPWMFreq(ctx context.Context, freqHz uint, extra map[string]interface{}) error
- func (gp *GPIOPin) SetPWMFreqCap() []interface{}
- type Gantry
- func (g *Gantry) Close(ctx context.Context) error
- func (g *Gantry) DoCommand(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error)
- func (g *Gantry) IsMoving(ctx context.Context) (bool, error)
- func (g *Gantry) Lengths(ctx context.Context, extra map[string]interface{}) ([]float64, error)
- func (g *Gantry) ModelFrame() referenceframe.Model
- func (g *Gantry) MoveToPosition(ctx context.Context, positions []float64, worldState *commonpb.WorldState, ...) error
- func (g *Gantry) Position(ctx context.Context, extra map[string]interface{}) ([]float64, error)
- func (g *Gantry) Stop(ctx context.Context, extra map[string]interface{}) error
- type Generic
- type Gripper
- func (g *Gripper) Close(ctx context.Context) error
- func (g *Gripper) DoCommand(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error)
- func (g *Gripper) Grab(ctx context.Context) (bool, error)
- func (g *Gripper) IsMoving(ctx context.Context) (bool, error)
- func (g *Gripper) Open(ctx context.Context) error
- func (g *Gripper) Stop(ctx context.Context) error
- type I2C
- type InputController
- func (s *InputController) Controls(ctx context.Context) ([]input.Control, error)
- func (s *InputController) DoCommand(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error)
- func (s *InputController) Events(ctx context.Context) (map[input.Control]input.Event, error)
- func (s *InputController) RegisterControlCallback(ctx context.Context, control input.Control, triggers []input.EventType, ...) error
- type LocalMotor
- type MotionService
- func (mgs *MotionService) GetPose(ctx context.Context, componentName resource.Name, destinationFrame string, ...) (*referenceframe.PoseInFrame, error)
- func (mgs *MotionService) Move(ctx context.Context, componentName resource.Name, ...) (bool, error)
- func (mgs *MotionService) MoveSingleComponent(ctx context.Context, componentName resource.Name, ...) (bool, error)
- type Motor
- func (m *Motor) DoCommand(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error)
- func (m *Motor) GoFor(ctx context.Context, rpm, revolutions float64, extra map[string]interface{}) error
- func (m *Motor) GoTo(ctx context.Context, rpm, positionRevolutions float64, ...) error
- func (m *Motor) IsPowered(ctx context.Context, extra map[string]interface{}) (bool, float64, error)
- func (m *Motor) Position(ctx context.Context, extra map[string]interface{}) (float64, error)
- func (m *Motor) Properties(ctx context.Context, extra map[string]interface{}) (map[motor.Feature]bool, error)
- func (m *Motor) ResetZeroPosition(ctx context.Context, offset float64, extra map[string]interface{}) error
- func (m *Motor) SetPower(ctx context.Context, powerPct float64, extra map[string]interface{}) error
- func (m *Motor) Stop(ctx context.Context, extra map[string]interface{}) error
- type MovementSensor
- func (i *MovementSensor) AngularVelocity(ctx context.Context) (spatialmath.AngularVelocity, error)
- func (i *MovementSensor) Close(ctx context.Context) error
- func (i *MovementSensor) CompassHeading(ctx context.Context) (float64, error)
- func (i *MovementSensor) DoCommand(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error)
- func (i *MovementSensor) LinearVelocity(ctx context.Context) (r3.Vector, error)
- func (i *MovementSensor) Orientation(ctx context.Context) (spatialmath.Orientation, error)
- func (i *MovementSensor) Position(ctx context.Context) (*geo.Point, float64, error)
- type NavigationService
- func (ns *NavigationService) AddWaypoint(ctx context.Context, point *geo.Point) error
- func (ns *NavigationService) Location(ctx context.Context) (*geo.Point, error)
- func (ns *NavigationService) Mode(ctx context.Context) (navigation.Mode, error)
- func (ns *NavigationService) RemoveWaypoint(ctx context.Context, id primitive.ObjectID) error
- func (ns *NavigationService) SetMode(ctx context.Context, mode navigation.Mode) error
- func (ns *NavigationService) Waypoints(ctx context.Context) ([]navigation.Waypoint, error)
- type PoseTracker
- type ReadWriteCloser
- type Robot
- func (r *Robot) Close(ctx context.Context) error
- func (r *Robot) Config(ctx context.Context) (*config.Config, error)
- func (r *Robot) DiscoverComponents(ctx context.Context, keys []discovery.Query) ([]discovery.Discovery, error)
- func (r *Robot) FrameSystemConfig(ctx context.Context, additionalTransforms []*commonpb.Transform) (framesystemparts.Parts, error)
- func (r *Robot) Logger() golog.Logger
- func (r *Robot) MockResourcesFromMap(rs map[resource.Name]interface{})
- func (r *Robot) OperationManager() *operation.Manager
- func (r *Robot) ProcessManager() pexec.ProcessManager
- func (r *Robot) Refresh(ctx context.Context) error
- func (r *Robot) RemoteByName(name string) (robot.Robot, bool)
- func (r *Robot) RemoteNames() []string
- func (r *Robot) ResourceByName(name resource.Name) (interface{}, error)
- func (r *Robot) ResourceNames() []resource.Name
- func (r *Robot) ResourceRPCSubtypes() []resource.RPCSubtype
- func (r *Robot) Status(ctx context.Context, resourceNames []resource.Name) ([]robot.Status, error)
- func (r *Robot) StopAll(ctx context.Context, extra map[resource.Name]map[string]interface{}) error
- func (r *Robot) TransformPose(ctx context.Context, pose *referenceframe.PoseInFrame, dst string, ...) (*referenceframe.PoseInFrame, error)
- type SLAMService
- type SPI
- type Sensor
- type SensorsService
- type Servo
- func (s *Servo) DoCommand(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error)
- func (s *Servo) IsMoving(ctx context.Context) (bool, error)
- func (s *Servo) Move(ctx context.Context, angleDeg uint8) error
- func (s *Servo) Position(ctx context.Context) (uint8, error)
- func (s *Servo) Stop(ctx context.Context) error
- type TriggerableInputController
- type VisionService
- func (vs *VisionService) AddClassifier(ctx context.Context, cfg vision.VisModelConfig) error
- func (vs *VisionService) AddDetector(ctx context.Context, cfg vision.VisModelConfig) error
- func (vs *VisionService) AddSegmenter(ctx context.Context, cfg vision.VisModelConfig) error
- func (vs *VisionService) Classifications(ctx context.Context, img image.Image, classifierName string, n int) (classification.Classifications, error)
- func (vs *VisionService) ClassificationsFromCamera(ctx context.Context, cameraName, classifierName string, n int) (classification.Classifications, error)
- func (vs *VisionService) ClassifierNames(ctx context.Context) ([]string, error)
- func (vs *VisionService) Detections(ctx context.Context, img image.Image, detectorName string) ([]objectdetection.Detection, error)
- func (vs *VisionService) DetectionsFromCamera(ctx context.Context, cameraName, detectorName string) ([]objectdetection.Detection, error)
- func (vs *VisionService) DetectorNames(ctx context.Context) ([]string, error)
- func (vs *VisionService) GetModelParameterSchema(ctx context.Context, modelType vision.VisModelType) (*jsonschema.Schema, error)
- func (vs *VisionService) GetObjectPointClouds(ctx context.Context, cameraName, segmenterName string) ([]*viz.Object, error)
- func (vs *VisionService) RemoveClassifier(ctx context.Context, classifierName string) error
- func (vs *VisionService) RemoveDetector(ctx context.Context, detectorName string) error
- func (vs *VisionService) RemoveSegmenter(ctx context.Context, segmenterName string) error
- func (vs *VisionService) SegmenterNames(ctx context.Context) ([]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnalogReader ¶
type AnalogReader struct { board.AnalogReader ReadFunc func(ctx context.Context, extra map[string]interface{}) (int, error) // contains filtered or unexported fields }
AnalogReader is an injected analog reader.
func (*AnalogReader) ReadCap ¶
func (a *AnalogReader) ReadCap() []interface{}
ReadCap returns the last parameters received by Read, and then clears them.
type Arm ¶
type Arm struct { arm.LocalArm DoFunc func(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error) EndPositionFunc func(ctx context.Context, extra map[string]interface{}) (*commonpb.Pose, error) MoveToPositionFunc func(ctx context.Context, to *commonpb.Pose, worldState *commonpb.WorldState, extra map[string]interface{}) error MoveToJointPositionsFunc func(ctx context.Context, pos *pb.JointPositions, extra map[string]interface{}) error JointPositionsFunc func(ctx context.Context, extra map[string]interface{}) (*pb.JointPositions, error) StopFunc func(ctx context.Context, extra map[string]interface{}) error IsMovingFunc func(context.Context) (bool, error) CloseFunc func(ctx context.Context) error }
Arm is an injected arm.
func (*Arm) DoCommand ¶ added in v0.1.0
func (a *Arm) DoCommand(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error)
DoCommand calls the injected DoCommand or the real version.
func (*Arm) EndPosition ¶ added in v0.1.0
func (a *Arm) EndPosition(ctx context.Context, extra map[string]interface{}) (*commonpb.Pose, error)
EndPosition calls the injected EndPosition or the real version.
func (*Arm) JointPositions ¶ added in v0.1.0
func (a *Arm) JointPositions(ctx context.Context, extra map[string]interface{}) (*pb.JointPositions, error)
JointPositions calls the injected JointPositions or the real version.
func (*Arm) MoveToJointPositions ¶
func (a *Arm) MoveToJointPositions(ctx context.Context, jp *pb.JointPositions, extra map[string]interface{}) error
MoveToJointPositions calls the injected MoveToJointPositions or the real version.
type AudioInput ¶ added in v0.0.8
type AudioInput struct { audioinput.AudioInput DoFunc func(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error) StreamFunc func( ctx context.Context, errHandlers ...gostream.ErrorHandler, ) (gostream.AudioStream, error) MediaPropertiesFunc func(ctx context.Context) (prop.Audio, error) CloseFunc func(ctx context.Context) error }
AudioInput is an injected audio input.
func (*AudioInput) Close ¶ added in v0.0.8
func (ai *AudioInput) Close(ctx context.Context) error
Close calls the injected Close or the real version.
func (*AudioInput) DoCommand ¶ added in v0.1.0
func (ai *AudioInput) DoCommand(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error)
DoCommand calls the injected DoCommand or the real version.
func (*AudioInput) MediaProperties ¶ added in v0.0.8
MediaProperties calls the injected MediaProperties or the real version.
func (*AudioInput) Stream ¶ added in v0.0.8
func (ai *AudioInput) Stream( ctx context.Context, errHandlers ...gostream.ErrorHandler, ) (gostream.AudioStream, error)
Stream calls the injected Stream or the real version.
type Base ¶
type Base struct { base.LocalBase DoFunc func(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error) MoveStraightFunc func(ctx context.Context, distanceMm int, mmPerSec float64, extra map[string]interface{}) error SpinFunc func(ctx context.Context, angleDeg, degsPerSec float64, extra map[string]interface{}) error WidthFunc func(ctx context.Context) (int, error) StopFunc func(ctx context.Context, extra map[string]interface{}) error IsMovingFunc func(context.Context) (bool, error) CloseFunc func(ctx context.Context) error }
Base is an injected base.
func (*Base) DoCommand ¶ added in v0.1.0
func (b *Base) DoCommand(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error)
DoCommand calls the injected DoCommand or the real version.
func (*Base) MoveStraight ¶
func (b *Base) MoveStraight(ctx context.Context, distanceMm int, mmPerSec float64, extra map[string]interface{}) error
MoveStraight calls the injected MoveStraight or the real version.
func (*Base) Spin ¶
func (b *Base) Spin(ctx context.Context, angleDeg, degsPerSec float64, extra map[string]interface{}) error
Spin calls the injected Spin or the real version.
type Board ¶
type Board struct { board.LocalBoard DoFunc func(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error) SPIByNameFunc func(name string) (board.SPI, bool) I2CByNameFunc func(name string) (board.I2C, bool) AnalogReaderByNameFunc func(name string) (board.AnalogReader, bool) DigitalInterruptByNameFunc func(name string) (board.DigitalInterrupt, bool) GPIOPinByNameFunc func(name string) (board.GPIOPin, error) SPINamesFunc func() []string I2CNamesFunc func() []string AnalogReaderNamesFunc func() []string DigitalInterruptNamesFunc func() []string GPIOPinNamesFunc func() []string CloseFunc func(ctx context.Context) error StatusFunc func(ctx context.Context, extra map[string]interface{}) (*commonpb.BoardStatus, error) // contains filtered or unexported fields }
Board is an injected board.
func (*Board) AnalogReaderByName ¶
func (b *Board) AnalogReaderByName(name string) (board.AnalogReader, bool)
AnalogReaderByName calls the injected AnalogReaderByName or the real version.
func (*Board) AnalogReaderByNameCap ¶
func (b *Board) AnalogReaderByNameCap() []interface{}
AnalogReaderByNameCap returns the last parameters received by AnalogReaderByName, and then clears them.
func (*Board) AnalogReaderNames ¶
AnalogReaderNames calls the injected AnalogReaderNames or the real version.
func (*Board) DigitalInterruptByName ¶
func (b *Board) DigitalInterruptByName(name string) (board.DigitalInterrupt, bool)
DigitalInterruptByName calls the injected DigitalInterruptByName or the real version.
func (*Board) DigitalInterruptByNameCap ¶
func (b *Board) DigitalInterruptByNameCap() []interface{}
DigitalInterruptByNameCap returns the last parameters received by DigitalInterruptByName, and then clears them.
func (*Board) DigitalInterruptNames ¶
DigitalInterruptNames calls the injected DigitalInterruptNames or the real version.
func (*Board) DoCommand ¶ added in v0.1.0
func (b *Board) DoCommand(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error)
DoCommand calls the injected DoCommand or the real version.
func (*Board) GPIOPinByName ¶
GPIOPinByName calls the injected GPIOPinByName or the real version.
func (*Board) GPIOPinByNameCap ¶
func (b *Board) GPIOPinByNameCap() []interface{}
GPIOPinByNameCap returns the last parameters received by GPIOPinByName, and then clears them.
func (*Board) GPIOPinNames ¶
GPIOPinNames calls the injected GPIOPinNames or the real version.
type Camera ¶
type Camera struct { camera.Camera DoFunc func(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error) StreamFunc func( ctx context.Context, errHandlers ...gostream.ErrorHandler, ) (gostream.VideoStream, error) NextPointCloudFunc func(ctx context.Context) (pointcloud.PointCloud, error) ProjectorFunc func(ctx context.Context) (transform.Projector, error) PropertiesFunc func(ctx context.Context) (camera.Properties, error) CloseFunc func(ctx context.Context) error }
Camera is an injected camera.
func (*Camera) DoCommand ¶ added in v0.1.0
func (c *Camera) DoCommand(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error)
DoCommand calls the injected DoCommand or the real version.
func (*Camera) NextPointCloud ¶
func (c *Camera) NextPointCloud(ctx context.Context) (pointcloud.PointCloud, error)
NextPointCloud calls the injected NextPointCloud or the real version.
func (*Camera) Projector ¶ added in v0.0.8
Projector calls the injected Projector or the real version.
func (*Camera) Properties ¶ added in v0.1.0
Properties calls the injected Properties or the real version.
func (*Camera) Stream ¶ added in v0.0.8
func (c *Camera) Stream( ctx context.Context, errHandlers ...gostream.ErrorHandler, ) (gostream.VideoStream, error)
Stream calls the injected Stream or the real version.
type DataManagerService ¶
type DataManagerService struct { datamanager.Service SyncFunc func( ctx context.Context, ) error }
DataManagerService represents a fake instance of an data manager service.
type DigitalInterrupt ¶
type DigitalInterrupt struct { board.DigitalInterrupt ValueFunc func(ctx context.Context, extra map[string]interface{}) (int64, error) TickFunc func(ctx context.Context, high bool, nanos uint64) error AddCallbackFunc func(c chan bool) AddPostProcessorFunc func(pp board.PostProcessor) // contains filtered or unexported fields }
DigitalInterrupt is an injected digital interrupt.
func (*DigitalInterrupt) AddCallback ¶
func (d *DigitalInterrupt) AddCallback(c chan bool)
AddCallback calls the injected AddCallback or the real version.
func (*DigitalInterrupt) AddPostProcessor ¶
func (d *DigitalInterrupt) AddPostProcessor(pp board.PostProcessor)
AddPostProcessor calls the injected AddPostProcessor or the real version.
func (*DigitalInterrupt) TickCap ¶
func (d *DigitalInterrupt) TickCap() []interface{}
TickCap returns the last parameters received by Tick, and then clears them.
func (*DigitalInterrupt) ValueCap ¶
func (d *DigitalInterrupt) ValueCap() []interface{}
ValueCap returns the last parameters received by Value, and then clears them.
type GPIOPin ¶
type GPIOPin struct { board.GPIOPin SetFunc func(ctx context.Context, high bool, extra map[string]interface{}) error GetFunc func(ctx context.Context, extra map[string]interface{}) (bool, error) PWMFunc func(ctx context.Context, extra map[string]interface{}) (float64, error) SetPWMFunc func(ctx context.Context, dutyCyclePct float64, extra map[string]interface{}) error PWMFreqFunc func(ctx context.Context, extra map[string]interface{}) (uint, error) SetPWMFreqFunc func(ctx context.Context, freqHz uint, extra map[string]interface{}) error // contains filtered or unexported fields }
GPIOPin is an injected GPIOPin.
func (*GPIOPin) GetCap ¶
func (gp *GPIOPin) GetCap() []interface{}
GetCap returns the last parameters received by Get, and then clears them.
func (*GPIOPin) PWMCap ¶
func (gp *GPIOPin) PWMCap() []interface{}
PWMCap returns the last parameters received by PWM, and then clears them.
func (*GPIOPin) PWMFreqCap ¶
func (gp *GPIOPin) PWMFreqCap() []interface{}
PWMFreqCap returns the last parameters received by PWMFreq, and then clears them.
func (*GPIOPin) SetCap ¶
func (gp *GPIOPin) SetCap() []interface{}
SetCap returns the last parameters received by Set, and then clears them.
func (*GPIOPin) SetPWM ¶
func (gp *GPIOPin) SetPWM(ctx context.Context, dutyCyclePct float64, extra map[string]interface{}) error
SetPWM calls the injected SetPWM or the real version.
func (*GPIOPin) SetPWMCap ¶
func (gp *GPIOPin) SetPWMCap() []interface{}
SetPWMCap returns the last parameters received by SetPWM, and then clears them.
func (*GPIOPin) SetPWMFreq ¶
SetPWMFreq calls the injected SetPWMFreq or the real version.
func (*GPIOPin) SetPWMFreqCap ¶
func (gp *GPIOPin) SetPWMFreqCap() []interface{}
SetPWMFreqCap returns the last parameters received by SetPWMFreq, and then clears them.
type Gantry ¶
type Gantry struct { gantry.LocalGantry DoFunc func(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error) PositionFunc func(ctx context.Context, extra map[string]interface{}) ([]float64, error) MoveToPositionFunc func(ctx context.Context, positions []float64, worldState *commonpb.WorldState, extra map[string]interface{}) error LengthsFunc func(ctx context.Context, extra map[string]interface{}) ([]float64, error) StopFunc func(ctx context.Context, extra map[string]interface{}) error IsMovingFunc func(context.Context) (bool, error) CloseFunc func(ctx context.Context) error ModelFrameFunc func() referenceframe.Model }
Gantry is an injected gantry.
func (*Gantry) DoCommand ¶ added in v0.1.0
func (g *Gantry) DoCommand(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error)
DoCommand calls the injected DoCommand or the real version.
func (*Gantry) ModelFrame ¶
func (g *Gantry) ModelFrame() referenceframe.Model
ModelFrame returns a Gantry ModelFrame.
func (*Gantry) MoveToPosition ¶
func (g *Gantry) MoveToPosition( ctx context.Context, positions []float64, worldState *commonpb.WorldState, extra map[string]interface{}, ) error
MoveToPosition calls the injected MoveToPosition or the real version.
type Generic ¶
type Generic struct { generic.Generic DoFunc func(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error) }
Generic is an injectable Generic component.
type Gripper ¶
type Gripper struct { gripper.LocalGripper DoFunc func(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error) OpenFunc func(ctx context.Context) error GrabFunc func(ctx context.Context) (bool, error) StopFunc func(ctx context.Context) error IsMovingFunc func(context.Context) (bool, error) CloseFunc func(ctx context.Context) error }
Gripper is an injected gripper.
func (*Gripper) DoCommand ¶ added in v0.1.0
func (g *Gripper) DoCommand(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error)
DoCommand calls the injected DoCommand or the real version.
type InputController ¶
type InputController struct { input.Controller DoFunc func(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error) ControlsFunc func(ctx context.Context) ([]input.Control, error) EventsFunc func(ctx context.Context) (map[input.Control]input.Event, error) RegisterControlCallbackFunc func( ctx context.Context, control input.Control, triggers []input.EventType, ctrlFunc input.ControlFunction, ) error }
InputController is an injected InputController.
func (*InputController) Controls ¶ added in v0.1.0
Controls calls the injected function or the real version.
func (*InputController) DoCommand ¶ added in v0.1.0
func (s *InputController) DoCommand(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error)
DoCommand calls the injected DoCommand or the real version.
func (*InputController) Events ¶ added in v0.1.0
Events calls the injected function or the real version.
func (*InputController) RegisterControlCallback ¶
func (s *InputController) RegisterControlCallback( ctx context.Context, control input.Control, triggers []input.EventType, ctrlFunc input.ControlFunction, ) error
RegisterControlCallback calls the injected function or the real version.
type LocalMotor ¶
type LocalMotor struct { Motor GoTillStopFunc func(ctx context.Context, rpm float64, stopFunc func(ctx context.Context) bool) error IsMovingFunc func(context.Context) (bool, error) }
LocalMotor is an injected motor that supports additional features provided by RDK (e.g. GoTillStop).
func (*LocalMotor) GoTillStop ¶
func (m *LocalMotor) GoTillStop( ctx context.Context, rpm float64, stopFunc func(ctx context.Context) bool, ) error
GoTillStop calls the injected GoTillStop or the real version.
type MotionService ¶
type MotionService struct { motion.Service MoveFunc func( ctx context.Context, componentName resource.Name, grabPose *referenceframe.PoseInFrame, worldState *commonpb.WorldState, extra map[string]interface{}, ) (bool, error) GetPoseFunc func( ctx context.Context, componentName resource.Name, destinationFrame string, supplementalTransforms []*commonpb.Transform, extra map[string]interface{}, ) (*referenceframe.PoseInFrame, error) }
MotionService represents a fake instance of an motion service.
func (*MotionService) GetPose ¶
func (mgs *MotionService) GetPose( ctx context.Context, componentName resource.Name, destinationFrame string, supplementalTransforms []*commonpb.Transform, extra map[string]interface{}, ) (*referenceframe.PoseInFrame, error)
GetPose calls the injected GetPose or the real variant.
func (*MotionService) Move ¶
func (mgs *MotionService) Move( ctx context.Context, componentName resource.Name, grabPose *referenceframe.PoseInFrame, worldState *commonpb.WorldState, extra map[string]interface{}, ) (bool, error)
Move calls the injected Move or the real variant.
func (*MotionService) MoveSingleComponent ¶ added in v0.0.6
func (mgs *MotionService) MoveSingleComponent( ctx context.Context, componentName resource.Name, grabPose *referenceframe.PoseInFrame, worldState *commonpb.WorldState, extra map[string]interface{}, ) (bool, error)
MoveSingleComponent calls the injected MoveSingleComponent or the real variant. It uses the same function as Move.
type Motor ¶
type Motor struct { motor.Motor DoFunc func(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error) SetPowerFunc func(ctx context.Context, powerPct float64, extra map[string]interface{}) error GoForFunc func(ctx context.Context, rpm, rotations float64, extra map[string]interface{}) error GoToFunc func(ctx context.Context, rpm, position float64, extra map[string]interface{}) error ResetZeroPositionFunc func(ctx context.Context, offset float64, extra map[string]interface{}) error PositionFunc func(ctx context.Context, extra map[string]interface{}) (float64, error) PropertiesFunc func(ctx context.Context, extra map[string]interface{}) (map[motor.Feature]bool, error) StopFunc func(ctx context.Context, extra map[string]interface{}) error IsPoweredFunc func(ctx context.Context, extra map[string]interface{}) (bool, float64, error) }
Motor is an injected motor.
func (*Motor) DoCommand ¶ added in v0.1.0
func (m *Motor) DoCommand(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error)
DoCommand calls the injected DoCommand or the real version.
func (*Motor) GoFor ¶
func (m *Motor) GoFor(ctx context.Context, rpm, revolutions float64, extra map[string]interface{}) error
GoFor calls the injected GoFor or the real version.
func (*Motor) GoTo ¶
func (m *Motor) GoTo(ctx context.Context, rpm, positionRevolutions float64, extra map[string]interface{}) error
GoTo calls the injected GoTo or the real version.
func (*Motor) Properties ¶ added in v0.1.0
func (m *Motor) Properties(ctx context.Context, extra map[string]interface{}) (map[motor.Feature]bool, error)
Properties calls the injected Properties or the real version.
func (*Motor) ResetZeroPosition ¶
func (m *Motor) ResetZeroPosition(ctx context.Context, offset float64, extra map[string]interface{}) error
ResetZeroPosition calls the injected Zero or the real version.
type MovementSensor ¶ added in v0.0.6
type MovementSensor struct { movementsensor.MovementSensor PositionFunc func(ctx context.Context) (*geo.Point, float64, error) LinearVelocityFunc func(ctx context.Context) (r3.Vector, error) AngularVelocityFunc func(ctx context.Context) (spatialmath.AngularVelocity, error) CompassHeadingFunc func(ctx context.Context) (float64, error) OrientationFunc func(ctx context.Context) (spatialmath.Orientation, error) DoFunc func(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error) CloseFunc func() error }
MovementSensor is an injected MovementSensor.
func (*MovementSensor) AngularVelocity ¶ added in v0.1.0
func (i *MovementSensor) AngularVelocity(ctx context.Context) (spatialmath.AngularVelocity, error)
AngularVelocity func or passthrough.
func (*MovementSensor) Close ¶ added in v0.0.6
func (i *MovementSensor) Close(ctx context.Context) error
Close calls the injected Close or the real version.
func (*MovementSensor) CompassHeading ¶ added in v0.1.0
func (i *MovementSensor) CompassHeading(ctx context.Context) (float64, error)
CompassHeading func or passthrough.
func (*MovementSensor) DoCommand ¶ added in v0.1.0
func (i *MovementSensor) DoCommand(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error)
DoCommand calls the injected DoCommand or the real version.
func (*MovementSensor) LinearVelocity ¶ added in v0.1.0
LinearVelocity func or passthrough.
func (*MovementSensor) Orientation ¶ added in v0.1.0
func (i *MovementSensor) Orientation(ctx context.Context) (spatialmath.Orientation, error)
Orientation func or passthrough.
type NavigationService ¶
type NavigationService struct {}
NavigationService represents a fake instance of a navigation service.
func (*NavigationService) AddWaypoint ¶
AddWaypoint calls the injected AddWaypointFunc or the real version.
func (*NavigationService) Location ¶ added in v0.1.0
Location calls the injected LocationFunc or the real version.
func (*NavigationService) Mode ¶ added in v0.1.0
func (ns *NavigationService) Mode(ctx context.Context) (navigation.Mode, error)
Mode calls the injected ModeFunc or the real version.
func (*NavigationService) RemoveWaypoint ¶
RemoveWaypoint calls the injected RemoveWaypointFunc or the real version.
func (*NavigationService) SetMode ¶
func (ns *NavigationService) SetMode(ctx context.Context, mode navigation.Mode) error
SetMode calls the injected SetModeFunc or the real version.
func (*NavigationService) Waypoints ¶ added in v0.1.0
func (ns *NavigationService) Waypoints(ctx context.Context) ([]navigation.Waypoint, error)
Waypoints calls the injected WaypointsFunc or the real version.
type PoseTracker ¶
type PoseTracker struct { posetracker.PoseTracker PosesFunc func(ctx context.Context, bodyNames []string) (posetracker.BodyToPoseInFrame, error) DoFunc func(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error) }
PoseTracker is an injected pose tracker.
func (*PoseTracker) DoCommand ¶ added in v0.1.1
func (pT *PoseTracker) DoCommand(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error)
DoCommand calls the injected DoCommand or the real version.
func (*PoseTracker) Poses ¶ added in v0.1.1
func (pT *PoseTracker) Poses( ctx context.Context, bodyNames []string, ) (posetracker.BodyToPoseInFrame, error)
Poses calls the injected Poses or the real version.
type ReadWriteCloser ¶
type ReadWriteCloser struct { io.ReadWriteCloser ReadFunc func(p []byte) (n int, err error) WriteFunc func(p []byte) (n int, err error) CloseFunc func() error }
ReadWriteCloser is an injected read write closer.
func (*ReadWriteCloser) Close ¶
func (rwc *ReadWriteCloser) Close() error
Close calls the injected Close or the real version.
type Robot ¶
type Robot struct { robot.LocalRobot DiscoverComponentsFunc func(ctx context.Context, keys []discovery.Query) ([]discovery.Discovery, error) RemoteByNameFunc func(name string) (robot.Robot, bool) ResourceByNameFunc func(name resource.Name) (interface{}, error) RemoteNamesFunc func() []string ResourceNamesFunc func() []resource.Name ResourceRPCSubtypesFunc func() []resource.RPCSubtype ProcessManagerFunc func() pexec.ProcessManager ConfigFunc func(ctx context.Context) (*config.Config, error) LoggerFunc func() golog.Logger CloseFunc func(ctx context.Context) error StopAllFunc func(ctx context.Context, extra map[resource.Name]map[string]interface{}) error RefreshFunc func(ctx context.Context) error FrameSystemConfigFunc func(ctx context.Context, additionalTransforms []*commonpb.Transform) (framesystemparts.Parts, error) TransformPoseFunc func( ctx context.Context, pose *referenceframe.PoseInFrame, dst string, additionalTransforms []*commonpb.Transform, ) (*referenceframe.PoseInFrame, error) StatusFunc func(ctx context.Context, resourceNames []resource.Name) ([]robot.Status, error) // contains filtered or unexported fields }
Robot is an injected robot.
func (*Robot) DiscoverComponents ¶
func (r *Robot) DiscoverComponents(ctx context.Context, keys []discovery.Query) ([]discovery.Discovery, error)
DiscoverComponents call the injected DiscoverComponents or the real one.
func (*Robot) FrameSystemConfig ¶
func (r *Robot) FrameSystemConfig(ctx context.Context, additionalTransforms []*commonpb.Transform) (framesystemparts.Parts, error)
FrameSystemConfig calls the injected FrameSystemConfig or the real version.
func (*Robot) MockResourcesFromMap ¶
MockResourcesFromMap mocks ResourceNames and ResourceByName based on a resource map.
func (*Robot) OperationManager ¶
OperationManager calls the injected OperationManager or the real version.
func (*Robot) ProcessManager ¶
func (r *Robot) ProcessManager() pexec.ProcessManager
ProcessManager calls the injected ProcessManager or the real version.
func (*Robot) RemoteByName ¶
RemoteByName calls the injected RemoteByName or the real version.
func (*Robot) RemoteNames ¶
RemoteNames calls the injected RemoteNames or the real version.
func (*Robot) ResourceByName ¶
ResourceByName calls the injected ResourceByName or the real version.
func (*Robot) ResourceNames ¶
ResourceNames calls the injected ResourceNames or the real version.
func (*Robot) ResourceRPCSubtypes ¶
func (r *Robot) ResourceRPCSubtypes() []resource.RPCSubtype
ResourceRPCSubtypes returns a list of all known resource RPC subtypes.
func (*Robot) TransformPose ¶
func (r *Robot) TransformPose( ctx context.Context, pose *referenceframe.PoseInFrame, dst string, additionalTransforms []*commonpb.Transform, ) (*referenceframe.PoseInFrame, error)
TransformPose calls the injected TransformPose or the real version.
type SLAMService ¶
type SLAMService struct { slam.Service PositionFunc func(ctx context.Context, name string) (*referenceframe.PoseInFrame, error) GetMapFunc func(ctx context.Context, name, mimeType string, cp *referenceframe.PoseInFrame, include bool) (string, image.Image, *vision.Object, error) }
SLAMService represents a fake instance of a slam service.
func (*SLAMService) GetMap ¶
func (slamSvc *SLAMService) GetMap(ctx context.Context, name, mimeType string, cp *referenceframe.PoseInFrame, include bool) ( string, image.Image, *vision.Object, error, )
GetMap calls the injected GetMapFunc or the real version.
func (*SLAMService) Position ¶ added in v0.1.0
func (slamSvc *SLAMService) Position(ctx context.Context, name string) (*referenceframe.PoseInFrame, error)
Position calls the injected PositionFunc or the real version.
type Sensor ¶
type Sensor struct { sensor.Sensor DoFunc func(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error) ReadingsFunc func(ctx context.Context) (map[string]interface{}, error) }
Sensor is an injected sensor.
type SensorsService ¶
type SensorsService struct { sensors.Service GetSensorsFunc func(ctx context.Context) ([]resource.Name, error) ReadingsFunc func(ctx context.Context, resources []resource.Name) ([]sensors.Readings, error) }
SensorsService represents a fake instance of a sensors service.
type Servo ¶
type Servo struct { servo.LocalServo DoFunc func(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error) MoveFunc func(ctx context.Context, angleDeg uint8) error PositionFunc func(ctx context.Context) (uint8, error) StopFunc func(ctx context.Context) error IsMovingFunc func(context.Context) (bool, error) }
Servo is an injected servo.
func (*Servo) DoCommand ¶ added in v0.1.0
func (s *Servo) DoCommand(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error)
DoCommand calls the injected DoCommand or the real version.
type TriggerableInputController ¶
type TriggerableInputController struct { InputController input.Triggerable TriggerEventFunc func(ctx context.Context, event input.Event) error }
TriggerableInputController is an injected injectable InputController.
func (*TriggerableInputController) TriggerEvent ¶
TriggerEvent calls the injected function or the real version.
type VisionService ¶
type VisionService struct { vision.Service GetModelParameterSchemaFunc func(ctx context.Context, modelType vision.VisModelType) (*jsonschema.Schema, error) // detection functions GetDetectorNamesFunc func(ctx context.Context) ([]string, error) AddDetectorFunc func(ctx context.Context, cfg vision.VisModelConfig) error RemoveDetectorFunc func(ctx context.Context, detectorName string) error DetectionsFromCameraFunc func(ctx context.Context, cameraName, detectorName string) ([]objectdetection.Detection, error) DetectionsFunc func(ctx context.Context, img image.Image, detectorName string) ([]objectdetection.Detection, error) // classification functions ClassifierNamesFunc func(ctx context.Context) ([]string, error) AddClassifierFunc func(ctx context.Context, cfg vision.VisModelConfig) error RemoveClassifierFunc func(ctx context.Context, classifierName string) error ClassificationsFromCameraFunc func(ctx context.Context, cameraName, classifierName string, n int) (classification.Classifications, error) ClassificationsFunc func(ctx context.Context, img image.Image, classifierName string, n int) (classification.Classifications, error) // segmentation functions SegmenterNamesFunc func(ctx context.Context) ([]string, error) AddSegmenterFunc func(ctx context.Context, cfg vision.VisModelConfig) error RemoveSegmenterFunc func(ctx context.Context, segmenterName string) error GetObjectPointCloudsFunc func(ctx context.Context, cameraName, segmenterName string) ([]*viz.Object, error) }
VisionService represents a fake instance of a vision service.
func (*VisionService) AddClassifier ¶ added in v0.0.9
func (vs *VisionService) AddClassifier(ctx context.Context, cfg vision.VisModelConfig) error
AddClassifier calls the injected AddClassifier or the real variant.
func (*VisionService) AddDetector ¶
func (vs *VisionService) AddDetector(ctx context.Context, cfg vision.VisModelConfig) error
AddDetector calls the injected AddDetector or the real variant.
func (*VisionService) AddSegmenter ¶ added in v0.1.0
func (vs *VisionService) AddSegmenter(ctx context.Context, cfg vision.VisModelConfig) error
AddSegmenter calls the injected AddSegmenter or the real variant.
func (*VisionService) Classifications ¶ added in v0.1.0
func (vs *VisionService) Classifications(ctx context.Context, img image.Image, classifierName string, n int, ) (classification.Classifications, error)
Classifications calls the injected Classifier or the real variant.
func (*VisionService) ClassificationsFromCamera ¶ added in v0.1.0
func (vs *VisionService) ClassificationsFromCamera(ctx context.Context, cameraName, classifierName string, n int, ) (classification.Classifications, error)
ClassificationsFromCamera calls the injected Classifer or the real variant.
func (*VisionService) ClassifierNames ¶ added in v0.1.0
func (vs *VisionService) ClassifierNames(ctx context.Context) ([]string, error)
ClassifierNames calls the injected ClassifierNames or the real variant.
func (*VisionService) Detections ¶ added in v0.1.0
func (vs *VisionService) Detections(ctx context.Context, img image.Image, detectorName string, ) ([]objectdetection.Detection, error)
Detections calls the injected Detect or the real variant.
func (*VisionService) DetectionsFromCamera ¶ added in v0.1.0
func (vs *VisionService) DetectionsFromCamera(ctx context.Context, cameraName, detectorName string, ) ([]objectdetection.Detection, error)
DetectionsFromCamera calls the injected Detector or the real variant.
func (*VisionService) DetectorNames ¶ added in v0.1.0
func (vs *VisionService) DetectorNames(ctx context.Context) ([]string, error)
DetectorNames calls the injected DetectorNames or the real variant.
func (*VisionService) GetModelParameterSchema ¶ added in v0.1.0
func (vs *VisionService) GetModelParameterSchema(ctx context.Context, modelType vision.VisModelType) (*jsonschema.Schema, error)
GetModelParameterSchema calls the injected ModelParameters or the real variant.
func (*VisionService) GetObjectPointClouds ¶
func (vs *VisionService) GetObjectPointClouds( ctx context.Context, cameraName, segmenterName string, ) ([]*viz.Object, error)
GetObjectPointClouds calls the injected GetObjectPointClouds or the real variant.
func (*VisionService) RemoveClassifier ¶ added in v0.0.9
func (vs *VisionService) RemoveClassifier(ctx context.Context, classifierName string) error
RemoveClassifier calls the injected RemoveClassifier or the real variant.
func (*VisionService) RemoveDetector ¶ added in v0.0.9
func (vs *VisionService) RemoveDetector(ctx context.Context, detectorName string) error
RemoveDetector calls the injected RemoveDetector or the real variant.
func (*VisionService) RemoveSegmenter ¶ added in v0.1.0
func (vs *VisionService) RemoveSegmenter(ctx context.Context, segmenterName string) error
RemoveSegmenter calls the injected RemoveSegmenter or the real variant.
func (*VisionService) SegmenterNames ¶ added in v0.1.0
func (vs *VisionService) SegmenterNames(ctx context.Context) ([]string, error)
SegmenterNames calls the injected SegmenterNames or the real variant.
Source Files
¶
- analog_reader.go
- arm.go
- audioinput.go
- base.go
- board.go
- camera.go
- datamanager_service.go
- digital_interrupt.go
- gantry.go
- generic.go
- gpio_pin.go
- gripper.go
- i2c.go
- input.go
- io.go
- motion_service.go
- motor.go
- movementsensor.go
- navigation_service.go
- pose_tracker.go
- robot.go
- sensor.go
- sensors.go
- servo.go
- slam_service.go
- spi.go
- vision_service.go