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: wait until autonomous mode is enabled #74

Merged
merged 1 commit into from
Jul 11, 2024

Conversation

tkimura4
Copy link
Contributor

@tkimura4 tkimura4 commented Jul 11, 2024

Description

The current automatic_goal_sender is set to call the /api/operation_mode/change_to_autonomous service as soon as /api/routing/state becomes RouteState::SET. However, in this state, Planning may still be in preparation, and autonomous_mode may not be ready. In such situations, the automatic_goal_sender process crashes as shown in the message below. I have modified the code to wait for autonomous_mode to be ready before calling the change_to_autonomous service.

automatic_goal_sender-1] [INFO 1720670631.443807582] [automatic_goal_sender]: Achieved goals will be saved in: /home/kimura/git/pilot-auto.x2/src/evaluation/autoware_awsim_evaluation_tools/src/awsim_evaluation_launcher/config/odaibagoals_achieved.log
[automatic_goal_sender-1] [INFO 1720670632.443782270] [automatic_goal_sender]: G0 (89067.52, 42360.04, 2.17): Goal set as the next. Planning in progress...
[automatic_goal_sender-1] [INFO 1720670632.943799086] [automatic_goal_sender]: G0 (89067.52, 42360.04, 2.17): Route has been planned. Route starting...
[automatic_goal_sender-1] [ERROR 1720670632.944549606] [automatic_goal_sender]: Service type "N22autoware_adapi_v1_msgs3srv19ChangeOperationModeE" status: 1, The target mode is not available. Please check the diagnostics.

Related links

none

Tests performed

I verified with the Planning_simulator that the automatic_goal_sender operates correctly in situations where Planning takes time to prepare.

$ros2 launch autoware_launch planning_simulator.launch.xml vehicle_id:=default vehicle_model:=[VEHICLE_MODEL] sensor_model:=[SENSOR_MODEL] map_path:=[MAP_PATH]
$ros2 launch tier4_automatic_goal_rviz_plugin automatic_goal_sender.launch.xml goals_list_file_path:=[GOAL_LIST_PATH] goals_achieved_dir_path:=[PATH]

Notes for reviewers

none

Interface changes

none

Effects on system behavior

none ( This is a feature not used in regular autonomous driving. )

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.

Copy link
Contributor

@shmpwk shmpwk left a comment

Choose a reason for hiding this comment

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

LGTM

@tkimura4 tkimura4 enabled auto-merge (squash) July 11, 2024 05:12
@tkimura4 tkimura4 merged commit 5652129 into main Jul 11, 2024
53 checks passed
@tkimura4 tkimura4 deleted the feat/wait_autonomous_enabled branch July 11, 2024 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants