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

refactor(simple_planning_simulator): rework parameters #5446

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

PhoebeWu21
Copy link
Member

Description

Implement the ROS Node configuration layout described in https://github.com/orgs/autowarefoundation/discussions/3371 for the simple_planning_simulator package.

  • Remove the default value from the source code in order to ensure all parameter values are passed from the parameter files.
  • Create the schema

Tests performed

Package built and launch locally.
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release --packages-up-to simple_planning_simulator

Effects on system behavior

More reliable and faster parameter configuration file creation.

Pre-review checklist for the PR author

The PR author must check the checkboxes below when creating the PR.

In-review checklist for the PR reviewers

The PR reviewers must check the checkboxes below before approval.

  • The PR follows the pull request guidelines.
  • The PR has been properly tested.
  • The PR has been reviewed by the code owners.

Post-review checklist for the PR author

The PR author must check the checkboxes below before merging.

  • There are no open discussions or they are tracked via tickets.
  • The PR is ready for merge.

After all checkboxes are checked, anyone who has write access can merge the PR.

@github-actions github-actions bot added type:documentation Creating or refining documentation. (auto-assigned) component:simulation Virtual environment setups and simulations. (auto-assigned) labels Oct 31, 2023
@ambroise-arm
Copy link
Contributor

The json-schema CI check fails because the config file should be under ../config/*.param.yaml. Could you move it there and ensure that if there are other packages making use of the config file they are updated to the new path as well?

@PhoebeWu21
Copy link
Member Author

The json-schema CI check fails because the config file should be under ../config/*.param.yaml. Could you move it there and ensure that if there are other packages making use of the config file they are updated to the new path as well?

@ambroise-arm Got it! Done.

@satoshi-ota satoshi-ota added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Nov 23, 2023
@satoshi-ota
Copy link
Contributor

@PhoebeWu21 Following error has occured by this PR. Could you confirm whether the autoware can be launch correctly with your branch?

[ERROR] [simple_planning_simulator_exe-53]: process has died [pid 572727, exit code -6, cmd '/home/satoshi/pilot-auto/install/simple_planning_simulator/lib/simple_planning_simulator/simple_planning_simulator_exe --ros-args -r __node:=simple_planning_simulator -r __ns:=/simulation -p use_sim_time:=False -p wheel_radius:=0.383 -p wheel_width:=0.235 -p wheel_base:=2.79 -p wheel_tread:=1.64 -p front_overhang:=1.0 -p 
rear_overhang:=1.1 -p left_overhang:=0.128 -p right_overhang:=0.128 -p vehicle_height:=2.5 -p max_steer_angle:=0.7 --params-file /tmp/launch_params_cm1fjop5 --params-file /tmp/launch_params_99funsy_ -r input/vector_map:=/map/vector_map -r input/initialpose:=/initialpose3d -r input/ackermann_control_command:=/control/command/control_cmd -r input/manual_ackermann_control_command:=/vehicle/command/manual_control_cmd
 -r input/gear_command:=/control/command/gear_cmd -r input/manual_gear_command:=/vehicle/command/manual_gear_command -r input/turn_indicators_command:=/control/command/turn_indicators_cmd -r input/hazard_lights_command:=/control/command/hazard_lights_cmd -r input/trajectory:=/planning/scenario_planning/trajectory -r input/engage:=/vehicle/engage -r input/control_mode_request:=/control/control_mode_request -r outp
ut/twist:=/vehicle/status/velocity_status -r output/odometry:=/localization/kinematic_state -r output/acceleration:=/localization/acceleration -r output/imu:=/sensing/imu/imu_data -r output/steering:=/vehicle/status/steering_status -r output/gear_report:=/vehicle/status/gear_status -r output/turn_indicators_report:=/vehicle/status/turn_indicators_status -r output/hazard_lights_report:=/vehicle/status/hazard_light
s_status -r output/control_mode_report:=/vehicle/status/control_mode'].                                                                                                                                                                                                                                                                                                                                                         
[simple_planning_simulator_exe-53] terminate called after throwing an instance of 'rclcpp::exceptions::UninitializedStaticallyTypedParameterException'                                                                                                                                                                                                                                                                          
[simple_planning_simulator_exe-53]   what():  Statically typed parameter 'initial_engage_state' must be initialized.

@PhoebeWu21
Copy link
Member Author

@PhoebeWu21 Following error has occured by this PR. Could you confirm whether the autoware can be launch correctly with your branch?

[ERROR] [simple_planning_simulator_exe-53]: process has died [pid 572727, exit code -6, cmd '/home/satoshi/pilot-auto/install/simple_planning_simulator/lib/simple_planning_simulator/simple_planning_simulator_exe --ros-args -r __node:=simple_planning_simulator -r __ns:=/simulation -p use_sim_time:=False -p wheel_radius:=0.383 -p wheel_width:=0.235 -p wheel_base:=2.79 -p wheel_tread:=1.64 -p front_overhang:=1.0 -p 
rear_overhang:=1.1 -p left_overhang:=0.128 -p right_overhang:=0.128 -p vehicle_height:=2.5 -p max_steer_angle:=0.7 --params-file /tmp/launch_params_cm1fjop5 --params-file /tmp/launch_params_99funsy_ -r input/vector_map:=/map/vector_map -r input/initialpose:=/initialpose3d -r input/ackermann_control_command:=/control/command/control_cmd -r input/manual_ackermann_control_command:=/vehicle/command/manual_control_cmd
 -r input/gear_command:=/control/command/gear_cmd -r input/manual_gear_command:=/vehicle/command/manual_gear_command -r input/turn_indicators_command:=/control/command/turn_indicators_cmd -r input/hazard_lights_command:=/control/command/hazard_lights_cmd -r input/trajectory:=/planning/scenario_planning/trajectory -r input/engage:=/vehicle/engage -r input/control_mode_request:=/control/control_mode_request -r outp
ut/twist:=/vehicle/status/velocity_status -r output/odometry:=/localization/kinematic_state -r output/acceleration:=/localization/acceleration -r output/imu:=/sensing/imu/imu_data -r output/steering:=/vehicle/status/steering_status -r output/gear_report:=/vehicle/status/gear_status -r output/turn_indicators_report:=/vehicle/status/turn_indicators_status -r output/hazard_lights_report:=/vehicle/status/hazard_light
s_status -r output/control_mode_report:=/vehicle/status/control_mode'].                                                                                                                                                                                                                                                                                                                                                         
[simple_planning_simulator_exe-53] terminate called after throwing an instance of 'rclcpp::exceptions::UninitializedStaticallyTypedParameterException'                                                                                                                                                                                                                                                                          
[simple_planning_simulator_exe-53]   what():  Statically typed parameter 'initial_engage_state' must be initialized.

Hi @satoshi-ota, I did successfully launch in local.
image
I have no idea what happened. I will recheck detailly again.

@satoshi-ota
Copy link
Contributor

Hi @PhoebeWu21 Thanks for your investigation.
Hmm... OK. I'll recheck, too.

@satoshi-ota
Copy link
Contributor

@satoshi-ota
Copy link
Contributor

When it launches planning_simulator from autoware_launch repos, the launch file includes other sim model yaml here.

ros2 launch autoware_launch planning_simulator.launch.xml map_path:=$HOME/autoware_map/sample-map-planning vehicle_model:=sample_vehicle sensor_model:=sample_sensor_kit

And, it seems that initial_engage_state param doesn't exist in the yaml file. I'm sure that this is the cause of the error.

@PhoebeWu21
Copy link
Member Author

PhoebeWu21 commented Nov 27, 2023

@satoshi-ota I see, thank you!
I add back { "initial_engage_state": LaunchConfiguration("initial_engage_state"), }, in simple_planning_simulator.launch.py file. It seems work for launching planning_simulator.
But the error Caught exception in launch (see debug for traceback): launch configuration 'initial_engage_state' does not exist will occur while launching the single simple_planning_simulator node.

@PhoebeWu21
Copy link
Member Author

I add back { "initial_engage_state": LaunchConfiguration("initial_engage_state"), }, in simple_planning_simulator.launch.py file. It seems work for launching planning_simulator. But the error Caught exception in launch (see debug for traceback): launch configuration 'initial_engage_state' does not exist will occur while launching the single simple_planning_simulator node.

@satoshi-ota Hi, I am not sure how to deal with this situation, since I did not make any other change to the launch file.

@satoshi-ota
Copy link
Contributor

@PhoebeWu21 Sorry for late reply. I'll investigate that error.

@satoshi-ota
Copy link
Contributor

When it launches planning_simulator from autoware_launch repos, the launch file includes other sim model yaml here.

ros2 launch autoware_launch planning_simulator.launch.xml map_path:=$HOME/autoware_map/sample-map-planning vehicle_model:=sample_vehicle sensor_model:=sample_sensor_kit

And, it seems that initial_engage_state param doesn't exist in the yaml file. I'm sure that this is the cause of the error.

Hi @PhoebeWu21
I think you need to add NOT ONLY initial_engage_state but also enable_road_slope_simulation, pos_noise_stddev, etc...

And, as I wrote, when we call planning_simulator.launch.xml, this file will be loaded. Actually, I confirmed that I could launch Psim with your branch after I added missing params to this file.

In short, we have to add missing params to simulator_model.param.yaml of ALL vehicle description packages (TIER IV has a lot of vehicle descriptions...) before removing default values in cpp file at first. So, I'll ask TIER IV internal member to help adding missing params.

@PhoebeWu21
Copy link
Member Author

Hi @satoshi-ota,
I see. So I think I don't need do modify my branch until the missing params in simulator_model.param.yaml be added, right?

Copy link

stale bot commented Mar 4, 2024

This pull request has been automatically marked as stale because it has not had recent activity.

@stale stale bot added the status:stale Inactive or outdated issues. (auto-assigned) label Mar 4, 2024
@idorobotics
Copy link

In short, we have to add missing params to simulator_model.param.yaml of ALL vehicle description packages (TIER IV has a lot of vehicle descriptions...) before removing default values in cpp file at first. So, I'll ask TIER IV internal member to help adding missing params.

@satoshi-ota - have you received feedback on adding the missing params? Can @PhoebeWu21 continue with this task or will you be taking over to complete it?

@stale stale bot removed the status:stale Inactive or outdated issues. (auto-assigned) label May 24, 2024
@idorobotics
Copy link

@satoshi-ota could you update the current status of this PR?

@mitsudome-r
Copy link
Member

I will take a look at this tomorrow since it's been blocked for a long time.

Copy link

stale bot commented Oct 1, 2024

This pull request has been automatically marked as stale because it has not had recent activity.

@stale stale bot added the status:stale Inactive or outdated issues. (auto-assigned) label Oct 1, 2024
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) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) status:stale Inactive or outdated issues. (auto-assigned) type:documentation Creating or refining documentation. (auto-assigned)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants