‹ MAE 148 — Introduction to Autonomous Vehicles · Maurício de Oliveira

2022WinterTeam5

Team 5: Charging On The Go

TheVehicles.jpg

Team Members

Project Overview

Concept Inspiration:

Goals:

Gantt Chart

Gantt-wi-22-team5.jpg

Autonomous Vehicles

CAD/Mechanical Designs

There was no need for 2 different designs here. The black car was the original design, which featured a hinged mechanism to flip open the electronics bay. The blue car was updated based on features that didn't work on the first vehicle. The goal for the 2nd design was to have an open, more sleek concept so the parts were easily accessible if troubleshooting needed to be performed. This vehicle also included a new feature which clipped onto the rear bumper to hold the purple tracking solution card.

Error creating thumbnail: Unable to save thumbnail to destination
Error creating thumbnail: Unable to save thumbnail to destination

Wiring

Error creating thumbnail: Unable to save thumbnail to destination

DonkeyCar

3 Laps Video

DonkeyCar Autonomous Laps

OpenCV/ROS2

3 Laps Video

ROS2 Autonomous Laps

Final Project

Autonomous Driving

The first goal of the project was to get both vehicles driving on the class track using the provide ROS2 code. This process involved calibrating the camera to track the contours of the yellow lines on the road, and calibrating the steering and throttle controls.

Issues:

Solutions:

Vehicle Tracking

The next goal of the project was for the charging car to be able to track the low power state car once it caught up to it on the track. We explored complete tracking solutions such as AprilTag and ArUco Markers to accomplish this goal. Both of these methods are able to compute the precise 3D position, orientation, and identity of their respective tags relative to the camera. We wanted to use this information to help update the steering based on how far the centroid of the tag was away from the center of the camera capture. We also wanted to use the distance to update the throttle commands to either speed up or slow down in order to maintain a pacing distance of 2-3ft behind the low power state vehicle.

Issues:

Solutions:

Error creating thumbnail: Unable to save thumbnail to destination

Updating Steering and Throttle Commands

Once we began our project we decided we were going to use the source code of the lane detection package in order to move our charging car. For the steering we implemented a new mask with to track the color purple as well as the original mask to track the yellow lines on the road. After this our logic was simple:

In the Lane_detection node:

  1. Using the masks created for each color find both the yellow and purple contours (if any) using openCV's findContours function.
  2. Check if we have found any purple contours
  3. If so calculate the area of the biggest contour and apply the homography matrix of the battery on the purple contour
  4. If the area is big enough(meaning the car is close enough to start tracking) calculate error for the purple contour
  5. If the area is not big enough calculate the error for the yellow contour(s).
  6. Publish the error and the area of the purple contour( Area = 0 if not found).

In the Lane_Guidance node:

  1. Get data from Lane Detection node
  2. For the steering we use the same towards error method used in the original lane guidance source code
  3. For the throttle if we have not found purple(Area = 0) same as original code, else calculate percentage of area compared to min area(how far do I want the car to follow purple) and the max area( how close do I want to be from the lead car)
  4. Publish Steering and Throttle

Issues:
Some issues we had was that we were publishing an array of floats so we had to add some libraries as well as fix some of the syntax. Another issue that we had was that our throttle and steering wasn't working at the end which might have been a problem with either publishing our error/area. Also towards the end the calibration for the RC car changed a bit which also didn't help us finish.

Solutions:
The solution would be to debug our code to check if the problem was with the car, with the published data that we receive, or with the code itself.

Pose Estimation

Although we had trouble implementing AprilTags and ArUco Markers we were still able to use the homography matrix idea to overlay the battery state on the purple tag. To accomplish this goal we used a combination of the code already provided to find the contours of the purple box which led to the coordinates of the points of the box. We then used the command getPerspectiveTransform() to find the matrix required to rotate, translate, and scale our battery image from the file default shape to overlay onto the purple tag on screen. The command warpPerspective() then multiplies the matrix by our image to then make the transformation. After that we separated the battery image from the black background and stitch the 2 images together. Below is our static demo getting the code to work on a still image. In the final demonstration, you can see this concept working with live video.

Error creating thumbnail: Unable to save thumbnail to destination
Error creating thumbnail: Unable to save thumbnail to destination
Error creating thumbnail: Unable to save thumbnail to destination

Demonstrations

Final Demonstration

Presentation

Final Presentation

Challenges

Advice:
Some advice we would provide is to start early on the project. If your project won't be using donkeyCar but will use ROS2 start with ROS2 early. Give yourself some time to test and fail early. Structure task accordingly and distribute them to all the team members.

Future Developments

Acknowledgements

Thank you Professor Jack Silberman, Dominic Nightingale, and Ivan Ferrier for all the help and guidance with our project.


Recovered from the original course wiki (server backup, August 2024).