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

fix: update dependencies and deprecated code for ROS 2 jazzy release #6656

Closed

Conversation

f0reachARR
Copy link
Contributor

@f0reachARR f0reachARR commented Mar 19, 2024

Description

As ROS 2 jazzy will be released soon, this PR will fix dependency error and some deprecated code found in rolling build environment.

  • Rewrite some #include to use recommended header file
  • Add missing dependency that caused build errors

Note

This change does not change code that should be fixed to support jazzy, so this PR does not mean supporting jazzy is completed.

  • QoS arguments of create_client / create_service: In jazzy, setting it to rmw_qos_* is deprecated, but humble does not support new method.
  • Ogre deprecated API for Rviz plugin
  • Currently, some required packages are not provided by apt for jazzy.

Tests performed

colcon test on humble distribution does not show new error.
colcon test on rolling shows some errors in vehicle_cmd_gate, so it should be fixed before supporting jazzy officially.

Effects on system behavior

Not applicable.

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.

@github-actions github-actions bot added component:perception Advanced sensor data processing and environment understanding. (auto-assigned) component:localization Vehicle's position determination in its environment. (auto-assigned) component:planning Route planning, decision-making, and navigation. (auto-assigned) component:control Vehicle control algorithms and mechanisms. (auto-assigned) component:system System design and integration. (auto-assigned) component:map Map creation, storage, and loading. (auto-assigned) component:vehicle Vehicle-specific implementations, drivers, packages. (auto-assigned) component:common Common packages from the autoware-common repository. (auto-assigned) component:evaluator Evaluation tools for planning, localization etc. (auto-assigned) labels Mar 19, 2024
@f0reachARR f0reachARR changed the title Update dependencies and deprecated code for ROS 2 jazzy release fix: Update dependencies and deprecated code for ROS 2 jazzy release Mar 19, 2024
@f0reachARR f0reachARR changed the title fix: Update dependencies and deprecated code for ROS 2 jazzy release fix: update dependencies and deprecated code for ROS 2 jazzy release Mar 19, 2024
@felixf4xu
Copy link
Contributor

I think it's better to merge this PR into a new branch named "jazzy" in autoware.universe instead of "main" branch.

@Timple
Copy link
Contributor

Timple commented May 25, 2024

I think it's better to merge this PR into a new branch named "jazzy" in autoware.universe instead of "main" branch.

Is there an official branching policy for autoware?

If not, this list of changes is rather small. And actually most of it should technically also be applied on humble.
Then there are only a few condition statements left. Having these seem like less maintenance than the backport / mergify hell challenge that other repositories have.

@f0reachARR
Copy link
Contributor Author

I checked this PR is working on both humble and jazzy, and does not include jazzy specific things.
So I think this PR can be merged into "main" branch without breaking changes

@f0reachARR f0reachARR force-pushed the fix/jazzy-deprecated branch from 302411d to c9d0e30 Compare May 31, 2024 02:57
@f0reachARR f0reachARR marked this pull request as ready for review May 31, 2024 03:22
Copy link
Contributor

@isamu-takagi isamu-takagi left a comment

Choose a reason for hiding this comment

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

LGTM (for diagnostic_graph_aggregator package)

@yukkysaito
Copy link
Contributor

@f0reachARR Thanks 👍 I seem to be having a conflict, can you please resolve it?

@f0reachARR
Copy link
Contributor Author

Sure! I fixed it.

@yukkysaito
Copy link
Contributor

@f0reachARR Thanks 👍
Can you tell me what kind of tests you did with humble and jazzy?
If possible, having a video of the following items in operation can serve as evidence and make it easier to proceed with merging.

  • rosbag replay simulator
  • planning simulator

@mitsudome-r mitsudome-r added the tag:run-build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label May 31, 2024
Comment on lines 21 to 25
#if __has_include(<cv_bridge/cv_bridge.hpp>)
#include <cv_bridge/cv_bridge.hpp>
#else
#include <cv_bridge/cv_bridge.h>
#endif
Copy link
Member

Choose a reason for hiding this comment

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

We might want to leave comments so that we know why we need this when we look back to this code in the future.

Suggested change
#if __has_include(<cv_bridge/cv_bridge.hpp>)
#include <cv_bridge/cv_bridge.hpp>
#else
#include <cv_bridge/cv_bridge.h>
#endif
#if __has_include(<cv_bridge/cv_bridge.hpp>)
#include <cv_bridge/cv_bridge.hpp> // for ROS 2 Jazzy
#else
#include <cv_bridge/cv_bridge.h> // for ROS 2 Humble
#endif

Copy link
Member

Choose a reason for hiding this comment

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

We should also fix other __has_include codes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see. This comment will help devs later. Thanks!

Similar usage of __has_include can be found some files that is not included in this PR.
(These codes seem to have been added to support ROS 2 Iron.)
Should I add some comment to these files?

Copy link
Member

@mitsudome-r mitsudome-r Jun 2, 2024

Choose a reason for hiding this comment

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

Yes, I think that would help. (If they are really for Jazzy or Iron)

@f0reachARR
Copy link
Contributor Author

I performed these tests.

  • Humble: Build test and unit test (by colcon test). I will test using rosbag replay simulator / planning simulator and upload some vides later
  • Jazzy: Build test only. This PR is intended to resolve build errors in the Jazzy environment and does not guarantee that Autoware is working.

@Timple
Copy link
Contributor

Timple commented May 31, 2024

Somehow locally on this branch I get:

/src/autoware.universe/sensing/pointcloud_preprocessor/src/downsample_filter/faster_voxel_grid_downsample_filter.cpp:105:25: error: ‘FLT_MAX’ was not declared in this scope
  105 |   min_point.setConstant(FLT_MAX);

Does this sound familiar?

@f0reachARR f0reachARR requested a review from beyzanurkaya as a code owner June 20, 2024 02:42
@f0reachARR
Copy link
Contributor Author

I have not seen pointcloud_preprocessor error @Timple showed.
If this error occured in Jazzy environment, I will investigate it.

@mitsudome-r
Copy link
Member

mitsudome-r commented Jun 20, 2024

I have few questions regarding the PR:

  • You said "Currently, some required packages are not provided by apt for jazzy.", could you provide the list of the packages that are not released as binary?
  • ament_index_cpp is added as a new dependency for many packages. What is it used for? Why were they not needed in Humble? (Were there any dependency changed in ament packages in Jazzy?)

@f0reachARR
Copy link
Contributor Author

Here is a list of required packages that is not provided by apt (binary package).

@f0reachARR
Copy link
Contributor Author

f0reachARR commented Jun 20, 2024

ament_index_cpp was added because it was the cause of build errors.
I looked into the build error about ament_index_cpp but could not find anything definite as to why. I also could not get anything from the ament_index repository.
It seems certain that it is a jazzy (or rolling) issue, as there are similar changes in several repositories other than Autoware.
Whatever the reason, the dependency that is used in source code was definitely missing and should be fixed.

Example usage of ament_index_cpp
https://github.com/autowarefoundation/autoware.universe/blob/main/common/autoware_test_utils/src/autoware_test_utils.cpp#L15

@f0reachARR
Copy link
Contributor Author

I'm thinking of splitting the Pull Request because there are too many changes, is that ok?

@HansRobo
Copy link
Member

I'm thinking of splitting the Pull Request because there are too many changes, is that ok?

Ok. I would appreciate it if you could proceed.
This is what I agreed to in the internal chat with @mitsudome-r .

@HansRobo HansRobo mentioned this pull request Jun 20, 2024
3 tasks
@f0reachARR f0reachARR closed this Jun 20, 2024
@Timple
Copy link
Contributor

Timple commented Jun 20, 2024

The ament_index_cpp I've had to apply on more repositories. I think the new cmake version is simply a bit more strict?

@HansRobo
Copy link
Member

The ament_index_cpp I've had to apply on more repositories. I think the new cmake version is simply a bit more strict?

That's a point to pay attention to!

And there are many changes in ament_cmake, which may affect the colcon/ament behavior.
ament/ament_cmake@humble...jazzy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:common Common packages from the autoware-common repository. (auto-assigned) component:control Vehicle control algorithms and mechanisms. (auto-assigned) component:evaluator Evaluation tools for planning, localization etc. (auto-assigned) component:localization Vehicle's position determination in its environment. (auto-assigned) component:map Map creation, storage, and loading. (auto-assigned) component:perception Advanced sensor data processing and environment understanding. (auto-assigned) component:planning Route planning, decision-making, and navigation. (auto-assigned) component:system System design and integration. (auto-assigned) component:vehicle Vehicle-specific implementations, drivers, packages. (auto-assigned) tag:run-build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants