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(default_ad_api): add localization api #1431

Merged

Conversation

isamu-takagi
Copy link
Contributor

@isamu-takagi isamu-takagi commented Jul 26, 2022

Signed-off-by: Takagi, Isamu isamu.takagi@tier4.jp

Description

Introduce AD API for routing. This PR is the rviz helper, auto initial pose and AD API part of the diagram.
Here are the changes for each package:

autoware_ad_api_msgs: Add the localization API messages.
autoware_ad_api_specs: Add the localization API definitions.
component_interface_specs; Add the internal localization interface definitions.
default_ad_api: Add the localization API.
default_ad_api_helpers: Add the adaptor for RViz localization topics, and auto initialize node by GNSS.

block-diagram-initial-pose drawio

Related links

autowarefoundation/autoware_launch#72
autowarefoundation/autoware_launch#70
tier4/tier4_autoware_msgs#44
#1500

autowarefoundation/autoware_launch#71

Tests performed

For planning simulation.

  1. Merge all related PRs.
  2. Launch planning simulation.
  3. Check if the localization succeeds when initialpose from RViz.

For logging simulation.

  1. Merge all related PRs.
  2. Launch logging simulation (sample map).
  3. Check if the localization succeeds automatically when the vehicle is stopped.
  4. Disable auto initial pose (feat(autoware_launch): add auto initial pose autoware_launch#71)
    • Check if the localization succeeds when initialpose from RViz when vehicle is stopped.
    • Check if the localization failes when initialpose from RViz when vehicle is not stopped.

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.

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.

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

@isamu-takagi isamu-takagi force-pushed the feature/ad-api/localization branch from 9c6aee2 to 0b6d5b9 Compare July 26, 2022 04:38
@isamu-takagi isamu-takagi self-assigned this Jul 26, 2022
@codecov
Copy link

codecov bot commented Jul 26, 2022

Codecov Report

Merging #1431 (de6a32c) into main (d9fae78) will increase coverage by 0.45%.
The diff coverage is 5.17%.

@@            Coverage Diff             @@
##             main    #1431      +/-   ##
==========================================
+ Coverage   10.25%   10.71%   +0.45%     
==========================================
  Files        1199     1108      -91     
  Lines       86374    78505    -7869     
  Branches    19891    18660    -1231     
==========================================
- Hits         8860     8410     -450     
+ Misses      68294    61169    -7125     
+ Partials     9220     8926     -294     
Flag Coverage Δ *Carryforward flag
differential 10.67% <5.17%> (?)
total 10.69% <ø> (+0.45%) ⬆️ Carriedforward from 7eaefe2

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

Impacted Files Coverage Δ
...lpers/ad_api_adaptors/src/initial_pose_adaptor.cpp 0.00% <0.00%> (ø)
...ose_initializer/src/automatic_pose_initializer.cpp 0.00% <0.00%> (ø)
system/default_ad_api/src/localization.cpp 42.85% <42.85%> (ø)
...vehicle_model/sim_model_ideal_steer_acc_geared.cpp 64.15% <0.00%> (-18.87%) ⬇️
...ail/dds_fastrtps/response_status__type_support.cpp 0.00% <0.00%> (-16.08%) ⬇️
..._msgs/msg/detail/response_status__type_support.cpp 0.00% <0.00%> (-15.39%) ⬇️
...ils/include/motion_utils/trajectory/trajectory.hpp 77.86% <0.00%> (-0.89%) ⬇️
...or_path_planner/src/behavior_path_planner_node.cpp 0.23% <0.00%> (-0.01%) ⬇️
planning/surround_obstacle_checker/src/node.cpp 0.00% <0.00%> (ø)
localization/ekf_localizer/src/ekf_localizer.cpp 0.00% <0.00%> (ø)
... and 118 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@isamu-takagi isamu-takagi changed the title feat(default_ad_api): add localization feat(default_ad_api): add localization api Jul 26, 2022
@isamu-takagi isamu-takagi force-pushed the feature/ad-api/localization branch from f57a754 to b1841cb Compare July 26, 2022 13:10
@isamu-takagi
Copy link
Contributor Author

I'll split the PR.

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>
@isamu-takagi isamu-takagi force-pushed the feature/ad-api/localization branch from 662a1f3 to b6ede8b Compare August 2, 2022 09:30
@isamu-takagi isamu-takagi requested review from mitsudome-r and removed request for YamatoAndo August 2, 2022 09:31
@isamu-takagi isamu-takagi marked this pull request as ready for review August 2, 2022 10:44
Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>
@isamu-takagi
Copy link
Contributor Author

This PR is ready.

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>
system/default_ad_api_helpers/README.md Outdated Show resolved Hide resolved
uint16 ERROR_UNSAFE = 1
uint16 ERROR_GNSS_SUPPORT = 2
uint16 ERROR_GNSS = 3
uint16 ERROR_ESTIMATION = 4
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you write brief descriptions of these error types?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Error Description
ERROR_UNSAFE Requested when unsafe, such as while driving.
ERROR_GNSS_SUPPORT GNSS is not supported.
ERROR_GNSS GNSS is supported but an error related to GNSS occurred.
ERROR_ESTIMATION An error occurred while pose estimation.

struct InitializationState
{
using Message = autoware_ad_api_msgs::msg::LocalizationInitializationState;
static constexpr char name[] = "/localization/initialization_state";
Copy link
Contributor

@kenji-miyake kenji-miyake Aug 10, 2022

Choose a reason for hiding this comment

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

@yukkysaito @mitsudome-r Do you have any opinions on the namings of Initialize and InitializationState?

image

Copy link
Contributor

Choose a reason for hiding this comment

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

I suppose these are okay.

system/default_ad_api/src/localization.cpp Outdated Show resolved Hide resolved
system/default_ad_api_helpers/src/initial_pose_adaptor.hpp Outdated Show resolved Hide resolved
system/default_ad_api_helpers/src/initial_pose_adaptor.cpp Outdated Show resolved Hide resolved
system/default_ad_api_helpers/src/initial_pose_adaptor.cpp Outdated Show resolved Hide resolved
| Interface | Local Name | Global Name | Description |
| ------------ | -------------- | --------------------------------- | ----------------------------------------- |
| Subscription | initialpose | /initialpose | The pose for localization initialization. |
| Client | fit_map_height | /localization/util/fit_map_height | To fix initial pose to map height |
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you tell me where this service is implemented, please?

Copy link
Contributor

Choose a reason for hiding this comment

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

I've found it in #1500.

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>
Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>
Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>
isamu-takagi and others added 15 commits August 25, 2022 19:51
…/autoware.universe into feature/ad-api/localization
Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>
Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>
Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>
Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>
Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>
Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>
Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>
Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>
Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>
@isamu-takagi isamu-takagi merged commit dcf99e5 into autowarefoundation:main Sep 1, 2022
@isamu-takagi isamu-takagi deleted the feature/ad-api/localization branch September 1, 2022 01:20
adaptor.init_cli(cli_initialize_, group_cli_);
adaptor.init_sub(sub_state_, [this](const State::Message::ConstSharedPtr msg) { state_ = *msg; });

const auto period = rclcpp::Rate(1.0).period();
Copy link
Contributor

Choose a reason for hiding this comment

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

As far as I tried on my PC, by setting the rate to higher value (e.g. rclcpp::Rate(2.0)), the automatic_pose_initializer started keep requesting for the pose initialization infinitely. It seems that the timer_ was kept called, and this blocked sub_state_ to update the state_.state from UNINITIALIZED to INITIALIZED.

Would you check if this happens in your PC, too? And if so, do you have any idea how to fix this issue?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh sorry my comment was a bit late. I would open an issue for this.

Copy link
Contributor

Choose a reason for hiding this comment

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

boyali referenced this pull request in boyali/autoware.universe Sep 28, 2022
* feat(default_ad_api): add localization api

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* docs: add readme

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* feat: add auto initial pose

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* feat(autoware_ad_api_msgs): define localization interface

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix(default_ad_api): fix interface definition

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* feat(default_ad_api): modify interface version api to use spec package

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* feat(default_ad_api): modify interface version api to use spec package

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: pre-commit

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: pre-commit

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: pre-commit

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: copyright

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* feat: split helper package

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: change topic name to local

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: style

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: style

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: style

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: remove needless keyword

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* feat: change api helper node namespace

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: fix launch file path

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>
boyali referenced this pull request in boyali/autoware.universe Oct 3, 2022
* feat(default_ad_api): add localization api

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* docs: add readme

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* feat: add auto initial pose

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* feat(autoware_ad_api_msgs): define localization interface

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix(default_ad_api): fix interface definition

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* feat(default_ad_api): modify interface version api to use spec package

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* feat(default_ad_api): modify interface version api to use spec package

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: pre-commit

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: pre-commit

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: pre-commit

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: copyright

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* feat: split helper package

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: change topic name to local

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: style

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: style

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: style

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: remove needless keyword

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* feat: change api helper node namespace

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: fix launch file path

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>
boyali referenced this pull request in boyali/autoware.universe Oct 3, 2022
* feat(default_ad_api): add localization api

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* docs: add readme

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* feat: add auto initial pose

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* feat(autoware_ad_api_msgs): define localization interface

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix(default_ad_api): fix interface definition

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* feat(default_ad_api): modify interface version api to use spec package

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* feat(default_ad_api): modify interface version api to use spec package

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: pre-commit

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: pre-commit

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: pre-commit

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: copyright

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* feat: split helper package

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: change topic name to local

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: style

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: style

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: style

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: remove needless keyword

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* feat: change api helper node namespace

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: fix launch file path

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>
yukke42 pushed a commit to tzhong518/autoware.universe that referenced this pull request Oct 14, 2022
* feat(default_ad_api): add localization api

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* docs: add readme

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* feat: add auto initial pose

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* feat(autoware_ad_api_msgs): define localization interface

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix(default_ad_api): fix interface definition

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* feat(default_ad_api): modify interface version api to use spec package

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* feat(default_ad_api): modify interface version api to use spec package

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: pre-commit

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: pre-commit

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: pre-commit

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: copyright

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* feat: split helper package

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: change topic name to local

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: style

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: style

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: style

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: remove needless keyword

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* feat: change api helper node namespace

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: fix launch file path

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>
boyali referenced this pull request in boyali/autoware.universe Oct 19, 2022
* feat(default_ad_api): add localization api

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* docs: add readme

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* feat: add auto initial pose

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* feat(autoware_ad_api_msgs): define localization interface

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix(default_ad_api): fix interface definition

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* feat(default_ad_api): modify interface version api to use spec package

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* feat(default_ad_api): modify interface version api to use spec package

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: pre-commit

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: pre-commit

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: pre-commit

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: copyright

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* feat: split helper package

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: change topic name to local

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: style

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: style

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: style

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: remove needless keyword

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* feat: change api helper node namespace

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: fix launch file path

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants