A robot model for robot with a differential drive (2 wheels on an axis, fixed orientation).
More...
|
template<typename Reflector > |
void | reflectDegrees (Reflector &r, const char *name, float &member, const char *comment) |
|
void | reflectDegrees (PropertySerializer &r, const char *name, float &member, const char *comment) |
|
void | reflect (XMLDeserializer &r) |
|
float | getMaxTransVelocity () const |
|
virtual PoseVelocityTrajectory | generateTrajectory (Velocity2 v, const Velocity2 &targetV, float lookAheadTime, int samples) |
| Generates a trajectory by accelerating/decelerating starting at velocity v for lookAheadTime time up to the velocity targetV. More...
|
|
Pose2 | globalKinematics (const Velocity2 &v, float dt, const Pose2 &p0) const |
| Computes the movement of the robot if it moves with the specified velocity v for the specified time dt. More...
|
|
void | clear () |
|
std::string | getRootLink () const |
|
CollisionGeometries | getCollisionGeometries (std::string targetFrame="", const Time ×tamp=Time::now(), const std::string &filter="") const |
|
std::list< Box3f > | getCollisionBoundingBoxes (std::string targetFrame="", const Time ×tamp=Time::now(), const std::string &filter="") const |
|
Footprint | getFootprint (std::string targetFrame="", const Time ×tamp=Time::now(), const std::string &filter="") const |
|
void | resolveAndPublishLinks (const std::string &ns, const Time ×tamp=Time::now()) |
|
void | publishJoint (const std::string &name, float value, const Time ×tamp=Time::now()) const |
|
Class const & | getClass () const |
|
MotionParameters | calculateMotionParameters (const Pose2 &p0, const Pose2 &p1) const |
| Calculate the motion model parameters. More...
|
|
Pose2 | sampleMotion (const Pose2 &startPose, const MotionParameters ¶meters) const |
| Samples motion using parameters for odometric drift and the odometry motion model from Thrun, Burgard, Fox in Probabilistic Robotics. More...
|
|
PoseCov2 | gaussianMotion (const PoseCov2 &startPose, const MotionParameters ¶meters) const |
| Applies a gaussian motion model to the initial pose at startPose. More...
|
|
|
| DifferentialRobotModel () |
|
template<typename Reflector > |
void | reflect (Reflector &r) |
|
|
virtual Pose2 | localKinematics (const Velocity2 &v, float dt) const |
| Computes the local movement of the robot if it moves with the specified velocity v for the specified time dt. More...
|
|
virtual float | predictStandstillDistance (const Velocity2 &v) const |
| Calculate the distance that is needed for braking to stand still, if the robot moves with the specified velocity v. More...
|
|
virtual float | predictStandstillRotation (const Velocity2 &v) const |
| Calculate the rotation that is needed for braking to stand still, if the robot moves with the specified velocity v. More...
|
|
|
SignedAnglef | angleFromTotalDistance (float totalLeft, float totalRight) const |
| Calculates the view direction of the robot from given traveled distance of left and right wheel and the wheel distance of the model. More...
|
|
Velocity2 | convert2Velocity (float vLeft, float vRight) const |
| Convert wheel speeds of left and right wheel to velocity (trans, rot) More...
|
|
std::pair< float, float > | convert2LRWheelSpeed (const Velocity2 &v) const |
| Converts velocity into left and right wheel speeds. More...
|
|
float | getMaxVelocity () const |
| Returns the absolute max. More...
|
|
|
virtual Pose2 | sampleMotion (const Pose2 &startPose, const Pose2 &p0, const Pose2 &p1) const |
|
virtual void | sampleMotion (const std::vector< Pose2 > &startPoses, const Pose2 &p0, const Pose2 &p1, std::vector< Pose2 > &sampledPoses) const |
| Like the above sampleMotion but samples multiple poses at once. More...
|
|
A robot model for robot with a differential drive (2 wheels on an axis, fixed orientation).
For generic robots with more wheels or non fixed castor wheels please use the GenericRobotModel.
- Note
- This class only uses the x-component of Velocity2. The y-component is totally ignored.
Calculate the motion model parameters.
This method computes the motion parameters for odometric drift based on the odometry motion model from Thrun, Burgard, Fox in "Probabilistic
Robotics", 2005.
- See also
- http://www.mrpt.org/Probabilistic_Motion_Models#References
Y / _
^ /\ rot2_ -
| / |_ -
| /_ -
| _ -P1
| _ -
| trans _ - \
| _ - | rot1
| _ - |
P0............... /...........................> X
x,y,phi denote the last estimated pose P0 at t-1 and x',y',phi' the new estimated pose P1 at t. Compute the relative motion parameters:
trans = sqrt((x-x')^2+(y-y')^2) rot1 = atan2(y'-y, x'-x) - phi rot2 = phi' - phi - d_rot1
If (x,y) and (x',y') are very nearby (< 0.005m), rot1 is set to zero.
transStddev = alphaTransTrans * trans + alphaTransRot * (rot1 + rot2) rot1Stddev = alphaRotRot * rot1 + alphaRotTrans * trans rot2Stddev = alphaRotRot * rot2 + alphaRotTrans * trans
- Parameters
-
[in] | p0 | The last observed pose |
[in] | p1 | The current observed pose |
- Returns
- The computed motion parameters.
Samples motion using parameters for odometric drift and the odometry motion model from Thrun, Burgard, Fox in Probabilistic Robotics.
This method takes motion model parameters that can be calculate by the method calculateMotionParameters(). A new pose is sampled based on the starting pose startPose.
Calculation of a motion sample:
trans^ = trans - N(0, transStddev * transStddev) rot1^ = rot1 - N(0, rot1Stddev * rot1Stddev) rot2^ = rot2 - N(0, rot2Stddev * rot2Stddev)
x = trans^ * cos(startPhi + rot1^) y = trans^ * sin(startPhi + rot1^) phi = rot1^ + rot2^
The sampled motion can be used to adapt a pose of a particle:
x' = startX + x y' = startY + y phi' = startPhi + phi
If parameters are known and many motion samples need to be computed (e.g for a particle filter) this method can be used to save some performance.
- Parameters
-
[in] | startPose | The starting position for applying the sampled motion |
[in] | parameters | The motion model parameters (can be obtained via calculateMotionParameters()) |
- Returns
- Starting position updated by the sampled motion