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

rtabmap no work (only xtion) -- odometry : could not get transform from camera_link to camera_rgb_optical_frame..

asked 2016-05-30 20:56:42 -0600

JunJun gravatar image

updated 2021-08-09 10:50:52 -0600

matlabbe gravatar image

hello .. i follow rtabmap-ros tutorial.

but program dont work.

http://wiki.ros.org/rtabmap_ros/Tutor...

i only use xtion (openni2). no odmoety no laser.

and i command line

roscore
roslaunch openni2_launch openni2.launch depth_registration:=true
roslaunch rtabmap_ros rgbd_mapping.launch rtabmap_args:="--delete_db_on_start"

output is bottom and gui is black

i think this is problem.

[ WARN] [1464615244.777627115]: odometry: Could not get transform from camera_link to camera_rgb_optical_frame (stamp=1464615244.512744) after 0.200000 seconds ("wait_for_transform_duration"=0.200000)!

i check

rosrun rqt_tf_tree rqt_tf_tree

camera_link -->camera_rgb_frame-->camera_rgb_optical_frame
            --> camera_depth_frame -->camera_depth_optical_frame

i watch simillar question . they have odom --> base_link_-->camera_link..

so i add static tf broadcaster node(base_link -->camera_link) but no work.. and change launch file (frame_id cmaera_link -->base_link) http://official-rtab-map-forum.206.s1...

$ rosrun tf tf_monitor

Frames:
Frame: /camera_depth_frame published by unknown_publisher Average Delay: -0.0993342 Max Delay: 0
Frame: /camera_depth_optical_frame published by unknown_publisher Average Delay: -0.0989423 Max Delay: 0
Frame: /camera_rgb_frame published by unknown_publisher Average Delay: -0.0991952 Max Delay: 0
Frame: /camera_rgb_optical_frame published by unknown_publisher Average Delay: -0.0985974 Max Delay: 0


///////////////////////////////////////////////////////////////////////////////////////////////
* /rosdistro: indigo
* /rosversion: 1.11.10
* /rtabmap/rgbd_odometry/Odom/FillInfoData: true
* /rtabmap/rgbd_odometry/frame_id: camera_link
* /rtabmap/rgbd_odometry/wait_for_transform_duration: 0.2
* /rtabmap/rtabmap/Mem/IncrementalMemory: true
* /rtabmap/rtabmap/Mem/InitWMWithAllNodes: false
* /rtabmap/rtabmap/Mem/SaveDepth16Format: true
* /rtabmap/rtabmap/RGBD/OptimizeFromGraphEnd: false
* /rtabmap/rtabmap/Rtabmap/TimeThr: 0
* /rtabmap/rtabmap/database_path: ~/.ros/rtabmap.db
* /rtabmap/rtabmap/frame_id: camera_link
* /rtabmap/rtabmap/subscribe_depth: True
* /rtabmap/rtabmap/subscribe_scan: False
* /rtabmap/rtabmap/subscribe_scan_cloud: False
* /rtabmap/rtabmap/wait_for_transform_duration: 0.2
* /rtabmap/rtabmapviz/frame_id: camera_link
* /rtabmap/rtabmapviz/subscribe_depth: True
* /rtabmap/rtabmapviz/subscribe_odom_info: True
* /rtabmap/rtabmapviz/subscribe_scan: False
* /rtabmap/rtabmapviz/subscribe_scan_cloud: False
* /rtabmap/rtabmapviz/wait_for_transform_duration: 0.2

NODES
/rtabmap/
rgbd_odometry (rtabmap_ros/rgbd_odometry)
rtabmap (rtabmap_ros/rtabmap)
rtabmapviz (rtabmap_ros/rtabmapviz)

ROS_MASTER_URI=http://localhost:11311

core service [/rosout] found
process[rtabmap/rgbd_odometry-1]: started with pid [34941]
process[rtabmap/rtabmap-2]: started with pid [34942]
process[rtabmap/rtabmapviz-3]: started with pid [34943]
[ INFO] [1464615240.954724732]: Starting node...
[ INFO] [1464615241.074584475]: Setting odometry parameter "Odom/FillInfoData"="true"
[ INFO] [1464615241.281704904]: Starting node...
[ INFO] [1464615241.384123291]: rtabmap: frame_id = camera_link
[ INFO] [1464615241.384244674]: rtabmap: map_frame_id = map
[ INFO] [1464615241.384285855]: rtabmap: queue_size = 10
[ INFO] [1464615241.384331464]: rtabmap: tf_delay = 0.050000
[ INFO] [1464615241.384361071]: rtabmap: depth_cameras = 1
[ INFO] [1464615241.636235974]: rtabmapviz: Using configuration from "/opt/ros/indigo/share/rtabmap_ros/launch/config/rgbd_gui.ini"
[ INFO] [1464615242.353012125]: Setting RTAB-Map parameter "Mem/IncrementalMemory"="true"
[ INFO] [1464615242.355861361]: Setting RTAB-Map parameter "Mem/InitWMWithAllNodes"="false"
[ INFO] [1464615242.539713960]: Setting RTAB-Map parameter "Mem/RehearsalSimilarity"="0.45"
[ INFO] [1464615242.564056420]: Setting RTAB-Map parameter "Mem/SaveDepth16Format"="true"
[ INFO] [1464615243.052447762]: Setting RTAB-Map parameter "RGBD/AngularUpdate"="0.01"
[ INFO] [1464615243.077966419]: Setting RTAB-Map parameter "RGBD/LinearUpdate"="0.01"
[ INFO] [1464615243.225300360]: Setting RTAB-Map parameter "RGBD/OptimizeFromGraphEnd"="false"
[ INFO] [1464615243.283571878]: Reading parameters from the ROS server...
[ INFO] [1464615243.754540264]: 
/rtabmap/rgbd_odometry subscribed to:
/camera/rgb/image_rect_color,
/camera/depth_registered/image_raw,
/camera/rgb/camera_info
[ INFO] [1464615243.876189639]: Setting RTAB-Map parameter "Rtabmap/TimeThr"="0"
[ INFO] [1464615244.215550331]: Parameters read = 0
[ WARN] [1464615244.777627115]: odometry: Could not get transform from camera_link to camera_rgb_optical_frame (stamp=1464615244.512744) after 0.200000 seconds ("wait_for_transform_duration"=0.200000 ...
(more)
edit retag flag offensive close merge delete

Comments

Can you show the output of $ rosrun tf view_frames after launching openni2? The warning says that TF /camera_link to /camera_rgb_optical_frame doesn't exist. Note that /odom -> /camera_link will not be published if this warning is not resolved.

matlabbe gravatar image matlabbe  ( 2016-06-01 16:53:18 -0600 )edit

oh.. Thank you. output is this. link text

JunJun gravatar image JunJun  ( 2016-06-02 08:15:47 -0600 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2016-06-02 10:00:31 -0600

matlabbe gravatar image

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

edit flag offensive delete link more

Comments

1

thank you!! T.T matlabbe i forgot to describe my develop environment. i use vmware and ubuntu 14.04 , ros indigo. i check rosrun tf tf_echo /camera_link /camera_rgb_optical_frame this is ok..

so i try to excute linux pc. not vmware.

linux pc openni2 .. very good play.. i think problem is vmware

JunJun gravatar image JunJun  ( 2016-06-04 01:17:00 -0600 )edit
1

linux pc just. i command line roscore roslaunch openni2_launch openni2.launch depth_registration:=true roslaunch rtabmap_ros rgbd_mapping.launch rtabmap_args:="--delete_db_on_start"

my plan is robot odmetry and xtion --> rgbdslam i want to research your project and imporve !!

JunJun gravatar image JunJun  ( 2016-06-04 01:19:20 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-05-30 20:56:42 -0600

Seen: 2,248 times

Last updated: Aug 09 '21