ros2 / ros2/geometry2

Buffer::lookupTransform hangs with sim time clock

Open
#338 5 comments 0 reactions 1 assignee View on GitHub

@wjwwood is already working on this.

Since Nov 19, 2020.

enhancement help wanted
Dominant language
C++
Stars
153
Forks
256
Avg merge
3d 23h
Merged PRs (30d)
14

Description

Bug report

Required Info:

  • Operating System:
    • Ubuntu 20.04
  • Installation type:
    • binaries
  • Version or commit hash:
    • foxy
Steps to reproduce issue

Start gazebo and provide parameter use_sim_time value true. Create tf2_ros::Buffer with my_node->get_clock().
Then lookupTransform hangs because of time check implementation in canTransform (https://github.com/ros2/geometry2/blob/ros2/tf2_ros/src/buffer.cpp#L183).

There is better example in https://answers.ros.org/question/307682/how-to-set-up-tfbuffer-clock-in-ros-2-so-it-works-with-sim-time/

Additional information
  1. lookupTransform does not freeze with zero timeout.
  2. I am not sure that provided behaviour is an issue. In my projects I construct Buffer with system clocks. So it is not a problem for me now. But there are projects that use rclcpp::Node::get_clock (e.g. https://github.com/introlab/rtabmap_ros/blob/ros2/src/CoreWrapper.cpp#L132). Such projects hang with gazebo. And may be it is their problem. However, imo, if there are problems in several projects, it is better to solve it here. At least giving some words in constructor comments other than * \param clock A clock to use for time and sleeping.
  3. Learning sources of Buffer I found that in lookupTransform method canTransform is called but its return value is not used (https://github.com/ros2/geometry2/blob/ros2/tf2_ros/src/buffer.cpp#L101). Is it correct?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.