vmodutils

package module
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2025 License: Apache-2.0 Imports: 21 Imported by: 4

README

PkgGoDev

pc crop camera

{
  "src" : "<cam>",
  "src_frame" : <optional>, // src point cloud will be converted to world from this, if not specified assume it is world
  "min" : { "X" : 0, "Y" : 0, "Z" : 0}, // specified in world frame
  "min" : { "X" : 9, "Y" : 9, "Z" : 9}  // specified in world frame
}
  

pc detect crop camera

{
  "src" : "<cam>",
  "service" : "<vision service>"
}

pc merge

{
  "cameras" : ["<cam>"]
}

arm position saver

{
    // required
    "arm" : "<name of arm>",

    // optional
    // if motion and joints are set, uses joint to joint motion via motion.Move
    // if motion and pose are set, uses cartesian motion via motion.Move
    // if motion is not set and joints are set, uses arm.MoveToJointPositions
    "motion" : "<name of motion service>",

    // can be set automatically via SetPosition command
    "joints" : [ ],
    "point" : < ... >,
    "orientation" : < ... >,

    // optional - if set, the Geometry objects in the vision services' GetObjectPointClouds results
    // are added to the world state passed to the motion service
    "vision_services": ["<name of vision service>"],

    // optional - options passed as 'extra' to motion.Move or arm.MoveToJointPositions
    "extra" : "<options>"
}

multi arm position switch

{
    // required
    "arm" : "<name of arm>",

    // optional - if set uses joint to joint motion via motion.Move, if not uses arm.MoveToJointPositions
    "motion" : "<name of motion service>",

    // list of arm joint positions
    // the list needs to contain at least one set of joint positions
    "joints" : [[0, 0, 0, 0, 0, 0], ...],

    // optional - if set, the Geometry objects in the vision services' GetObjectPointClouds results
    // are added to the world state passed to the motion service
    "vision_services": ["<name of vision service>"],

    // optional - options passed as 'extra' to motion.Move or arm.MoveToJointPositions
    "extra" : "<options>"
}

pc multiple arm poses

{
 "src" : "<name of camera>",
 "positions" : [ <arm-position-saver>, ... ]
 }

obstacle

Configure this with a frame and you can have obstacles on your robot without having to hard code.

{
 "geometries" : [ { "type" : "box", "x" : 100, "y": 100, "z" : 100 } ]
 "geometries" : [ { "type" : "sphere", "r" : 100 } ]

}

obstacle open box

Configure this with a frame and you can have obstacles on your robot without having to hard code.

{
  "length" : 10,
  "width" : 10,
  "height" : 10,
  "thickness" : <optional, defaults to 1>,
  "to_move" : <if you want to move something to grab>,
  "motion" : <needed it to_move, but will also default to builtin>
}

pc look at crop camera

looks at the center of a point cloud and gets just that

{
    "src" : "<camera>",
    "use_color" : "<bool>" // optional
}

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NamespaceFamily = resource.ModelNamespace("erh").WithFamily("vmodutils")

Functions

func ConnectToHostFromCLIToken added in v0.1.0

func ConnectToHostFromCLIToken(ctx context.Context, host string, logger logging.Logger) (robot.Robot, error)

ConnectToHostFromCLIToken uses the viam cli token to login to a machine with just a hostname. use "viam login" to setup the token.

func ConnectToMachine added in v0.0.4

func ConnectToMachine(ctx context.Context, logger logging.Logger, host, apiKeyId, apiKey string) (robot.Robot, error)

func ConnectToMachineFromEnv added in v0.0.4

func ConnectToMachineFromEnv(ctx context.Context, logger logging.Logger) (robot.Robot, error)

func FindDep added in v0.2.9

func FindDep(deps resource.Dependencies, n string) (resource.Resource, bool)

func GetFloat64FromMap added in v0.2.10

func GetFloat64FromMap(m map[string]interface{}, n string) (float64, bool)

func GetInt64FromMap added in v0.2.7

func GetInt64FromMap(m map[string]interface{}, n string) (int64, bool)

func GetIntFromMap

func GetIntFromMap(m map[string]interface{}, n string) (int, bool)

func HTTPAuthHeader added in v0.3.0

func HTTPAuthHeader(nameType, machine, apiKeyId, apiKey string) string

nameType is BoatAuth or the like

func HTTPAuthHeaderFromEnv added in v0.3.0

func HTTPAuthHeaderFromEnv(nameType string) (string, error)

func MachineToDependencies added in v0.0.2

func MachineToDependencies(client robot.Robot) (resource.Dependencies, error)

func NewWebModule added in v0.0.4

func NewWebModule(name resource.Name, fs fs.FS, logger logging.Logger) (*webModule, error)

func NewWebModuleAndStart added in v0.0.4

func NewWebModuleAndStart(name resource.Name, fs fs.FS, logger logging.Logger, port int) (resource.Resource, error)

func NewWebModuleWithCookies added in v0.3.0

func NewWebModuleWithCookies(name resource.Name, fs fs.FS, logger logging.Logger, cookies []*http.Cookie) (*webModule, error)

func PrepInModuleServer added in v0.0.4

func PrepInModuleServer(fs fs.FS, accessLog logging.Logger, cookies []*http.Cookie) (*http.ServeMux, *http.Server, error)

func ReadJSONFromFile added in v0.1.4

func ReadJSONFromFile(fn string, where any) error

func UpdateComponentCloudAttributes added in v0.1.1

func UpdateComponentCloudAttributes(ctx context.Context, c *app.AppClient, id string, name resource.Name, newAttr utils.AttributeMap) error

func UpdateComponentCloudAttributesFromModuleEnv added in v0.1.1

func UpdateComponentCloudAttributesFromModuleEnv(ctx context.Context, name resource.Name, newAttr utils.AttributeMap, logger logging.Logger) error

Types

type MachineSetup

type MachineSetup struct {
	// contains filtered or unexported fields
}

func AddMachineFlags

func AddMachineFlags() *MachineSetup

func (*MachineSetup) Connect

func (ms *MachineSetup) Connect(ctx context.Context, logger logging.Logger) (*client.RobotClient, error)

func (*MachineSetup) Valid added in v0.0.3

func (ms *MachineSetup) Valid() bool

type StringState added in v0.2.3

type StringState struct {
	// contains filtered or unexported fields
}

func (*StringState) CheckEmpty added in v0.2.3

func (s *StringState) CheckEmpty() error

func (*StringState) Pop added in v0.2.3

func (s *StringState) Pop()

func (*StringState) Push added in v0.2.3

func (s *StringState) Push(str string)

func (*StringState) String added in v0.2.3

func (s *StringState) String() string

Directories

Path Synopsis
cmd
module command
pctools command
stl_to_geometry command

Jump to

Keyboard shortcuts

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