Obstacle Avoidance during map construction.

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

Obstacle Avoidance during map construction.

uzairazhar
Hello Sir,I am new to ROS.Currently I am able to do mapping and localization using rgbd_mapping.launch.Results are excellent but I am stuck here.I want to do obstacle avoidance even when my robot is making the map but tutorials seems to confuse me.I will be very thankful if you can guide me from here.
Reply | Threaded
Open this post in threaded view
|

Re: Obstacle Avoidance during map construction.

matlabbe
Administrator
Hi,

You may want to take a look at the turtlebot tutorial.

The general approach is to feed the generated map (/rtabmap/grid_map or /rtabmap/proj_map) from rtabmap to move_base's global map. Actual obstacles avoidance is done using move_base local costmap, see this tutorial: http://wiki.ros.org/navigation/Tutorials/RobotSetup

cheers
Reply | Threaded
Open this post in threaded view
|

Re: Obstacle Avoidance during map construction.

uzairazhar
Thankyou.One more question.When I start the obstacle nodelet,i dont get any data on that.Tried to debug it but couldn't get the idea.What I am missing here.Also,my visual odometry gets lost sometimes and when I changed the resetmap parameter to '1',the resulting map is very distorted.Is there any way for navigation through rtabmap standalone version.

Regards,

Reply | Threaded
Open this post in threaded view
|

Re: Obstacle Avoidance during map construction.

matlabbe
Administrator
Some questions:
1-What is your launch file?
2-Can you show rqt_graph?
3-Which version of rtabmap? (binaries 0.10 or source 0.11)

For odometry recovery, the default parameters (see Parameters.h (0.11)) require that the camera comes back to where it got lost to track again (to be consistent with the previous data). Another strategy is to set "Odom/ResetCountdown" > 0 so that odometry is reset to last pose when lost after some X frames (high variance 9999 is set for the first odom msg). When odometry is reset, rtabmap creates a new map. If you want rtabmap to start a new map only after it is has been localized with the first map (so it is like continuing the previous map), you can set "Rtabmap/StartNewMapOnLoopClosure" to true.

Note that g2o optimization handles badly multi session mapping. You may want to set "Optimizer/Strategy" to 0 (TORO) or 2 (GTSAM if available).

cheers
Reply | Threaded
Open this post in threaded view
|

Re: Obstacle Avoidance during map construction.

uzairazhar
I am using the following files to do autonomous navigation.
$ rosrun move_base move_base
$ roslaunch freenect_launch freenect.launch depth_registration:=true
$ rosrun depthimage_to_laserscan depthimage_to_laserscan image:=/camera/depth_registered/image_raw camera_info:=/camera/depth_registered/camera_info
$ rosrun tf static_transform_publisher 0 0 0 0 0 0 /base_footprint /camera_link 100
$ roslaunch rtabmap_ros rgbd_mapping.launch frame_id:=base_footprint rtabmap_args:="--delete_db_on_start" rtabmapviz:=false subscribe_scan:=true
$ roslaunch rtabmap_ros navigation.launch map_topic:=/rtabmap/grid_map//file added in opt
$ roslaunch rtabmap_ros demo_turtlebot_rviz.launch

->I am using rtabmap 0.10.
->Also costmaps are also not publishing anything.
Reply | Threaded
Open this post in threaded view
|

Re: Obstacle Avoidance during map construction.

uzairazhar
In reply to this post by matlabbe
I am using Rtabmap binaries 0.10rqt_graph
Reply | Threaded
Open this post in threaded view
|

Re: Obstacle Avoidance during map construction.

uzairazhar
In reply to this post by matlabbe
Sir,where should I change Odom/ResetCountdown" > 0 in parameters.h or in launch file .Furthurmore where should I change (high variance 9999 is set for the first odom msg).Waiting for your reply.

regards,
uzair
Reply | Threaded
Open this post in threaded view
|

Re: Obstacle Avoidance during map construction.

matlabbe
Administrator

The rqt_graph image above is resized, and cannot be read. I cannot find navigation.launch, is it homemade launch?

To change RTAB-Map's parameters, you don't have to change it in Parameters.h, you can do it in a launch file like this (example for odometry parameter):
<node pkg="rtabmap_ros" type="rgbd_odometry" name="rgbd_odometry">
   <param name="Odom/ResetCountdown" type="string" value="10"/>
   ...
</node>

The high variance is set on version 0.11.

You cannot start move_base on the command line directly. It requires config files (yaml) to setup the costmaps for example. See the navigation tutorial: http://wiki.ros.org/navigation/Tutorials/RobotSetup

cheers
Reply | Threaded
Open this post in threaded view
|

Re: Obstacle Avoidance during map construction.

uzairazhar
Another query for odometry lost.

Why min_inliers parameter value should be >=8.What if I set it less than 8.

Secondly,sir can I use laser_scan of kinect to provide me odometry data like act as laser sensor using its fake scan,incase I enter in featureless environments.

Regards,
uzair
Reply | Threaded
Open this post in threaded view
|

Re: Obstacle Avoidance during map construction.

uzairazhar
In reply to this post by matlabbe
Also,when doing 'resetcountdown' > 0 odometry quality sometimes stuck at 0.Even if seeing the same view ,it cannot link it with map it has already built.Any idea how to overcome this one.Waiting for reply.

regards,
uzair
Reply | Threaded
Open this post in threaded view
|

Re: Obstacle Avoidance during map construction.

matlabbe
Administrator
This post was updated on .
Hi,

Resetting the odometry at the same place it got lost, it is more likely that odometry will not still be able to be computed after reset. Visual odometry cannot be done in featureless environments. See "Lost odometry" section on this page for more info. The minimum inliers set to 8 is that below this number, most computed transformations are not good. An odometry quality over 100 would give good odometry.

For not detecting loop closures with a previous map, you can look at this post to track down if they are detected but rejected.

The fake scan from the Kinect is not really reliable alone. Its field of view is too limited comparatively to a real LiDAR and also less precise. I would recommend to use wheel odometry to be more robust to featureless environments. You may also want to give a try to robot_localization package to do fusion of wheel odometry and visual odometry.

cheers
Reply | Threaded
Open this post in threaded view
|

Re: Obstacle Avoidance during map construction.

uzairazhar
Hi Sir,

There is a problem I have never encountered before and I am unable to find out why is that happening.
In environment,full of features,package is when started is still giving lost odometry.

regards,
uzair
Reply | Threaded
Open this post in threaded view
|

Re: Obstacle Avoidance during map construction.

matlabbe
Administrator
Is it because you updated the code? Was it working before in the same environment? Do you have an image of this environment?

See Lost Odometry section on this page for hints: https://github.com/introlab/rtabmap/wiki/Kinect-mapping

cheers

Reply | Threaded
Open this post in threaded view
|

Re: Obstacle Avoidance during map construction.

torkx
In reply to this post by matlabbe
Hi,

I am having the same issue. I have successfully mapped my environment and can see the rtabmap/proj_map in RVIZ and I want to use that map as my costmap for local obstacle avoidance. Here is my launch file linking to move_base.

 <remap from="odom" to="odom" />
      <remap from="map" to="rtabmap/proj_map"/> 
   <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
             
       
       
       
       
       
       

     <rosparam file="$(find PKG)/config/costmap_common_params.yaml" command="load" ns="global_costmap" />
       <rosparam file="$(find PKG)/config/costmap_common_params.yaml" command="load" ns="local_costmap" />
     <rosparam file="$(find PKG)/config/local_costmap_params.yaml" command="load" />
     <rosparam file="$(find PKG)/config/global_costmap_params.yaml" command="load" />
     <rosparam file="$(find PKG)/config/base_local_planner.yaml" command="load" />

    </node>


However, when trying to visualize the /move_base/global_costmap/costmap in RVIZ it just shows a blank spot.



Here is my local_costmap_params.yaml

local_costmap:
  global_frame: odom
  robot_base_frame: base_footprint
  update_frequency: 5.0
  publish_frequency: 3.0
  static_map: true
  rolling_window: false
  width: 5.0
  height: 5.0
  resolution: 0.125
  origin_x: -2
  origin_y: -2

plugins:
  - {name: obstacles_layer, type: "costmap_2d::ObstacleLayer"}
  - {name: inflater_layer, type: "costmap_2d::InflationLayer"}


I'm stuck and don't know where I am missing something.

Thanks for your time.
Reply | Threaded
Open this post in threaded view
|

Re: Obstacle Avoidance during map construction.

matlabbe
Administrator
Hi,

/rtabmap/proj_map would be the input of the global costmap, not the local costmap. The local costmap is created directly from the sensors' values (defined in obstacle_layer parameters). The global costmap would be a mix of  a static_layer (with /map as input) + obstacle_layer (optional) + inflation_layer. The local costmap should have the obstacle_layer + inflation_layer.

I am not sure what is the blank spot as the /map seems ok. However the costmap looks having big cells. Note that a cell resolution of 0.125 is quite high. By default, cell resolution is 0.025 m and 0.05 m for the local and global costmaps respectively.

cheers