Added obstacles to rtabmap projected map

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Added obstacles to rtabmap projected map

sanjfir3
This post was updated on .
Hi,

I'm trying to use RTABMap to create a 2D Occupancy Grid that contains obstacles like tables, and chairs. In its current state, the 3D map looks good and well represents the environment. The tables look good and are the correct shape. The grid is made by the 2D laser scanner so does the walls and any tables that are covered with a table cloth.

The main problem is the projected map. The walls line up well with the grid map but the tables have some lines associated with them but they can't really be seen in the map. Like "Grid/FromDepth" is set in some example launch files but it seems to be used nowhere else.

I was trying to fix this by playing with the Grid settings but i've tried searching the git and grepping the actual file but these settings don't seem to do anything.

My launch file publishes the tf for the robot, publishes the laser scan to topic /scan, the robot odometry to /odom, and then openni2 with depth_registration standard topics. Then these lines are called to launch rtabmap:

<!-- Launch rtabmap -->  
  <group ns="rtabmap">
    <node name="rtabmap" pkg="rtabmap_ros" type="rtabmap" output="screen" args="--delete_db_on_start">  
	<remap from="odom" to="/odom"/>
	<remap from="scan" to="/scan"/>
	<remap from="rgb/image" to="/camera/rgb/image_rect_color"/>
        <remap from="depth/image" to="/camera/depth_registered/image_raw"/>
	<remap from="rgb/camera_info" to="/camera/rgb/camera_info"/>  
        <param name="frame_id"                      type="string" value="base_link"/>
	<param name="odom_frame_id"                 type="string" value="odom"/>
	<param name="wait_for_transform_duration"  type="double" value="0.03"/>
	<param name="subscribe_depth"              type="bool"   value="true"/>
	<param name="subscribe_scan"                type="bool"   value="true"/>
	<param name="rviz"                         type="bool"   value="false"/>
	<param name="rtabmapviz"                    type="bool"   value="true"/>
	<param name="queue_size"                    type="int"    value="10"/>
	<param name="Rtabmap/TimeThr"              type="string" value="700"/>
	<param name="RGBD/NeighborLinkRefining"    type="string" value="true"/>
	<param name="RGBD/AngularUpdate"            type="string" value="0.05"/>
	<param name="RGBD/LinearUpdate"            type="string" value="0.05"/>            
	<param name="RGBD/LocalRadius"             type="string" value="3"/>
	<param name="RGBD/PlanAngularVelocity"     type="string" value="1.0"/>
	<param name="RGBD/OptimizeFromGraphEnd"     type="string" value="false"/>
	<param name="Optimizer/Slam2D"              type="string" value="true"/>
	<param name="Reg/Force3DoF"                 type="string" value="true"/>
	<param name="Reg/Strategy"                 type="string" value="1"/>      
	<param name="Mem/RehearsalSimilarity"      type="string" value="0.30"/>
        <param name="Mem/IncrementalMemory"        type="string" value="true"/>       
	<param name="Grid/FromDepth"               type="string" value="true"/>
	<param name="Grid/DepthMax"                 type="string" value="3.5"/>
	<param name="Grid/DepthMin"                 type="string" value="0.5"/>
	<param name="Grid/FootprintHeight"          type="string" value="2.0"/>
	<param name="Grid/FootprintLength"          type="string" value="0.75"/>
	<param name="Grid/FootprintWidth"          type="string" value="0.75"/>
	<param name="Grid/MapFrameProjection"      type="string" value="true"/>
	<param name="Grid/MaxObstacleHeight"        type="string" value="2.5"/>
	<param name="Grid/NormalsSegmentation"     type="string" value="true"/>
	<param name="Grid/FlatObstacleDetected"    type="string" value="true"/>
	<param name="Grid/MaxGroundAngle"           type="string" value="45"/>
	<param name="Grid/MaxGroundHeight"         type="string" value="0.5"/>
	<param name="Grid/3D"                      type="string" value="true"/>
	<param name="Grid/3DGroundIsObstacle"      type="string" value="false"/>
	<param name="Icp/CorrespondenceRatio"        type="string" value="0.3"/>
	<param name="Vis/InlierDistance"            type="string" value="0.1"/>
	<param name="Vis/MaxDepth"                 type="string" value="3"/>
	<param name="Vis/MinInliers"                type="string" value="5"/>
    </node>
  </group>

Can someone help me with my problem?
Reply | Threaded
Open this post in threaded view
|

Re: Added obstacles to rtabmap projected map

matlabbe
Administrator
Hi,

To insert code, use "More->Raw Text" to better format in the forum. For "Grid/FromDepth" parameter, it is not explicitly set in the launch files because for convenience if rtabmap subscribes to laser scan, it will be false (creating /rtabmap/grid_map from laser scans), otherwise it will be true (creating /rtabmap/grid_map from depth image projection).

Well if subscribed to laser scan, "Grid/FromDepth" can be set to true to force the 2D grid map to be created from the depth image. Do you have screenshots to compare between "Grid/FromDepth" set to true and false (maybe in comparison to MapCloud in RVIZ)?

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: Added obstacles to rtabmap projected map

sanjfir3
Would it create the same map as /rtabmap/proj_map? I have tried it both ways and both times it just used the laser scan. Another thing i noticed is that when i run 'rosrun rtabmap_ros rtabmap --params' on my robot i get a list that doesn't any grid parameters at all. When i run the same command on my computer, I still get the grid parameters.
Reply | Threaded
Open this post in threaded view
|

Re: Added obstacles to rtabmap projected map

matlabbe
Administrator
/rtabmap/proj_map is deprecated, you may have warnings on terminal. It is the same as /rtabmap/grid_map, still there for backward compatibility. It is "Grid/FromDepth" parameter that will make choose between laser scan and depth image projection (how /rtabmap/grid_map is generated).

Beware that Indigo/Jade binaries are old versions (not updated from almost a year). The Grid/ parameters are in Kinetic and when building from source (for indigo/Jade, you then have to build from source to use them).

cheers,
Mathieu