Documentation ¶
Overview ¶
Package framesystem defines the frame system service which is responsible for managing a stateful frame system
Index ¶
- Constants
- Variables
- func DependencyNotFoundError(name string) error
- func DuplicateResourceShortNameError(name string) error
- func NotInputEnabledError(component resource.Resource) error
- func PrefixRemoteParts(parts []*referenceframe.FrameSystemPart, remoteName, remoteParent string)
- type Config
- type Service
Constants ¶
const LocalFrameSystemName = "robot"
LocalFrameSystemName is the default name of the frame system created by the service.
const SubtypeName = "frame_system"
SubtypeName is a constant that identifies the internal frame system resource subtype string.
Variables ¶
var API = resource.APINamespaceRDKInternal.WithServiceType(SubtypeName)
API is the fully qualified API for the internal frame system service.
var InternalServiceName = resource.NewName(API, "builtin")
InternalServiceName is used to refer to/depend on this service internally.
Functions ¶
func DependencyNotFoundError ¶ added in v0.2.47
DependencyNotFoundError returns an error if the given dependency name could not be found when building the framesystem.
func DuplicateResourceShortNameError ¶ added in v0.2.47
DuplicateResourceShortNameError returns an error if mutiple components are attempted to be registered in the frame system which share a short name.
func NotInputEnabledError ¶ added in v0.2.47
NotInputEnabledError is returned when the given component is not InputEnabled but should be.
func PrefixRemoteParts ¶ added in v0.2.47
func PrefixRemoteParts(parts []*referenceframe.FrameSystemPart, remoteName, remoteParent string)
PrefixRemoteParts applies prefixes to a list of FrameSystemParts appropriate to the remote they originate from.
Types ¶
type Config ¶ added in v0.2.47
type Config struct { resource.TriviallyValidateConfig Parts []*referenceframe.FrameSystemPart AdditionalTransforms []*referenceframe.LinkInFrame }
Config is a slice of *config.FrameSystemPart.
type Service ¶
type Service interface { resource.Resource // TransformPose returns a transformed pose in the destination reference frame. // This method converts a given source pose from one reference frame to a specified destination frame. TransformPose( ctx context.Context, pose *referenceframe.PoseInFrame, dst string, additionalTransforms []*referenceframe.LinkInFrame, ) (*referenceframe.PoseInFrame, error) // TransformPointCloud returns a new point cloud with points adjusted from one reference frame to a specified destination frame. TransformPointCloud(ctx context.Context, srcpc pointcloud.PointCloud, srcName, dstName string) (pointcloud.PointCloud, error) // CurrentInputs returns a map of the current inputs for each component of a machine's frame system // and a map of statuses indicating which of the machine's components may be actuated through input values. CurrentInputs(ctx context.Context) (map[string][]referenceframe.Input, map[string]referenceframe.InputEnabled, error) // FrameSystem returns the frame system of the machine and incorporates any specified additional transformations. FrameSystem(ctx context.Context, additionalTransforms []*referenceframe.LinkInFrame) (referenceframe.FrameSystem, error) }
A Service that returns the frame system for a robot.
TransformPose example:
// Define a Pose coincident with the world reference frame firstPose := spatialmath.NewZeroPose // Establish the world as the reference for firstPose firstPoseInFrame := referenceframe.NewPoseInFrame(referenceframe.World, firstPose) // Calculate firstPoseInFrame from the perspective of the origin frame of myArm transformedPoseInFrame, err := machine.TransformPose(context.Background(), firstPoseInFrame, "myArm", nil)
TransformPointCloud example:
// Create an empty slice to store point cloud data. pointClouds := make([]pointcloud.PointCloud, 0) // Transform the first point cloud in the list from its reference frame to the frame of 'myArm'. transformed, err := fsService.TransformPointCloud(context.Background(), pointClouds[0], referenceframe.World, "myArm")
CurrentInputs example:
myCurrentInputs, err := fsService.CurrentInputs(context.Background()) frameSystem, err := fsService.FrameSystem(context.Background(), nil)
func FromDependencies ¶ added in v0.2.47
func FromDependencies(deps resource.Dependencies) (Service, error)
FromDependencies is a helper for getting the framesystem from a collection of dependencies.