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:
The gradient direction at each pixel is then calculated as the arctangent of the gradient divided by the
gradient:
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.
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
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.