touch

package
v0.3.10 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: Apache-2.0 Imports: 38 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCannotSpecifyGoalStateInExtra      = errors.New("cannot specify 'goal_state' in 'extra', should be specified via 'joints'")
	ErrMustSpecifyAtLeastOneJointPosition = errors.New("must specify at least one joint position")
)
View Source
var ArmPositionSaverModel = vmodutils.NamespaceFamily.WithModel("arm-position-saver")
View Source
var ClusterModel = vmodutils.NamespaceFamily.WithModel("pc-cluster")
View Source
var CropCameraModel = vmodutils.NamespaceFamily.WithModel("pc-crop-camera")
View Source
var DetectCropCameraModel = vmodutils.NamespaceFamily.WithModel("pc-detect-crop-camera")
View Source
var LookAtCameraModel = vmodutils.NamespaceFamily.WithModel("pc-look-at-crop-camera")
View Source
var MergeModel = vmodutils.NamespaceFamily.WithModel("pc-merge")
View Source
var MultiArmPositionSwitchModel = vmodutils.NamespaceFamily.WithModel("multi-arm-position-switch")
View Source
var MultipleArmPosesModel = vmodutils.NamespaceFamily.WithModel("pc-multiple-arm-poses")
View Source
var ObstacleModel = vmodutils.NamespaceFamily.WithModel("obstacle")
View Source
var ObstacleOpenBoxModel = vmodutils.NamespaceFamily.WithModel("obstacle-open-box")
View Source
var RealSenseProperties = camera.Properties{
	IntrinsicParams:  &transform.PinholeCameraIntrinsics{Width: 1280, Height: 720, Fx: 906.0663452148438, Fy: 905.1234741210938, Ppx: 646.94970703125, Ppy: 374.4667663574219},
	DistortionParams: &transform.BrownConrady{RadialK1: 0, RadialK2: 0, RadialK3: 0, TangentialP1: 0, TangentialP2: 0},
}

Functions

func BoundingRectMinMax

func BoundingRectMinMax(r *image.Rectangle, p r3.Vector)

func Cluster added in v0.3.0

func Cluster(pc pointcloud.PointCloud, maxDistance float64, minPointsPerSegment, minPointsPerCluster int) ([]pointcloud.PointCloud, error)

func EuclideanRGB added in v0.3.0

func EuclideanRGB(c1, c2 color.Color) float64

func FindPart added in v0.1.11

func FrameSystemWithSomeParts added in v0.1.15

func FrameSystemWithSomeParts(ctx context.Context, myRobot framesystem.Service, names []string, transforms []*referenceframe.LinkInFrame) (*referenceframe.FrameSystem, error)

func GetApproachPoint added in v0.2.5

func GetApproachPoint(p r3.Vector, deltaLinear float64, o *spatialmath.OrientationVectorDegrees) r3.Vector

GetApproachPoint

func GetMergedPointCloudFromMultiPositionSwitch added in v0.3.5

func GetMergedPointCloudFromMultiPositionSwitch(ctx context.Context, s toggleswitch.Switch, sleepTime time.Duration, srcCamera camera.Camera, extraForCamera map[string]any, fsSvc framesystem.Service, writeFilesToCaptureDirectory bool) (pointcloud.PointCloud, error)

func GetMergedPointCloudFromPositions added in v0.3.5

func GetMergedPointCloudFromPositions(ctx context.Context, positions []toggleswitch.Switch, sleepTime time.Duration, srcCamera camera.Camera, extraForCamera map[string]any, fsSvc framesystem.Service, writeFilesToCaptureDirectory bool) (pointcloud.PointCloud, error)

func InBox added in v0.0.8

func InBox(pt, min, max r3.Vector) bool

func PCCrop added in v0.2.8

func PCCrop(pc pointcloud.PointCloud, min, max r3.Vector) pointcloud.PointCloud

func PCCropWithColor added in v0.3.0

func PCCropWithColor(pc pointcloud.PointCloud, min, max r3.Vector, colorFilters []ColorFilter) pointcloud.PointCloud

func PCDetectCrop added in v0.3.3

func PCDetectCrop(
	pc pointcloud.PointCloud,
	detections []objectdetection.Detection,
	props camera.Properties) (pointcloud.PointCloud, error)

func PCFindHighestInRegion added in v0.2.8

func PCFindHighestInRegion(pc pointcloud.PointCloud, box image.Rectangle) r3.Vector

func PCFindLowestInRegion added in v0.2.8

func PCFindLowestInRegion(pc pointcloud.PointCloud, box image.Rectangle) r3.Vector

func PCLimitToImageBoxes added in v0.3.3

func PCLimitToImageBoxes(
	pc pointcloud.PointCloud,
	boxes []*image.Rectangle,
	colorCheck ColorCheck,
	props camera.Properties) (pointcloud.PointCloud, error)

func PCLookAtSegment added in v0.3.3

func PCLookAtSegment(pc pointcloud.PointCloud) (pointcloud.PointCloud, error)

func PCToImage added in v0.1.4

func PCToImage(pc pointcloud.PointCloud) image.Image

func PixelToPoint

func PixelToPoint(properties camera.Properties, pixelX, pixelY, depth float64) (float64, float64, float64)

func PrepBoundingRectForSearch

func PrepBoundingRectForSearch() *image.Rectangle

func RSPixelToPoint

func RSPixelToPoint(properties camera.Properties, pixelX, pixelY, depth float64) (float64, float64, float64)

Types

type ArmPositionSaver added in v0.1.1

type ArmPositionSaver struct {
	resource.AlwaysRebuild
	resource.TriviallyCloseable
	// contains filtered or unexported fields
}

func (*ArmPositionSaver) DoCommand added in v0.1.1

func (aps *ArmPositionSaver) DoCommand(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error)

func (*ArmPositionSaver) GetNumberOfPositions added in v0.1.1

func (aps *ArmPositionSaver) GetNumberOfPositions(ctx context.Context, extra map[string]interface{}) (uint32, []string, error)

func (*ArmPositionSaver) GetPosition added in v0.1.1

func (aps *ArmPositionSaver) GetPosition(ctx context.Context, extra map[string]interface{}) (uint32, error)

func (*ArmPositionSaver) Name added in v0.1.1

func (aps *ArmPositionSaver) Name() resource.Name

func (*ArmPositionSaver) SetPosition added in v0.1.1

func (aps *ArmPositionSaver) SetPosition(ctx context.Context, position uint32, extra map[string]interface{}) error

type ArmPositionSaverConfig added in v0.1.1

type ArmPositionSaverConfig struct {
	Arm            string                               `json:"arm,omitempty"`
	Joints         []float64                            `json:"joints,omitempty"`
	Motion         string                               `json:"motion,omitempty"`
	Point          r3.Vector                            `json:"point,omitzero"`
	Orientation    spatialmath.OrientationVectorDegrees `json:"orientation,omitzero"`
	VisionServices []string                             `json:"vision_services,omitempty"`
	Extra          map[string]interface{}               `json:"extra,omitempty"`
}

func (*ArmPositionSaverConfig) Validate added in v0.1.1

func (c *ArmPositionSaverConfig) Validate(path string) ([]string, []string, error)

type ClusterConfig added in v0.3.0

type ClusterConfig struct {
	Camera              string
	MaxDistance         float64 `json:"max-distance"`
	MinPointsPerSegment int     `json:"min-points-per-segment"`
	MinPointsPerCluster int     `json:"min-points-per-cluster"`
}

func (*ClusterConfig) Validate added in v0.3.0

func (cc *ClusterConfig) Validate(p string) ([]string, []string, error)

type ClusterService added in v0.3.0

type ClusterService struct {
	resource.AlwaysRebuild
	resource.TriviallyCloseable
	// contains filtered or unexported fields
}

func (*ClusterService) CaptureAllFromCamera added in v0.3.0

func (cs *ClusterService) CaptureAllFromCamera(ctx context.Context,
	cameraName string,
	opts viscapture.CaptureOptions,
	extra map[string]interface{}) (viscapture.VisCapture, error)

func (*ClusterService) Classifications added in v0.3.0

func (cs *ClusterService) Classifications(
	ctx context.Context,
	img image.Image,
	n int,
	extra map[string]interface{},
) (classification.Classifications, error)

func (*ClusterService) ClassificationsFromCamera added in v0.3.0

func (cs *ClusterService) ClassificationsFromCamera(
	ctx context.Context,
	cameraName string,
	n int,
	extra map[string]interface{},
) (classification.Classifications, error)

func (*ClusterService) Detections added in v0.3.0

func (cs *ClusterService) Detections(ctx context.Context, img image.Image, extra map[string]interface{}) ([]objectdetection.Detection, error)

func (*ClusterService) DetectionsFromCamera added in v0.3.0

func (cs *ClusterService) DetectionsFromCamera(ctx context.Context, cameraName string, extra map[string]interface{}) ([]objectdetection.Detection, error)

func (*ClusterService) DoCommand added in v0.3.0

func (cs *ClusterService) DoCommand(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error)

func (*ClusterService) GetObjectPointClouds added in v0.3.0

func (cs *ClusterService) GetObjectPointClouds(ctx context.Context, cameraName string, extra map[string]interface{}) ([]*viz.Object, error)

func (*ClusterService) GetProperties added in v0.3.0

func (cs *ClusterService) GetProperties(ctx context.Context, extra map[string]interface{}) (*vision.Properties, error)

func (*ClusterService) Name added in v0.3.0

func (cs *ClusterService) Name() resource.Name

type ColorCheck added in v0.3.3

type ColorCheck func(c color.Color) (bool, error)

type ColorFilter added in v0.3.0

type ColorFilter struct {
	Color    color.RGBA
	Distance float64
}

type CropCameraConfig

type CropCameraConfig struct {
	Src      string
	SrcFrame string `json:"src_frame"`
	Min      r3.Vector
	Max      r3.Vector

	GoodColors []ColorFilter `json:"good_colors"`
}

func (*CropCameraConfig) Validate

func (ccc *CropCameraConfig) Validate(path string) ([]string, []string, error)

type DetectCropCameraConfig added in v0.3.3

type DetectCropCameraConfig struct {
	Src     string
	Service string

	Labels []string
	Min    float64
}

func (*DetectCropCameraConfig) Validate added in v0.3.3

func (dccc *DetectCropCameraConfig) Validate(path string) ([]string, []string, error)

type LookAtCameraConfig added in v0.3.3

type LookAtCameraConfig struct {
	Src      string
	UseColor bool `json:"use_color"`
}

func (*LookAtCameraConfig) Validate added in v0.3.3

func (ccc *LookAtCameraConfig) Validate(path string) ([]string, []string, error)

type MergeCamera added in v0.1.8

type MergeCamera struct {
	resource.AlwaysRebuild
	resource.TriviallyCloseable
	// contains filtered or unexported fields
}

func (*MergeCamera) DoCommand added in v0.1.8

func (mapc *MergeCamera) DoCommand(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error)

func (*MergeCamera) Geometries added in v0.2.9

func (mapc *MergeCamera) Geometries(ctx context.Context, _ map[string]interface{}) ([]spatialmath.Geometry, error)

func (*MergeCamera) Image added in v0.1.8

func (mapc *MergeCamera) Image(ctx context.Context, mimeType string, extra map[string]interface{}) ([]byte, camera.ImageMetadata, error)

func (*MergeCamera) Images added in v0.1.8

func (mapc *MergeCamera) Images(ctx context.Context, filterSourceNames []string, extra map[string]interface{}) ([]camera.NamedImage, resource.ResponseMetadata, error)

func (*MergeCamera) Name added in v0.1.8

func (mapc *MergeCamera) Name() resource.Name

func (*MergeCamera) NextPointCloud added in v0.1.8

func (mapc *MergeCamera) NextPointCloud(ctx context.Context, extra map[string]interface{}) (pointcloud.PointCloud, error)

func (*MergeCamera) Properties added in v0.1.8

func (mapc *MergeCamera) Properties(ctx context.Context) (camera.Properties, error)

type MergeConfig added in v0.1.8

type MergeConfig struct {
	Cameras []string
}

func (*MergeConfig) Validate added in v0.1.8

func (c *MergeConfig) Validate(path string) ([]string, []string, error)

type MultiArmPositionSwitch added in v0.3.5

type MultiArmPositionSwitch struct {
	resource.AlwaysRebuild
	resource.TriviallyCloseable
	// contains filtered or unexported fields
}

func (*MultiArmPositionSwitch) DoCommand added in v0.3.5

func (maps *MultiArmPositionSwitch) DoCommand(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error)

func (*MultiArmPositionSwitch) GetNumberOfPositions added in v0.3.5

func (maps *MultiArmPositionSwitch) GetNumberOfPositions(ctx context.Context, extra map[string]interface{}) (uint32, []string, error)

func (*MultiArmPositionSwitch) GetPosition added in v0.3.5

func (maps *MultiArmPositionSwitch) GetPosition(ctx context.Context, extra map[string]interface{}) (uint32, error)

func (*MultiArmPositionSwitch) Name added in v0.3.5

func (maps *MultiArmPositionSwitch) Name() resource.Name

func (*MultiArmPositionSwitch) SetPosition added in v0.3.5

func (maps *MultiArmPositionSwitch) SetPosition(ctx context.Context, position uint32, extra map[string]interface{}) error

type MultiArmPositionSwitchConfig added in v0.3.5

type MultiArmPositionSwitchConfig struct {
	Arm                          string         `json:"arm,omitempty"`
	JointsList                   [][]float64    `json:"joints_list,omitempty"`
	Motion                       string         `json:"motion,omitempty"`
	VisionServices               []string       `json:"vision_services,omitempty"`
	Extra                        map[string]any `json:"extra,omitempty"`
	WriteFilesToCaptureDirectory bool           `json:"write_files_to_capture_directory,omitempty"`
}

func (*MultiArmPositionSwitchConfig) Validate added in v0.3.5

func (c *MultiArmPositionSwitchConfig) Validate(path string) ([]string, []string, error)

type MultipleArmPosesCamera added in v0.1.1

type MultipleArmPosesCamera struct {
	resource.AlwaysRebuild
	resource.TriviallyCloseable
	// contains filtered or unexported fields
}

func (*MultipleArmPosesCamera) DoCommand added in v0.1.1

func (mapc *MultipleArmPosesCamera) DoCommand(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error)

func (*MultipleArmPosesCamera) Geometries added in v0.2.9

func (mapc *MultipleArmPosesCamera) Geometries(ctx context.Context, _ map[string]interface{}) ([]spatialmath.Geometry, error)

func (*MultipleArmPosesCamera) Image added in v0.1.1

func (mapc *MultipleArmPosesCamera) Image(ctx context.Context, mimeType string, extra map[string]interface{}) ([]byte, camera.ImageMetadata, error)

func (*MultipleArmPosesCamera) Images added in v0.1.1

func (mapc *MultipleArmPosesCamera) Images(ctx context.Context, _ []string, _ map[string]interface{}) ([]camera.NamedImage, resource.ResponseMetadata, error)

func (*MultipleArmPosesCamera) Name added in v0.1.1

func (mapc *MultipleArmPosesCamera) Name() resource.Name

func (*MultipleArmPosesCamera) NextPointCloud added in v0.1.1

func (mapc *MultipleArmPosesCamera) NextPointCloud(ctx context.Context, extra map[string]interface{}) (pointcloud.PointCloud, error)

func (*MultipleArmPosesCamera) Properties added in v0.1.1

func (mapc *MultipleArmPosesCamera) Properties(ctx context.Context) (camera.Properties, error)

type MultipleArmPosesConfig added in v0.1.1

type MultipleArmPosesConfig struct {
	Src          string
	SleepSeconds float64 `json:"sleep_seconds"`
	Positions    []string
}

func (*MultipleArmPosesConfig) Validate added in v0.1.1

func (c *MultipleArmPosesConfig) Validate(path string) ([]string, []string, error)

type Obstacle added in v0.1.3

type Obstacle struct {
	resource.AlwaysRebuild
	resource.TriviallyCloseable
	// contains filtered or unexported fields
}

func (*Obstacle) CurrentInputs added in v0.2.0

func (g *Obstacle) CurrentInputs(ctx context.Context) ([]referenceframe.Input, error)

func (*Obstacle) DoCommand added in v0.1.3

func (o *Obstacle) DoCommand(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error)

func (*Obstacle) Geometries added in v0.1.3

func (o *Obstacle) Geometries(ctx context.Context, _ map[string]interface{}) ([]spatialmath.Geometry, error)

func (*Obstacle) GoToInputs added in v0.2.0

func (g *Obstacle) GoToInputs(ctx context.Context, inputs ...[]referenceframe.Input) error

func (*Obstacle) Grab added in v0.1.3

func (o *Obstacle) Grab(ctx context.Context, extra map[string]interface{}) (bool, error)

func (*Obstacle) IsHoldingSomething added in v0.2.9

func (o *Obstacle) IsHoldingSomething(ctx context.Context, extra map[string]interface{}) (gripper.HoldingStatus, error)

func (*Obstacle) IsMoving added in v0.1.3

func (o *Obstacle) IsMoving(context.Context) (bool, error)

func (*Obstacle) Kinematics added in v0.2.0

func (g *Obstacle) Kinematics(ctx context.Context) (referenceframe.Model, error)

func (*Obstacle) Name added in v0.1.3

func (o *Obstacle) Name() resource.Name

func (*Obstacle) Open added in v0.1.3

func (o *Obstacle) Open(ctx context.Context, extra map[string]interface{}) error

func (*Obstacle) Stop added in v0.1.3

func (o *Obstacle) Stop(context.Context, map[string]interface{}) error

type ObstacleConfig added in v0.1.3

type ObstacleConfig struct {
	Geometries []spatialmath.GeometryConfig
}

func (*ObstacleConfig) ParseGeometries added in v0.1.3

func (c *ObstacleConfig) ParseGeometries() ([]spatialmath.Geometry, error)

func (*ObstacleConfig) Validate added in v0.1.3

func (c *ObstacleConfig) Validate(path string) ([]string, []string, error)

type ObstacleOpenBox added in v0.2.8

type ObstacleOpenBox struct {
	resource.AlwaysRebuild
	resource.TriviallyCloseable
	// contains filtered or unexported fields
}

func (*ObstacleOpenBox) CurrentInputs added in v0.2.8

func (g *ObstacleOpenBox) CurrentInputs(ctx context.Context) ([]referenceframe.Input, error)

func (*ObstacleOpenBox) DoCommand added in v0.2.8

func (o *ObstacleOpenBox) DoCommand(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error)

func (*ObstacleOpenBox) Geometries added in v0.2.8

func (o *ObstacleOpenBox) Geometries(ctx context.Context, _ map[string]interface{}) ([]spatialmath.Geometry, error)

func (*ObstacleOpenBox) GoToInputs added in v0.2.8

func (g *ObstacleOpenBox) GoToInputs(ctx context.Context, inputs ...[]referenceframe.Input) error

func (*ObstacleOpenBox) Grab added in v0.2.8

func (o *ObstacleOpenBox) Grab(ctx context.Context, extra map[string]interface{}) (bool, error)

func (*ObstacleOpenBox) IsHoldingSomething added in v0.2.9

func (o *ObstacleOpenBox) IsHoldingSomething(ctx context.Context, extra map[string]interface{}) (gripper.HoldingStatus, error)

func (*ObstacleOpenBox) IsMoving added in v0.2.8

func (o *ObstacleOpenBox) IsMoving(context.Context) (bool, error)

func (*ObstacleOpenBox) Kinematics added in v0.2.8

func (g *ObstacleOpenBox) Kinematics(ctx context.Context) (referenceframe.Model, error)

func (*ObstacleOpenBox) Name added in v0.2.8

func (o *ObstacleOpenBox) Name() resource.Name

func (*ObstacleOpenBox) Open added in v0.2.8

func (o *ObstacleOpenBox) Open(ctx context.Context, extra map[string]interface{}) error

func (*ObstacleOpenBox) Stop added in v0.2.8

func (o *ObstacleOpenBox) Stop(context.Context, map[string]interface{}) error

type ObstacleOpenBoxConfig added in v0.2.8

type ObstacleOpenBoxConfig struct {
	Length, Width, Height float64
	Thickness             float64

	ToMove string `json:"to_move"`
	Motion string
	Offset float64
}

func (*ObstacleOpenBoxConfig) Geometries added in v0.2.8

func (c *ObstacleOpenBoxConfig) Geometries(name string) ([]spatialmath.Geometry, error)

func (*ObstacleOpenBoxConfig) Validate added in v0.2.8

func (c *ObstacleOpenBoxConfig) Validate(path string) ([]string, []string, error)

Jump to

Keyboard shortcuts

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