-
Notifications
You must be signed in to change notification settings - Fork 685
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(simple_planning_simulator): add mechanical actuaion sim model #9300
feat(simple_planning_simulator): add mechanical actuaion sim model #9300
Conversation
Thank you for contributing to the Autoware project! 🚧 If your pull request is in progress, switch it to draft mode. Please ensure:
|
f948fcd
to
8d3b85b
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9300 +/- ##
==========================================
+ Coverage 29.31% 29.45% +0.13%
==========================================
Files 1334 1338 +4
Lines 102800 103074 +274
Branches 39984 40066 +82
==========================================
+ Hits 30136 30357 +221
- Misses 69797 69848 +51
- Partials 2867 2869 +2
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
DelayBuffer delay_buffer_; | ||
PIDController pid_; | ||
SteeringDynamics steering_dynamics_; | ||
MechanicalParams params_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MechanicalParams params_; | |
const MechanicalParams params_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in update from suggestions
...ator/simple_planning_simulator/src/simple_planning_simulator/utils/mechanical_controller.cpp
Show resolved
Hide resolved
dynamics_state_new.angular_velocity = std::clamp( | ||
dynamics_state.angular_velocity + d_angular_velocity * dt, -params_.rate_limit, | ||
params_.rate_limit); | ||
dynamics_state_new.is_in_dead_zone = k4.is_in_dead_zone; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just wondering if I can use k4.is_in_dead_zone here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed it because I thought it might cause a slight discrepancy in judgment.
The input torque (delayed_signal) is obtained from the results of k1-k4, and it is determined if it is_deazone when it is input to the current dynamics_state.
const double delayed_signal =
(k1.delay_buffer.back().first + 2.0 * k2.delay_buffer.back().first +
2.0 * k3.delay_buffer.back().first + k4.delay_buffer.back().first) /
6.0;
const double elapsed_time = delay_buffer_.empty() ? dt : delay_buffer_.back().second + dt;
delay_buffer_ =
delay(delayed_signal, params_.torque_delay_time, delay_buffer_, elapsed_time).second;
dynamics_state_new.is_in_dead_zone =
steering_dynamics_.is_in_dead_zone(dynamics_state_new, delayed_signal);
double inertia_{0.0}; | ||
double damping_{0.0}; | ||
double stiffness_{0.0}; | ||
double friction_{0.0}; | ||
double dead_zone_threshold_{0.0}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
double inertia_{0.0}; | |
double damping_{0.0}; | |
double stiffness_{0.0}; | |
double friction_{0.0}; | |
double dead_zone_threshold_{0.0}; | |
const double inertia_; | |
const double damping_; | |
const double stiffness_; | |
const double friction_; | |
const double dead_zone_threshold_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in update from suggestions
Signed-off-by: kosuke55 <kosuke.tnp@gmail.com> update docs Signed-off-by: kosuke55 <kosuke.tnp@gmail.com>
cf2d17e
to
c6c9419
Compare
Signed-off-by: kosuke55 <kosuke.tnp@gmail.com>
Signed-off-by: kosuke55 <kosuke.tnp@gmail.com>
…utowarefoundation#9300) * feat(simple_planning_simulator): add mechanical actuaion sim model Signed-off-by: kosuke55 <kosuke.tnp@gmail.com> update docs Signed-off-by: kosuke55 <kosuke.tnp@gmail.com> * update from suggestions Signed-off-by: kosuke55 <kosuke.tnp@gmail.com> * calc internal state using RK4 results Signed-off-by: kosuke55 <kosuke.tnp@gmail.com> --------- Signed-off-by: kosuke55 <kosuke.tnp@gmail.com>
…utowarefoundation#9300) * feat(simple_planning_simulator): add mechanical actuaion sim model Signed-off-by: kosuke55 <kosuke.tnp@gmail.com> update docs Signed-off-by: kosuke55 <kosuke.tnp@gmail.com> * update from suggestions Signed-off-by: kosuke55 <kosuke.tnp@gmail.com> * calc internal state using RK4 results Signed-off-by: kosuke55 <kosuke.tnp@gmail.com> --------- Signed-off-by: kosuke55 <kosuke.tnp@gmail.com>
Description
add new simulator model.
The vehicle side software assumes that it has limiters, PID controllers, power steering, etc. for the input.
The conversion in the power steering is approximated by a polynomial.
Steering Dynamics is a model that represents the motion of the tire angle when the Steering Torque is input. It is represented by the following formula.
system identification result is following. I tested real driving data and compare obeserved and simulated steering angle error (focusing on low steer angle)
Results are
mecanical
>second order
>first order
in that order for train and test data.if tuning for deadzone
Related links
move from #9252.
commit can be refrect and PR can not be reopen for some reason, I recreate PR again
Parent Issue:
How was this PR tested?
Notes for reviewers
None.
Interface changes
None.
Effects on system behavior
None.