|typedef boost::function< void(double, |
| ||Integration function, used to integrate the odometry: |
Public Member Functions
|double ||getAngular () const |
| ||angular velocity getter |
|double ||getHeading () const |
| ||heading getter |
|double ||getLinearX () const |
| ||linearX velocity getter |
|double ||getLinearY () const |
| ||linearY velocity getter |
|double ||getX () const |
| ||x position getter |
|double ||getY () const |
| ||y position getter |
|void ||init (const ros::Time &time)|
| ||Initialize the odometry. |
| ||Odometry (size_t velocity_rolling_window_size=10)|
| ||Constructor Timestamp will get the current time value Value will be set to zero. |
|void ||setWheelsParams (double wheels_k, double wheels_radius)|
| ||Sets the wheels parameters: mecanum geometric param and radius. |
|bool ||update (double wheel0_vel, double wheel1_vel, double wheel2_vel, double wheel3_vel, const ros::Time &time)|
| ||Updates the odometry class with latest wheels position. |
|void ||updateOpenLoop (double linearX, double linearY, double angular, const ros::Time &time)|
| ||Updates the odometry class with latest velocity command. |
< double, bacc::stats
< bacc::tag::rolling_mean > >
| ||Rolling mean accumulator and window: |
|typedef bacc::tag::rolling_window ||RollingWindow|
Private Member Functions
|void ||integrateExact (double linearX, double linearY, double angular)|
| ||Integrates the velocities (linear and angular) using exact method. |
| ||Integration funcion, used to integrate the odometry: |
| ||Current velocity: |
| ||Current timestamp: |
| ||Rolling mean accumulators for the linar and angular velocities: |
| ||Wheels kinematic parameters [m]: |
| ||Current pose: |
The Odometry class handles odometry readings (2D pose and velocity with related timestamp)
Definition at line 60 of file odometry.h.
Integrates the velocities (linear and angular) using exact method.
|linearX||Linear velocity along X [m] (linear displacement, i.e. m/s * dt) computed by encoders |
|linearY||Linear velocity along Y [m] (linear displacement, i.e. m/s * dt) computed by encoders |
|angular||Angular velocity [rad] (angular displacement, i.e. m/s * dt) computed by encoders |
Integrate angular velocity.
The odometry pose should be published in the /odom frame (unlike the odometry twist which is a body twist). Project the twist in the odometry basis (we cannot integrate linearX, linearY, angular 'as are' because they correspond to a body twist).
Integrate linear velocity.
Definition at line 132 of file odometry.cpp.
Updates the odometry class with latest wheels position.
|wheel0_vel||Wheel velocity [rad] |
|wheel1_vel||Wheel velocity [rad] |
|wheel2_vel||Wheel velocity [rad] |
|wheel3_vel||Wheel velocity [rad] |
|time||Current time |
- true if the odometry is actually updated
We cannot estimate the speed with very small time intervals:
Compute forward kinematics (i.e. compute mobile robot's body twist out of its wheels velocities): NOTE: we use the IK of the mecanum wheels which we invert using a pseudo-inverse. NOTE: in the diff drive the velocity is filtered out, but we prefer to return it raw and let the user perform post-processing at will. We prefer this way of doing as filtering introduces delay (which makes it difficult to interpret and compare behavior curves).
Definition at line 85 of file odometry.cpp.