Skip to content

Commit

Permalink
fix(simple_planning_simulator): set ego pitch to 0 if road slope is n…
Browse files Browse the repository at this point in the history
…ot simulated (autowarefoundation#5501) (autowarefoundation#1027)

set ego pitch to 0 if road slope is not simulated

Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>
Co-authored-by: danielsanchezaran <daniel.sanchez@tier4.jp>
  • Loading branch information
h-ohta and danielsanchezaran authored Nov 21, 2023
1 parent 0b731b4 commit 3b13216
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -321,9 +321,9 @@ void SimplePlanningSimulator::on_timer()
}

// calculate longitudinal acceleration by slope
const double ego_pitch_angle = calculate_ego_pitch();
const double acc_by_slope =
enable_road_slope_simulation_ ? -9.81 * std::sin(ego_pitch_angle) : 0.0;
constexpr double gravity_acceleration = -9.81;
const double ego_pitch_angle = enable_road_slope_simulation_ ? calculate_ego_pitch() : 0.0;
const double acc_by_slope = gravity_acceleration * std::sin(ego_pitch_angle);

// update vehicle dynamics
{
Expand Down

0 comments on commit 3b13216

Please sign in to comment.