46 #include <boost/accumulators/accumulators.hpp> 47 #include <boost/accumulators/statistics/stats.hpp> 48 #include <boost/accumulators/statistics/rolling_mean.hpp> 49 #include <boost/function.hpp> 54 namespace bacc = boost::accumulators;
73 Odometry(
size_t velocity_rolling_window_size = 10);
88 bool update(
double drive_motor_vel,
double steer_motor_vel,
const ros::Time &time);
155 void setGearRatios(
double drive_motor_gear_ratio,
double steer_motor_gear_ratio);
160 typedef bacc::accumulator_set<double, bacc::stats<bacc::tag::rolling_mean> >
RollingMeanAcc;
bacc::accumulator_set< double, bacc::stats< bacc::tag::rolling_mean > > RollingMeanAcc
Rolling mean accumulator and window:
IntegrationFunction integrate_fun_
Integration funcion, used to integrate the odometry:
double getX() const
x position getter
void integrateExact(double linear, double angular)
Integrates the velocities (linear and angular) using exact method.
void setGearRatios(double drive_motor_gear_ratio, double steer_motor_gear_ratio)
Sets the gear ratio parameters: gear ratio.
double linear_
Current velocity:
double getAngular() const
angular velocity getter
The Odometry class handles odometry readings (2D pose and velocity with related timestamp) ...
double getHeading() const
heading getter
Odometry(size_t velocity_rolling_window_size=10)
Constructor Timestamp will get the current time value Value will be set to zero.
double getY() const
y position getter
double getLinear() const
linear velocity getter
double drive_motor_gear_ratio_
void updateOpenLoop(double linear, double angular, const ros::Time &time)
Updates the odometry class with latest velocity command.
double steer_motor_gear_ratio_
ros::Time timestamp_
Current timestamp:
bacc::tag::rolling_window RollingWindow
RollingMeanAcc linear_acc_
void init(const ros::Time &time)
Initialize the odometry.
boost::function< void(double, double)> IntegrationFunction
Integration function, used to integrate the odometry:
void setWheelsParams(double wheel_radius, double wheel_separation)
Sets the wheels parameters: radius and seperation.
bool update(double drive_motor_vel, double steer_motor_vel, const ros::Time &time)
Updates the odometry class with latest wheels position.
size_t velocity_rolling_window_size_
Rolling mean accumulators for the linar and angular velocities:
RollingMeanAcc angular_acc_
double wheel_radius_
Wheels kinematic parameters [m]: