kinematics-dynamics
Public Member Functions | Private Member Functions | Private Attributes | List of all members
roboticslab::CartesianControlClient Class Reference

The CartesianControlClient class implements ICartesianControl client side.

#include <CartesianControlClient.hpp>

Inheritance diagram for roboticslab::CartesianControlClient:
roboticslab::ICartesianControl

Public Member Functions

bool stat (std::vector< double > &x, int *state=nullptr, double *timestamp=nullptr) override
 Current state and position. More...
 
bool inv (const std::vector< double > &xd, std::vector< double > &q) override
 Inverse kinematics. More...
 
bool movj (const std::vector< double > &xd) override
 Move in joint space, absolute coordinates. More...
 
bool relj (const std::vector< double > &xd) override
 Move in joint space, relative coordinates. More...
 
bool movl (const std::vector< double > &xd) override
 Linear move to target position. More...
 
bool movv (const std::vector< double > &xdotd) override
 Linear move with given velocity. More...
 
bool gcmp () override
 Gravity compensation. More...
 
bool forc (const std::vector< double > &fd) override
 Force control. More...
 
bool stopControl () override
 Stop control. More...
 
bool wait (double timeout) override
 Wait until completion. More...
 
bool tool (const std::vector< double > &x) override
 Change tool. More...
 
bool act (int command) override
 Actuate tool. More...
 
void pose (const std::vector< double > &x) override
 Achieve pose. More...
 
void twist (const std::vector< double > &xdot) override
 Instantaneous velocity steps. More...
 
void wrench (const std::vector< double > &w) override
 Exert force. More...
 
bool setParameter (int vocab, double value) override
 Set a configuration parameter. More...
 
bool getParameter (int vocab, double *value) override
 Retrieve a configuration parameter. More...
 
bool setParameters (const std::map< int, double > &params) override
 Set multiple configuration parameters. More...
 
bool getParameters (std::map< int, double > &params) override
 Retrieve multiple configuration parameters. More...
 
bool open (yarp::os::Searchable &config) override
 
bool close () override
 
- Public Member Functions inherited from roboticslab::ICartesianControl
virtual ~ICartesianControl ()=default
 Destructor.
 
virtual void movi (const std::vector< double > &x)
 

Private Member Functions

bool handleRpcRunnableCmd (int vocab)
 
bool handleRpcConsumerCmd (int vocab, const std::vector< double > &in)
 
bool handleRpcFunctionCmd (int vocab, const std::vector< double > &in, std::vector< double > &out)
 
void handleStreamingConsumerCmd (int vocab, const std::vector< double > &in)
 
void handleStreamingBiConsumerCmd (int vocab, const std::vector< double > &in1, double in2)
 

Private Attributes

yarp::os::RpcClient rpcClient
 
yarp::os::BufferedPort< yarp::os::Bottle > fkInPort
 
yarp::os::BufferedPort< yarp::os::Bottle > commandPort
 
FkStreamResponder fkStreamResponder
 
double fkStreamTimeoutSecs
 

Member Function Documentation

◆ act()

bool CartesianControlClient::act ( int  command)
overridevirtual

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

Parameters
commandOne of available actuator vocabs.
Returns
true on success, false otherwise

Implements roboticslab::ICartesianControl.

◆ forc()

bool CartesianControlClient::forc ( const std::vector< double > &  fd)
overridevirtual

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

Implements roboticslab::ICartesianControl.

◆ gcmp()

bool CartesianControlClient::gcmp ( )
overridevirtual

Enable gravity compensation.

Returns
true on success, false otherwise

Implements roboticslab::ICartesianControl.

◆ getParameter()

bool CartesianControlClient::getParameter ( int  vocab,
double *  value 
)
overridevirtual

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

Implements roboticslab::ICartesianControl.

◆ getParameters()

bool CartesianControlClient::getParameters ( std::map< int, double > &  params)
overridevirtual

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

Implements roboticslab::ICartesianControl.

◆ inv()

bool CartesianControlClient::inv ( const std::vector< double > &  xd,
std::vector< double > &  q 
)
overridevirtual

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

Implements roboticslab::ICartesianControl.

◆ movj()

bool CartesianControlClient::movj ( const std::vector< double > &  xd)
overridevirtual

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).
See also
relj (relative coordinates)
Returns
true on success, false otherwise

Implements roboticslab::ICartesianControl.

◆ movl()

bool CartesianControlClient::movl ( const std::vector< double > &  xd)
overridevirtual

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

Implements roboticslab::ICartesianControl.

◆ movv()

bool CartesianControlClient::movv ( const std::vector< double > &  xdotd)
overridevirtual

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

Implements roboticslab::ICartesianControl.

◆ pose()

void CartesianControlClient::pose ( const std::vector< double > &  x)
overridevirtual

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).

Implements roboticslab::ICartesianControl.

◆ relj()

bool CartesianControlClient::relj ( const std::vector< double > &  xd)
overridevirtual

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

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

Implements roboticslab::ICartesianControl.

◆ setParameter()

bool CartesianControlClient::setParameter ( int  vocab,
double  value 
)
overridevirtual

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

Implements roboticslab::ICartesianControl.

◆ setParameters()

bool CartesianControlClient::setParameters ( const std::map< int, double > &  params)
overridevirtual

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

Implements roboticslab::ICartesianControl.

◆ stat()

bool CartesianControlClient::stat ( std::vector< double > &  x,
int *  state = nullptr,
double *  timestamp = nullptr 
)
overridevirtual

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

Parameters
x6-element vector describing current position in cartesian space; first three elements denote translation (meters), last three denote rotation in scaled axis-angle representation (radians).
stateIdentifier for a cartesian control vocab.
timestampRemote encoder acquisition time.
Returns
true on success, false otherwise

Implements roboticslab::ICartesianControl.

◆ stopControl()

bool CartesianControlClient::stopControl ( )
overridevirtual

Halt current control loop if any and cease movement.

Returns
true on success, false otherwise

Implements roboticslab::ICartesianControl.

◆ tool()

bool CartesianControlClient::tool ( const std::vector< double > &  x)
overridevirtual

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

Implements roboticslab::ICartesianControl.

◆ twist()

void CartesianControlClient::twist ( const std::vector< double > &  xdot)
overridevirtual

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).

Implements roboticslab::ICartesianControl.

◆ wait()

bool CartesianControlClient::wait ( double  timeout)
overridevirtual

Block execution until the movement is completed, errors occur or timeout is reached.

Parameters
timeoutTimeout in seconds, '0.0' means no timeout.
Returns
true on success, false if errors occurred during the execution of the trajectory

Implements roboticslab::ICartesianControl.

◆ wrench()

void CartesianControlClient::wrench ( const std::vector< double > &  w)
overridevirtual

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).

Implements roboticslab::ICartesianControl.


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