Could not get transform from base_link to /camera_rgb_optical_frame

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Could not get transform from base_link to /camera_rgb_optical_frame

beckhz
Hi guys!

I have a rgbd camera broadcasting on the following:


and I have modified my launch file on the following:


This is my frames:


any idea what I could do? I understand its an issue with tf ? any help is super appreciated! thx!
Reply | Threaded
Open this post in threaded view
|

Re: Could not get transform from base_link to /camera_rgb_optical_frame

matlabbe
Administrator
Hi,

It seems ok to me. Does the hand-held tutorial work?

The only thing I see is that the warnings have stamp 1.2 sec after the stamp in the topic. With a wait_for_transform_duration of 0.1 sec, the warning would appear ~100 ms after the stamp.

Is the mapping node running on the same computer than the camera? If not, make sure the clocks are synchronized (e.g., ntpdate).

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: Could not get transform from base_link to /camera_rgb_optical_frame

beckhz
My camera is not suitable for the hand-held tutorials, cannot be recognized.
The node and my camera both working on the same computer
I`ve modified frame_id "base_link"->"camera_rgb_optical_frame", and i got this:

My rviz has something wrong with the map, and the rtabmapviz shows nothing:

Any help is super appreciated! thx!
Reply | Threaded
Open this post in threaded view
|

Re: Could not get transform from base_link to /camera_rgb_optical_frame

matlabbe
Administrator
Hi,

There is something strange with TF. You could try to increase "wait_for_transform_duration" parameter for rtabmap and rgbd_odometry nodes to 1 or 2 sec. However, if TF delays are so long, there would be lags in RVIZ. frame_id should be the root fixed frame of the robot, which is /base_link in your case.

/map -> /odom (rtabmap) and /odom -> /base_link (rgbd_odometry) should be working to see something on RVIZ. I think /map ->/odom is not published because rtabmap update aborted (because of missing TF). Odometry seems working, as the logs of Odom are showing quality > 0. If you set fixed frame in RVIZ to /odom, you would see the camera moving.

Not sure why rgbd_odometry works, but not rtabmap in this case. You can copy paste the launch here using Raw text mode (see More button).

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: Could not get transform from base_link to /camera_rgb_optical_frame

beckhz
I copied the launch file from this turtorial:http://wiki.ros.org/rtabmap_ros/Tutorials/SetupOnYourRobot#Kinect

And modified like this:
<launch>
  <group ns="rtabmap">
   
    <node pkg="rtabmap_ros" type="rgbd_odometry" name="rgbd_odometry" output="screen">
      <remap from="rgb/image"       to="/camera/rgb/image_rect_color"/>
      <remap from="depth/image"     to="/camera/depth_registered/image_raw"/>
      <remap from="rgb/camera_info" to="/camera/depth_registered/camera_info"/>
      < param name="frame_id" type="string" value="base_link"/>
      < param name="wait_for_transform_duration" type="double" value="2"/>
    </node>

    <node name="rtabmap" pkg="rtabmap_ros" type="rtabmap" output="screen" args="--delete_db_on_start">
          < param name="frame_id" type="string" value="base_link"/>
          < param name="subscribe_depth" type="bool" value="true"/>
          <remap from="odom" to="odom"/>
          <remap from="rgb/image" to="/camera/rgb/image_rect_color"/>
          <remap from="depth/image" to="/camera/depth_registered/image_raw"/>
          <remap from="rgb/camera_info" to="/camera/rgb/camera_info"/>
          < param name="queue_size" type="int" value="10"/>
          < param name="wait_for_transform_duration" type="double" value="2"/>

         
          < param name="RGBD/AngularUpdate" type="string" value="0.01"/>
          < param name="RGBD/LinearUpdate" type="string" value="0.01"/>
          < param name="Rtabmap/TimeThr" type="string" value="700"/>
          < param name="Mem/RehearsalSimilarity" type="string" value="0.45"/>
          < param name="RGBD/OptimizeFromGraphEnd" type="string" value="true"/>
    </node>

    <node pkg="tf" type="static_transform_publisher" name="base_to_camera"
args="0 0 0 0 0 0 /base_link /camera_link 100"/>
   
  </group>
</launch>

Still got warnning:
odometry:Could not get transform from base_link to camera_rgb_optical_frame
And rviz still not working

I`m confused about my tf tree that miss the /map -> /odom. Is there any problem in my launch file?
Any help is super appreciated! thx!
Reply | Threaded
Open this post in threaded view
|

Re: Could not get transform from base_link to /camera_rgb_optical_frame

matlabbe
Administrator
Hi,

Just tried your launch file with a kinect and it works (tested with Ubuntu 14.04/Indigo binaries like your setup I think):
<launch>

<!-- Camera -->
<include file="$(find freenect_launch)/launch/freenect.launch">
    <arg name="depth_registration" value="True" />
</include>


  <group ns="rtabmap">
   
    <node pkg="rtabmap_ros" type="rgbd_odometry" name="rgbd_odometry" output="screen">
      <remap from="rgb/image"       to="/camera/rgb/image_rect_color"/>
      <remap from="depth/image"     to="/camera/depth_registered/image_raw"/>
      <remap from="rgb/camera_info" to="/camera/depth_registered/camera_info"/>
      <param name="frame_id" type="string" value="base_link"/>
      <param name="wait_for_transform_duration" type="double" value="2"/>
    </node>

    <node name="rtabmap" pkg="rtabmap_ros" type="rtabmap" output="screen" args="--delete_db_on_start">
          <param name="frame_id" type="string" value="base_link"/>
          <param name="subscribe_depth" type="bool" value="true"/>
          <remap from="odom" to="odom"/>
          <remap from="rgb/image" to="/camera/rgb/image_rect_color"/>
          <remap from="depth/image" to="/camera/depth_registered/image_raw"/>
          <remap from="rgb/camera_info" to="/camera/rgb/camera_info"/>
          <param name="queue_size" type="int" value="10"/>
          <param name="wait_for_transform_duration" type="double" value="2"/>

         
          <param name="RGBD/AngularUpdate" type="string" value="0.01"/>
          <param name="RGBD/LinearUpdate" type="string" value="0.01"/>
          <param name="Rtabmap/TimeThr" type="string" value="700"/>
          <param name="Mem/RehearsalSimilarity" type="string" value="0.45"/>
          <param name="RGBD/OptimizeFromGraphEnd" type="string" value="true"/>
    </node>

    <node pkg="tf" type="static_transform_publisher" name="base_to_camera"
args="0 0 0 0 0 0 /base_link /camera_link 100"/>
   
  </group>

</launch>

rtabmap won't publish /map->/odom if input topics are not received or if there is a TF error. If you have odometry working and not rtabmap with this launch file, the only difference is the camera_info topic (one is subscribed to /camera/rgb/camera_info and the other to /camera/depth_registered/camera_info). Otherwise, the error may be related to hardware used, you may try with the camera connected on a laptop and the same launch file.

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: Could not get transform from base_link to /camera_rgb_optical_frame

beckhz
Thank you very much for your help!
I noticed that my camera driver is non-standard node for ROS. Next, I'll contact the camare supplier,hope that my problem can be solved.
Thank you again for your help!