ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

My assumption about tf was wrong, the solution was indeed related to laser_geometry. As described here, the Projector uses start and end time of the scan and therefore asks for a timestamp in the future.

So to wait long enough, the call to waitForTransform should be:

if(!gTfListener->waitForTransform(
           scan->header.frame_id,
           "camera",
            scan->header.stamp + ros::Duration().fromSec(scan->ranges.size()*scan->time_increment),
            ros::Duration(2.0),
            ros::Duration(0.01),
            &error_msg))

My assumption about tf was wrong, the solution was indeed related to laser_geometry. As described here, the Projector uses start and end time of the scan and therefore asks for a timestamp in the future.

So to wait long enough, the call to waitForTransform should be:

if(!gTfListener->waitForTransform(
          scan->header.frame_id,
          "camera",
           scan->header.stamp + ros::Duration().fromSec(scan->ranges.size()*scan->time_increment),
           ros::Duration(2.0),
           ros::Duration(0.01),
           &error_msg))

My assumption about tf was wrong, the solution was indeed related to laser_geometry. As described here, the Projector uses start and end time of the scan and therefore asks for a timestamp in the future.

So to wait long enough, the call to waitForTransform should be:

if(!gTfListener->waitForTransform(
        scan->header.frame_id,
        "camera",
         scan->header.stamp + ros::Duration().fromSec(scan->ranges.size()*scan->time_increment),
         ros::Duration(2.0),
         ros::Duration(0.01),
         &error_msg))