Ask Your Question
0

rtabmap_ros how to set odometry and camera?

asked 2016-06-07 09:52:50 -0600

JunJun gravatar image

updated 2016-06-09 14:05:08 -0600

matlabbe gravatar image

Hello

i try to xtion, kobuki(2 wheel mobile robot).

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

and apply my launch.

i modify rgbd_mapping.launch.and program work normally.

  <arg name="subscribe_scan"          default="true"/>         <!-- Assuming 2D scan if set, rtabmap will do 3DoF mapping instead of 6DoF -->
  <arg name="scan_topic"              default="/kinect_scan"/>

  <arg name="subscribe_scan_cloud"    default="false"/>         <!-- Assuming 3D scan if set -->
  <arg name="scan_cloud_topic"        default="/scan_cloud"/>

  <arg name="visual_odometry"         default="false"/>          <!-- Generate visual odometry -->
  <arg name="odom_topic"              default="/odom"/>         <!-- Odometry topic used if visual_odometry is false -->

  <!-- Kinect cloud to laser scan  11cm 16cm-->
    <node pkg="depthimage_to_laserscan" type="depthimage_to_laserscan" name="depthimage_to_laserscan">
      <remap from="image"     to="/camera/depth_registered/image_raw"/>
      <remap from="camera_info" to="/camera/depth_registered/camera_info"/>
      <remap from="scan" to="/kinect_scan"/>
      <param name="range_max" type="double" value="4"/>
    </node>
<node pkg="tf" type="static_transform_publisher" name="odom_camera_tf" args="0.11 0 0.16 0 0 0 1 /base_footprint /camera_link 100" />

but result is strange.

first. set my xtion from robot ( 0.11cm, 0, 0.16cm) so i add tf broadcaster.

<node pkg="tf" type="static_transform_publisher" name="odom_camera_tf" args="0.11 0 0.16 0 0 0 1 /base_footprint /camera_link 100"/>

result is below link.

https://plus.google.com/1106177581457...

1.point cloud and map cloud is different.

is the result normal??

2.map is bad when robot turn a round and go to origin.

https://plus.google.com/1106177581457...

full launch file.

<launch>
  <!-- Your RGB-D sensor should be already started with "depth_registration:=true".
        Examples:
           $ roslaunch freenect_launch freenect.launch depth_registration:=true 
           $ roslaunch openni2_launch openni2.launch depth_registration:=true -->


  <!-- Choose visualization -->
  <arg name="rviz"                    default="false" />
  <arg name="rtabmapviz"              default="true" /> 

  <!-- Localization-only mode -->
  <arg name="localization"            default="false"/>

  <!-- Corresponding config files -->
  <arg name="rtabmapviz_cfg"          default="-d $(find rtabmap_ros)/launch/config/rgbd_gui.ini" />
  <arg name="rviz_cfg"                default="-d $(find rtabmap_ros)/launch/config/rgbd.rviz" />

  <arg name="frame_id"                default="camera_link"/>   <!-- Fixed frame id, you may set "base_link" or "base_footprint" if they are published -->
  <arg name="time_threshold"          default="0"/>             <!-- (ms) If not 0 ms, memory management is used to keep processing time on this fixed limit. -->
  <arg name="optimize_from_last_node" default="false"/>         <!-- Optimize the map from the last node. Should be true on multi-session mapping and when time threshold is set -->
  <arg name="database_path"           default="~/.ros/rtabmap.db"/>
  <arg name="rtabmap_args"            default=""/>              <!-- delete_db_on_start, udebug -->
  <arg name="launch_prefix"           default=""/>              <!-- for debugging purpose, it fills launch-prefix tag of the nodes -->

  <arg name="rgb_topic"               default="/camera/rgb/image_rect_color" />
  <arg name="depth_registered_topic"  default="/camera/depth_registered/image_raw" />
  <arg name="camera_info_topic"       default="/camera/rgb/camera_info" />
  <arg name="compressed"              default="false"/>
  <arg name="convert_depth_to_mm"     default="true"/>

  **<arg name="subscribe_scan"          default="true"/>         <!-- Assuming 2D scan if set, rtabmap will do 3DoF mapping instead of 6DoF -->
  <arg name="scan_topic"              default="/kinect_scan"/>**

  <arg name="subscribe_scan_cloud"    default="false"/>         <!-- Assuming 3D scan if set -->
  <arg name="scan_cloud_topic"        default="/scan_cloud"/>

  <arg name="visual_odometry"         default="false"/>          <!-- Generate visual odometry -->
  <arg name="odom_topic"              default="/odom"/>         <!-- Odometry topic used if visual_odometry is false -->

  <arg name="namespace"               default="rtabmap"/>
  <arg name="wait_for_transform"      default="0.2"/>


  <!-- Kinect cloud to laser scan  11cm 16cm-->
    <node pkg="depthimage_to_laserscan ...
(more)
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2016-06-07 10:50:51 -0600

JunJun gravatar image

Oh.. i found problem.

i didnt change frame_id.

"frame_id" default="camera_link"

i change camera_link --> base_footprint.

1.point cloud and map cloud is different. solved!!

edit flag offensive delete link more
0

answered 2016-06-09 14:13:32 -0600

matlabbe gravatar image

Hi,

For your point 2. maybe no loop closures were found so the map is not corrected. Since you use a fake scan from Kinect, you may lower the Icp/CorrespondenceRatio (set to 0.25 in your launch). Don't decrease it below 0.1 as lower the threshold is, better chance to accept a wrong transformation.

To know if there are loop closures in the map, you can add the rtabmap_ros/MapGraph display in RVIZ. The red links are the loop closure links (blue links are odometry links). You can also look at the terminal for possible warnings telling if a loop closure is rejected.

cheers

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-06-07 09:52:50 -0600

Seen: 726 times

Last updated: Jun 09 '16