kinematics-dynamics
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | List of all members
roboticslab::ICartesianControl Class Referenceabstract

Abstract base class for a cartesian controller.

#include <ICartesianControl.h>

Inheritance diagram for roboticslab::ICartesianControl:
BasicCartesianControl CartesianControlClient CartesianControlClientROS2

Classes

struct  ControllerState
 Controller state structure. More...
 

Public Types

enum class  Vocabs {
  OK = yarp::os::createVocab32('o','k') , FAILED = yarp::os::createVocab32('f','a','i','l') , SET = yarp::os::createVocab32('s','e','t') , GET = yarp::os::createVocab32('g','e','t') ,
  NOT_SET = yarp::os::createVocab32('n','s','e','t')
}
 General-purpose vocabs. More...
 
enum class  RPC {
  STATE = yarp::os::createVocab32('s','t','a','t') , INV = yarp::os::createVocab32('i','n','v') , MOVEJ = yarp::os::createVocab32('m','o','v','j') , MOVEL = yarp::os::createVocab32('m','o','v','l') ,
  MOVEV = yarp::os::createVocab32('m','o','v','v') , GCMP = yarp::os::createVocab32('g','c','m','p') , FORCE = yarp::os::createVocab32('f','o','r','c') , STOP = yarp::os::createVocab32('s','t','o','p') ,
  TOOL = yarp::os::createVocab32('t','o','o','l') , ACT = yarp::os::createVocab32('a','c','t')
}
 RPC vocabs. More...
 
enum class  Streaming { POSE = yarp::os::createVocab32('p','o','s','e') , TWIST = yarp::os::createVocab32('t','w','s','t') , WRENCH = yarp::os::createVocab32('w','r','n','c') }
 Streaming vocabs. More...
 
enum class  Mode {
  NONE = yarp::os::createVocab32('n','c','t','l') , MOVEJ = yarp::os::createVocab32('m','o','v','j') , MOVEL = yarp::os::createVocab32('m','o','v','l') , MOVEV = yarp::os::createVocab32('m','o','v','v') ,
  GCMP = yarp::os::createVocab32('g','c','m','p') , FORCE = yarp::os::createVocab32('f','o','r','c')
}
 Controller mode vocabs. More...
 
enum class  Actuator {
  NONE = yarp::os::createVocab32('a','c','n') , CLOSE = yarp::os::createVocab32('a','c','c','g') , OPEN = yarp::os::createVocab32('a','c','o','g') , STOP = yarp::os::createVocab32('a','c','s','g') ,
  GENERIC = yarp::os::createVocab32('a','c','g')
}
 Actuator control vocabs. More...
 
enum class  Config {
  GAIN = yarp::os::createVocab32('c','p','c','g') , TRAJ_DURATION = yarp::os::createVocab32('c','p','t','d') , TRAJ_REF_SPD = yarp::os::createVocab32('c','p','t','s') , TRAJ_REF_ACC = yarp::os::createVocab32('c','p','t','a') ,
  CMC_PERIOD = yarp::os::createVocab32('c','p','c','p') , FRAME = yarp::os::createVocab32('c','p','f') , STREAMING_CMD = yarp::os::createVocab32('c','p','s','c')
}
 Controller configuration vocabs. More...
 

Public Member Functions

virtual ~ICartesianControl ()=default
 Destructor.
 
virtual bool stat (std::vector< double > &x, int *state=nullptr, double *timestamp=nullptr)
 
virtual bool inv (const std::vector< double > &xd, std::vector< double > &q)
 
virtual bool movj (const std::vector< double > &xd)
 
virtual bool relj (const std::vector< double > &xd)
 
virtual bool movl (const std::vector< double > &xd)
 
virtual bool movv (const std::vector< double > &xdotd)
 
virtual bool gcmp ()
 
virtual bool forc (const std::vector< double > &fd)
 
virtual bool wait (double timeout=0.0)
 
virtual bool tool (const std::vector< double > &x)
 
virtual bool act (int command)
 
virtual bool setParameter (int vocab, double value)
 
virtual bool getParameter (int vocab, double *value)
 
virtual bool setParameters (const std::map< int, double > &params)
 
virtual bool getParameters (std::map< int, double > &params)
 
RPC commands

RPC commands with success/failure response.

virtual yarp::dev::ReturnValue getState (ControllerState &state)=0
 Current state and position.
 
virtual yarp::dev::ReturnValue solvePose (const std::vector< double > &xd, std::vector< double > &q)=0
 Inverse kinematics.
 
virtual yarp::dev::ReturnValue moveJoint (const std::vector< double > &xd)=0
 Move in joint space.
 
virtual yarp::dev::ReturnValue moveLinear (const std::vector< double > &xd)=0
 Linear move to target position.
 
virtual yarp::dev::ReturnValue moveVelocity (const std::vector< double > &xdotd)=0
 Linear move with given velocity.
 
virtual yarp::dev::ReturnValue gravityCompensation ()=0
 Gravity compensation.
 
virtual yarp::dev::ReturnValue forceControl (const std::vector< double > &fd)=0
 Force control.
 
virtual yarp::dev::ReturnValue stopControl ()=0
 Stop control.
 
virtual yarp::dev::ReturnValue changeTool (const std::vector< double > &x)=0
 Change tool.
 
virtual yarp::dev::ReturnValue actuateTool (Actuator command)=0
 Actuate tool.
 
Streaming commands

High-frequency streaming commands, no acknowledge.

virtual void pose (const std::vector< double > &x)=0
 Achieve pose.
 
virtual void twist (const std::vector< double > &xdot)=0
 Instantaneous velocity steps.
 
virtual void wrench (const std::vector< double > &w)=0
 Exert force.
 
Configuration accessors

Configuration setters and getters with success/failure response.

virtual yarp::dev::ReturnValue setParameter (Config vocab, double value)=0
 Set a configuration parameter.
 
virtual yarp::dev::ReturnValue getParameter (Config vocab, double *value)=0
 Retrieve a configuration parameter.
 
virtual yarp::dev::ReturnValue setParameters (const std::map< Config, double > &params)=0
 Set multiple configuration parameters.
 
virtual yarp::dev::ReturnValue getParameters (std::map< Config, double > &params)=0
 Retrieve multiple configuration parameters.
 

Member Enumeration Documentation

◆ Actuator

Used by ICartesianControl::act to control the actuator.

Enumerator
NONE 

No actuator or no action.

CLOSE 

Close gripper.

OPEN 

Open gripper.

STOP 

Stop gripper.

GENERIC 

Generic actuator.

◆ Config

Used by configuration accessors.

Enumerator
GAIN 

Controller gain.

TRAJ_DURATION 

Trajectory duration [s].

TRAJ_REF_SPD 

Trajectory reference speed [m/s].

TRAJ_REF_ACC 

Trajectory reference acceleration [m/s^2].

CMC_PERIOD 

CMC period [ms].

FRAME 

Reference frame.

STREAMING_CMD 

Preset streaming command.

◆ Mode

Used by ICartesianControl::getState to reflect current control mode.

Enumerator
NONE 

Not controlling.

MOVEJ 

Executing MOVEJ command.

MOVEL 

Executing MOVEL command.

MOVEV 

Executing MOVEV command.

GCMP 

Executing GCMP command.

FORCE 

Executing FORCE command.

◆ RPC

Used by RPC commands.

Enumerator
STATE 

Current state and position.

INV 

Inverse kinematics.

MOVEJ 

Move in joint space, absolute coordinates.

MOVEL 

Linear move to target position.

MOVEV 

Linear move with given velocity.

GCMP 

Gravity compensation.

FORCE 

Force control.

STOP 

Stop control.

TOOL 

Change tool.

ACT 

Actuate tool.

◆ Streaming

Used by streaming commands.

Enumerator
POSE 

Achieve pose.

TWIST 

Instantaneous velocity steps.

WRENCH 

Exert force.

◆ Vocabs

Used in acknowledge responses, configuration accessors, etc..

Enumerator
OK 

Success.

FAILED 

Failure.

SET 

Setter.

GET 

Getter.

NOT_SET 

State: not set.

Member Function Documentation

◆ actuateTool()

virtual yarp::dev::ReturnValue roboticslab::ICartesianControl::actuateTool ( Actuator  command)
pure virtual

Send control command to actuate the robot's tool, if available.

Parameters
commandOne of the available ICartesianControl::Actuator vocabs.
Returns
true on success, false otherwise

Implemented in BasicCartesianControl, CartesianControlClient, and CartesianControlClientROS2.

◆ changeTool()

virtual yarp::dev::ReturnValue roboticslab::ICartesianControl::changeTool ( const std::vector< double > &  x)
pure virtual

Unload current tool if any and append new tool frame to the kinematic chain.

Parameters
x6-element vector describing new tool tip with regard to current end-effector frame in cartesian space; first three elements denote translation (meters), last three denote rotation in scaled axis-angle representation (radians).
Returns
true on success, false otherwise

Implemented in BasicCartesianControl, CartesianControlClient, and CartesianControlClientROS2.

◆ forceControl()

virtual yarp::dev::ReturnValue roboticslab::ICartesianControl::forceControl ( const std::vector< double > &  fd)
pure virtual

Apply desired forces in task space.

Parameters
fd6-element vector describing desired force exerted by the TCP in cartesian space; first three elements denote linear force (Newton), last three denote torque (Newton*meters).
Returns
true on success, false otherwise

Implemented in BasicCartesianControl, CartesianControlClient, and CartesianControlClientROS2.

◆ getParameter()

virtual yarp::dev::ReturnValue roboticslab::ICartesianControl::getParameter ( Config  vocab,
double *  value 
)
pure virtual

Ask the controller to retrieve a parameter of 'double' type.

Parameters
vocabYARP-encoded vocab (parameter key).
valueParameter value encoded as a double.
Returns
true on success, false otherwise

Implemented in BasicCartesianControl, CartesianControlClient, and CartesianControlClientROS2.

◆ getParameters()

virtual yarp::dev::ReturnValue roboticslab::ICartesianControl::getParameters ( std::map< Config, double > &  params)
pure virtual

Ask the controller to retrieve all available parameters at once.

Parameters
paramsDictionary of YARP-encoded vocabs as keys and their values.
Returns
true on success, false otherwise

◆ getState()

virtual yarp::dev::ReturnValue roboticslab::ICartesianControl::getState ( ControllerState state)
pure virtual

Inform on control state, get robot position and perform forward kinematics.

Parameters
stateController state data.
Returns
true on success, false otherwise

Implemented in BasicCartesianControl, CartesianControlClient, and CartesianControlClientROS2.

◆ gravityCompensation()

virtual yarp::dev::ReturnValue roboticslab::ICartesianControl::gravityCompensation ( )
pure virtual

Enable gravity compensation.

Returns
true on success, false otherwise

Implemented in BasicCartesianControl, CartesianControlClient, and CartesianControlClientROS2.

◆ moveJoint()

virtual yarp::dev::ReturnValue roboticslab::ICartesianControl::moveJoint ( const std::vector< double > &  xd)
pure virtual

Perform inverse kinematics and move to desired position in joint space using absolute coordinates.

Parameters
xd6-element vector describing desired position in cartesian space; first three elements denote translation (meters), last three denote rotation in scaled axis-angle representation (radians).
Returns
true on success, false otherwise

Implemented in BasicCartesianControl, CartesianControlClient, and CartesianControlClientROS2.

◆ moveLinear()

virtual yarp::dev::ReturnValue roboticslab::ICartesianControl::moveLinear ( const std::vector< double > &  xd)
pure virtual

Move to end position along a line trajectory.

Parameters
xd6-element vector describing desired position in cartesian space; first three elements denote translation (meters), last three denote rotation in scaled axis-angle representation (radians).
Returns
true on success, false otherwise

Implemented in BasicCartesianControl, CartesianControlClient, and CartesianControlClientROS2.

◆ moveVelocity()

virtual yarp::dev::ReturnValue roboticslab::ICartesianControl::moveVelocity ( const std::vector< double > &  xdotd)
pure virtual

Move along a line with constant velocity.

Parameters
xdotd6-element vector describing desired velocity in cartesian space; first three elements denote translational velocity (meters/second), last three denote angular velocity (radians/second).
Returns
true on success, false otherwise

Implemented in BasicCartesianControl, CartesianControlClient, and CartesianControlClientROS2.

◆ pose()

virtual void roboticslab::ICartesianControl::pose ( const std::vector< double > &  x)
pure virtual

Move to desired position instantaneously, no further intermediate calculations are expected other than computing the inverse kinematics.

Parameters
x6-element vector describing desired instantaneous pose in cartesian space; first three elements denote translation (meters), last three denote rotation in scaled axis-angle representation (radians).

Implemented in BasicCartesianControl, CartesianControlClient, and CartesianControlClientROS2.

◆ setParameter()

virtual yarp::dev::ReturnValue roboticslab::ICartesianControl::setParameter ( Config  vocab,
double  value 
)
pure virtual

Ask the controller to store or update a parameter of 'double' type.

Parameters
vocabYARP-encoded vocab (parameter key).
valueParameter value encoded as a double.
Returns
true on success, false otherwise

Implemented in BasicCartesianControl, CartesianControlClient, and CartesianControlClientROS2.

◆ setParameters()

virtual yarp::dev::ReturnValue roboticslab::ICartesianControl::setParameters ( const std::map< Config, double > &  params)
pure virtual

Ask the controller to store or update multiple parameters at once.

Parameters
paramsDictionary of YARP-encoded vocabs as keys and their values.
Returns
true on success, false otherwise

◆ solvePose()

virtual yarp::dev::ReturnValue roboticslab::ICartesianControl::solvePose ( const std::vector< double > &  xd,
std::vector< double > &  q 
)
pure virtual

Perform inverse kinematics (using robot position as initial guess), but do not move.

Parameters
xd6-element vector describing desired position in cartesian space; first three elements denote translation (meters), last three denote rotation in scaled axis-angle representation (radians).
qVector describing current position in joint space (meters or degrees).
Returns
true on success, false otherwise

Implemented in BasicCartesianControl, CartesianControlClient, and CartesianControlClientROS2.

◆ stopControl()

virtual yarp::dev::ReturnValue roboticslab::ICartesianControl::stopControl ( )
pure virtual

Halt current control loop if any and cease movement.

Returns
true on success, false otherwise

Implemented in BasicCartesianControl, CartesianControlClient, and CartesianControlClientROS2.

◆ twist()

virtual void roboticslab::ICartesianControl::twist ( const std::vector< double > &  xdot)
pure virtual

Move in instantaneous velocity increments.

Parameters
xdot6-element vector describing velocity increments in cartesian space; first three elements denote translational velocity (meters/second), last three denote angular velocity (radians/second).

Implemented in BasicCartesianControl, CartesianControlClient, and CartesianControlClientROS2.

◆ wrench()

virtual void roboticslab::ICartesianControl::wrench ( const std::vector< double > &  w)
pure virtual

Make the TCP exert the desired force instantaneously.

Parameters
w6-element vector describing desired force exerted by the TCP in cartesian space; first three elements denote linear force (Newton), last three denote torque (Newton*meters).

Implemented in BasicCartesianControl, CartesianControlClient, and CartesianControlClientROS2.


The documentation for this class was generated from the following file: