A open-loop kinematic chain model, suitable to robotic manipulators.
Each link is parameterized with standard Denavit-Hartenberg standard parameterization [theta, d, a, alpha].
The orientation of the first link can be modified with setOriginPose(), which defaults to standard XYZ axes with +Z pointing upwards.
Definition at line 54 of file CKinematicChain.h.
#include <mrpt/kinematics/CKinematicChain.h>
Public Member Functions | |
size_t | size () const |
Return the number of links. | |
void | clear () |
Erases all links and leave the robot arm empty. | |
void | addLink (double theta, double d, double a, double alpha, bool is_prismatic) |
Appends a new link to the robotic arm, with the given Denavit-Hartenberg parameters (see TKinematicLink for further details) | |
void | removeLink (const size_t idx) |
Removes one link from the kinematic chain (0<=idx<N) | |
const TKinematicLink & | getLink (const size_t idx) const |
Get a ref to a given link (read-only) | |
TKinematicLink & | getLinkRef (const size_t idx) |
Get a ref to a given link (read-write) | |
void | setOriginPose (const mrpt::poses::CPose3D &new_pose) |
Can be used to define a first degree of freedom along a +Z axis which does not coincide with the global +Z axis. | |
const mrpt::poses::CPose3D & | getOriginPose () const |
Returns the current pose of the first link. | |
template<class VECTOR > | |
void | getConfiguration (VECTOR &v) const |
Get all the DOFs of the arm at once, returning them in a vector with all the "q_i" values, which can be interpreted as rotations (radians) or displacements (meters) depending on links being "revolute" or "prismatic". | |
template<class VECTOR > | |
void | setConfiguration (const VECTOR &v) |
Set all the DOFs of the arm at once, from a vector with all the "q_i" values, which are interpreted as rotations (radians) or displacements (meters) depending on links being "revolute" or "prismatic". | |
void | getAs3DObject (mrpt::opengl::CSetOfObjectsPtr &inout_gl_obj, mrpt::aligned_containers< mrpt::poses::CPose3D >::vector_t *out_all_poses=NULL) const |
Constructs a 3D representation of the kinematic chain, in its current state. | |
void | update3DObject (mrpt::aligned_containers< mrpt::poses::CPose3D >::vector_t *out_all_poses=NULL) const |
Read getAs3DObject() for a description. | |
void | recomputeAllPoses (mrpt::aligned_containers< mrpt::poses::CPose3D >::vector_t &poses, const mrpt::poses::CPose3D &pose0=mrpt::poses::CPose3D()) const |
Go thru all the links of the chain and compute the global pose of each link. | |
Protected Member Functions | |
CSerializable virtual methods | |
void | writeToStream (mrpt::utils::CStream &out, int *getVersion) const MRPT_OVERRIDE |
void | readFromStream (mrpt::utils::CStream &in, int version) MRPT_OVERRIDE |
Private Attributes | |
std::vector< mrpt::opengl::CRenderizablePtr > | m_last_gl_objects |
Smart pointers to the last objects for each link, as returned in getAs3DObject(), for usage within update3DObject() | |
std::vector< TKinematicLink > | m_links |
The links of this robot arm. | |
mrpt::poses::CPose3D | m_origin |
The pose of the first link. | |
RTTI stuff <br> | |
typedef CKinematicChainPtr | SmartPtr |
static mrpt::utils::CLASSINIT | _init_CKinematicChain |
static mrpt::utils::TRuntimeClassId | classCKinematicChain |
static const mrpt::utils::TRuntimeClassId * | classinfo |
static const mrpt::utils::TRuntimeClassId * | _GetBaseClass () |
virtual const mrpt::utils::TRuntimeClassId * | GetRuntimeClass () const MRPT_OVERRIDE |
virtual mrpt::utils::CObject * | duplicate () const MRPT_OVERRIDE |
static mrpt::utils::CObject * | CreateObject () |
static CKinematicChainPtr | Create () |
A typedef for the associated smart pointer
Definition at line 57 of file CKinematicChain.h.
|
staticprotected |
void mrpt::kinematics::CKinematicChain::addLink | ( | double | theta, |
double | d, | ||
double | a, | ||
double | alpha, | ||
bool | is_prismatic | ||
) |
Appends a new link to the robotic arm, with the given Denavit-Hartenberg parameters (see TKinematicLink for further details)
void mrpt::kinematics::CKinematicChain::clear | ( | ) |
Erases all links and leave the robot arm empty.
|
static |
|
static |
|
virtual |
void mrpt::kinematics::CKinematicChain::getAs3DObject | ( | mrpt::opengl::CSetOfObjectsPtr & | inout_gl_obj, |
mrpt::aligned_containers< mrpt::poses::CPose3D >::vector_t * | out_all_poses = NULL |
||
) | const |
Constructs a 3D representation of the kinematic chain, in its current state.
You can call update3DObject() to update the kinematic state of these OpenGL objects in the future, since an internal list of smart pointers to the constructed objects is kept internally. This is more efficient than calling this method again to build a new representation.
[out] | out_all_poses | Optional output vector, will contain the poses in the format of recomputeAllPoses() |
|
inline |
Get all the DOFs of the arm at once, returning them in a vector with all the "q_i" values, which can be interpreted as rotations (radians) or displacements (meters) depending on links being "revolute" or "prismatic".
The vector is automatically resized to the correct size (the number of links).
VECTOR | Can be any Eigen vector, mrpt::math::CVectorDouble, or std::vector<double> |
Definition at line 97 of file CKinematicChain.h.
const TKinematicLink & mrpt::kinematics::CKinematicChain::getLink | ( | const size_t | idx | ) | const |
Get a ref to a given link (read-only)
TKinematicLink & mrpt::kinematics::CKinematicChain::getLinkRef | ( | const size_t | idx | ) |
Get a ref to a given link (read-write)
const mrpt::poses::CPose3D & mrpt::kinematics::CKinematicChain::getOriginPose | ( | ) | const |
Returns the current pose of the first link.
|
virtual |
|
protected |
void mrpt::kinematics::CKinematicChain::recomputeAllPoses | ( | mrpt::aligned_containers< mrpt::poses::CPose3D >::vector_t & | poses, |
const mrpt::poses::CPose3D & | pose0 = mrpt::poses::CPose3D() |
||
) | const |
Go thru all the links of the chain and compute the global pose of each link.
The "ground" link pose "pose0" defaults to the origin of coordinates, but anything else can be passed as the optional argument. The returned vector has N+1 elements (N=number of links), since [0] contains the base frame, [1] the pose after the first link, and so on.
void mrpt::kinematics::CKinematicChain::removeLink | ( | const size_t | idx | ) |
Removes one link from the kinematic chain (0<=idx<N)
|
inline |
Set all the DOFs of the arm at once, from a vector with all the "q_i" values, which are interpreted as rotations (radians) or displacements (meters) depending on links being "revolute" or "prismatic".
std::exception | If the size of the vector doesn't match the number of links. |
VECTOR | Can be any Eigen vector, mrpt::math::CVectorDouble, or std::vector<double> |
Definition at line 114 of file CKinematicChain.h.
References ASSERT_EQUAL_.
void mrpt::kinematics::CKinematicChain::setOriginPose | ( | const mrpt::poses::CPose3D & | new_pose | ) |
Can be used to define a first degree of freedom along a +Z axis which does not coincide with the global +Z axis.
|
inline |
Return the number of links.
Definition at line 68 of file CKinematicChain.h.
void mrpt::kinematics::CKinematicChain::update3DObject | ( | mrpt::aligned_containers< mrpt::poses::CPose3D >::vector_t * | out_all_poses = NULL | ) | const |
Read getAs3DObject() for a description.
[out] | out_all_poses | Optional output vector, will contain the poses in the format of recomputeAllPoses() |
|
protected |
|
staticprotected |
Definition at line 57 of file CKinematicChain.h.
|
static |
Definition at line 57 of file CKinematicChain.h.
|
static |
Definition at line 57 of file CKinematicChain.h.
|
mutableprivate |
Smart pointers to the last objects for each link, as returned in getAs3DObject(), for usage within update3DObject()
Definition at line 60 of file CKinematicChain.h.
|
private |
The links of this robot arm.
Definition at line 62 of file CKinematicChain.h.
|
private |
The pose of the first link.
Definition at line 63 of file CKinematicChain.h.
Page generated by Doxygen 1.9.6 for MRPT 1.4.0 SVN: at Wed Mar 22 06:08:57 UTC 2023 |