Go to the documentation of this file.
47 #include <boost/accumulators/accumulators.hpp>
48 #include <boost/accumulators/statistics/stats.hpp>
49 #include <boost/accumulators/statistics/rolling_mean.hpp>
50 #include <boost/function.hpp>
54 namespace bacc = boost::accumulators;
73 Odometry(
size_t velocity_rolling_window_size = 10);
88 bool update(
double rear_wheel_pos,
double front_steer_pos,
const ros::Time &time);
148 void setWheelParams(
double wheel_reparation_h,
double wheel_radius);
159 typedef bacc::accumulator_set<double, bacc::stats<bacc::tag::rolling_mean> >
RollingMeanAcc;
boost::function< void(double, double)> IntegrationFunction
Integration function, used to integrate the odometry:
double wheel_separation_h_
Wheel kinematic parameters [m]:
bacc::accumulator_set< double, bacc::stats< bacc::tag::rolling_mean > > RollingMeanAcc
Rolling mean accumulator and window:
size_t velocity_rolling_window_size_
Rolling mean accumulators for the linar and angular velocities:
ros::Time timestamp_
Current timestamp:
double getX() const
x position getter
RollingMeanAcc angular_acc_
void setWheelParams(double wheel_reparation_h, double wheel_radius)
Sets the wheel parameters: radius and separation.
double rear_wheel_old_pos_
Previous wheel position/state [rad]:
void integrateExact(double linear, double angular)
Integrates the velocities (linear and angular) using exact method.
bacc::tag::rolling_window RollingWindow
double getLinear() const
linear velocity getter
void integrateRungeKutta2(double linear, double angular)
Integrates the velocities (linear and angular) using 2nd order Runge-Kutta.
double getY() const
y position getter
void resetAccumulators()
Reset linear and angular accumulators.
double getHeading() const
heading getter
RollingMeanAcc linear_acc_
void updateOpenLoop(double linear, double angular, const ros::Time &time)
Updates the odometry class with latest velocity command.
Odometry(size_t velocity_rolling_window_size=10)
Constructor Timestamp will get the current time value Value will be set to zero.
bool update(double rear_wheel_pos, double front_steer_pos, const ros::Time &time)
Updates the odometry class with latest wheels position.
double getAngular() const
angular velocity getter
void setVelocityRollingWindowSize(size_t velocity_rolling_window_size)
Velocity rolling window size setter.
void init(const ros::Time &time)
Initialize the odometry.
IntegrationFunction integrate_fun_
Integration funcion, used to integrate the odometry:
double linear_
Current velocity: