Documentation ¶
Overview ¶
Package trossen implements arms from Trossen Robotics.
Index ¶
- Constants
- Variables
- func NewArm(r robot.Robot, cfg config.Component, logger golog.Logger, json []byte) (arm.LocalArm, error)
- type Arm
- func (a *Arm) Close()
- func (a *Arm) CurrentInputs(ctx context.Context) ([]referenceframe.Input, error)
- func (a *Arm) EndPosition(ctx context.Context, extra map[string]interface{}) (spatialmath.Pose, error)
- func (a *Arm) GetAllAngles() (map[string]float64, error)
- func (a *Arm) GetAllServos() []*servo.Servo
- func (a *Arm) GetMoveLock() *sync.Mutex
- func (a *Arm) GetServos(jointName string) []*servo.Servo
- func (a *Arm) GoToInputs(ctx context.Context, goal []referenceframe.Input) error
- func (a *Arm) HomePosition(ctx context.Context) error
- func (a *Arm) IsMoving(ctx context.Context) (bool, error)
- func (a *Arm) JointOrder() []string
- func (a *Arm) JointPositions(ctx context.Context, extra map[string]interface{}) (*pb.JointPositions, error)
- func (a *Arm) JointTo(jointName string, pos int, block bool)
- func (a *Arm) ModelFrame() referenceframe.Model
- func (a *Arm) MoveToJointPositions(ctx context.Context, jp *pb.JointPositions, extra map[string]interface{}) error
- func (a *Arm) MoveToPosition(ctx context.Context, pos spatialmath.Pose, worldState *commonpb.WorldState, ...) error
- func (a *Arm) PrintPositions() error
- func (a *Arm) SetAcceleration(accel int) error
- func (a *Arm) SetVelocity(veloc int) error
- func (a *Arm) SleepPosition(ctx context.Context) error
- func (a *Arm) Stop(ctx context.Context, extra map[string]interface{}) error
- func (a *Arm) TorqueOff() error
- func (a *Arm) TorqueOn() error
- func (a *Arm) WaitForMovement(ctx context.Context) error
- type AttrConfig
Constants ¶
const ( // ModelNameWX250S is the string used to refer to the wx250s arm model. ModelNameWX250S = "wx250s" // ModelNameVX300S is the string used to refer to the vx300s arm model. ModelNameVX300S = "vx300s" )
Variables ¶
var OffAngles = map[string]float64{
"Waist": 2048,
"Shoulder": 795,
"Elbow": 3091,
"Forearm_rot": 2048,
"Wrist": 2566,
"Wrist_rot": 2048,
}
OffAngles are the angles the arm falls into after torque is off.
var SleepAngles = map[string]float64{
"Waist": 2048,
"Shoulder": 840,
"Elbow": 3090,
"Forearm_rot": 2048,
"Wrist": 2509,
"Wrist_rot": 2048,
}
SleepAngles are the angles we go to to prepare to turn off torque.
Functions ¶
Types ¶
type Arm ¶
type Arm struct { generic.Unimplemented Joints map[string][]*servo.Servo // contains filtered or unexported fields }
Arm TODO.
func (*Arm) CurrentInputs ¶
CurrentInputs TODO.
func (*Arm) EndPosition ¶
func (a *Arm) EndPosition(ctx context.Context, extra map[string]interface{}) (spatialmath.Pose, error)
EndPosition computes and returns the current cartesian position.
func (*Arm) GetAllAngles ¶
GetAllAngles will return a map of the angles of each joint, denominated in servo position.
func (*Arm) GetAllServos ¶
GetAllServos returns a slice containing all servos in the arm.
func (*Arm) GoToInputs ¶
GoToInputs TODO.
func (*Arm) HomePosition ¶
HomePosition goes to the home position.
func (*Arm) JointPositions ¶
func (a *Arm) JointPositions(ctx context.Context, extra map[string]interface{}) (*pb.JointPositions, error)
JointPositions returns an empty struct, because the wx250s should use joint angles from kinematics.
func (*Arm) MoveToJointPositions ¶
func (a *Arm) MoveToJointPositions(ctx context.Context, jp *pb.JointPositions, extra map[string]interface{}) error
MoveToJointPositions takes a list of degrees and sets the corresponding joints to that position.
func (*Arm) MoveToPosition ¶
func (a *Arm) MoveToPosition( ctx context.Context, pos spatialmath.Pose, worldState *commonpb.WorldState, extra map[string]interface{}, ) error
MoveToPosition moves the arm to the specified cartesian position.
func (*Arm) PrintPositions ¶
PrintPositions prints positions of all servos. TODO(pl): Print joint names, not just servo numbers.
func (*Arm) SetAcceleration ¶
SetAcceleration sets acceleration for servos.
func (*Arm) SetVelocity ¶
SetVelocity sets velocity for servos in travel time; recommended value 1000.
func (*Arm) SleepPosition ¶
SleepPosition goes back to the sleep position, ready to turn off torque.
type AttrConfig ¶
type AttrConfig struct { UsbPort string `json:"serial_path"` BaudRate int `json:"serial_baud_rate"` ArmServoCount int `json:"arm_servo_count"` }
AttrConfig is used for converting Arm config attributes.
func (*AttrConfig) Validate ¶
func (config *AttrConfig) Validate(path string) error
Validate ensures all parts of the config are valid.