icp-slam-live
Real-time 2D ICP-based SLAM from a live 2D LIDAR. It runs the same algorithm as icp-slam (mrpt::slam::CMetricMapBuilderICP, through mrpt::apps::ICP_SLAM_App_Live), but instead of reading a rawlog file it launches a sensor driver (any mrpt::hwdrivers::CGenericSensor that produces mrpt::obs::CObservation2DRangeScan observations, e.g. RPLIDAR, Hokuyo, SICK) in a background thread and maps with the most recent scan at each step. No odometry is used.
Usage
icp-slam-live <config_file.ini>
The program stops when the sensor fails or no scan arrives for 2 seconds, or when ESC is pressed in the console. The final map is then saved.
Example
icp-slam-live modules/mrpt_data/config_files/icp-slam-live/icp-slam-live_demo_RPLIDAR_gridmap.ini
Edit the serial port (COM_port_LIN / COM_port_WIN) and sensor pose in the [LIDAR_SENSOR] section first.
Configuration file
[LIDAR_SENSOR]: the sensor driver.driveris the class name of the driver (e.g.CRoboPeakLidar,CHokuyoURG,CSickLaserUSB) andprocess_rate(Hz, must be above the sensor rate) is mandatory; the rest are the driver-specific parameters, as in the rawlog-grabber config files (seemodules/mrpt_data/config_files/rawlog-grabber/).[MappingApplication]: the same options as icp-slam :logOutput_dir(default:log_out; its previous contents are deleted),LOG_FREQUENCY,SAVE_3D_SCENE,SAVE_POSE_LOG.SAVE_RAWLOG: also save the grabbed sensor data to a rawlog (icpslamlive_dataset_<date>.rawlog, in the current directory).SHOW_PROGRESS_3D_REAL_TIME,SHOW_PROGRESS_3D_REAL_TIME_DELAY_MS,SHOW_LASER_SCANS_3D: live 3D view of the map and robot.Map update thresholds (
insertionLinDistance,insertionAngDistance,localizationLinDistance,localizationAngDistance),minICPgoodnessToAccept,matchAgainstTheGrid, and the metric map definitions (occupancyGrid_count,pointsMap_count, and their[MappingApplication_*]sections). See mrpt::slam::CMetricMapBuilderICP::TConfigParams.
[ICP]: the ICP parameters (mrpt::slam::CICP::TConfigParams).
Output
In logOutput_dir :
File |
Contents |
|---|---|
|
All the keyframes (poses and scans). |
|
Final metric maps (e.g. grid map image, points as text). |
|
Estimated robot path ( |
|
Execution time and memory usage per step. |
|
3D scenes every |
See also
icp-slam : the same, from a rawlog file.
rawlog-grabber : to record datasets.