introlab / rtabmap_ros

RTAB-Map's ROS package.
http://wiki.ros.org/rtabmap_ros
BSD 3-Clause "New" or "Revised" License
974 stars 557 forks source link

using bluefox #19

Closed ksgaur12 closed 8 years ago

ksgaur12 commented 9 years ago

I am using bluefox camera. I am getting following topic after launching the stereo node of the following driver https://github.com/KumarRobotics/bluefox2

/rosout
/rosout_agg
/stereo/left/camera_info
/stereo/left/image_raw
/stereo/left/image_raw/compressed
/stereo/left/image_raw/compressed/parameter_descriptions
/stereo/left/image_raw/compressed/parameter_updates
/stereo/left/image_raw/compressedDepth
/stereo/left/image_raw/compressedDepth/parameter_descriptions
/stereo/left/image_raw/compressedDepth/parameter_updates
/stereo/left/image_raw/theora
/stereo/left/image_raw/theora/parameter_descriptions
/stereo/left/image_raw/theora/parameter_updates
/stereo/parameter_descriptions
/stereo/parameter_updates
/stereo/right/camera_info
/stereo/right/image_raw
/stereo/right/image_raw/compressed
/stereo/right/image_raw/compressed/parameter_descriptions
/stereo/right/image_raw/compressed/parameter_updates
/stereo/right/image_raw/compressedDepth
/stereo/right/image_raw/compressedDepth/parameter_descriptions
/stereo/right/image_raw/compressedDepth/parameter_updates
/stereo/right/image_raw/theora
/stereo/right/image_raw/theora/parameter_descriptions
/stereo/right/image_raw/theora/parameter_updates

So I update my launch file demo_stereo_outdoor.launch

<launch>
   <param name="use_sim_time" type="bool" value="True"/>

   <!-- Just to uncompress images for stereo_image_rect -->
   <node name="republish_left" type="republish" pkg="image_transport" args="compressed in:=/stereo_camera/left/image_raw raw out:=/stereo_camera/left/image_raw" />
   <node name="republish_right" type="republish" pkg="image_transport" args="compressed in:=/stereo_camera/right/image_raw raw out:=/stereo_camera/right/image_raw" />

   <!-- Run the ROS package stereo_image_proc for image rectification-->
   <group ns="/stereo" >
      <node pkg="nodelet" type="nodelet" name="stereo_nodelet"  args="manager"/>

      <node pkg="stereo_image_proc" type="stereo_image_proc" name="stereo_image_proc">
         <remap from="left/image_raw"    to="left/image_raw"/>
         <remap from="left/camera_info"  to="left/camera_info"/>
         <remap from="right/image_raw"   to="right/image_raw"/>
         <remap from="right/camera_info" to="right/camera_info"/>
      </node>
   </group>

   <!-- STEREO ODOMETRY -->
   <node pkg="rtabmap_ros" type="stereo_odometry" name="stereo_odometry" output="screen">
      <remap from="left/image_rect"       to="/stereo/left/image_rect"/>
      <remap from="right/image_rect"      to="/stereo/right/image_rect"/>
      <remap from="left/camera_info"      to="/stereo/left/camera_info"/>
      <remap from="right/camera_info"     to="/stereo/right/camera_info"/>
      <remap from="odom"                  to="/stereo/odometry"/>

      <param name="frame_id" type="string" value="base_footprint"/>
      <param name="odom_frame_id" type="string" value="odom"/>

      <param name="Odom/InlierDistance" type="string" value="0.1"/>
      <param name="Odom/MinInliers" type="string" value="10"/>
      <param name="Odom/RoiRatios" type="string" value="0.03 0.03 0.04 0.04"/>
      <param name="Odom/MaxDepth" type="string" value="10"/>

      <param name="GFTT/MaxCorners" type="string" value="500"/>
      <param name="GFTT/MinDistance" type="string" value="5"/>
   </node>

   <group ns="rtabmap">   
      <!-- Visual SLAM -->
      <!-- args: "delete_db_on_start" and "udebug" -->
      <node name="rtabmap" pkg="rtabmap_ros" type="rtabmap" output="screen" args="--delete_db_on_start">
         <param name="frame_id" type="string" value="base_footprint"/>
         <param name="subscribe_stereo" type="bool" value="true"/>
         <param name="subscribe_depth" type="bool" value="false"/>

         <remap from="left/image_rect" to="/stereo/left/image_rect_color"/>
         <remap from="right/image_rect" to="/stereo/right/image_rect"/>
         <remap from="left/camera_info" to="/stereo/left/camera_info"/>
         <remap from="right/camera_info" to="/stereo_camera/right/camera_info"/>

         <remap from="odom" to="/stereo_odometer/odometry"/>

         <param name="queue_size" type="int" value="30"/>

         <!-- RTAB-Map's parameters -->
         <param name="Rtabmap/TimeThr" type="string" value="700"/>
         <param name="Rtabmap/DetectionRate" type="string" value="1"/>

         <param name="Kp/WordsPerImage" type="string" value="200"/>
         <param name="Kp/RoiRatios" type="string" value="0.03 0.03 0.04 0.04"/>

         <param name="SURF/HessianThreshold" type="string" value="1000"/>

         <param name="LccBow/MaxDepth" type="string" value="10"/>
         <param name="LccBow/MinInliers" type="string" value="10"/>
         <param name="LccBow/InlierDistance" type="string" value="0.02"/>

         <param name="LccReextract/Activated" type="string" value="true"/>
         <param name="LccReextract/MaxWords" type="string" value="400"/>

         <!-- Disable graph optimization because we use map_optimizer node below -->
         <param name="RGBD/ToroIterations" type="string" value="0"/> 
      </node>

      <!-- Optimizing outside rtabmap node makes it able to optimize always the global map -->
      <node pkg="rtabmap_ros" type="map_optimizer" name="map_optimizer"/>

   </group>

   <!-- RVIZ --> 
   <node pkg="rviz" type="rviz" name="rviz" args="-d $(find rtabmap_ros)/launch/config/stereo_outdoor_demo.rviz"/>

</launch>

But I am getting a warning [ WARN] [1435577740.009374989]: "base_footprint" passed to lookupTransform argument target_frame does not exist.

and getting nothing on RVIZ

rtabmap

please help me solve the problem.

matlabbe commented 9 years ago

You should change the frame_id parameter of each node from base_footprint to the fixed link to which your camera is attached (example camera_link or base_link). What is the TF that your camera driver "bluefox2" is providing? You can run this to see the frames after launching the camera driver:

$ rosrun tf view_frames

The stereo outdoor demo launch file is configured to use inputs from a rosbag. I have updated the Stereo B configuration with an example of launch file with a real camera.

cheers

ksgaur12 commented 9 years ago

I am not much familiar with the tf the output I am getting for $rosrun tf view_frames is this Listening to /tf for 5.000000 seconds Done Listening dot - graphviz version 2.36.0 (20140111.2315)

Detected dot version 2.36 frames.pdf generated

please help me further

matlabbe commented 9 years ago

I think you can drop the frames.pdf in the Github comment box so we can see your frames. To learn more about TF, see http://wiki.ros.org/tf/Tutorials/Introduction%20to%20tf

Well, I've recently added a new launch file for testing stereo cameras for convenience. See stereo_mapping.launch. I can't test it here for bluefox2 camera, but based on bluefox2 launch file, it maybe something like that:

$ roslaunch bluefox2 stereo_node.launch camera:=stereo_camera
$ roslaunch rtabmap_ros stereo_mapping.launch frame_id:=stereo_camera
ksgaur12 commented 9 years ago

I did $ rosrun rqt_tf_tree rqt_tf_tree it shows no tf data received.

matlabbe commented 9 years ago

Can you try launching the two launch files above and see what are the errors?

If a TF is still required, you can generate one. Example:

$ roslaunch bluefox2 stereo_node.launch camera:=stereo_camera
$ rosrun tf static_transform_publisher 0 0 0 -1.57079 0 -1.57079  base_link stereo_camera 100
$ roslaunch rtabmap_ros stereo_mapping.launch frame_id:=base_link

(the static transform publisher rotates at the same time the camera to put it in the world frame)