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(perception_utils): add classification util function with string #2090

Merged

Conversation

scepter914
Copy link
Contributor

@scepter914 scepter914 commented Oct 18, 2022

Description

Make util function for label conversion between string and uint8.
The function is used in

After this PR merged, I'll send the PR to replace to these functions to util functions.

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: scepter914 <scepter914@gmail.com>
Signed-off-by: scepter914 <scepter914@gmail.com>
Signed-off-by: scepter914 <scepter914@gmail.com>
Signed-off-by: scepter914 <scepter914@gmail.com>
Signed-off-by: scepter914 <scepter914@gmail.com>
@codecov
Copy link

codecov bot commented Oct 18, 2022

Codecov Report

Base: 10.83% // Head: 10.35% // Decreases project coverage by -0.48% ⚠️

Coverage data is based on head (3a34fdb) compared to base (ff1af93).
Patch coverage: 49.25% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2090      +/-   ##
==========================================
- Coverage   10.83%   10.35%   -0.49%     
==========================================
  Files        1179     1176       -3     
  Lines       84845    84466     -379     
  Branches    19985    19637     -348     
==========================================
- Hits         9196     8746     -450     
- Misses      65931    66147     +216     
+ Partials     9718     9573     -145     
Flag Coverage Δ *Carryforward flag
differential 6.07% <47.76%> (?)
total 10.35% <ø> (-0.47%) ⬇️ Carriedforward from 15d8d0a

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

Impacted Files Coverage Δ
...include/tier4_autoware_utils/geometry/geometry.hpp 95.80% <ø> (ø)
...autoware_utils/test/src/geometry/test_geometry.cpp 43.34% <ø> (ø)
...tion_utils/test/src/test_object_classification.cpp 15.87% <15.62%> (-0.26%) ⬇️
...include/perception_utils/object_classification.hpp 76.92% <80.00%> (+26.92%) ⬆️
...lude/freespace_planning_algorithms/reeds_shepp.hpp 50.00% <0.00%> (-50.00%) ⬇️
.../freespace_planning_algorithms/src/reeds_shepp.cpp 55.51% <0.00%> (-38.97%) ⬇️
...lude/behavior_path_planner/turn_signal_decider.hpp 50.00% <0.00%> (-35.72%) ⬇️
...eespace_planning_algorithms/abstract_algorithm.hpp 44.44% <0.00%> (-25.56%) ⬇️
...ng/behavior_path_planner/test/test_turn_signal.cpp 27.60% <0.00%> (-12.81%) ⬇️
...ehicle/raw_vehicle_cmd_converter/src/brake_map.cpp 33.33% <0.00%> (-11.83%) ⬇️
... and 153 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.

Signed-off-by: scepter914 <scepter914@gmail.com>
@@ -17,6 +17,7 @@

#include "autoware_auto_perception_msgs/msg/object_classification.hpp"

#include <string>
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious.

Where is this function with string argument used?
I'm not sure why the label is used as string in the implementation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Deep learning module sometime has string config like CenterPoint, so this case need for converter.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know if having class names as a string is good or not, but I got it. Thank you.

Comment on lines 115 to 117
} else {
return ObjectClassification::UNKNOWN;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This handling looks not good.
If we have typo on class types as a string, the type will be unknown.

I think it's okay to throw exception in this case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's certainly true. Thank you for recommendation.
Fixed at 15d8d0a.

Signed-off-by: scepter914 <scepter914@gmail.com>
Copy link
Contributor

@takayuki5168 takayuki5168 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@yukke42 yukke42 left a comment

Choose a reason for hiding this comment

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

LGTM

@scepter914 scepter914 enabled auto-merge (squash) November 2, 2022 02:46
@scepter914 scepter914 merged commit 4c0f75f into autowarefoundation:main Nov 2, 2022
HansRobo pushed a commit to HansRobo/autoware.universe that referenced this pull request Dec 16, 2022
…ing (autowarefoundation#2090)

* feat(perception_utils): add classification util function with string

Signed-off-by: scepter914 <scepter914@gmail.com>

* add unit test

Signed-off-by: scepter914 <scepter914@gmail.com>

* add include string

Signed-off-by: scepter914 <scepter914@gmail.com>

* fix function interface

Signed-off-by: scepter914 <scepter914@gmail.com>

* fix unit test

Signed-off-by: scepter914 <scepter914@gmail.com>

* change function name

Signed-off-by: scepter914 <scepter914@gmail.com>

* change to except throw

Signed-off-by: scepter914 <scepter914@gmail.com>

Signed-off-by: scepter914 <scepter914@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
…ing (autowarefoundation#2090)

* feat(perception_utils): add classification util function with string

Signed-off-by: scepter914 <scepter914@gmail.com>

* add unit test

Signed-off-by: scepter914 <scepter914@gmail.com>

* add include string

Signed-off-by: scepter914 <scepter914@gmail.com>

* fix function interface

Signed-off-by: scepter914 <scepter914@gmail.com>

* fix unit test

Signed-off-by: scepter914 <scepter914@gmail.com>

* change function name

Signed-off-by: scepter914 <scepter914@gmail.com>

* change to except throw

Signed-off-by: scepter914 <scepter914@gmail.com>

Signed-off-by: scepter914 <scepter914@gmail.com>
Signed-off-by: yoshiri <yoshiyoshidetteiu@gmail.com>
@scepter914 scepter914 deleted the refactor/classification_string branch April 19, 2023 04:22
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