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(lidar_apollo_segmentation_tvm/_nodes): remove autoware_auto_common dependency #2234

Conversation

takayuki5168
Copy link
Contributor

@takayuki5168 takayuki5168 commented Nov 7, 2022

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

Description

related to #2229
remove autoware_auto_common from lidar_apollo_segmentation_tvm/_nodes

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.

@takayuki5168 takayuki5168 marked this pull request as ready for review November 7, 2022 14:22
@takayuki5168
Copy link
Contributor Author

@yukke42 @yukkysaito
I'm not familiar with these packages, but I wanna remove autoware_auto_common which is autoware.auto's common package.
For this reason, I created this PR. Could you check this PR please.

@yukkysaito
Copy link
Contributor

yukkysaito commented Nov 7, 2022

@takayuki5168 I agree with the policy. There must be a reason why it was introduced and I would like to know.
@esteve Do you know the background and benefits of the introduction of these types?

@codecov
Copy link

codecov bot commented Nov 7, 2022

Codecov Report

Base: 12.29% // Head: 10.88% // Decreases project coverage by -1.41% ⚠️

Coverage data is based on head (3f8bc4a) compared to base (a7e322d).
Patch has no changes to coverable lines.

❗ Current head 3f8bc4a differs from pull request most recent head d7f9531. Consider uploading reports for the commit d7f9531 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2234      +/-   ##
==========================================
- Coverage   12.29%   10.88%   -1.42%     
==========================================
  Files        1171     1179       +8     
  Lines       82644    84935    +2291     
  Branches    23314    20043    -3271     
==========================================
- Hits        10162     9242     -920     
- Misses      61711    65931    +4220     
+ Partials    10771     9762    -1009     
Flag Coverage Δ *Carryforward flag
differential ∅ <ø> (?)
total 10.85% <ø> (-1.44%) ⬇️ Carriedforward from 4c0f75f

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

Impacted Files Coverage Δ
...vehicle_model/vehicle_model_bicycle_kinematics.hpp 0.00% <0.00%> (-100.00%) ⬇️
vehicle/raw_vehicle_cmd_converter/src/pid.cpp 0.00% <0.00%> (-85.72%) ⬇️
...clude/obstacle_avoidance_planner/mpt_optimizer.hpp 0.00% <0.00%> (-80.00%) ⬇️
...nner/src/vehicle_model/vehicle_model_interface.cpp 0.00% <0.00%> (-75.00%) ⬇️
...onverter/include/raw_vehicle_cmd_converter/pid.hpp 0.00% <0.00%> (-66.67%) ⬇️
...vehicle_model/vehicle_model_bicycle_kinematics.cpp 0.00% <0.00%> (-52.18%) ⬇️
...g/obstacle_avoidance_planner/src/mpt_optimizer.cpp 0.00% <0.00%> (-43.55%) ⬇️
...include/obstacle_avoidance_planner/utils/utils.hpp 0.00% <0.00%> (-36.48%) ⬇️
...planner/src/lanelet2_plugins/utility_functions.cpp 0.00% <0.00%> (-29.04%) ⬇️
...n_planner/src/lanelet2_plugins/default_planner.cpp 0.00% <0.00%> (-24.60%) ⬇️
... and 920 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.

@ambroise-arm
Copy link
Contributor

@kenji-miyake
Copy link
Contributor

@takayuki5168
Copy link
Contributor Author

takayuki5168 commented Nov 8, 2022

@kenji-miyake Could you give me more hint of how to refer to the guideline. (-> Explained in a chat.)

FYI: There is no behavior change with this PR since bool8_t, float32_t, float64_t is defined as bool, float, double respectively here.

using bool8_t = bool;
using char8_t = char;
using uchar8_t = unsigned char;
// If we ever compile on a platform where this is not true, float32_t and float64_t definitions
// need to be adjusted.
static_assert(sizeof(float) == 4, "float is assumed to be 32-bit");
using float32_t = float;
static_assert(sizeof(double) == 8, "double is assumed to be 64-bit");
using float64_t = double;

@xmfcx xmfcx self-requested a review November 9, 2022 14:54
xmfcx
xmfcx previously approved these changes Nov 9, 2022
@xmfcx
Copy link
Contributor

xmfcx commented Nov 9, 2022

(Please ignore my review, it was a dummy test)

@kenji-miyake Could you give me more hint of how to refer to the guideline. (-> Explained in a chat.)

@takayuki5168 I've opened up the following discussion to talk about it: https://github.com/orgs/autowarefoundation/discussions/3016

@ambroise-arm
Copy link
Contributor

I feel like this PR is a step backwards if long term we want to indeed have fixed-width types.
Also, I don't understand the rational of removing the common package just because it is an autoware.auto package. It could simply be renamed.
And as for the "annoying dependencies" it creates, isn't it the case for any common package that aims at being used in several other packages in order to de-duplicate code?

In any case, those are not strongly held opinions and I don't oppose going ahead with the change.

@xmfcx
Copy link
Contributor

xmfcx commented Nov 16, 2022

@ambroise-arm

I don't understand the rational of removing the common package just because it is an autoware.auto package. It could simply be renamed.

It's not because it is an Autoware.Auto package, it's because it's a dependency. In https://github.com/orgs/autowarefoundation/discussions/3016 we've discussed if we should create a similar package for types in Autoware Core.

I feel like this PR is a step backwards if long term we want to indeed have fixed-width types.

As discussed in https://github.com/orgs/autowarefoundation/discussions/3016 , here are some conclusions:

  • Autoware doesn't require to be MISRA/AUTOSAR compliant in near future.
  • We will encourage devs to use <cstdint> for integer types. And will try to add automatic checking features to CI to fix them automatically.
  • When C++23 comes out and a ROS version supporting it comes out, we will use <stdfloat>

As for typedef bool bool8_t and typedef char char8_t I think we can discuss it further.

And as for the "annoying dependencies" it creates, isn't it the case for any common package that aims at being used in several other packages in order to de-duplicate code?

Since types are the most essential things, it needs to be included in every package. We will of course have these kind of things if they are necessary. But what we are discussing is about whether they are necessary or not for the current state of the Autoware, the users etc.

Please add your inputs to the discussion as well.

@ambroise-arm
Copy link
Contributor

ambroise-arm commented Nov 16, 2022

It's not because it is an Autoware.Auto package, it's because it's a dependency.

I may have misunderstood the meaning of the initial comment #2234 (comment). Alright then.

We will encourage devs to use <cstdint> for integer types.

I had missed that the PR only replaced floatXX_t and bool8_t. Although it should also replace char8_t by char. It probably won't compile in the current state (not picked up in CI as the package doesn't get compiled by default).

@@ -37,9 +36,8 @@ namespace perception
{
namespace lidar_apollo_segmentation_tvm
{
using autoware::common::types::bool8_t;

using autoware::common::types::char8_t;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be removed too as pointed out by @ambroise-arm in #2234 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

d7f9531
DONE

Copy link
Contributor

Choose a reason for hiding this comment

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

using autoware::common::types::char8_t; is the issue here, not the white line, as it is a autoware_auto_common dependency
After removing this line, the char8_t in the file should then be replaced by char as mentioned in #2234 (comment)

@yukkysaito
Copy link
Contributor

@takayuki5168 Can you resolve some conflicts?

…common dependency

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
@takayuki5168 takayuki5168 force-pushed the refactor/remove-autoware-auto-common-from-perception branch from 5feb158 to 6b72319 Compare January 10, 2023 08:26
@takayuki5168 takayuki5168 requested a review from a team as a code owner January 10, 2023 08:26
@github-actions github-actions bot added the component:perception Advanced sensor data processing and environment understanding. (auto-assigned) label Jan 10, 2023
@takayuki5168
Copy link
Contributor Author

@yukkysaito @xmfcx I resolved the conflicts.

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

LGTM

@@ -37,9 +36,8 @@ namespace perception
{
namespace lidar_apollo_segmentation_tvm
{
using autoware::common::types::bool8_t;

using autoware::common::types::char8_t;
Copy link
Contributor

Choose a reason for hiding this comment

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

using autoware::common::types::char8_t; is the issue here, not the white line, as it is a autoware_auto_common dependency
After removing this line, the char8_t in the file should then be replaced by char as mentioned in #2234 (comment)

@esteve
Copy link
Contributor

esteve commented Jan 20, 2023

@esteve Do you know the background and benefits of the introduction of these types?

Sorry for the slow response, my notifications were not working properly. The reason for these types is mostly MISRA, because the built-in types don't have a defined size across all platforms, so by defining these aliases we can see quickly what size they have.

@stale
Copy link

stale bot commented Mar 21, 2023

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 21, 2023
@xmfcx
Copy link
Contributor

xmfcx commented Mar 22, 2023

@takayuki5168 I've moved this branch to AWF organization to collaborate easier. And made some fixes.

New PR: #3136

In order to build it, you need to run colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DDOWNLOAD_ARTIFACTS=1 --packages-select lidar_apollo_segmentation_tvm lidar_apollo_segmentation_tvm_nodes tvm_utility

Without the --cmake-args -DDOWNLOAD_ARTIFACTS=1 argument, it will skip building the package.

@xmfcx xmfcx closed this Mar 22, 2023
@stale stale bot removed the status:stale Inactive or outdated issues. (auto-assigned) label Mar 22, 2023
@takayuki5168
Copy link
Contributor Author

@xmfcx Sorry about not handling this PR. I really appreciate your help.

@takayuki5168 takayuki5168 deleted the refactor/remove-autoware-auto-common-from-perception branch May 20, 2023 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:perception Advanced sensor data processing and environment understanding. (auto-assigned)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants