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