Skip to content
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 VGR sim model #8415

Merged
merged 4 commits into from
Aug 22, 2024

Conversation

kosuke55
Copy link
Contributor

@kosuke55 kosuke55 commented Aug 8, 2024

Description

As shown in #8504, add conversion from steer angle to handle angle by variable gear ratio to raw_vehicle_cmd_converter.
To simulate this, implement a model that works with handle angle. And add atuation status publishing.

image

  1. same VGR coef in converter and sim
    raw_vehicle_cmd_converter
    convert_steer_cmd_method: "vgr"
    vgr_coef_a: 15.713
    vgr_coef_b: 0.053
    vgr_coef_c: 0.042
    convert_actuation_to_steering_status: true

sim

    accel_time_delay: 0.1
    accel_time_constant: 0.1
    brake_time_delay: 0.1
    brake_time_constant: 0.1
    accel_map_path: $(find-pkg-share simple_planning_simulator)/data/actuation_cmd_map/accel_map.csv
    brake_map_path: $(find-pkg-share simple_planning_simulator)/data/actuation_cmd_map/brake_map.csv

    convert_accel_cmd: true
    convert_brake_cmd: true
    convert_steer_cmd: true

    convert_steer_cmd_method: "vgr"
    vgr_coef_a: 15.713
    vgr_coef_b: 0.053
    vgr_coef_c: 0.042
    enable_pub_steer: false
vgr_sim-2024-08-08_21.18.15.mp4
  1. change sim VGR
    convert_steer_cmd_method: "vgr"
    vgr_coef_a: 5.0
    vgr_coef_b: 2.0
    vgr_coef_c: 1.0
    convert_actuation_to_steering_status: true
    enable_pub_steer: false
vgr_sim-2024-08-08_23.04.50.mp4

Related links

Parent Issue:

  • Link

How was this PR tested?

  • psim
  • add unit test

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

@github-actions github-actions bot added component:vehicle Vehicle-specific implementations, drivers, packages. (auto-assigned) component:simulation Virtual environment setups and simulations. (auto-assigned) labels Aug 8, 2024
Copy link

github-actions bot commented Aug 8, 2024

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

@kosuke55 kosuke55 force-pushed the feat/steer_wheel_sim branch 2 times, most recently from a4e3f1f to f806d46 Compare August 16, 2024 07:01
@github-actions github-actions bot removed the component:vehicle Vehicle-specific implementations, drivers, packages. (auto-assigned) label Aug 16, 2024
@kosuke55 kosuke55 marked this pull request as ready for review August 16, 2024 07:38
@kosuke55 kosuke55 added the tag:run-build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Aug 16, 2024
@github-actions github-actions bot added the type:documentation Creating or refining documentation. (auto-assigned) label Aug 16, 2024
Copy link

codecov bot commented Aug 16, 2024

Codecov Report

Attention: Patch coverage is 82.72727% with 19 lines in your changes missing coverage. Please review.

Project coverage is 23.96%. Comparing base (9a461b4) to head (3696f5f).
Report is 45 commits behind head on main.

Files Patch % Lines
...imulator/vehicle_model/sim_model_actuation_cmd.cpp 87.01% 2 Missing and 8 partials ⚠️
...nning_simulator/simple_planning_simulator_core.cpp 71.42% 2 Missing and 6 partials ⚠️
...ng_simulator/vehicle_model/sim_model_interface.hpp 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8415      +/-   ##
==========================================
+ Coverage   23.90%   23.96%   +0.05%     
==========================================
  Files        1381     1383       +2     
  Lines      101923   102054     +131     
  Branches    38808    38866      +58     
==========================================
+ Hits        24363    24453      +90     
- Misses      75116    75144      +28     
- Partials     2444     2457      +13     
Flag Coverage Δ *Carryforward flag
differential 27.42% <82.72%> (?)
total 23.89% <ø> (-0.01%) ⬇️ Carriedforward from 8dbdd04

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

publish_steering(current_steer_);
}

if (vehicle_model_type_ == VehicleModelType::ACTUATION_CMD) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The VehicleModelType should not be used here for extensibility. Please define steering_publish_type in constructor, use it here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in ed78398

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added virtual bool shouldPublishActuationStatus() const { return false; }

if (vehicle_model_type_ != VehicleModelType::ACTUATION_CMD) {
return;
}
const auto model = std::dynamic_pointer_cast<SimModelActuationCmd>(vehicle_model_ptr_);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use of dynamic_pointer_cast should be avoided as much as possible. In this case, you can add a getActuationStatus() in a base class with returning zero by default.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in ed78398

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

returning zero by default.

I return not zoro but null

Signed-off-by: kosuke55 <[email protected]>
Signed-off-by: kosuke55 <[email protected]>
@kosuke55 kosuke55 merged commit 6988233 into autowarefoundation:main Aug 22, 2024
32 of 34 checks passed
@kosuke55 kosuke55 deleted the feat/steer_wheel_sim branch August 22, 2024 05:00
kosuke55 added a commit to tier4/autoware.universe that referenced this pull request Aug 22, 2024
…n#8415)

* feat(simple_planning_simulator): add VGR sim model

Signed-off-by: kosuke55 <[email protected]>

* Update simulator/simple_planning_simulator/test/test_simple_planning_simulator.cpp

* move to interface

Signed-off-by: kosuke55 <[email protected]>

* add const

Signed-off-by: kosuke55 <[email protected]>

---------

Signed-off-by: kosuke55 <[email protected]>
kyoichi-sugahara pushed a commit to kyoichi-sugahara/autoware.universe that referenced this pull request Aug 27, 2024
…n#8415)

* feat(simple_planning_simulator): add VGR sim model

Signed-off-by: kosuke55 <[email protected]>

* Update simulator/simple_planning_simulator/test/test_simple_planning_simulator.cpp

* move to interface

Signed-off-by: kosuke55 <[email protected]>

* add const

Signed-off-by: kosuke55 <[email protected]>

---------

Signed-off-by: kosuke55 <[email protected]>
kosuke55 added a commit to tier4/autoware.universe that referenced this pull request Aug 29, 2024
…n#8415)

* feat(simple_planning_simulator): add VGR sim model

Signed-off-by: kosuke55 <[email protected]>

* Update simulator/simple_planning_simulator/test/test_simple_planning_simulator.cpp

* move to interface

Signed-off-by: kosuke55 <[email protected]>

* add const

Signed-off-by: kosuke55 <[email protected]>

---------

Signed-off-by: kosuke55 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:simulation Virtual environment setups and simulations. (auto-assigned) tag:run-build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) type:documentation Creating or refining documentation. (auto-assigned)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants