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

3D map with RTAB, SICK, IMU and Husky A200

asked 2016-08-23 18:20:24 -0600

Marcus Barnet gravatar image

updated 2016-08-23 19:04:36 -0600

I'm continuing my work on 3D map building as specified in my old topic.

Finally, I mounted my sensors (IMU, SICK and RealSense R200) on a mobile robot (Husky A200) an I'm doing some acquisitions outdoor; in particular, the IMU is mounted on the center of the robot frame, the SICK laser is mounted 10 centimeters at the top of the IMU sensor and the RealSense is mounted 40 centimeters on the top of the laser sensor.

Now, I have the /odometry/filtered topic which is a combination of wheels encoders and IMU data. I added the laser information in this way:

  <arg name="subscribe_scan"          default="true"/>
  <arg name="scan_topic"              default="/scan"/>

inside the rgbd_mapping.launch file and I run the RTAB algorithm with these commands:

$ roscore
$ rosparam set use_sim_time true
$ roslaunch rtabmap_ros rgbd_mapping.launch rgb_topic:=/camera/color/image_raw depth_registered_topic:=/camera/depth/image_raw camera_info_topic:=/camera/color/camera_info compressed:=true frame_id:=base_link rtabmap_args:="--delete_db_on_start" estimation:=1
$ rosbag play --clock test1.bag (the bag contains both realsense and laser data)

How can I add the filtered odometry which contains also the IMU data? Is there anything which I have to change/add in the rgbd_mapping.launch file?

Moreover, I tried to check the tf and frames for all sensors and I cannot see the laser frame. Moreover, the real sense frame is not a child of base_link.

How can I fix this frame problem? This is the frames.pdf file. The frame tree is suitable for the RTAB algorithm?

What happens if the robot has to face terrain disparity? The /odometry/filtered based on IMU sensor is able to compensate the disparity by adjusting the laser and the real sense data according with the tilt angle?

This is my rgbd_mapping.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" /> 

  <!-- 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="/scan"/>

  <arg name ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-08-23 19:39:53 -0600

mjedmonds gravatar image

updated 2016-08-23 19:40:18 -0600

First, you need to add a calibrated tf between your base_link and your realsense_frame. You can manually measure this and verify it. The robot needs to know where the camera is relative to its other parts.

You may also want to look at the robot_localization package to fuse your rtabmap odometry with the IMU and wheel odometry.

edit flag offensive delete link more

Comments

rosrun tf static_transform_publisher 0 0 0.50 0 0 0 base_link realsense_frame 100

rosrun tf static_transform_publisher 0 0 0.1 0 0 0 base_link laser 100

Do you think it should be correct?

/odometry/filtered is the output of robot_localization, how can I use it as input for RTAB?

Marcus Barnet gravatar image Marcus Barnet  ( 2016-08-24 02:35:59 -0600 )edit

/odometry/filtered already contains the wheel odometry fused with the IMU data. I need to use this as input for RTAB, but I don't know how to set this inside rgbd_mapping.launch file.

Marcus Barnet gravatar image Marcus Barnet  ( 2016-08-24 02:38:52 -0600 )edit
1

Using /odometry/filtered as odometry:

<arg name="visual_odometry" default="false"/> <!-- Generate visual odometry -->
<arg name="odom_topic" default="/odometry/filtered"/> <!-- Odometry topic used if visual_odometry is false -->
matlabbe gravatar image matlabbe  ( 2016-08-24 07:44:06 -0600 )edit

Do you think the /odometry/filtered with IMU will improve the rtab algorithm by adding compensation for terrain disparity? I mean for example if the robot climbs or tilt on agricultural terrain.

Marcus Barnet gravatar image Marcus Barnet  ( 2016-08-24 08:16:13 -0600 )edit
1

Not sure what do you mean by terrain disparity, but with IMU you would have 6DoF odometry, instead of 3DoF if using only wheel encoders.

Note also that if you are on a 3D terrain, don't set subscribe_scan to true, as rtabmap assumes you are on a 2d terrain (indoor) if it is true.

matlabbe gravatar image matlabbe  ( 2016-08-24 08:36:49 -0600 )edit

On agricultural terrain, there can be ditches that will cause the robot and the camera to bottom out, and slopes that will tip the robot and the camera over. With 6FoF, the RTAB can compensate this problems by building a more accurate 3D map?

Marcus Barnet gravatar image Marcus Barnet  ( 2016-08-24 09:19:15 -0600 )edit

Moreover, if I'm on a 3D terrain, can't I use /scan topic, then? I noticed that using the laser, the map is improved with more features. Is there a way to add laser information on 3D terrain? Can't I compensate the scan information by adding the IMU data to achieve a 3D laser visualization?

Marcus Barnet gravatar image Marcus Barnet  ( 2016-08-24 09:20:53 -0600 )edit
1

It seems more appropriate to have bottom-out and tipping avoidance be part of your navigation planner, but I'm not an expert on the topic.

However, the way I use robot_localization, I fuse the IMU with the wheel odometry and visual odometry from rtabmap. See the robot_localization package

mjedmonds gravatar image mjedmonds  ( 2016-08-24 11:25:34 -0600 )edit

Thank you for the suggestion. I've read the documentation about the robot_localization package but I didn't understand how it is possible to fuse the filtered odometry (wheels + IMU) with the visual odometry. How do you do this?

Marcus Barnet gravatar image Marcus Barnet  ( 2016-08-24 11:43:14 -0600 )edit
1

You'll add a line like this:

<param name="odom1" value="rtabmap/odom"/>

mjedmonds gravatar image mjedmonds  ( 2016-08-24 12:00:35 -0600 )edit
1

with a corresponding config like this:

<rosparam param="odom1_config">[true, true, false, false, false, true, false, false, false, false, false, false, false, false, false]</rosparam>

mjedmonds gravatar image mjedmonds  ( 2016-08-24 12:01:37 -0600 )edit

You mean I can do it directly inside my rgbd_mapping.launch file? rtabmap/odom is the visual odometry computed by RTAB? Because I think I can specify only one odometry topic inside the rgbd_mapping.launch file.

Marcus Barnet gravatar image Marcus Barnet  ( 2016-08-24 12:28:49 -0600 )edit
1

No, you set those parameters in the robot_localization launch file that's already fusing your IMU and wheel odometery. See an example robot_localization launch file from the package.

mjedmonds gravatar image mjedmonds  ( 2016-08-24 12:45:03 -0600 )edit

The problem is that the robot_localization package is launched by husky_base base.launch file which launches control.launch which starts robot_localization here. How can I modify it?

Marcus Barnet gravatar image Marcus Barnet  ( 2016-08-24 12:55:10 -0600 )edit
1

Not a problem, put the odom configuration in between the <node> tags for robot_localization in the file you linked

mjedmonds gravatar image mjedmonds  ( 2016-08-24 13:21:31 -0600 )edit

Ok I'm going to try it in a while. But if I do this, I will have to record again the bag files by including the Odom configuration in robot_localization? Or can I do it by using the old bag files?

Marcus Barnet gravatar image Marcus Barnet  ( 2016-08-24 13:45:38 -0600 )edit
1

Yes, this is a fundamental change to the odometry/filtered topic, so you will have to rerecord your bags. Any change to the robot's configuration will require a rerecording of any bags.

mjedmonds gravatar image mjedmonds  ( 2016-08-24 14:01:53 -0600 )edit

So, during the recording, do I have to launch also roslaunch rtabmap_ros rgbd_mapping.launch since I need to generete the RTAB visual odometry needed by robot_localization? Is it correct? Or do I need to launch another file?

Marcus Barnet gravatar image Marcus Barnet  ( 2016-08-24 14:06:25 -0600 )edit
1

Yes, that sounds correct, though you know more about your exact configuration than I do.

mjedmonds gravatar image mjedmonds  ( 2016-08-24 14:58:25 -0600 )edit

I added to robot_localization the visual odometry rtabmap/odom as suggested. In rgbd_mapping.launch I had to set to false the visual_odometry: <arg name="visual_odometry" default="false"/> since I had to specify the /odometry/filtered topic.

Marcus Barnet gravatar image Marcus Barnet  ( 2016-08-24 17:21:18 -0600 )edit

But, now, when I launch the rgbd_mapping.launch file, will it create the visual odometry rtabmap/odom even if I set it to false? Does it make sense to use visual odometry in robot_localization if it is not generated by rgbd_mapping? Or the visual odometry is always published by RTAB?

Marcus Barnet gravatar image Marcus Barnet  ( 2016-08-24 17:24:52 -0600 )edit
1

Be aware that you should set publish_tf to false for the visual odometry if you want to integrate to robot_localization (which also publishes /odom->/base_link). You may also prefer to copy the <node> you want in another launch file than using rgbd_mapping.launch.

matlabbe gravatar image matlabbe  ( 2016-08-24 18:00:37 -0600 )edit
1

You can take also a look at the sensor_fusion.launch example for an integration of IMU/vo and robot_localization.

matlabbe gravatar image matlabbe  ( 2016-08-24 18:01:06 -0600 )edit

I'm getting confusing. When I lunch my robot roslaunch husky_base base.launch, base.launch launches control.launch which launches robot_localization package in this way.

Marcus Barnet gravatar image Marcus Barnet  ( 2016-08-25 02:50:27 -0600 )edit

This is my modified control.launch. This is my rgbd_mapping.launch. How can I use the sensor_fusion.launch? I see it calls again ekf_localization_node. Should I don't use the control.launch file?

Marcus Barnet gravatar image Marcus Barnet  ( 2016-08-25 02:54:12 -0600 )edit

If I use the modified control.launch, robot_localization will require the visual odometry, too, in order to generete /odometry/filtered. But RTAB won't generete the visual_odometry since it is already set to false because I use /odometry/filtered in rgbd_mapping.launch. Is it correct?

Marcus Barnet gravatar image Marcus Barnet  ( 2016-08-25 07:44:31 -0600 )edit
1

It would be less complicated using the rtabmap's nodes directly, not the launch files. You may copy the nodes in control.launch if you want. rgbd_mapping.launch and sensor_fusion.launch files are "examples" on how to use the nodes.

matlabbe gravatar image matlabbe  ( 2016-08-25 10:08:16 -0600 )edit

I included the RTAB node and this is the control-new.launch file, is it OK? I don't know if I have to use /vo or rtabmap/odom as parameter in robot_localization node. How to pass the correct visual odometry to robot_localization?help me please

Marcus Barnet gravatar image Marcus Barnet  ( 2016-08-25 10:49:14 -0600 )edit
1

The numbering for each fused source should start at 0, as the robot_localization documentation indicates. So if rtabmap is your own odometry source, you should set it be 'odom0' and 'odom0_config'. However, you said you were also integrating wheel odometry, which can be a twist or odometry input.

mjedmonds gravatar image mjedmonds  ( 2016-08-25 12:22:07 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-08-23 18:20:24 -0600

Seen: 831 times

Last updated: Aug 23 '16