35 explicit Odometry(
size_t velocity_rolling_window_size = 10);
37 void init(
const rclcpp::Time & time);
38 bool update(
double left_pos,
double right_pos,
const rclcpp::Time & time);
39 bool updateFromVelocity(
double left_vel,
double right_vel,
const rclcpp::Time & time);
40 void updateOpenLoop(
double linear,
double angular,
const rclcpp::Time & time);
43 double getX()
const {
return x_; }
44 double getY()
const {
return y_; }
45 double getHeading()
const {
return heading_; }
46 double getLinear()
const {
return linear_; }
47 double getAngular()
const {
return angular_; }
49 void setWheelParams(
double wheel_separation,
double left_wheel_radius,
double right_wheel_radius);
50 void setVelocityRollingWindowSize(
size_t velocity_rolling_window_size);
53 using RollingMeanAccumulator = rcppmath::RollingMeanAccumulator<double>;
55 void integrateRungeKutta2(
double linear,
double angular);
56 void integrateExact(
double linear,
double angular);
57 void resetAccumulators();
60 rclcpp::Time timestamp_;
72 double wheel_separation_;
73 double left_wheel_radius_;
74 double right_wheel_radius_;
77 double left_wheel_old_pos_;
78 double right_wheel_old_pos_;
81 size_t velocity_rolling_window_size_;
82 RollingMeanAccumulator linear_accumulator_;
83 RollingMeanAccumulator angular_accumulator_;