Skip to content

Phenorob 2021 Activities

Sergi Molina edited this page Aug 27, 2021 · 33 revisions

List of SLAM systems used:

Kohlbrecher, S., Von Stryk, O., Meyer, J. and Klingauf, U., 2011, November. A flexible and scalable SLAM system with full 3D motion estimation. In 2011 IEEE international symposium on safety, security, and rescue robotics (pp. 155-160). IEEE.

Shan, T., Englot, B., Meyers, D., Wang, W., Ratti, C. and Rus, D., 2020, October. Lio-sam: Tightly-coupled lidar inertial odometry via smoothing and mapping. In 2020 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS) (pp. 5135-5142). IEEE.

Labbé, M. and Michaud, F., 2019. RTAB‐Map as an open‐source lidar and visual simultaneous localization and mapping library for large‐scale and long‐term online operation. Journal of Field Robotics, 36(2), pp.416-446.

Activities:

1 - HECTOR SLAM

You can also find a video guide of this first activity in : https://youtu.be/y3YAq190BDI

1.1 - Hector SLAM

roslaunch bacchus_slam hector_slam.launch

Saving the map

In order to save the 2d occupancy map created, we can call the following command in a new terminal:

rosrun map_server map_saver -f <map_file_name>

NOTE: the map will be saved in the location where the command is run (unless the path is specified in the <map_file_name>)

1.2 - AMCL Localisation with Hector SLAM MAP

1.2.1 - Using the same plant stage

In order to localise using the 2D occupancy map created previously in section 1.1 with Hector SLAM, we can use the AMCL probabilistic localization system. To do so, change the nav_map_yaml paremeter in ~/row_ws/src/bacchus_lcas/bacchus_slam/amcl_localization.launch to the map name created in section 1.1.

Then launch the following, and test the localisation perfomance:

roslaunch bacchus_slam amcl_localization.launch

1.2.2 - Using another plant stage

In this step we will use the same map as in the previous step, however we will change the plant stage simulating that some time has passed since the mapping activity, and the plants have grown.

To do so, change the world_name parameter in ~/row_ws/src/bacchus_lcas/bacchus_slam/amcl_localization.launch to summer_school_stage3. Check again the localisation performance running again the system with:

roslaunch bacchus_slam amcl_localization.launch

2 - LIO-SAM

roslaunch bacchus_slam lio_slam.launch

Parameters that we can tune (~/ros_ws/src/bacchus_lcas/bacchus_slam/config/lio_sam_params.yaml ):

  • a) surroundingkeyframeAddingDistThreshold [Default: 1.0]:meters, regulate keyframe adding threshold

  • b) surroundingkeyframeAddingAngleThreshold [Default: 0.2]:radians, regulate keyframe adding threshold

  • c) surroundingKeyframeDensity [Default: 2.0]:meters, downsample surrounding keyframe poses

  • d) historyKeyframeSearchRadius [Default: 15.0]:meters, key frame that is within n meters from current pose will be considerd for loop closure

  • e) historyKeyframeSearchTimeDiff [Default: 30.0]:seconds, key frame that is n seconds older will be considered for loop closure

  • f) historyKeyframeSearchNum [Default: 25]:number of hostory key frames will be fused into a submap for loop closure

  • g) historyKeyframeFitnessScore [Default: 0.3]:icp threshold, the smaller the better alignment

3 - RTAB-MAP

3.1 - RTAB-MAP SLAM

roslaunch bacchus_slam rtabmap_rgbd_slam.launch

Parameters to tune (~/ros_ws/src/bacchus_lcas/bacchus_slam/launch/rtabmap_rgbd_slam.launch):

  • a) Odom/Strategy [Default: 0]: 0=Frame-to-Map (F2M) 1=Frame-to-Frame (F2F) 2=Fovis 3=viso2 4=DVO-SLAM 5=ORB_SLAM2 6=OKVIS 7=LOAM 8=MSCKF_VIO 9=VINS-Fusion
  • b) Kp/DetectorStrategy [Default: 8]: 2=ORB 7=BRISK 8=GFTT/ORB 9=KAZE 10=ORB-OCTREE 11=SuperPoint 15=PyDetector
  • c) Optimizer/Strategy [Default: 1]: Graph optimization strategy: 0=TORO, 1=g2o, 3=Ceres

NOTE: If your PC is low spec, please the recommended Odom/Strategy is 1=Frame-to-Frame (F2F).

Saving the map

The map is automatically saved when we stop RTAB-Map. But if we run again RTAB-Map in mapping mode, the old map will be deleted and only the last one will be kept. If we don't want the map to be deleted we can run the system in localization-only mode by doing the step 3.2 explained below.

3.2 - RTAB-MAP Localisation-only mode

In order run RTAB-MAp in localisation-only mode we need to set the localization parameter to True by running the following:

roslaunch bacchus_slam rtabmap_rgbd_slam.launch localization:=True

Then, to load the saved map, we will click the button with the two arrows and then press OK in the pop-up window

.

In order to test if the localisation can recover the robot location in case the robot is lost or moved to a another location while off (in the robotics community this is know as the 'Kidnapped robot problem'), we can spawn the robot in another location. To do so we can run:

roslaunch bacchus_slam rtabmap_rgbd_slam.launch localization:=True X_INIT:=-7 Y_INIT:=7

Navigation

In order to control the robot with the keyboard. Launch the following command after the simulation has started:

roslaunch bacchus_slam thorvald_teleop.launch

The instructions on how to give the command will appear on screen.

NOTE: Remember that in order to provide the moving inputs, the terminal window/tab with the previous roslaunch command has to be the active window.