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

Hi,

You don't need to add a transform /base_link -> /camera_link. In the tutorial, the frame_id is set to /camera_link by default. However, the transform /camera_link -> /camera_rgb_optical_frame should exist (10 Hz). Is the following work?

$ rostun tf tf_echo /camera_link /camera_rgb_optical_frame

If so, I don't see the problem. The odometry error is detected from this waitForTransform():

// TF ready?
Transform transform;
try
{
    if(waitForTransform_ && !stamp.isZero() && waitForTransformDuration_ > 0.0)
    {
        if(!tfListener_.waitForTransform(fromFrameId, toFrameId, stamp, ros::Duration(waitForTransformDuration_)))
        {
            ROS_WARN("odometry: Could not get transform from %s to %s (stamp=%f) after %f seconds (\"wait_for_transform_duration\"=%f)!",
                    fromFrameId.c_str(), toFrameId.c_str(), stamp.toSec(), waitForTransformDuration_, waitForTransformDuration_);
            return transform;
        }
    }

    tf::StampedTransform tmp;
    tfListener_.lookupTransform(fromFrameId, toFrameId, stamp, tmp);
    transform = rtabmap_ros::transformFromTF(tmp);
}
catch(tf::TransformException & ex)
{
    ROS_WARN("%s",ex.what());
}

cheers