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> 54 namespace bacc = boost::accumulators;
73 Odometry(
size_t velocity_rolling_window_size = 10);
90 bool update(
double wheel0_vel,
double wheel1_vel,
double wheel2_vel,
double wheel3_vel,
const ros::Time &time);
164 typedef bacc::accumulator_set<double, bacc::stats<bacc::tag::rolling_mean> >
RollingMeanAcc;
173 void integrateExact(
double linearX,
double linearY,
double angular);
void setWheelsParams(double wheels_k, double wheels_radius)
Sets the wheels parameters: mecanum geometric param and radius.
double getLinearX() const
linearX velocity getter
void integrateExact(double linearX, double linearY, double angular)
Integrates the velocities (linear and angular) using exact method.
RollingMeanAcc angular_acc_
IntegrationFunction integrate_fun_
Integration funcion, used to integrate the odometry:
RollingMeanAcc linearY_acc_
size_t velocity_rolling_window_size_
Rolling mean accumulators for the linar and angular velocities:
double getY() const
y position getter
double linearX_
Current velocity:
double getLinearY() const
linearY velocity getter
RollingMeanAcc linearX_acc_
Odometry(size_t velocity_rolling_window_size=10)
Constructor Timestamp will get the current time value Value will be set to zero.
void updateOpenLoop(double linearX, double linearY, double angular, const ros::Time &time)
Updates the odometry class with latest velocity command.
double getAngular() const
angular velocity getter
double getHeading() const
heading getter
void init(const ros::Time &time)
Initialize the odometry.
bacc::tag::rolling_window RollingWindow
double wheels_k_
Wheels kinematic parameters [m]:
boost::function< void(double, double, double)> IntegrationFunction
Integration function, used to integrate the odometry:
double getX() const
x position getter
bool update(double wheel0_vel, double wheel1_vel, double wheel2_vel, double wheel3_vel, const ros::Time &time)
Updates the odometry class with latest wheels position.
ros::Time timestamp_
Current timestamp:
The Odometry class handles odometry readings (2D pose and velocity with related timestamp) ...
bacc::accumulator_set< double, bacc::stats< bacc::tag::rolling_mean > > RollingMeanAcc
Rolling mean accumulator and window: