46 #include <boost/bind.hpp> 51 namespace bacc = boost::accumulators;
64 , velocity_rolling_window_size_(velocity_rolling_window_size)
65 , linearX_acc_(
RollingWindow::window_size = velocity_rolling_window_size)
66 , linearY_acc_(
RollingWindow::window_size = velocity_rolling_window_size)
67 , angular_acc_(
RollingWindow::window_size = velocity_rolling_window_size)
68 , integrate_fun_(
boost::bind(&
Odometry::integrateExact, this, _1, _2, _3))
118 const double dt = (time -
timestamp_).toSec();
143 x_ += vel_inOdom.
x();
144 y_ += vel_inOdom.
y();
void setWheelsParams(double wheels_k, double wheels_radius)
Sets the wheels parameters: mecanum geometric param and radius.
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 linearX_
Current velocity:
TFSIMD_FORCE_INLINE const tfScalar & x() const
RollingMeanAcc linearX_acc_
static Quaternion createQuaternionFromYaw(double yaw)
Odometry(size_t velocity_rolling_window_size=10)
Constructor Timestamp will get the current time value Value will be set to zero.
TFSIMD_FORCE_INLINE const tfScalar & y() const
void updateOpenLoop(double linearX, double linearY, double angular, const ros::Time &time)
Updates the odometry class with latest velocity command.
void init(const ros::Time &time)
Initialize the odometry.
bacc::tag::rolling_window RollingWindow
double wheels_k_
Wheels kinematic parameters [m]:
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: