Autonomous Vehicle (Polaris Gem) Projects

Published:

All the codes of this project can be found here

Pedestrian detection

Autonomous vehicles have the potential to revolutionize transportation and make our roads safer. One important aspect of autonomous vehicle technology is the ability to detect and react to obstacles in the road. We explore the use of an RGB camera and the opencv library to develop a system that can detect pedestrians and automatically brake the car to avoid collision. By using opencv to process the video feed from the RGB camera, we are able to identify the shape and movement of objects in the road. When a pedestrian is detected, the system sends a signal to the brakes to bring the car to a stop.

We realized the pedestrian detection and braking particularly using the HOG (Histogram of Oriented Gradients) algorithm. The HOG algorithm is a feature descriptor used in computer vision and image processing to represent the shape and appearance of an object in an image. It is commonly used for object detection tasks, such as pedestrian detection and facial recognition.

The HOG algorithm works by dividing the input image into small cells and computing a histogram of gradient directions within each cell. The gradient direction at a particular pixel is calculated by taking the gradient of the image intensity at that pixel, which is a measure of how quickly the intensity changes as we move across the image. The gradient is typically calculated using the Sobel operator, which is a finite difference approximation of the gradient.

The Sobel operator can be represented by the following equations:


where is the intensity of the pixel at position in the image, is the gradient in the direction, and is the gradient in the direction.

The gradient direction at each pixel is then calculated as the arctangent of the gradient divided by the gradient:

The HOG algorithm then divides the image into small cells and computes a histogram of gradient directions within each cell. The histogram is a distribution of the number of pixels within each cell that have a particular gradient direction. The resulting histogram is used as a feature descriptor for the object in the image.

By comparing the HOG feature descriptor of an object to a database of HOG feature descriptors for known objects, we can identify the object in the image and determine its position and orientation. The HOG algorithm is particularly effective at object detection tasks because it is able to capture the shape and appearance of the object, which is important for distinguishing it from other objects and background clutter in the image. The following video is the realization of the pedestrian detector and autonomous braking on the PolarisGem electric vehicle operated via ROS.

PID Control

Proportional-Integral-Derivative (PID) control and is a feedback control system that continuously adjusts a control output in order to achieve a desired setpoint. The PID controller uses three separate control terms, each with its own unique function:

  • Proportional (P) control: This term is based on the current error between the setpoint and the measured output. The larger the error, the larger the correction applied by the proportional control.
  • Integral (I) control: This term is based on the accumulated error over time. It helps to eliminate steady-state error, which is the difference between the setpoint and the measured output that persists even when the system is in steady-state.
  • Derivative (D) control: This term is based on the rate of change of the error. It helps to reduce overshoot and oscillations in the system.
The PID controller adjusts the control output using the following equation:

The values of Kp, Ki, and Kd can be adjusted to fine-tune the performance of the PID controller. A common approach is to use the "Ziegler-Nichols method" to determine the initial values of the gains, and then fine-tune them through trial and error. The following video applied the Ziegler-Nichols method to simulate the follow the given waypoints. Specifically, Kp = 0.09, Ki = 0.0144, Kd = 1.406 for this case.

What happens if the PID controller is not properly tuned? Obviously, it leads to a poor control performance, and it can manifest in a number of ways, including:

  • Oscillations or instability in the control output
  • Slow or sluggish response to changes in the system
  • Excessive overshoot or undershoot of the setpoint
  • Excessive steady-state error

The following video demonstrates the oscillatory case that is particularly actualized by high proportional gain value. We set Kp, = 10.0 Ki, = 0.2 Kd, = 0.1.

SLAM

Simultaneous Localization and Mapping (SLAM) is a fundamental problem in robotics and computer vision. It involves using sensors and algorithms to build a map of an unknown environment while simultaneously determining the location of the robot within that environment.

There are several approaches to solving the SLAM problem, including feature-based methods and graph-based methods. Here we will focus on graph-based SLAM, which involves representing the robot's trajectory and the map as a graph and using optimization techniques to estimate the unknown variables.

The main components of a graph-based SLAM system are:

  • Robot poses: These represent the location and orientation of the robot at each time step.
  • Map features: These are points or landmarks in the environment that can be observed by the robot's sensors.
  • Sensory data: This is the data collected by the robot's sensors, such as range measurements or images.
To solve the SLAM problem, we need to estimate the robot poses and map features that best explain the sensory data. This can be done using optimization techniques, such as least squares or maximum likelihood estimation. The optimization problem is solved by iteratively updating the estimate of the robot poses and map features until the difference between the predicted and measured sensory data is minimized. The following videos are our implementation of SLAM in the PolarisGem, indoor and outdoor.