Contains transforms (e.g. differential drive inverse kinematics) for the various types of mobile robot platforms.
Various representations and transforms relevant to mobile robot platforms.
Include the following at the top of any translation unit which requires this library:
#include <ecl/mobile_robot.hpp> // The error interfaces using ecl::Pose; using ecl::DifferentialDrive;
You will also need to link to -lecl_mobile_robot.
This is the classical definition for a mobile robot's state in a 2D world - [ x, y, heading ].
This class provides a convenient c++ container style interface as well as a few mathematical operators for calculating relative poses (differentials).
Pose pose1, pose2;
pose1 << 0,0,Math::pi/2; // comma initialisation
std::cout << pose.x() << pose.y() << pose.heading(); // readable access
std::cout << pose[0] << pose[1] << pose[1]; // vector style access
Pose pose3 = pose1 + pose2; // pose + relative pose
pose1 += pose2; // pose1 + relative pose
pose3 = pose1 - pose2; // calculates pose2 rel pose1
Currently there is only the diff drive kinematics class. This provides functions for forward and inverse kinematics on a differential drive type robot.
DifferentialDrive::Kinematics kinematics(0.1,0.5,0.05); // fixed axis length, centre offset, wheel radius Pose dpose = kinematics.forward(0.2, 0.1); // left and right wheel angle updates -> differential pose Vector2d wheel_vels = kinematics.inverse(0.1, 0.05); // linear/angular velocites -> left/right wheel angular rates Vector2d vels = Kinematics::Inverse(pose1,pose2); // orig and final pose -> linear/angular platform velocities