iCub-main
|
Abstract class defining the core of on-line solvers. More...
#include <iKinSlv.h>
Public Member Functions | |
CartesianSolver (const std::string &_slvName) | |
Constructor. More... | |
virtual bool | open (yarp::os::Searchable &options) |
Configure the solver and start it up. More... | |
virtual void | interrupt () |
Interrupt the open() method waiting for motor parts to be ready. More... | |
virtual void | close () |
Stop the solver and dispose it. More... | |
virtual bool | isClosed () const |
To be called to check whether the solver has received a [quit] request. More... | |
virtual bool & | getTimeoutFlag () |
To be called to check whether communication timeout has been detected. More... | |
virtual void | suspend () |
Suspend the solver's main loop. More... | |
virtual void | resume () |
Resume the solver's main loop. More... | |
virtual | ~CartesianSolver () |
Default destructor. More... | |
Protected Member Functions | |
virtual PartDescriptor * | getPartDesc (yarp::os::Searchable &options)=0 |
virtual yarp::sig::Vector | solve (yarp::sig::Vector &xd) |
virtual yarp::sig::Vector & | encodeDOF () |
virtual bool | decodeDOF (const yarp::sig::Vector &_dof) |
virtual bool | handleJointsRestPosition (const yarp::os::Bottle *options, yarp::os::Bottle *reply=NULL) |
virtual bool | handleJointsRestWeights (const yarp::os::Bottle *options, yarp::os::Bottle *reply=NULL) |
yarp::dev::PolyDriver * | waitPart (const yarp::os::Property &partOpt) |
bool | isNewDOF (const yarp::sig::Vector &_dof) |
bool | changeDOF (const yarp::sig::Vector &_dof) |
bool | alignJointsBounds () |
bool | setLimits (int axis, double min, double max) |
void | countUncontrolledJoints () |
void | latchUncontrolledJoints (yarp::sig::Vector &joints) |
void | getFeedback (const bool wait=false) |
void | initPos () |
void | lock () |
void | unlock () |
void | waitDOFHandling () |
void | postDOFHandling () |
void | fillDOFInfo (yarp::os::Bottle &reply) |
void | send (const yarp::sig::Vector &xd, const yarp::sig::Vector &x, const yarp::sig::Vector &q, double *tok) |
void | printInfo (const std::string &typ, const yarp::sig::Vector &xd, const yarp::sig::Vector &x, const yarp::sig::Vector &q, const double t) |
virtual void | prepareJointsRestTask () |
virtual void | respond (const yarp::os::Bottle &command, yarp::os::Bottle &reply) |
virtual bool | threadInit () |
virtual void | afterStart (bool) |
virtual void | run () |
virtual void | threadRelease () |
Protected Attributes | |
PartDescriptor * | prt |
std::deque< yarp::dev::PolyDriver * > | drv |
std::deque< yarp::dev::IControlLimits * > | lim |
std::deque< yarp::dev::IEncoders * > | enc |
std::deque< int > | jnt |
std::deque< int * > | rmp |
iKinIpOptMin * | slv |
SolverCallback * | clb |
RpcProcessor * | cmdProcessor |
yarp::os::Port * | rpcPort |
InputPort * | inPort |
yarp::os::BufferedPort< yarp::os::Bottle > * | outPort |
std::mutex | mtx |
std::string | slvName |
std::string | type |
unsigned int | period |
unsigned int | ctrlPose |
bool | fullDOF |
bool | contModeOld |
bool | configured |
bool | closing |
bool | closed |
bool | interrupting |
bool | verbosity |
bool | timeout_detected |
int | maxPartJoints |
int | unctrlJointsNum |
double | ping_robot_tmo |
double | token |
double * | pToken |
yarp::sig::Matrix | hwLimits |
yarp::sig::Matrix | swLimits |
yarp::sig::Vector | unctrlJointsOld |
yarp::sig::Vector | dof |
yarp::sig::Vector | restJntPos |
yarp::sig::Vector | restWeights |
yarp::sig::Vector | xd_2ndTask |
yarp::sig::Vector | w_2ndTask |
yarp::sig::Vector | qd_3rdTask |
yarp::sig::Vector | w_3rdTask |
yarp::sig::Vector | idx_3rdTask |
std::mutex | mtx_dofEvent |
std::condition_variable | cv_dofEvent |
Friends | |
class | RpcProcessor |
class | InputPort |
class | SolverCallback |
Additional Inherited Members | |
Static Protected Member Functions inherited from iCub::iKin::CartesianHelper | |
static void | addVectorOption (yarp::os::Bottle &b, const int vcb, const yarp::sig::Vector &v) |
static bool | getDesiredOption (const yarp::os::Bottle &reply, yarp::sig::Vector &xdhat, yarp::sig::Vector &odhat, yarp::sig::Vector &qdhat) |
static void | addTargetOption (yarp::os::Bottle &b, const yarp::sig::Vector &xd) |
Appends to a bottle all data needed to command a target. More... | |
static void | addDOFOption (yarp::os::Bottle &b, const yarp::sig::Vector &dof) |
Appends to a bottle all data needed to reconfigure chain's dof. More... | |
static void | addJointsResPosOption (yarp::os::Bottle &b, const yarp::sig::Vector &restPos) |
Appends to a bottle all data needed to modify joints rest position. More... | |
static void | addJointsRestWeightsOption (yarp::os::Bottle &b, const yarp::sig::Vector &restWeights) |
Appends to a bottle all data needed to modify joints rest weights. More... | |
static void | addPoseOption (yarp::os::Bottle &b, const unsigned int pose) |
Appends to a bottle all data needed to change the pose mode. More... | |
static void | addModeOption (yarp::os::Bottle &b, const bool tracking) |
Appends to a bottle all data needed to change the tracking mode. More... | |
static void | addTokenOption (yarp::os::Bottle &b, const double token) |
Appends to a bottle a token to be exchanged with the solver. More... | |
static yarp::os::Bottle * | getTargetOption (const yarp::os::Bottle &b) |
Retrieves commanded target data from a bottle. More... | |
static yarp::os::Bottle * | getEndEffectorPoseOption (const yarp::os::Bottle &b) |
Retrieves the end-effector pose data. More... | |
static yarp::os::Bottle * | getJointsOption (const yarp::os::Bottle &b) |
Retrieves the joints configuration data. More... | |
static bool | getTokenOption (const yarp::os::Bottle &b, double *token) |
Retrieves the token from the bottle. More... | |
static bool | computeFixationPointData (iKinChain &eyeL, iKinChain &eyeR, yarp::sig::Vector &fp) |
Retrieves current fixation point given the current kinematics configuration of the eyes. More... | |
static bool | computeFixationPointData (iKinChain &eyeL, iKinChain &eyeR, yarp::sig::Vector &fp, yarp::sig::Matrix &J) |
Retrieves current fixation point and its Jacobian wrt eyes tilt-pan-vergence dofs given the current kinematics configuration of the eyes. More... | |
CartesianSolver::CartesianSolver | ( | const std::string & | _slvName | ) |
Constructor.
_slvName | specifies the base name for all ports created as below: |
/<_slvName>/in : the input port which accepts requests in streaming mode.
/<_slvName>/rpc : the input port where to send requests and wait for replies.
/<_slvName>/out : the port which streams out the results of optimization.
Definition at line 267 of file iKinSlv.cpp.
|
virtual |
Default destructor.
Definition at line 1749 of file iKinSlv.cpp.
|
protectedvirtual |
Definition at line 1607 of file iKinSlv.cpp.
|
protected |
Definition at line 340 of file iKinSlv.cpp.
|
protected |
Definition at line 1458 of file iKinSlv.cpp.
|
virtual |
|
protected |
Definition at line 401 of file iKinSlv.cpp.
|
protectedvirtual |
Reimplemented in iCub::iKin::iCubArmCartesianSolver.
Definition at line 1175 of file iKinSlv.cpp.
|
protectedvirtual |
Definition at line 1160 of file iKinSlv.cpp.
|
protected |
Definition at line 507 of file iKinSlv.cpp.
|
protected |
Definition at line 425 of file iKinSlv.cpp.
|
protectedpure virtual |
Implemented in iCub::iKin::iCubLegCartesianSolver, and iCub::iKin::iCubArmCartesianSolver.
|
inlinevirtual |
|
protectedvirtual |
Definition at line 1195 of file iKinSlv.cpp.
|
protectedvirtual |
Definition at line 1226 of file iKinSlv.cpp.
|
protected |
Definition at line 466 of file iKinSlv.cpp.
|
virtual |
Interrupt the open() method waiting for motor parts to be ready.
Definition at line 1525 of file iKinSlv.cpp.
|
inlinevirtual |
|
protected |
Definition at line 1254 of file iKinSlv.cpp.
|
protected |
Definition at line 408 of file iKinSlv.cpp.
|
protected |
Definition at line 478 of file iKinSlv.cpp.
|
virtual |
Configure the solver and start it up.
options | contains the set of options in form of a Property object. |
Available options are:
robot <string>: example (robot icub), specifies the name of the robot to connect to.
type <string>: example (type right), specifies the type of the limb to be instantiated; it can be "left" or "right".
dof <(int int ...)>: example (dof (1 1 0 1 ...)), specifies which dof of the chain are actuated (by putting 1 in the corresponding position) and which not (with 0). The length of the provided list of 1's and 0's should match the number of chain's links. The special value 2 is used to keep the link status unchanged and proceed to the next link.
rest_pos <(double double ...)>: example (rest_pos (20.0 0.0 0.0 ...)), specifies in degrees the joints rest position used as secondary task in the minimization. The length of the provided list should match the number of chain's links. Default values are (0.0 0.0 0.0 ...).
rest_weights <(double double ...)>: example (rest_weights (1.0 0.0 0.0 1.0 ...)), specifies for each link the weights used for the secondary task minimization. The length of the provided list should match the number of the chain's links. Default values are (0.0 0.0 0.0 ...).
period <int>: example (period 30), specifies the thread period in ms.
pose <vocab>: example (pose full), specifies the end-effector pose the user wants to achieve; it can be [full] (position+orientation) or [xyz] (only position).
mode : example (mode cont), selects the solver mode between [cont] which implements a continuous tracking and [shot] which does not compensate for movements induced on unacatuated joints.
verbosity <vocab>: example (verbosity on), selects whether to report or not on the screen the result of each optimization instance; allowed values are [on] or [off].
tol <double>: example (tol 0.001), specifies the desired tolerance on the task function to be minimized.
constr_tol <double>: example (constr_tol 0.000001), specifies the desired tolerance for the constraints to comply with.
maxIter <int>: example (maxIter 200), specifies the maximum number of iterations allowed for one optimization instance.
interPoints <vocab>: example (interPoints on), selects whether to force or not the solver to output on the port all intermediate points of optimization instance; allowed values are [on] or [off].
ping_robot_tmo <double>: example (ping_robot_tmo 2.0), specifies a timeout in seconds during which robot state ports are pinged prior to connecting; a timeout equal to zero disables this option.
Reimplemented in iCub::iKin::iCubArmCartesianSolver.
Definition at line 1270 of file iKinSlv.cpp.
|
protected |
Definition at line 500 of file iKinSlv.cpp.
|
protectedvirtual |
Definition at line 1489 of file iKinSlv.cpp.
|
protected |
Definition at line 1144 of file iKinSlv.cpp.
|
protectedvirtual |
Definition at line 515 of file iKinSlv.cpp.
|
virtual |
Resume the solver's main loop.
Definition at line 1630 of file iKinSlv.cpp.
|
protectedvirtual |
Definition at line 1644 of file iKinSlv.cpp.
|
protected |
Definition at line 1126 of file iKinSlv.cpp.
|
protected |
Definition at line 375 of file iKinSlv.cpp.
|
protectedvirtual |
Definition at line 1515 of file iKinSlv.cpp.
|
virtual |
Suspend the solver's main loop.
Definition at line 1617 of file iKinSlv.cpp.
|
protectedvirtual |
Definition at line 1595 of file iKinSlv.cpp.
|
protectedvirtual |
Definition at line 1742 of file iKinSlv.cpp.
|
protected |
Definition at line 485 of file iKinSlv.cpp.
|
protected |
Definition at line 492 of file iKinSlv.cpp.
|
protected |
Definition at line 301 of file iKinSlv.cpp.
|
friend |
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |