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) {}
60 mutable
std::vector<
mrpt::opengl::CRenderizablePtr> m_last_gl_objects;
63 mrpt::poses::CPose3D m_origin;
68 size_t size()
const {
return m_links.size(); }
74 void addLink(
double theta,
double d,
double a,
double alpha,
bool is_prismatic);
77 void removeLink(
const size_t idx);
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,
#define ASSERT_EQUAL_(__A, __B)
#define MRPT_DECLARE_TTYPENAME_NAMESPACE(_TYPE, __NS)
The virtual base class which provides a unified interface for all persistent objects in MRPT...
TKinematicLink(double _theta, double _d, double _a, double _alpha, bool _is_prismatic)
double d
Distance along Z_i to the common normal between Z_i and Z_{i+1}.
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
#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...
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...
bool is_prismatic
"false": Is revolute ("q_i" is "theta"), "true": is prismatic ("q_i" is "d")
::mrpt::utils::CStream & operator>>(mrpt::utils::CStream &in, CKinematicChainPtr &pObj)
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...
#define KINEMATICS_IMPEXP
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
double alpha
Rotation along X_{i+1} to transform Z_i into Z_{i+1}.
KINEMATICS_IMPEXP mrpt::utils::CStream & operator<<(mrpt::utils::CStream &out, const TKinematicLink &o)
size_t size(const MATRIXLIKE &m, int dim)
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
double theta
Rotation from X_i to X_{i+1} (radians)
double a
Distance along the common normal (in the same direction than the new X_{i+1})
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
A open-loop kinematic chain model, suitable to robotic manipulators.
std::vector< TYPE1, Eigen::aligned_allocator< TYPE1 > > vector_t
An individual kinematic chain element (one link) which builds up a CKinematicChain.