13 #include <boost/accumulators/accumulators.hpp> 14 #include <boost/accumulators/statistics/stats.hpp> 15 #include <boost/accumulators/statistics/rolling_mean.hpp> 16 #include <boost/function.hpp> 21 namespace bacc = boost::accumulators;
40 Odometry(
size_t velocity_rolling_window_size = 10);
54 const std::vector<ActuatedJoint>& steering_joints,
55 const std::vector<Wheel>& odometry_joints,
125 typedef bacc::accumulator_set<double, bacc::stats<bacc::tag::rolling_mean> >
RollingMeanAcc;
double getY() const
y position getter
bool update(const std::vector< ActuatedJoint > &steering_joints, const std::vector< Wheel > &odometry_joints, const ros::Time &time)
Updates the odometry class with latest wheels position.
void setWheelbase(double wheelbase)
IntegrationFunction integrate_fun_
Integration funcion, used to integrate the odometry:
ros::Time timestamp_
Current timestamp:
void setVelocityRollingWindowSize(size_t velocity_rolling_window_size)
Velocity rolling window size setter.
size_t velocity_rolling_window_size_
Rolling mean accumulators for the linar and angular velocities:
double linear_
Current velocity:
RollingMeanAcc angular_acc_
double getHeading() const
heading getter
void integrateExact(double linear, double angular)
Integrates the velocities (linear and angular) using exact method.
std::map< std::string, double > wheels_old_pos_
Previou wheel position/state [rad]:
void updateOpenLoop(double linear, double angular, const ros::Time &time)
Updates the odometry class with latest velocity command.
double getLinear() const
linear velocity getter
boost::function< void(double, double)> IntegrationFunction
Integration function, used to integrate the odometry:
Odometry(size_t velocity_rolling_window_size=10)
Constructor Timestamp will get the current time value Value will be set to zero.
double getX() const
x position getter
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.
void init(const ros::Time &time)
Initialize the odometry.
void resetAccumulators()
Reset linear and angular accumulators.
bacc::tag::rolling_window RollingWindow
The Odometry class handles odometry readings (2D pose and velocity with related timestamp) ...
double getAngular() const
angular velocity getter
RollingMeanAcc linear_acc_