[mrpt-kinematics]
Overview
Kinematics of robot arms and mobile robots.
Library mrpt-kinematics
This library is part of MRPT and can be installed in Debian-based systems with:
sudo apt install libmrpt-kinematics-dev
Read also how to import MRPT into your CMake scripts.
Classes for defining and managing the kinematics of robotic arms.
See mrpt::kinematics
Overview
This module covers two different topics:
Robotic arms : open-loop kinematic chains described with Denavit-Hartenberg parameters, with forward kinematics and a 3D representation for visualization.
Planar mobile robots : velocity commands for differential-drive and holonomic robots, and simple kinematic simulators of both, used for example by the reactive navigators in [mrpt-nav].
Key classes
mrpt::kinematics::CKinematicChain : a chain of revolute or prismatic links;
recomputeAllPoses()computes the pose of every link, andgetAs3DObject()builds an mrpt::viz representation.mrpt::kinematics::TKinematicLink : one link, with its Denavit-Hartenberg parameters
[theta, d, a, alpha].mrpt::kinematics::CVehicleVelCmd_DiffDriven, mrpt::kinematics::CVehicleVelCmd_Holo : velocity commands for each kind of mobile base.
mrpt::kinematics::CVehicleSimul_DiffDriven, mrpt::kinematics::CVehicleSimul_Holo : simulators that integrate velocity commands over time, with optional odometry errors.
Example: forward kinematics of an arm
#include <mrpt/core/bits_math.h> #include <mrpt/kinematics/CKinematicChain.h> mrpt::kinematics::CKinematicChain arm; // Denavit-Hartenberg parameters: theta, d, a, alpha, is_prismatic arm.addLink(0.0, 0.3, 0.0, mrpt::DEG2RAD(90.0), false); arm.addLink(0.0, 0.0, 0.5, 0.0, false); arm.addLink(0.0, 0.0, 0.4, 0.0, false); // Joint values (radians for revolute joints, meters for prismatic ones): arm.setConfiguration(std::vector<double>{0.1, -0.4, 0.8}); // poses[0] is the base, poses.back() the end effector. std::vector<mrpt::poses::CPose3D> poses; arm.recomputeAllPoses(poses);
Examples
The GUI application robotic-arm-kinematics lets you edit a kinematic chain interactively.
Python: mrpt_kinematics_example.py.
Library contents
// structs struct mrpt::kinematics::TKinematicLink; // classes class mrpt::kinematics::CKinematicChain; class mrpt::kinematics::CVehicleSimulVirtualBase; class mrpt::kinematics::CVehicleSimul_DiffDriven; class mrpt::kinematics::CVehicleSimul_Holo; class mrpt::kinematics::CVehicleVelCmd; class mrpt::kinematics::CVehicleVelCmd_DiffDriven; class mrpt::kinematics::CVehicleVelCmd_Holo; // global functions void mrpt::kinematics::registerAllClasses_mrpt_kinematics();
Global Functions
void mrpt::kinematics::registerAllClasses_mrpt_kinematics()
Forces manual RTTI registration of all serializable classes in this namespace.
Should never be required to be explicitly called by users, except if building MRPT as a static library.