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(tier4_autoware_utils): add quaternion operation #2244

Merged

Conversation

takayuki5168
Copy link
Contributor

@takayuki5168 takayuki5168 commented Nov 8, 2022

Signed-off-by: Takayuki Murooka takayuki5168@gmail.com

Description

motion_common is autoware.auto's unique implementation, where dependency from other packages will be removed soon. #2229
In autoware.universe, we have other utils packages that are tier4_autoware_utils/motion_utils.

Some control packages depend on motion_common's implementation, which I copied them to tier4_autoware_utils in this PR.

namespace geometry_msgs
{
namespace msg
{
Quaternion operator+(Quaternion a, Quaternion b) noexcept
{
tf2::Quaternion quat_a;
tf2::Quaternion quat_b;
tf2::fromMsg(a, quat_a);
tf2::fromMsg(b, quat_b);
return tf2::toMsg(quat_a + quat_b);
}
Quaternion operator-(Quaternion a) noexcept
{
tf2::Quaternion quat_a;
tf2::fromMsg(a, quat_a);
return tf2::toMsg(quat_a * -1.0);
}
Quaternion operator-(Quaternion a, Quaternion b) noexcept
{
tf2::Quaternion quat_a;
tf2::Quaternion quat_b;
tf2::fromMsg(a, quat_a);
tf2::fromMsg(b, quat_b);
return tf2::toMsg(quat_a * quat_b.inverse());
}

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.

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
@takayuki5168 takayuki5168 marked this pull request as ready for review November 8, 2022 06:24
@takayuki5168
Copy link
Contributor Author

This PR needs to be merged before #2231 since control_performance_analysis uses this PR's functions.

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
Copy link
Contributor

@TakaHoribe TakaHoribe left a comment

Choose a reason for hiding this comment

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

LGTM anyway.
This is ported from motion_common, which was used in the autoware.auto

@takayuki5168 takayuki5168 changed the title fet(tier4_autoware_utils): add quaternion operation feat(tier4_autoware_utils): add quaternion operation Nov 8, 2022
@codecov
Copy link

codecov bot commented Nov 8, 2022

Codecov Report

Base: 10.88% // Head: 11.45% // Increases project coverage by +0.57% 🎉

Coverage data is based on head (6a310b7) compared to base (4c0f75f).
Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2244      +/-   ##
==========================================
+ Coverage   10.88%   11.45%   +0.57%     
==========================================
  Files        1179     1198      +19     
  Lines       84935    87186    +2251     
  Branches    20043    21353    +1310     
==========================================
+ Hits         9242     9984     +742     
- Misses      65931    66968    +1037     
- Partials     9762    10234     +472     
Flag Coverage Δ *Carryforward flag
differential 12.65% <0.00%> (?)
total 10.85% <ø> (ø) Carriedforward from 4c0f75f

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

Impacted Files Coverage Δ
...mon/tier4_autoware_utils/src/ros/msg_operation.cpp 0.00% <0.00%> (ø)
...ctory_follower/include/trajectory_follower/mpc.hpp 42.30% <0.00%> (-4.36%) ⬇️
...ion/ndt_scan_matcher/src/ndt_scan_matcher_core.cpp 0.00% <0.00%> (ø)
...e_pursuit/src/pure_pursuit_core/planning_utils.cpp 0.00% <0.00%> (ø)
...on_planner/src/mission_planner/mission_planner.cpp 0.00% <0.00%> (ø)
...rsuit/include/pure_pursuit/util/planning_utils.hpp 0.00% <0.00%> (ø)
...ocity_planner/src/scene_module/stop_line/scene.cpp 0.00% <0.00%> (ø)
...c/pure_pursuit/pure_pursuit_lateral_controller.cpp 0.00% <0.00%> (ø)
...ity_planner/src/scene_module/intersection/util.cpp 0.00% <0.00%> (ø)
.../src/scene_module/side_shift/side_shift_module.cpp 0.00% <0.00%> (ø)
... and 33 more

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

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@takayuki5168 takayuki5168 merged commit ea16796 into autowarefoundation:main Nov 9, 2022
@takayuki5168 takayuki5168 deleted the feat/quaternion-utils-func branch November 9, 2022 01:01
HansRobo pushed a commit to HansRobo/autoware.universe that referenced this pull request Dec 16, 2022
…ion#2244)

* fet(tier4_autoware_utils): add quaternion operation

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>

* fix

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>

* fix file name

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
Signed-off-by: Kotaro Yoshimoto <pythagora.yoshimoto@gmail.com>
YoshiRi pushed a commit to YoshiRi/autoware.universe that referenced this pull request Jan 11, 2023
…ion#2244)

* fet(tier4_autoware_utils): add quaternion operation

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>

* fix

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>

* fix file name

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
Signed-off-by: yoshiri <yoshiyoshidetteiu@gmail.com>
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.

3 participants