- 1 Team Members
- 2 Project Overview
- 3 Objectives
- 4 Mechanical Design
- 5 Electrical Schematic/Circuitry
- 6 Software Integration
- 7 Results
- 8 References
Kenan O'Connor - Mechanical Engineering
Mingwei Xu - Electrical and Computer Engineering
Haiyang Yu - Electrical Engineering
In this project, we implemented adaptive cruise control on the donkey car. We used LIDAR for distance measurement, utilized ROS within the donkey framework to get LIDAR data and designed a cruise controller to control throttle in order to maintain vehicle speed and safe distance. Meanwhile, the adaptive cruise controller is still compatible with the original donkey autopilot, hence our autonomous can safely navigate while in autonomous mode.
In addition, we utilized the YOLO network for pedestrian and traffic sign detection, which enhanced the safety features of our autonomous driving RC car.
Must have: adaptive cruise control
Nice to have: pedestrian and traffic sign detection
Adaptive Cruise Control
Adaptive cruise control automatically adjusts the vehicle speed to maintain a safe distance from vehicles ahead. It is a key component of autonomous cars and has been proven to be an effective safety feature of road vehicles.
Main objectives of adaptive cruise control are:
1. Use ROS to get LIDAR scan data from RPLidar
2. Subscribe to ROS LIDAR topic, apply LIDAR filter to reduce sensor noise and add distance calculator to check the object distance in front of the car
3. Implement adaptive cruise control that takes distance sequence and control throttle accordingly
Pedestrian and Traffic Sign Detection
The first major mechanical design challenge was to integrate all the components needed to run an autonomous vehicle with the chassis of the RC car. To start, a mounting plate needed to be designed and laser cut in order to accommodate all the electrical hardware.
Since our robocar needed a camera to drive autonomously, the next big challenge was to design a mount for the camera. There were a few major design considerations for this camera mount. First, the mount needed to provide adequate protection for the camera in in case of a car accident. In addition, the camera needed to be angled towards the ground in order to view the track. During the design process for the mount, the optimal viewing angle and height of the camera was not known. As a workaround, the camera angle was designed to be adjustable. This feature would allow us to not only experiment with different viewing angles, but it would allow us to easily reconfigure the layout of the car when new components were added to the car (as was done for our final project).
Our team's project involved integrating a LIDAR to our existing robocar. The LIDAR needed a case to protect it in case of collision and to allow it to be attached to the deck.
It is important to note that since the LIDAR needed be mounted at the front of the car, the increased weight resulted in a large amount of downward deflection of the mounting deck. This was problematic because this resulted in the LIDAR being angled towards the ground instead of horizontally leveled. To solve this problem, stiffer springs were added to the front of the vehicle to counteract the increased weight.
We integrated our project into the donkey framework by developing several donkey parts and a modified_manage.py script to use those parts.
The parts are:
1. LIDAR Processor to get LIDAR data from ROS and return calculated distance
2. Adaptive Cruise Controller to take calculated distance and return throttle output
3. YOLO Detector for pedestrian and traffic sign detection
For software setup and usage, please refer to the README page on Github. Check references section for Github link.
In this project, we use Robot Operation System (ROS) to read LIDAR data, since RPLidar, the LIDAR we used in this project has an official ROS package. Therefore we can develop our application on top of that more efficiently.
We developed a handful of functions to process the raw ROS Laser Scan Message, including LIDAR filters and distance calculator. We created a donkey part: lidar processor, to integrate all the LIDAR functions into the donkey car framework. In a nutshell, the LIDAR processor will subscribe to the Laser Scan Message from RPLidar, apply necessary filters and return back the relative distance between our car and the object in front of the car. The flow chart below shows the workflow of the lidar processor part.
LIDAR Filter Player Tool
To visualize the LIDAR filters for easier debug and tuning purposes, we created a lidar filter player tool that subscribes to LIDAR ROS message in real-time and visualizes LIDAR scans with different filters applied, as well as the distance calculator. Different line colors correspond to different filtered scans, and the radius of the circle in the medium indicates the calculated distance.
Adaptive Cruise Controller
In this project, we designed the control model in Simulink and then tested it by taking a "sin" signal as input. In this control model, the output throttle of the vehicle is influenced by both the relative distance between the two cars and the relative velocity of them (the derivative of distance).
In the simulation of the control model, the throttle turned to a high value when the relative distance is too large. However, compare to the distance, the throttle may change in advance because of the influence of the relative velocity.
You only look once (YOLO) is a state-of-the-art, real-time object detection system. It is fast and accurate in object detection, hence we use it in our pedestrian and traffic detection donkey part. Due to the relatively low computational resource on Nvidia Jetson, we use a lightweight YOLO structure: Tiny YOLO.
The stop sign detection result is shown below.
Due to time limitation, the YOLO detector only warns the driver and it does not affect car behavior and throttle output.
Robot Operating System (ROS)
The Robot Operating System (ROS) is a framework for developing robot applications. It includes many useful libraries and tools to let the user develop robotics applications easier and faster.
Using ROS in this project, we have saved a lot of time from dealing with LIDAR firmware, connection, and data transfer. Because ROS is running outside donkey, LIDAR performance consistent as it is not affected by the donkey python script.
A ROS subscriber is implemented in the donkey part: lidar_processor. This allows us to transfer LIDAR scan data from ROS into donkey.
The video below shows the result of our adaptive cruise controller.
In the first video, the robocar's throttle is being controlled autonomously by adaptive cruise control, but the steering is being controlled manually.
In the second video, the robocar's throttle is being controlled autonomously adaptive cruise control, and the steering is being controlled by donkey autopilot.
1. Not very responsive at low speeds, because the DC ESC and motor are not responsive to small throttle input. And due to this fact, the controller tends to overshoot by giving too much throttle when starts. Also during low speed, it may stop frequently if the frontal car slows down because the throttle output is too low for the motor to move. We tested our code using different artificial input signals, and the throttle response works as expected (please see unit test cases in our code: test_cruise_controller.py). However real-world test on robocar is not ideal. The next team should try to upgrade to more responsive ESC and motor, see if it can solve this issue.
2. Date issue with Jetson. Every time our Jetson would power-up, the date would reset and would be incorrect. This issue could possibly be due to a faulty internal clock battery.
3. Firmware error when loading intel WIFI card (could be hardware or clock issue).
Github page for this project https://github.com/InspireX96/ECE148AdaptiveCruiseControl
Robot Operating System (ROS) https://www.ros.org/
RPLidar ROS Package http://wiki.ros.org/rplidar
YOLO: Real-Time Object Detection https://pjreddie.com/darknet/yolo/
Our final presentation slides https://drive.google.com/open?id=1rISUhG9unI13RRrHbpjEntcPtAj7lYmWisbntjl9lrM