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

The KdlTreeSolver class implements ICartesianSolver.

#include <KdlTreeSolver.hpp>

Inheritance diagram for roboticslab::KdlTreeSolver:
roboticslab::ICartesianSolver

Public Member Functions

int getNumJoints () override
 Get number of joints for which the solver has been configured. More...
 
int getNumTcps () override
 Get number of TCPs for which the solver has been configured. More...
 
bool appendLink (const std::vector< double > &x) override
 Append an additional link. More...
 
bool restoreOriginalChain () override
 Restore original kinematic chain. More...
 
bool changeOrigin (const std::vector< double > &x_old_obj, const std::vector< double > &x_new_old, std::vector< double > &x_new_obj) override
 Change origin in which a pose is expressed. More...
 
bool fwdKin (const std::vector< double > &q, std::vector< double > &x) override
 Perform forward kinematics. More...
 
bool poseDiff (const std::vector< double > &xLhs, const std::vector< double > &xRhs, std::vector< double > &xOut) override
 Obtain difference between supplied pose inputs. More...
 
bool invKin (const std::vector< double > &xd, const std::vector< double > &qGuess, std::vector< double > &q, reference_frame frame) override
 Perform inverse kinematics. More...
 
bool diffInvKin (const std::vector< double > &q, const std::vector< double > &xdot, std::vector< double > &qdot, reference_frame frame) override
 Perform differential inverse kinematics. More...
 
bool invDyn (const std::vector< double > &q, std::vector< double > &t) override
 Perform inverse dynamics. More...
 
bool invDyn (const std::vector< double > &q, const std::vector< double > &qdot, const std::vector< double > &qdotdot, const std::vector< double > &ftip, std::vector< double > &t, reference_frame frame) override
 Perform inverse dynamics. More...
 
bool open (yarp::os::Searchable &config) override
 
bool close () override
 
- Public Member Functions inherited from roboticslab::ICartesianSolver
virtual ~ICartesianSolver ()=default
 Destructor.
 
virtual bool invDyn (const std::vector< double > &q, const std::vector< double > &qdot, const std::vector< double > &qdotdot, const std::vector< std::vector< double >> &fexts, std::vector< double > &t)
 Perform inverse dynamics. More...
 

Protected Attributes

std::vector< std::string > endpoints
 
std::map< std::string, std::string > mergedEndpoints
 
KDL::Tree tree
 
KDL::TreeFkSolverPos * fkSolverPos
 
KDL::TreeIkSolverPos * ikSolverPos
 
KDL::TreeIkSolverVel * ikSolverVel
 
KDL::TreeIdSolver * idSolver
 

Additional Inherited Members

- Public Types inherited from roboticslab::ICartesianSolver
enum  reference_frame { BASE_FRAME = yarp::os::createVocab32('c','p','f','b') , TCP_FRAME = yarp::os::createVocab32('c','p','f','t') }
 Lists supported reference frames. More...
 

Member Function Documentation

◆ appendLink()

bool KdlTreeSolver::appendLink ( const std::vector< double > &  x)
overridevirtual
Parameters
x6-element vector describing 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::ICartesianSolver.

◆ changeOrigin()

bool KdlTreeSolver::changeOrigin ( const std::vector< double > &  x_old_obj,
const std::vector< double > &  x_new_old,
std::vector< double > &  x_new_obj 
)
overridevirtual
Parameters
x_old_obj_in6-element vector describing a pose in cartesian space, expressed in the old frame; first three elements denote translation (meters), last three denote rotation in scaled axis-angle representation (radians).
x_new_old6-element vector describing a transformation from the new to the old frame; first three elements denote translation (meters), last three denote rotation in scaled axis-angle representation (radians).
x_new_obj6-element vector describing a pose in cartesian space, expressed in the new frame; first three elements denote translation (meters), last three denote rotation in scaled axis-angle representation (radians).
Returns
true on success, false otherwise

Implements roboticslab::ICartesianSolver.

◆ diffInvKin()

bool KdlTreeSolver::diffInvKin ( const std::vector< double > &  q,
const std::vector< double > &  xdot,
std::vector< double > &  qdot,
reference_frame  frame 
)
overridevirtual
Parameters
qVector describing current position in joint space (meters or degrees).
xdot6-element vector describing desired velocity in cartesian space; first three elements denote translational velocity (meters/second), last three denote angular velocity (radians/second).
qdotVector describing target velocity in joint space (meters/second or degrees/second).
framePoints at the reference_frame the desired position is expressed in.
Returns
true on success, false otherwise

Implements roboticslab::ICartesianSolver.

◆ fwdKin()

bool KdlTreeSolver::fwdKin ( const std::vector< double > &  q,
std::vector< double > &  x 
)
overridevirtual
Parameters
qVector describing a position in joint space (meters or degrees).
x6-element vector describing same 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::ICartesianSolver.

◆ getNumJoints()

int KdlTreeSolver::getNumJoints ( )
overridevirtual
Returns
Number of joints.

Implements roboticslab::ICartesianSolver.

◆ getNumTcps()

int KdlTreeSolver::getNumTcps ( )
overridevirtual
Returns
The number of TCPs.

Implements roboticslab::ICartesianSolver.

◆ invDyn() [1/2]

bool KdlTreeSolver::invDyn ( const std::vector< double > &  q,
const std::vector< double > &  qdot,
const std::vector< double > &  qdotdot,
const std::vector< double > &  ftip,
std::vector< double > &  t,
reference_frame  frame 
)
overridevirtual
Parameters
qVector describing current position in joint space (meters or degrees).
qdotVector describing current velocity in joint space (meters/second or degrees/second).
qdotdotVector describing current acceleration in joint space (meters/second² or degrees/second²).
ftipVector describing an external force applied to the robot tip, expressed in cartesian space; first three elements denote translational acceleration (meters/second²), last three denote angular acceleration (radians/second²).
t6-element vector describing desired forces in cartesian space; first three elements denote translational acceleration (meters/second²), last three denote angular acceleration (radians/second²).
framePoints at the reference_frame ftip is expressed in.
Returns
true on success, false otherwise

Implements roboticslab::ICartesianSolver.

◆ invDyn() [2/2]

bool KdlTreeSolver::invDyn ( const std::vector< double > &  q,
std::vector< double > &  t 
)
overridevirtual

Assumes null joint velocities and accelerations, and no external forces.

Parameters
qVector describing current position in joint space (meters or degrees).
t6-element vector describing desired forces in cartesian space; first three elements denote translational acceleration (meters/second²), last three denote angular acceleration (radians/second²).
Returns
true on success, false otherwise

Implements roboticslab::ICartesianSolver.

◆ invKin()

bool KdlTreeSolver::invKin ( const std::vector< double > &  xd,
const std::vector< double > &  qGuess,
std::vector< double > &  q,
reference_frame  frame 
)
overridevirtual
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).
qGuessVector describing current position in joint space (meters or degrees).
qVector describing target position in joint space (meters or degrees).
framePoints at the reference_frame the desired position is expressed in.
Returns
true on success, false otherwise

Implements roboticslab::ICartesianSolver.

◆ poseDiff()

bool KdlTreeSolver::poseDiff ( const std::vector< double > &  xLhs,
const std::vector< double > &  xRhs,
std::vector< double > &  xOut 
)
overridevirtual

The result is an infinitesimal displacement twist, i.e. a vector, for which the operation of addition makes physical sense.

Parameters
xLhs6-element vector describing a pose in cartesian space (left hand side); first three elements denote translation (meters), last three denote rotation in scaled axis-angle representation (radians).
xRhs6-element vector describing a pose in cartesian space (right hand side); first three elements denote translation (meters), last three denote rotation in scaled axis-angle representation (radians).
xOut6-element vector describing a pose in cartesian space (result); first three elements denote translation (meters), last three denote rotation in scaled axis-angle representation (radians).
Returns
true on success, false otherwise

Implements roboticslab::ICartesianSolver.

◆ restoreOriginalChain()

bool KdlTreeSolver::restoreOriginalChain ( )
overridevirtual
Returns
true on success, false otherwise

Implements roboticslab::ICartesianSolver.


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