Go to the documentation of this file.
9 #ifndef mrpt_CKinematicChain_H
10 #define mrpt_CKinematicChain_H
39 TKinematicLink(
double _theta,
double _d,
double _a,
double _alpha,
bool _is_prismatic) : theta(_theta),d(_d),a(_a),alpha(_alpha),is_prismatic(_is_prismatic) {}
68 size_t size()
const {
return m_links.size(); }
74 void addLink(
double theta,
double d,
double a,
double alpha,
bool is_prismatic);
96 template <
class VECTOR>
99 const size_t N=m_links.size();
101 for (
size_t i=0;i<N;i++) {
102 if (m_links[i].is_prismatic)
104 else v[i] = m_links[i].theta;
113 template <
class VECTOR>
117 const size_t N=m_links.size();
118 for (
size_t i=0;i<N;i++) {
119 if (m_links[i].is_prismatic)
121 else m_links[i].theta = v[i];
133 mrpt::opengl::CSetOfObjectsPtr &inout_gl_obj,
double a
Distance along the common normal (in the same direction than the new X_{i+1})
::mrpt::utils::CStream & operator>>(mrpt::utils::CStream &in, CKinematicChainPtr &pObj)
#define ASSERT_EQUAL_(__A, __B)
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 a...
double theta
Rotation from X_i to X_{i+1} (radians)
A open-loop kinematic chain model, suitable to robotic manipulators.
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 glob...
#define KINEMATICS_IMPEXP
bool is_prismatic
"false": Is revolute ("q_i" is "theta"), "true": is prismatic ("q_i" is "d")
KINEMATICS_IMPEXP mrpt::utils::CStream & operator<<(mrpt::utils::CStream &out, const TKinematicLink &o)
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 up...
TKinematicLink(double _theta, double _d, double _a, double _alpha, bool _is_prismatic)
void update3DObject(mrpt::aligned_containers< mrpt::poses::CPose3D >::vector_t *out_all_poses=NULL) const
Read getAs3DObject() for a description.
#define MRPT_DECLARE_TTYPENAME_NAMESPACE(_TYPE, __NS)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
double d
Distance along Z_i to the common normal between Z_i and Z_{i+1}.
size_t size() const
Return the number of links.
void removeLink(const size_t idx)
Removes one link from the kinematic chain (0<=idx<N)
std::vector< TKinematicLink > m_links
The links of this robot arm.
void clear()
Erases all links and leave the robot arm empty.
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
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.
const TKinematicLink & getLink(const size_t idx) const
Get a ref to a given link (read-only)
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 TKinematicLi...
The virtual base class which provides a unified interface for all persistent objects in MRPT.
double alpha
Rotation along X_{i+1} to transform Z_i into Z_{i+1}.
#define DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
This declaration must be inserted in all CSerializable classes definition, before the class declarati...
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
const mrpt::poses::CPose3D & getOriginPose() const
Returns the current pose of the first link.
mrpt::poses::CPose3D m_origin
The pose of the first link.
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.
std::vector< TYPE1, Eigen::aligned_allocator< TYPE1 > > vector_t
An individual kinematic chain element (one link) which builds up a CKinematicChain.
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,...
Page generated by Doxygen 1.8.20 for MRPT 1.4.0 SVN: at Thu Aug 27 02:40:23 UTC 2020 | | |