39 #include <boost/accumulators/accumulators.hpp> 40 #include <boost/accumulators/statistics/stats.hpp> 41 #include <boost/accumulators/statistics/rolling_mean.hpp> 42 #include <boost/function.hpp> 46 namespace bacc = boost::accumulators;
65 Odometry(
size_t velocity_rolling_window_size = 10);
84 bool update(
const double& fl_speed,
const double& fr_speed,
const double& rl_speed,
const double& rr_speed,
85 double front_steering,
double rear_steering,
const ros::Time &time);
194 void setWheelParams(
double steering_track,
double wheel_steering_y_offset,
double wheel_radius,
double wheel_base);
205 typedef bacc::accumulator_set<double, bacc::stats<bacc::tag::rolling_mean> >
RollingMeanAcc;
214 void integrateXY(
double linear_x,
double linear_y,
double angular);
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:
RollingMeanAcc linear_accel_acc_
double getX() const
x position getter
double getLinearY() const
linear velocity getter along Y on the robot base link frame
RollingMeanAcc rear_steer_vel_acc_
double getLinearAcceleration() const
linear acceleration getter
double front_steer_vel_prev_
boost::function< void(double, double)> IntegrationFunction
Integration function, used to integrate the odometry:
double wheel_steering_y_offset_
double getLinear() const
linear velocity getter norm
double wheel_old_pos_
Previous wheel position/state [rad]:
Odometry(size_t velocity_rolling_window_size=10)
Constructor Timestamp will get the current time value Value will be set to zero.
The Odometry class handles odometry readings (2D pose and velocity with related timestamp) ...
double getY() const
y position getter
RollingMeanAcc front_steer_vel_acc_
ros::Time last_update_timestamp_
Current timestamp:
bool update(const double &fl_speed, const double &fr_speed, const double &rl_speed, const double &rr_speed, double front_steering, double rear_steering, const ros::Time &time)
Updates the odometry class with latest wheels and steerings position.
double linear_
Current velocity:
bacc::tag::rolling_window RollingWindow
double linear_accel_prev_
void setWheelParams(double steering_track, double wheel_steering_y_offset, double wheel_radius, double wheel_base)
Sets the wheel parameters: radius and separation.
void integrateXY(double linear_x, double linear_y, double angular)
Integrates the velocities (linear on x and y and angular)
void resetAccumulators()
Reset linear and angular accumulators.
double getLinearJerk() const
linear jerk getter
double rear_steer_vel_prev_
bacc::accumulator_set< double, bacc::stats< bacc::tag::rolling_mean > > RollingMeanAcc
Rolling mean accumulator and window:
double getFrontSteerVel() const
front steering velocity getter
void integrateRungeKutta2(double linear, double angular)
Integrates the velocities (linear and angular) using 2nd order Runge-Kutta.
double getHeading() const
heading getter
double getRearSteerVel() const
rear steering velocity getter
void init(const ros::Time &time)
Initialize the odometry.
double getAngular() const
angular velocity getter
double steering_track_
Wheel kinematic parameters [m]:
double getLinearX() const
linear velocity getter along X on the robot base link frame
RollingMeanAcc linear_jerk_acc_
void integrateExact(double linear, double angular)
Integrates the velocities (linear and angular) using exact method.