3D reconstruction with stereo cameras
Dear ROS community!
I've started to built a stereo camera system to reconstruct the field of view. I use two Logitech C270 webcameras on a base stand to get the image streams. (Here you can see the prototype: https://www.youtube.com/watch?v=vypIr... )
For the project it's necessary to hold the camera optics as close as I can, so I've turned one camera vertically. I use video_stream_opencv package to get and rotate the images and also to send them to the other nodes.
Because of the further operations and to save some hardware resources, I thought it's necessary to synchronize the images' and camera info's timestamps before calibration, rectification etc., so I've created a synchronization node which uses approximate synchronization between the image frames and camera info messages, and it also republishes the data with the same timestamps. I thought that after the synchronization won't be necessary to use the approx_sync, but I think I was wrong. To test the system I also started to use a static Tf publisher.
Anyway, I couldn't get out some point cloud from the system, however in the terminal a warning message appears frequently:
odometry: Could not get transform from base_link to left (stamp=1506788450.735916) after 0.200000 seconds ("wait_for_transform_duration"=0.200000)! Error=". canTransform returned after 0.202835 timeout was 0.2.
I suspect to the static TF publisher, but I'm not sure.
Here is my launch file:
<launch> <arg name="fps" default="25"/>
<!-- Synchronization -->
<arg name="syncronizer_namespace" default="/syncronizer"/>
<arg name="left_camera_raw" default="$(arg syncronizer_namespace)/left" />
<arg name="right_camera_raw" default="$(arg syncronizer_namespace)/right" />
<arg name="left_camera_info_topic" default="$(arg syncronizer_namespace)/left/camera_info" />
<arg name="right_camera_info_topic" default="$(arg syncronizer_namespace)/right/camera_info" />
<!-- Stereo -->
<arg name="stereo_namespace" default="/stereo_camera"/>
<arg name="left_image_topic" default="$(arg stereo_namespace)/left/image_rect" />
<arg name="right_image_topic" default="$(arg stereo_namespace)/right/image_rect" />
<arg name="approx_sync" default="true"/>
<arg name="queue_size" default="5"/>
<!-- Tranfsorm -->
<arg name="use_static_transform" default="true"/>
<!-- 2D visualization -->
<arg name="visualize" default="false"/>
<arg name="show_raw" default="true"/>
<arg name="show_disparity" default="true"/>
<!-- Visual SLAM -->
<arg name="frame_id" default="base_link"/> <!-- Fixed frame id, set "base_link" or "base_footprint" if they are published -->
<arg name="rtabmap" default="true"/>
<arg name="odometry" default="true"/>
<!-- Odometry -->
<arg name="odom_frame_id" default="odom"/> <!-- If set, TF is used to get odometry instead of the topic -->
<arg name="ground_truth_frame_id" default=""/> <!-- e.g., "world" -->
<arg name="ground_truth_base_frame_id" default=""/> <!-- e.g., "tracker", a fake frame matching the frame "frame_id" (but on different TF tree) -->
<arg name="wait_for_transform" default="true"/>
<arg name="wait_for_transform_duration" default="0.2"/>
<!-- 3D visualization -->
<arg name="rviz" default="false"/>
<arg name="rtabmapviz" default="true"/>
<arg name="localization" default="false"/>
<arg name="time_threshold" default="0"/>
<arg name="optimize_from_last_node" default="false"/>
<arg name="launch_prefix" default=""/>
<arg name="convert_depth_to_mm" default="true"/>
<arg name="subscribe_scan" default="true"/>
<arg name="subscribe_scan_cloud" default="false"/>
<arg name="scan_cloud_topic" default="/scan_cloud"/>
<arg name="visual_odometry" default="true"/>
<arg name="camera_info" default="camera_info"/>
<!--*******************************************************************************************-->
<!-- Core functionality ***********************************************************************-->
<!--*******************************************************************************************-->
<!-- Camera -->
<group ns="/camera">
<node pkg="nodelet" type="nodelet" name="stereo_camera_nodelet ...
I don't know if it's the cause, but the last arg there is the period, not the rate. So
static_transform_publisher
(STP) is publishing at 10 Hz here.Try STP from
tf2
.I tried to use tf2 but unfortunately it didn't help.