Skip to content

Range sensor layer can't transform from odom to range_sensor_link #2975

@arslogavitabrevis

Description

@arslogavitabrevis

Required Info:

  • Operating System: Ubuntu 20.04

  • ROS2 Version: Galactic binaries

  • Version or commit hash: 1.08

  • DDS implementation: Default

Steps to reproduce issue

  1. Add some range sensor to the gazebo model
  2. Add a RangeSensorLayer plugin to the local costmap
  3. Run the simulation
  4. You should get the messages "Range sensor layer can't transform from odom to range_sensor_link" sometime in the terminal.

Expected behavior

It should have a similar behavior than the "ObstacleLayer" pluging when dealing with the update rate of the odom->base_footprint frame instead.

Actual behavior

It seem that the range messages that can't have a transform from odom to range_sensor_link are discarded.

Additional information

I add to the range_sensor_layer.cpp a fallback canTransform check for the latest tranform in the range sensor layer for my test and it did seem to work well, but I know this is probably not a good solution as the transforms can be wrong if they are too old.

if (!tf_->canTransform(
        in.header.frame_id, global_frame_, tf2_ros::fromMsg(in.header.stamp)))
{
  if (!tf_->canTransform(
          in.header.frame_id, global_frame_, rclcpp::Time()))
  {
    RCLCPP_INFO(
        logger_, "Range sensor layer can't transform from %s to %s",
        global_frame_.c_str(), in.header.frame_id.c_str());
    return;
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions