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

Replaying mutli camera rosbag file for rtabmap os

asked 2021-02-25 07:58:18 -0500

nedo99 gravatar image

updated 2021-02-25 09:56:54 -0500

Hello,

I am trying to replay data via rosbag from 2 realsense D435 cameras for rtabmap algorithm. Running it on the host where cameras are connected is working fine and I am getting data. rosrun tf view_frames produces this graph. Launch file will be posted below.

I want to run rtabmap on another host where I don't have the cameras connected. I recorded the rosbag file with rosbag record -O out.bag /tf /tf_static /camera1/nodelet_manager1/bond /camera2/nodelet_manager2/bond /camera2/aligned_depth_to_color/image_raw /camera1/aligned_depth_to_color/image_raw /camera2/color/image_raw /camera2/color/camera_info /camera1/color/image_raw /camera1/color/camera_info.

When I replay the rosbag file rosbag play out.bag --clock and start the launch file (in offline mode) on another host, I am getting following warning: Warning: TF_OLD_DATA ignoring data from the past for frame camera2_link at time 1.61372e+09 according to authority unknown_publisher Possible reasons are listed at http://wiki.ros.org/tf/Errors%20explained at line Warning: 277 in /tmp/binarydeb/ros-melodic-tf2-0.6.5/src/buffer_core.cpp In the replay case, I am getting this graph.

Which step along the way did I miss, or did wrong? Any help appreciated.

Regards, Nedim

Launch file I am using:

<!-- Multi-cameras demo  -->
<launch>

<!-- Choose visualization -->
<arg name="rviz"       default="false" />
<arg name="rtabmapviz" default="false" />
<arg name="offline"          default="false"/>
<!-- Cameras -->
<include unless="$(arg offline)" file="$(find realsense2_camera)/launch/rs_camera.launch">
 <arg name="camera" value="camera1" />
 <arg name="serial_no" value="11111111"/>
 <arg name="align_depth" value="true" />
</include>

<include unless="$(arg offline)" file="$(find realsense2_camera)/launch/rs_camera.launch">
 <arg name="camera" value="camera2" />
 <arg name="serial_no" value="2222222"/>
 <arg name="align_depth" value="true" />
</include>


<!-- Frames: Cameras are placed at 90 degrees, clockwise x, y, z , Rz, Ry, Rx -->
<node pkg="tf" type="static_transform_publisher" name="base_to_camera1_tf"
   args=" 0.17 0.0 0.27 0.0 0.0 0.0 /base_link /camera1_link 100" />
<node pkg="tf" type="static_transform_publisher" name="base_to_camera2_tf"
   args="0.0 -0.17 0.27 -1.570796326 0.0 0.0 /base_link /camera2_link 100" />

 <!-- sync rgb/depth images per camera -->
 <group ns="camera1">
  <node pkg="nodelet" type="nodelet" name="nodelet_manager1" args="manager"/>
   <node pkg="nodelet" type="nodelet" name="rgbd_sync1" args="load rtabmap_ros/rgbd_sync nodelet_manager1">
    <remap from="rgb/image"       to="color/image_raw"/>
    <remap from="depth/image"     to="aligned_depth_to_color/image_raw"/>
    <remap from="rgb/camera_info" to="color/camera_info"/>
    <param name="approx"          value="false"/>
  </node>
  </group>
 <group ns="camera2">
 <node pkg="nodelet" type="nodelet" name="nodelet_manager2" args="manager"/>
  <node pkg="nodelet" type="nodelet" name="rgbd_sync2" args="load rtabmap_ros/rgbd_sync nodelet_manager2">
    <remap from="rgb/image"       to="color/image_raw"/>
    <remap from="depth/image"     to="aligned_depth_to_color/image_raw"/>
    <remap from="rgb/camera_info" to="color/camera_info"/>
    <param name="approx"          value="false"/>
  </node>
  </group>

 <group ns="rtabmap">

 <!-- Odometry -->
 <node pkg="rtabmap_ros" type="rgbd_odometry" name="rgbd_odometry ...
(more)
edit retag flag offensive close merge delete

Comments

Is parameter use_sim_time set to true?

matlabbe gravatar image matlabbe  ( 2021-02-25 13:33:17 -0500 )edit

I set it to true and I am not getting a transform warning. I am only getting:

Warning: Warning: TF_OLD_DATA ignoring data from the past for frame camera1_link at time 1.61372e+09 according to authority unknown_publisher
Possible reasons are listed at http://wiki.ros.org/tf/Errors%20explainedTF_OLD_DATA ignoring data from the past for frame camera1_link at time 1.61372e+09 according to authority unknown_publisher
Possible reasons are listed at http://wiki.ros.org/tf/Errors%20explained

         at line          at line 277277 in  in /tmp/binarydeb/ros-melodic-tf2-0.6.5/src/buffer_core.cpp/tmp/binarydeb/ros-melodic-tf2-0.6.5/src/buffer_core.cpp

I am still not getting anything being drawn in rviz.

nedo99 gravatar image nedo99  ( 2021-02-26 01:38:30 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-03-02 06:33:56 -0500

nedo99 gravatar image

Hi,

Figured out the issue. At least partly. The replay ros bag was short and I kept replaying it (either manually or with --loop parameter). When it starts the second time that is when the issue with timestamp starts and nothing gets received.

With the first run, mapData is there and it is visible.

Regards, Nedim

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2021-02-25 07:58:18 -0500

Seen: 189 times

Last updated: Mar 02 '21