43 #ifndef ODOMETRY_ACKERMANN_STEERING_H_ 44 #define ODOMETRY_ACKERMANN_STEERING_H_ 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;
RollingMeanAcc angular_acc_
void init(const ros::Time &time)
Initialize the odometry.
bacc::tag::rolling_window RollingWindow
Odometry(size_t velocity_rolling_window_size=10)
Constructor Timestamp will get the current time value Value will be set to zero.
size_t velocity_rolling_window_size_
Rolling mean accumulators for the linar and angular velocities:
double rear_wheel_old_pos_
Previous wheel position/state [rad]:
The Odometry class handles odometry readings (2D pose and velocity with related timestamp) ...
boost::function< void(double, double)> IntegrationFunction
Integration function, used to integrate the odometry:
bacc::accumulator_set< double, bacc::stats< bacc::tag::rolling_mean > > RollingMeanAcc
Rolling mean accumulator and window:
void integrateRungeKutta2(double linear, double angular)
Integrates the velocities (linear and angular) using 2nd order Runge-Kutta.
double getAngular() const
angular velocity getter
void resetAccumulators()
Reset linear and angular accumulators.
void setWheelParams(double wheel_reparation_h, double wheel_radius)
Sets the wheel parameters: radius and separation.
double linear_
Current velocity:
double getHeading() const
heading getter
void integrateExact(double linear, double angular)
Integrates the velocities (linear and angular) using exact method.
double getLinear() const
linear velocity getter
RollingMeanAcc linear_acc_
void updateOpenLoop(double linear, double angular, const ros::Time &time)
Updates the odometry class with latest velocity command.
double getX() const
x position getter
ros::Time timestamp_
Current timestamp:
double wheel_separation_h_
Wheel kinematic parameters [m]:
double getY() const
y position getter
void setVelocityRollingWindowSize(size_t velocity_rolling_window_size)
Velocity rolling window size setter.
bool update(double rear_wheel_pos, double front_steer_pos, const ros::Time &time)
Updates the odometry class with latest wheels position.
IntegrationFunction integrate_fun_
Integration funcion, used to integrate the odometry: