ChengeYang / SLAM-with-Velodyne-Lidar-and-Jackal-UGV

Winter Project at Northwestern.
40 stars 7 forks source link

SLAM with Velodyne Lidar and Jackal UGV

Individual Project, Winter 2019, Northwestern University

Chenge Yang


Demo

SLAM in Simulation (Gazebo)

SLAM in MSR Lab

Pedestrian Detection


Introduction

The goal of this project is to build a mobile robot system in both simulation and real-world environments to achieve SLAM, autonomous navigation and pedestrian detection with Velodyne VLP-16 Lidar sensor and Clearpath Jackal UGV.

Hardware

Simulation

Simulation is established for the Jackal and Velodyne VLP-16 Lidar in Gazebo and rviz.


Implementation

Pipeline Flow

State Estimation

The package robot_localization is used to fuse Odometry with IMU data through Extended Kalman Filter. It estimates the robot state and provides the transformation between tf frames /odom and /base_link.

PointCloud Processing

The raw Lidar PointCloud is processed in C++ using PCL library. The following steps are implemented:

  1. Find the floor plane and remove it from the raw PointCloud
  2. Remove all points that are higher than the robot, lower than the ground and too close to the robot
  3. Get rid of noisy points that have no neighbour points within a particular radius
  4. Downsample to obtain a less dense PointCloud

SLAM

I used the 2D SLAM package gmapping, which implements the Rao-Blackwellized Particle Filter to generate a 2D grip costmap and the the localizaion of the robot in the map (transformation between tf frames /map and /odom).

Navigation

I used package move_base to achieve autonomous navigation of Jackal. It reads the map and localization from gmapping and plans a local and global path for the robot.

Pedestrian Detection

I used package hdl_people_tracking to achieve pedestrian detection and tracking with Velodyne Lidar. It generate semantic segmentation of the human clusters in the PointCloud.


Dependencies and Installation

The Jackal packages are released in ROS Indigo and Kinetic. To use them in ROS Melodic, the following compiling processes are implemented:

Build from apt-get:

Install in Terminal with sudo apt-get install:

Build from source: (version: kinetic)

Git clone the original Github repo to local catkin workspace, and run catkin_make.


Usage

Launch in simulation:

roslaunch winter_project simulation.launch

Launch in Jackal:


Jackal Setup

Router connection

Direct Ethernet connection

nmcli connection up Jackal
ssh administrator@cpr-j100-0076.local

PS3 Joystick

Files on Jackal

Copy and remove file to/from Jackal

sudo rm -r winter_project/
scp -r /home/ethan/jackal_ws/src/winter_project/  administrator@cpr-j100-0076.local:~/chenge_ws/src

Main issues solved

Z drifting in rviz

The problem is caused by the default settings of robot_localization package. It can be solved by changing the parameters for EKF in the following files:

Yaw drifting in rviz

The problem is caused by the noise measurements of IMU. The roll and pitch measurements have gravity as the absolute reference (measured by accelerometer), while the yaw measurement does not. Thus, the magnetometer is enabled for package imu_filter_madgwick to provide the absolute yaw reference. The launch file is located at:

Velodyne Lidar issues

PCL library issue in Jackal:

The PCL used in Jackal is version 1.7. Running the node written with PCL will cause a segmentation fault (core dumped). This is because PCL 1.7 does not support C++11. Therefore, I commented the line in CMakeLists.txt that specifying to compile using C++11. Also, the following commands are used in the debugging process:

sudo apt update
sudo apt install gdb
rosrun --prefix 'gdb --args' winter_project floor_removal