Skip to content

Commit

Permalink
fix(speed_display): always show speed positive and depend on gear for…
Browse files Browse the repository at this point in the history
… negatives (autowarefoundation#8957)

Signed-off-by: KhalilSelyan <khalil@leodrive.ai>
  • Loading branch information
KhalilSelyan authored Sep 27, 2024
1 parent 68abc99 commit 9c7d542
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void SpeedDisplay::updateSpeedData(
// Assuming msg->state.longitudinal_velocity_mps is the field you're interested in
float speed = msg->longitudinal_velocity;
// we received it as a m/s value, but we want to display it in km/h
current_speed_ = (speed * 3.6);
current_speed_ = std::abs(speed * 3.6);
} catch (const std::exception & e) {
// Log the error
std::cerr << "Error in processMessage: " << e.what() << std::endl;
Expand Down

0 comments on commit 9c7d542

Please sign in to comment.