Skip to content

Commit

Permalink
fix(simple_planning_simulator): fix ideal steer acc calc (autowarefou…
Browse files Browse the repository at this point in the history
…ndation#2595)

Signed-off-by: taikitanaka3 <ttatcoder@outlook.jp>

Signed-off-by: taikitanaka3 <ttatcoder@outlook.jp>
  • Loading branch information
taikitanaka3 authored Dec 28, 2022
1 parent 3cd453b commit 8704ce9
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ void SimModelIdealSteerAccGeared::updateStateWithGear(
state(IDX::X) = prev_state(IDX::X);
state(IDX::Y) = prev_state(IDX::Y);
state(IDX::YAW) = prev_state(IDX::YAW);
current_acc_ = (state(IDX::VX) - prev_state(IDX::VX)) / std::max(dt, 1.0e-5);
};

using autoware_auto_vehicle_msgs::msg::GearCommand;
Expand All @@ -94,4 +93,6 @@ void SimModelIdealSteerAccGeared::updateStateWithGear(
} else {
setStopState();
}
// calculate acc from velocity diff
current_acc_ = (state(IDX::VX) - prev_state(IDX::VX)) / std::max(dt, 1.0e-5);
}

0 comments on commit 8704ce9

Please sign in to comment.