You should have:
- Ubuntu
18.04
(Should work with latest versions). - ROS melodic.
VLP-16
LiDAR.
- The root folder of this repository is supposed to be your catkin workspace.
- Clone the repository and either source the new folder called "lidar" or change the name to your existing catkin workspace directory name.
- Install the necessary ros packages by cloning them into the src folder:
- Install glog:
sudo apt-get install libgoogle-glog-dev
- Install velodyne depencencies for ROS:
sudo apt-get install ros-melodic-velodyne
- Install ros-numpy:
sudo apt-get install ros-melodic-ros-numpy
- Install scikit-learn:
pip install -U scikit-learn
- Build with
catkin_make
- Source the setup file by running:
source ~/<catkin_workspace_name>/devel/source.bash
. If you are using zsh instead of bash run:source ~/<catkin_workspace_name/devel/source.zsh
To launch the whole environment run: roslaunch lidar_nodes lidar.launch
.
Getting up and running with your own point cloud source should be as simple as:
- Change the
input_topic
parameter insegmentation.launch
to your topic.(Already configured, change only if you want to run your custom setup) - Adjust the
sensor_height
parameter insegmentation_params.yaml
to the height where the sensor is mounted on your robot (e.g. KITTI Velodyne: 1.8m)
- Open RVIZ with the frame set to velodyne:
rosrun rviz rviz -f velodyne
- Click the add button and choose the topic you want to listen to:
/velodyne_points
: raw points captured by the lidar./prefiltered_points
: Remaining points after filters(depth, azimuth, etc.)/ground_cloud
: Ground points./obstacle_cloud
: Cone pointcloud./visualization_marker
: Detected cones.
Parameters are set in linefit_ground_segmentation_ros/launch/segmentation_params.yaml
This algorithm works on the assumption that you known the height of the sensor above ground.
Therefore, you have to adjust the sensor_height
to your robot specifications, otherwise, it will not work.
The default parameters should work on the KITTI dataset.
- sensor_height Sensor height above ground.
- max_dist_to_line maximum vertical distance of point to line to be considered ground.
- max_slope Maximum slope of a line.
- max_fit_error Maximum error a point is allowed to have in a line fit.
- max_start_height Maximum height difference between new point and estimated ground height to start a new line.
- long_threshold Distance after which the max_height condition is applied.
- max_height Maximum height difference between line points when they are farther apart than long_threshold.
- line_search_angle How far to search in angular direction to find a line. A higher angle helps fill "holes" in the ground segmentation.
- r_min Distance at which segmentation starts.
- r_max Distance at which segmentation ends.
- n_bins Number of radial bins.
- n_segments Number of angular segments.
- n_threads Number of threads to use.
- latch Latch output point clouds in ROS node.
- visualize Visualize the segmentation result.
⚠️ only for development and debugging, don't use during operation.