diff --git a/diff_drive_controller/src/odometry.cpp b/diff_drive_controller/src/odometry.cpp index d1fcc3fc65..77b3cff6fa 100644 --- a/diff_drive_controller/src/odometry.cpp +++ b/diff_drive_controller/src/odometry.cpp @@ -68,7 +68,11 @@ bool Odometry::update(double left_pos, double right_pos, const rclcpp::Time & ti left_wheel_old_pos_ = left_wheel_cur_pos; right_wheel_old_pos_ = right_wheel_cur_pos; +// Disable deprecated warnings +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" updateFromVelocity(left_wheel_est_vel, right_wheel_est_vel, time); +#pragma GCC diagnostic pop return true; } @@ -105,7 +109,11 @@ bool Odometry::updateFromVelocity(double left_vel, double right_vel, const rclcp const double angular = (right_vel - left_vel) / wheel_separation_; // Integrate odometry: +// Disable deprecated warnings +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" integrateExact(linear, angular); +#pragma GCC diagnostic pop timestamp_ = time; @@ -152,7 +160,11 @@ void Odometry::updateOpenLoop(double linear, double angular, const rclcpp::Time /// Integrate odometry: const double dt = time.seconds() - timestamp_.seconds(); timestamp_ = time; +// Disable deprecated warnings +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" integrateExact(linear * dt, angular * dt); +#pragma GCC diagnostic pop } bool Odometry::try_update_open_loop(double linear_vel, double angular_vel, double dt) @@ -203,7 +215,11 @@ void Odometry::integrateExact(double linear, double angular) { if (fabs(angular) < 1e-6) { +// Disable deprecated warnings +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" integrateRungeKutta2(linear, angular); +#pragma GCC diagnostic pop } else {