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: add select option for dynamic transform lookup time #10288

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

badai-nguyen
Copy link
Contributor

@badai-nguyen badai-nguyen commented Mar 17, 2025

Description

Related links

Parent Issue:

How was this PR tested?

  • Test by logging simulator on high-speed moving/turn rosbag
Before After
Fast Moving (look at pillar on the left) 2_before.webm 2_after.webm
Turn Left 1_before.webm 1_after.webm

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>
@github-actions github-actions bot added component:sensing Data acquisition from sensors, drivers, preprocessing. (auto-assigned) component:launch Launch files, scripts and initialization tools. (auto-assigned) labels Mar 17, 2025
Copy link

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

@badai-nguyen badai-nguyen added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Mar 18, 2025
@badai-nguyen badai-nguyen self-assigned this Mar 18, 2025
@badai-nguyen badai-nguyen requested a review from amadeuszsz March 18, 2025 02:23
@badai-nguyen
Copy link
Contributor Author

CI error:

/__w/autoware.universe/autoware.universe/sensing/autoware_pointcloud_preprocessor/src/filter.cpp: In member function ‘bool autoware::pointcloud_preprocessor::Filter::calculate_transform_matrix(const string&, const PointCloud2&, autoware::pointcloud_preprocessor::TransformInfo&)’:
/__w/autoware.universe/autoware.universe/sensing/autoware_pointcloud_preprocessor/src/filter.cpp:316:41: error: no matching function for call to ‘autoware_utils_pcl::ManagedTransformBuffer::get_transform(const string&, const _frame_id_type&, rclcpp::Time&, Eigen::Matrix4f&)’
  316 |   if (!managed_tf_buffer_->get_transform(
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
  317 |         target_frame, from.header.frame_id, lookup_time, transform_info.eigen_transform)) {
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /__w/autoware.universe/autoware.universe/install/autoware_utils/include/autoware_utils/ros/managed_transform_buffer.hpp:21,
                 from /__w/autoware.universe/autoware.universe/sensing/autoware_pointcloud_preprocessor/include/autoware/pointcloud_preprocessor/filter.hpp:79,
                 from /__w/autoware.universe/autoware.universe/sensing/autoware_pointcloud_preprocessor/src/filter.cpp:52:
/__w/autoware.universe/autoware.universe/install/autoware_utils_pcl/include/autoware_utils_pcl/managed_transform_buffer.hpp:85:8: note: candidate: ‘bool autoware_utils_pcl::ManagedTransformBuffer::get_transform(const string&, const string&, Eigen::Matrix4f&)’
   85 |   bool get_transform(
      |        ^~~~~~~~~~~~~
/__w/autoware.universe/autoware.universe/install/autoware_utils_pcl/include/autoware_utils_pcl/managed_transform_buffer.hpp:85:8: note:   candidate expects 3 arguments, 4 provided
In file included from /usr/include/c++/11/memory:76,
                 from /__w/autoware.universe/autoware.universe/sensing/autoware_pointcloud_preprocessor/include/autoware/pointcloud_preprocessor/filter.hpp:57,
                 from /__w/autoware.universe/autoware.universe/sensing/autoware_pointcloud_preprocessor/src/filter.cpp:52:
/usr/include/c++/11/bits/unique_ptr.h: In instantiation of ‘typename std::_MakeUniq<_Tp>::__single_object std::make_unique(_Args&& ...) [with _Tp = autoware_utils_pcl::ManagedTransformBuffer; _Args = {autoware::pointcloud_preprocessor::Filter*, bool&, bool&}; typename std::_MakeUniq<_Tp>::__single_object = std::unique_ptr<autoware_utils_pcl::ManagedTransformBuffer>]’:
/__w/autoware.universe/autoware.universe/sensing/autoware_pointcloud_preprocessor/src/filter.cpp:128:80:   required from here
/usr/include/c++/11/bits/unique_ptr.h:962:30: error: no matching function for call to ‘autoware_utils_pcl::ManagedTransformBuffer::ManagedTransformBuffer(autoware::pointcloud_preprocessor::Filter*, bool&, bool&)’
  962 |     { return unique_ptr<_Tp>(new _Tp(std::forward<_Args>(__args)...)); }
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /__w/autoware.universe/autoware.universe/install/autoware_utils/include/autoware_utils/ros/managed_transform_buffer.hpp:21,
                 from /__w/autoware.universe/autoware.universe/sensing/autoware_pointcloud_preprocessor/include/autoware/pointcloud_preprocessor/filter.hpp:79,
                 from /__w/autoware.universe/autoware.universe/sensing/autoware_pointcloud_preprocessor/src/filter.cpp:52:
/__w/autoware.universe/autoware.universe/install/autoware_utils_pcl/include/autoware_utils_pcl/managed_transform_buffer.hpp:66:12: note: candidate: ‘autoware_utils_pcl::ManagedTransformBuffer::ManagedTransformBuffer(rclcpp::Node*, const bool&)’
   66 |   explicit ManagedTransformBuffer(rclcpp::Node * node, const bool & has_static_tf_only)
      |            ^~~~~~~~~~~~~~~~~~~~~~
/__w/autoware.universe/autoware.universe/install/autoware_utils_pcl/include/autoware_utils_pcl/managed_transform_buffer.hpp:66:12: note:   candidate expects 2 arguments, 3 provided
/__w/autoware.universe/autoware.universe/install/autoware_utils_pcl/include/autoware_utils_pcl/managed_transform_buffer.hpp:63:7: note: candidate: ‘autoware_utils_pcl::ManagedTransformBuffer::ManagedTransformBuffer(autoware_utils_pcl::ManagedTransformBuffer&&)’
   63 | class ManagedTransformBuffer
      |       ^~~~~~~~~~~~~~~~~~~~~~
/__w/autoware.universe/autoware.universe/install/autoware_utils_pcl/include/autoware_utils_pcl/managed_transform_buffer.hpp:63:7: note:   candidate expects 1 argument, 3 provided
gmake[2]: *** [CMakeFiles/pointcloud_preprocessor_filter_base.dir/build.make:76: CMakeFiles/pointcloud_preprocessor_filter_base.dir/src/filter.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:205: CMakeFiles/pointcloud_preprocessor_filter_base.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
---
Aborted  <<< autoware_test_utils [1min 17s]

I think this will be passed after autowarefoundation/autoware_utils#50 merged

@technolojin
Copy link
Contributor

technolojin commented Mar 18, 2025

As here any reason to let user select to pick the latest or message time? I thing using message time is the only option to be.

Proposal: do not add option use_pc_stamp_for_dynamic_transform_lookup and implement the message time transformation ONLY.

managed_tf_buffer_ =
std::make_unique<autoware_utils::ManagedTransformBuffer>(this, has_static_tf_only_);
managed_tf_buffer_ = std::make_unique<autoware_utils::ManagedTransformBuffer>(
this, has_static_tf_only_, use_pc_stamp_for_dynamic_transform_lookup_);
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment with taekjin-san.
Do we need transform within current timestamp for pointcloud transforms? If no, we can simply set true in this part.

@badai-nguyen
Copy link
Contributor Author

badai-nguyen commented Mar 18, 2025

@technolojin cc @YoshiRi

As here any reason to let user select to pick the latest or message time? I thing using message time is the only option to be.

Proposal: do not add option use_pc_stamp_for_dynamic_transform_lookup and implement the message time transformation ONLY.

The get_dynamic_transform function is used in different nodes and some node should use the latest timestamp for transform such as distortion_correctorI think. It was the reason I add optional for lookup time.
cc @vividf Could you review the affect of this change to distortion_corrector?

@technolojin
Copy link
Contributor

@technolojin cc @YoshiRi

As here any reason to let user select to pick the latest or message time? I thing using message time is the only option to be.
Proposal: do not add option use_pc_stamp_for_dynamic_transform_lookup and implement the message time transformation ONLY.

The get_dynamic_transform function is used in different nodes and some node should use the latest timestamp for transform such as distortion_correctorI think. It was the reason I add optional for lookup time. cc @vividf Could you review the affect of this change to distortion_corrector?

Those can be co-exist.
As comment of @YoshiRi, setting use_pc_stamp_for_dynamic_transform_lookup_ could be always true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:launch Launch files, scripts and initialization tools. (auto-assigned) component:sensing Data acquisition from sensors, drivers, preprocessing. (auto-assigned) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci)
Projects
Status: To Triage
Development

Successfully merging this pull request may close these issues.

3 participants