The Odometry class handles odometry readings (2D pose and velocity with related timestamp)
More...
#include <odometry.h>
|
double | getAngular () const |
| angular velocity getter More...
|
|
double | getHeading () const |
| heading getter More...
|
|
double | getLinear () const |
| linear velocity getter More...
|
|
double | getX () const |
| x position getter More...
|
|
double | getY () const |
| y position getter More...
|
|
void | init (const ros::Time &time) |
| Initialize the odometry. More...
|
|
| Odometry (size_t velocity_rolling_window_size=10) |
| Constructor Timestamp will get the current time value Value will be set to zero. More...
|
|
void | setGearRatios (double drive_motor_gear_ratio, double steer_motor_gear_ratio) |
| Sets the gear ratio parameters: gear ratio. More...
|
|
void | setWheelsParams (double wheel_radius, double wheel_separation) |
| Sets the wheels parameters: radius and seperation. More...
|
|
bool | update (double drive_motor_vel, double steer_motor_vel, const ros::Time &time) |
| Updates the odometry class with latest wheels position. More...
|
|
void | updateOpenLoop (double linear, double angular, const ros::Time &time) |
| Updates the odometry class with latest velocity command. More...
|
|
|
typedef bacc::accumulator_set< double, bacc::stats< bacc::tag::rolling_mean > > | RollingMeanAcc |
| Rolling mean accumulator and window: More...
|
|
typedef bacc::tag::rolling_window | RollingWindow |
|
|
void | integrateExact (double linear, double angular) |
| Integrates the velocities (linear and angular) using exact method. More...
|
|
The Odometry class handles odometry readings (2D pose and velocity with related timestamp)
Definition at line 60 of file odometry.h.
Integration function, used to integrate the odometry:
Definition at line 65 of file odometry.h.
Rolling mean accumulator and window:
Definition at line 160 of file odometry.h.
double_diff_drive_controller::Odometry::Odometry |
( |
size_t |
velocity_rolling_window_size = 10 | ) |
|
Constructor Timestamp will get the current time value Value will be set to zero.
- Parameters
-
velocity_rolling_window_size | Rolling window size used to compute the velocity mean |
Definition at line 54 of file odometry.cpp.
double double_diff_drive_controller::Odometry::getAngular |
( |
| ) |
const |
|
inline |
angular velocity getter
- Returns
- angular velocity [rad/s]
Definition at line 138 of file odometry.h.
double double_diff_drive_controller::Odometry::getHeading |
( |
| ) |
const |
|
inline |
heading getter
- Returns
- heading [rad]
Definition at line 102 of file odometry.h.
double double_diff_drive_controller::Odometry::getLinear |
( |
| ) |
const |
|
inline |
linear velocity getter
- Returns
- linear velocity [m/s]
Definition at line 129 of file odometry.h.
double double_diff_drive_controller::Odometry::getX |
( |
| ) |
const |
|
inline |
x position getter
- Returns
- x position [m]
Definition at line 111 of file odometry.h.
double double_diff_drive_controller::Odometry::getY |
( |
| ) |
const |
|
inline |
y position getter
- Returns
- y position [m]
Definition at line 120 of file odometry.h.
void double_diff_drive_controller::Odometry::init |
( |
const ros::Time & |
time | ) |
|
Initialize the odometry.
- Parameters
-
Definition at line 71 of file odometry.cpp.
void double_diff_drive_controller::Odometry::integrateExact |
( |
double |
linear, |
|
|
double |
angular |
|
) |
| |
|
private |
Integrates the velocities (linear and angular) using exact method.
- Parameters
-
linear | Linear velocity along X m computed by encoders |
angular | Angular velocity rad 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 linear, angular 'as are' because they correspond to a body twist).
Integrate linear velocity.
Definition at line 128 of file odometry.cpp.
void double_diff_drive_controller::Odometry::setGearRatios |
( |
double |
drive_motor_gear_ratio, |
|
|
double |
steer_motor_gear_ratio |
|
) |
| |
Sets the gear ratio parameters: gear ratio.
- Parameters
-
drive_motor_gear_ratio | Drive motor gear ratio [-] |
steer_motor_gear_ratio | Steer motor gear ratio [-] |
Definition at line 121 of file odometry.cpp.
void double_diff_drive_controller::Odometry::setWheelsParams |
( |
double |
wheel_radius, |
|
|
double |
wheel_separation |
|
) |
| |
Sets the wheels parameters: radius and seperation.
- Parameters
-
wheel_radius | Wheels radius [m] |
wheel_seperation | Distance between wheels [m] |
Definition at line 114 of file odometry.cpp.
bool double_diff_drive_controller::Odometry::update |
( |
double |
drive_motor_vel, |
|
|
double |
steer_motor_vel, |
|
|
const ros::Time & |
time |
|
) |
| |
Updates the odometry class with latest wheels position.
- Parameters
-
wheel0_vel | Wheel velocity [rad] |
wheel1_vel | Wheel velocity [rad] |
time | Current time |
- Returns
- true if the odometry is actually updated
We cannot estimate the speed with very small time intervals:
Integrate odometry.
Definition at line 82 of file odometry.cpp.
void double_diff_drive_controller::Odometry::updateOpenLoop |
( |
double |
linear, |
|
|
double |
angular, |
|
|
const ros::Time & |
time |
|
) |
| |
Updates the odometry class with latest velocity command.
- Parameters
-
linear | Linear velocity [m/s] |
angular | Angular velocity [rad/s] |
time | Current time |
Save last linear and angular velocity:
Integrate odometry:
Definition at line 101 of file odometry.cpp.
double double_diff_drive_controller::Odometry::angular_ |
|
private |
double double_diff_drive_controller::Odometry::drive_motor_gear_ratio_ |
|
private |
double double_diff_drive_controller::Odometry::heading_ |
|
private |
Integration funcion, used to integrate the odometry:
Definition at line 192 of file odometry.h.
double double_diff_drive_controller::Odometry::linear_ |
|
private |
double double_diff_drive_controller::Odometry::steer_motor_gear_ratio_ |
|
private |
ros::Time double_diff_drive_controller::Odometry::timestamp_ |
|
private |
size_t double_diff_drive_controller::Odometry::velocity_rolling_window_size_ |
|
private |
Rolling mean accumulators for the linar and angular velocities:
Definition at line 187 of file odometry.h.
double double_diff_drive_controller::Odometry::wheel_radius_ |
|
private |
Wheels kinematic parameters [m]:
Definition at line 183 of file odometry.h.
double double_diff_drive_controller::Odometry::wheel_separation_ |
|
private |
double double_diff_drive_controller::Odometry::x_ |
|
private |
double double_diff_drive_controller::Odometry::y_ |
|
private |
The documentation for this class was generated from the following files: