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> 53 namespace bacc = boost::accumulators;
72 Odometry(
size_t velocity_rolling_window_size = 10);
148 void setWheelParams(
double wheel_separation,
double left_wheel_radius,
double right_wheel_radius);
159 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:
RollingMeanAcc linear_acc_
bool update(double left_pos, double right_pos, const ros::Time &time)
Updates the odometry class with latest wheels position.
double left_wheel_old_pos_
Previou wheel position/state [rad]:
ros::Time timestamp_
Current timestamp:
double getHeading() const
heading getter
double linear_
Current velocity:
Odometry(size_t velocity_rolling_window_size=10)
Constructor Timestamp will get the current time value Value will be set to zero.
void integrateExact(double linear, double angular)
Integrates the velocities (linear and angular) using exact method.
double getY() const
y position getter
void integrateRungeKutta2(double linear, double angular)
Integrates the velocities (linear and angular) using 2nd order Runge-Kutta.
double getAngular() const
angular velocity getter
double getX() const
x position getter
void init(const ros::Time &time)
Initialize the odometry.
RollingMeanAcc angular_acc_
void setWheelParams(double wheel_separation, double left_wheel_radius, double right_wheel_radius)
Sets the wheel parameters: radius and separation.
boost::function< void(double, double)> IntegrationFunction
Integration function, used to integrate the odometry:
The Odometry class handles odometry readings (2D pose and velocity with related timestamp) ...
double right_wheel_old_pos_
void setVelocityRollingWindowSize(size_t velocity_rolling_window_size)
Velocity rolling window size setter.
bacc::tag::rolling_window RollingWindow
size_t velocity_rolling_window_size_
Rolling mean accumulators for the linar and angular velocities:
double getLinear() const
linear velocity getter
void updateOpenLoop(double linear, double angular, const ros::Time &time)
Updates the odometry class with latest velocity command.
double right_wheel_radius_
double wheel_separation_
Wheel kinematic parameters [m]:
IntegrationFunction integrate_fun_
Integration funcion, used to integrate the odometry:
void resetAccumulators()
Reset linear and angular accumulators.
double left_wheel_radius_