fmrico / book_ros2

550 stars 112 forks source link

Requesting hints for exercise question #21

Closed sam-tj closed 1 year ago

sam-tj commented 1 year ago

Important!!!

Type of bug

Issue Description

I was going through the exercise available for Chapter 4 - The TF system and would like to get some hints for the 1st question. I understood the question about subtracting current frame from previous frame but the problem is about how to get access to previous frame.

Additionally the code on page 78 odom2laser_msg = tf_buffer_.lookupTransform("odom", "base_laser_link", msg->header.stamp, rclcpp::Duration(200ms));

It doesn't work for humble. It gives the following error: error: no matching function for call to ‘tf2::BufferCore::lookupTransform(const char [5], const char [16], const TimePoint&, rclcpp::Duration)’ Somehow lookupTransform() function is not working for me. I even referred the following. https://docs.ros.org/en/humble/Tutorials/Intermediate/Tf2/Time-Travel-With-Tf2-Cpp.html

fmrico commented 1 year ago

Hi @sam-tj

I have just updated the br2_tf2_detector example for the option to add this timeout. Please, check it.

Reopen if the problem persists.

Best