d4c
Public Member Functions
iCub::d4c::D4C Class Referenceabstract

The Definition of the D4C Interface. More...

#include <d4c.h>

Inherited by iCub::d4c::D4CClient, and iCub::d4c::D4CServer.

Public Member Functions

virtual bool open (const yarp::os::Property &options)=0
 Configure the client or the server part of d4c framework. More...
 
virtual void close ()=0
 Stop the client/server and dispose it. More...
 
virtual bool addItem (const yarp::os::Property &options, int &item)=0
 Request for the creation of a new d4c entity which can be either a target or an obstacle. More...
 
virtual bool eraseItem (const int item)=0
 Remove one item from the items table. More...
 
virtual bool clearItems ()=0
 Purge all the items contained in the table. More...
 
virtual bool getItems (yarp::os::Bottle &items)=0
 Retrieve the list of all available items. More...
 
virtual bool setProperty (const int item, const yarp::os::Property &options)=0
 Allow changing the properties of an existing item. More...
 
virtual bool getProperty (const int item, yarp::os::Property &options)=0
 Retrieve the properties of an existing item. More...
 
virtual bool enableField ()=0
 Enable the generation of the d4c field. More...
 
virtual bool disableField ()=0
 Disable the generation of the d4c field. More...
 
virtual bool getFieldStatus (bool &status)=0
 Retrieve the current status of the d4c field. More...
 
virtual bool enableControl ()=0
 Enable the control of the robot part. More...
 
virtual bool disableControl ()=0
 Disable the control of the robot part. More...
 
virtual bool getControlStatus (bool &status)=0
 Retrieve the current status of the robot part control. More...
 
virtual bool enableSimulation ()=0
 Enable the simulation of the robot part. More...
 
virtual bool disableSimulation ()=0
 Disable the simulation of the robot part. More...
 
virtual bool getSimulationStatus (bool &status)=0
 Retrieve the current status of the robot part simulation. More...
 
virtual bool setPeriod (const int period)=0
 Allow changing the thread period for d4c field generation. More...
 
virtual bool getPeriod (int &period)=0
 Retrieve the current thread period for d4c field generation. More...
 
virtual bool setPointStateToTool ()=0
 Allow setting the trajectory state equal to the currently attached tool state (or end-effector state if no tool is attached). More...
 
virtual bool attachToolFrame (const yarp::sig::Vector &x, const yarp::sig::Vector &o)=0
 Attach a tool frame to the end-effector. More...
 
virtual bool getToolFrame (yarp::sig::Vector &x, yarp::sig::Vector &o)=0
 Retrieve the frame of the tool currently attached to the end-effector. More...
 
virtual bool removeToolFrame ()=0
 Remove the tool currently attached to the end-effector. More...
 
virtual bool getTool (yarp::sig::Vector &x, yarp::sig::Vector &o)=0
 Retrieve the coordinates of the tool currently attached to the end-effector. More...
 
virtual bool setPointState (const yarp::sig::Vector &x, const yarp::sig::Vector &o, const yarp::sig::Vector &xdot, const yarp::sig::Vector &odot)=0
 Allow chainging the trajectory state generated by the d4c framework. More...
 
virtual bool setPointOrientation (const yarp::sig::Vector &o, const yarp::sig::Vector &odot)=0
 Allow changing the orientation state of the trajectory generated by the d4c framework. More...
 
virtual bool getPointState (yarp::sig::Vector &x, yarp::sig::Vector &o, yarp::sig::Vector &xdot, yarp::sig::Vector &odot)=0
 Retrieve the current trajectory state generated by the d4c framework. More...
 
virtual bool getField (yarp::sig::Vector &field)=0
 Retrieve the current field as generated by the d4c framework. More...
 
virtual bool getSimulation (yarp::sig::Vector &xhat, yarp::sig::Vector &ohat, yarp::sig::Vector &qhat)=0
 Sample step by step the trajectory the end-effector will follow as constrained by the d4c field. More...
 
virtual bool getActiveIF (std::string &activeIF)=0
 Retrieve the interface currently active that controls the limb. More...
 
virtual bool setActiveIF (const std::string &activeIF)=0
 Set the active interface for limb control. More...
 
virtual bool getTrajectory (std::deque< yarp::sig::Vector > &trajPos, std::deque< yarp::sig::Vector > &trajOrien, const unsigned int maxIterations=D4C_DEFAULT_MAXITERATIONS, const double Ts=D4C_DEFAULT_TS_DISABLED)=0
 Retrieve the complete simulated trajectory as evolved from the current state point. More...
 
virtual bool executeTrajectory (const std::deque< yarp::sig::Vector > &trajPos, const std::deque< yarp::sig::Vector > &trajOrien, const double trajTime)=0
 Execute the simulated trajectory provided by the user. More...
 
virtual ~D4C ()
 Destructor.
 

Detailed Description

The Definition of the D4C Interface.

Definition at line 54 of file d4c.h.

Member Function Documentation

virtual bool iCub::d4c::D4C::addItem ( const yarp::os::Property &  options,
int &  item 
)
pure virtual

Request for the creation of a new d4c entity which can be either a target or an obstacle.

Parameters
optionscontains the set of options in form of a Property object.
itemhere is returned the unique item identifier to be used for later access.

Options common to all items:

name <string>: example (name item_name), specifies the item name.

type <string>: example (type tag), specifies the item type on whose basis the configuration is properly carried out.

active <string>: example (active on), specifies whether the item should be taken into account for generating the field ("on") or not ("off").

center <(double(x) double(y) double(z))>: example (center (-0.3 0.0 0.1)), specifies the xyz position of the item wrt the robot's root reference frame.

orientation <(double(ax) double(ay) double(az) double(theta))>: example (orientation (1.0 0.0 0.0 3.14)), specifies the orientation of the item's frame in axis/angle representation given wrt the robot's root reference frame.

color <(double(r) double(g) double(b))>: example (color (255.0 0.0 0.0)), specifies the color of the ellipsoid in RGB format.

radius <(double(rx) double(ry) double(rz))>: example (radius (0.01 0.02 0.03)), specifies the dimension of the ellipsoid radii (in [m]) representing the item wrt item's reference frame.

The type "target_msd" implements a target acting as a mass-spring-damper system on the end-effector within the d4c framework.

Options specific to the "target_msd" item:

K <double>: example (K 0.1), specifies the spring stiffness.

D <double>: example (D 0.1), specifies the damping factor.

The type "obstacle_gaussian" implements an obstacle acting as a multivariate gaussian repulsive field within the d4c framework.

Options specific to the "obstacle_gaussian" item:

G <double>: example (G 0.1), specifies the gain of the gaussian field.

cut_tails <string>: example (cut_tails on), specifies whether to cut or not the tails of the gaussian field out of the space occupied by the obstacle.

Returns
true/false if successful/failed.
virtual bool iCub::d4c::D4C::attachToolFrame ( const yarp::sig::Vector &  x,
const yarp::sig::Vector &  o 
)
pure virtual

Attach a tool frame to the end-effector.

Parameters
xa 3-d vector describing the position of the tool wrt the end-effector (meters).
oa 4-d vector describing the orientation of the tool wrt the end-effector (axis-angle notation).
Returns
true/false if successful/failed.
virtual bool iCub::d4c::D4C::clearItems ( )
pure virtual

Purge all the items contained in the table.

Returns
true/false if successful/failed.
virtual void iCub::d4c::D4C::close ( )
pure virtual

Stop the client/server and dispose it.

Called by destructor.

virtual bool iCub::d4c::D4C::disableControl ( )
pure virtual

Disable the control of the robot part.

Returns
true/false if successful/failed.
virtual bool iCub::d4c::D4C::disableField ( )
pure virtual

Disable the generation of the d4c field.

Returns
true/false if successful/failed.
virtual bool iCub::d4c::D4C::disableSimulation ( )
pure virtual

Disable the simulation of the robot part.

Returns
true/false if successful/failed.
virtual bool iCub::d4c::D4C::enableControl ( )
pure virtual

Enable the control of the robot part.

Returns
true/false if successful/failed.
Note
if simulation is on, it gets automatically disabled.
virtual bool iCub::d4c::D4C::enableField ( )
pure virtual

Enable the generation of the d4c field.

Returns
true/false if successful/failed.
virtual bool iCub::d4c::D4C::enableSimulation ( )
pure virtual

Enable the simulation of the robot part.

Returns
true/false if successful/failed.
Note
if control is on, it gets automatically disabled.
virtual bool iCub::d4c::D4C::eraseItem ( const int  item)
pure virtual

Remove one item from the items table.

Parameters
itemthe item identifier to be erased.
Returns
true/false if successful/failed.
virtual bool iCub::d4c::D4C::executeTrajectory ( const std::deque< yarp::sig::Vector > &  trajPos,
const std::deque< yarp::sig::Vector > &  trajOrien,
const double  trajTime 
)
pure virtual

Execute the simulated trajectory provided by the user.

Parameters
trajPosa list containing the whole trajectory of points (position).
trajOriena list containing the whole trajectory of points (orientation).
trajTimethe trajectory duration [s].
Returns
true/false if successful/failed.
virtual bool iCub::d4c::D4C::getActiveIF ( std::string &  activeIF)
pure virtual

Retrieve the interface currently active that controls the limb.

Parameters
activeIFa string containing "right" or "left" depending on the active interface.
Returns
true/false if successful/failed.
virtual bool iCub::d4c::D4C::getControlStatus ( bool &  status)
pure virtual

Retrieve the current status of the robot part control.

Parameters
statustrue/false on controlled/uncontrolled robot part.
Returns
true/false if successful/failed.
virtual bool iCub::d4c::D4C::getField ( yarp::sig::Vector &  field)
pure virtual

Retrieve the current field as generated by the d4c framework.

Parameters
fielda 7-d Vector containing the current field.
Returns
true/false if successful/failed.
virtual bool iCub::d4c::D4C::getFieldStatus ( bool &  status)
pure virtual

Retrieve the current status of the d4c field.

Parameters
statustrue/false on enabled/disabled d4c field.
Returns
true/false if successful/failed.
virtual bool iCub::d4c::D4C::getItems ( yarp::os::Bottle &  items)
pure virtual

Retrieve the list of all available items.

Parameters
itemsthe Bottle containing the retrieved list.
Returns
true/false if successful/failed.
virtual bool iCub::d4c::D4C::getPeriod ( int &  period)
pure virtual

Retrieve the current thread period for d4c field generation.

Parameters
periodthe current thread period in [ms].
Returns
true/false if successful/failed.
virtual bool iCub::d4c::D4C::getPointState ( yarp::sig::Vector &  x,
yarp::sig::Vector &  o,
yarp::sig::Vector &  xdot,
yarp::sig::Vector &  odot 
)
pure virtual

Retrieve the current trajectory state generated by the d4c framework.

Parameters
xa 3-d Vector containing the current position [m].
oa 4-d Vector containing the current orientation (axis/angle).
xdota 3-d Vector containing the current translational velocity [m/s].
odota 4-d Vector containing the current rotational velocity (axis/angle).
Returns
true/false if successful/failed.
virtual bool iCub::d4c::D4C::getProperty ( const int  item,
yarp::os::Property &  options 
)
pure virtual

Retrieve the properties of an existing item.

Parameters
itemthe item identifier.
optionsthe Property object containing the item properties.
Returns
true/false if successful/failed.
virtual bool iCub::d4c::D4C::getSimulation ( yarp::sig::Vector &  xhat,
yarp::sig::Vector &  ohat,
yarp::sig::Vector &  qhat 
)
pure virtual

Sample step by step the trajectory the end-effector will follow as constrained by the d4c field.

Parameters
xhata 3-d Vector containing the simulated position [m].
ohata 4-d Vector containing the simulated orientation (axis/angle).
qhata Vector containing the corresponding part joints [degrees].
Returns
true/false if successful/failed.
virtual bool iCub::d4c::D4C::getSimulationStatus ( bool &  status)
pure virtual

Retrieve the current status of the robot part simulation.

Parameters
statustrue/false.
Returns
true/false if successful/failed.
virtual bool iCub::d4c::D4C::getTool ( yarp::sig::Vector &  x,
yarp::sig::Vector &  o 
)
pure virtual

Retrieve the coordinates of the tool currently attached to the end-effector.

Parameters
xa 3-d vector containing the position of the tool (meters).
oa 4-d vector containing the orientation of the tool (axis-angle notation).
Returns
true/false if successful/failed.
Note
if no tool is attached, clearly the end-effector pose is returned.
virtual bool iCub::d4c::D4C::getToolFrame ( yarp::sig::Vector &  x,
yarp::sig::Vector &  o 
)
pure virtual

Retrieve the frame of the tool currently attached to the end-effector.

Parameters
xa 3-d vector containing the position of the tool wrt the end-effector (meters).
oa 4-d vector containing the orientation of the tool wrt the end-effector (axis-angle notation).
Returns
true/false if successful/failed.
virtual bool iCub::d4c::D4C::getTrajectory ( std::deque< yarp::sig::Vector > &  trajPos,
std::deque< yarp::sig::Vector > &  trajOrien,
const unsigned int  maxIterations = D4C_DEFAULT_MAXITERATIONS,
const double  Ts = D4C_DEFAULT_TS_DISABLED 
)
pure virtual

Retrieve the complete simulated trajectory as evolved from the current state point.

Parameters
trajPosa list containing the whole trajectory of points (position).
trajOriena list containing the whole trajectory of points (orientation).
maxIterationsmaximum number of iterations performed to reach the target.
Tsintegration period [s]. If Ts<=0.0 then the configuration option "period" is used.
Returns
true/false if successful/failed.
virtual bool iCub::d4c::D4C::open ( const yarp::os::Property &  options)
pure virtual

Configure the client or the server part of d4c framework.

Parameters
optionscontains the set of options in form of a Property object.

Available options for the client are:

remote <string>: example (remote /d4c_server), specifies the server port stem-name to connect to.

local <string>: example (local /d4c_client), specifies the the client stem-name to be used for opening ports.

carrier <string>: example (carrier udp), specifies the protocol used to connect yarp streaming ports.

verbosity <int>: example (verbosity 3), specifies the verbosity level of print-outs messages.

Available options for the server are:

device <string>: example (device cartesiancontrollerclient), specifies the name of the device that implements the cartesian interface.

name <string>: example (name d4c_server), specifies the name of the server to be launched.

robot <string>: example (robot icub), specifies the name of the robot to connect to.

part <string>: example (part right_arm), specifies the robot part to be controlled.

period <int>: example (period 20), specifies the period given in [ms] to generate the d4c field.

offline: example (offline), lets the client/server start in offline mode.

verbosity <int>: example (verbosity 3), specifies the verbosity level of print-outs messages.

Returns
true/false if successful/failed.
virtual bool iCub::d4c::D4C::removeToolFrame ( )
pure virtual

Remove the tool currently attached to the end-effector.

Returns
true/false if successful/failed.
Note
The end-effector is the tool again.
virtual bool iCub::d4c::D4C::setActiveIF ( const std::string &  activeIF)
pure virtual

Set the active interface for limb control.

Parameters
activeIFa string containing "right" or "left" depending on the interface to enable.
Returns
true/false if successful/failed.
virtual bool iCub::d4c::D4C::setPeriod ( const int  period)
pure virtual

Allow changing the thread period for d4c field generation.

Parameters
periodthe new thread period in [ms].
Returns
true/false if successful/failed.
virtual bool iCub::d4c::D4C::setPointOrientation ( const yarp::sig::Vector &  o,
const yarp::sig::Vector &  odot 
)
pure virtual

Allow changing the orientation state of the trajectory generated by the d4c framework.

Parameters
oa 4-d Vector containing the new orientation (axis/angle).
odota 4-d Vector containing the new rotational velocity (axis/angle).
Returns
true/false if successful/failed.
virtual bool iCub::d4c::D4C::setPointState ( const yarp::sig::Vector &  x,
const yarp::sig::Vector &  o,
const yarp::sig::Vector &  xdot,
const yarp::sig::Vector &  odot 
)
pure virtual

Allow chainging the trajectory state generated by the d4c framework.

Parameters
xa 3-d Vector containing the new position [m].
oa 4-d Vector containing the new orientation (axis/angle).
xdota 3-d Vector containing the new translational velocity [m/s].
odota 4-d Vector containing the new rotational velocity (axis/angle).
Returns
true/false if successful/failed.
virtual bool iCub::d4c::D4C::setPointStateToTool ( )
pure virtual

Allow setting the trajectory state equal to the currently attached tool state (or end-effector state if no tool is attached).

Returns
true/false if successful/failed.
virtual bool iCub::d4c::D4C::setProperty ( const int  item,
const yarp::os::Property &  options 
)
pure virtual

Allow changing the properties of an existing item.

Parameters
itemthe item identifier.
optionsthe Property object containing the new item values.
Returns
true/false if successful/failed.

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