Difference between revisions of "2022WinterTeam5"

From MAE/ECE 148 - Introduction to Autonomous Vehicles
Jump to navigation Jump to search
Line 41: Line 41:

== 3 Laps Video ==
== 3 Laps Video ==
[https://drive.google.com/file/d/1Z8NQuAf5pJ3RJnrHfS0_6Ya5RzRdAeVj/view?usp=sharing ROS2 Autonomous Laps]

= Final Project =
= Final Project =

Revision as of 20:24, 21 March 2022

Team 5: Charging On The Go


Team Members

  • Andrew Hallett, MAE
  • Juan SanJuan, ECE

Project Overview

Concept Inspiration:

  • We were inspired by in-flight refueling of aircraft. Taking this concept and applying it to electric autonomous vehicles we could potentially recharge vehicles out on the road without them needing to slow down or stop from their current task. In this project we explore methods of autonomous driving and tracking while the recharging concept is only visualized through an augmented reality overlay on the back of the low power state car. If we were to explore the charging method in another project we thought about ways of doing this through cable connections, inductive charging, or regenerative braking.


  • Build 2 autonomous vehicles
  • Implement autonomous driving using ROS2
  • Implement a tracking solution to identify the low power state car
  • Use the tracking solution to update the steering and throttle controls
  • Simulate recharging through a visual representation

Gantt Chart


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.

Chargingcar-wi-22-team5.jpg Leadcar-wi-22-team5.jpg




3 Laps Video


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.


  • The camera calibration depends on the lighting of the environment.
  • We tried to calibrate the motors so the vehicles would drive as slow as possible on the track. This became an issue when we swapped batteries and would sometimes result in the car not moving at all when testing our code.


  • It is recommended to do the calibration at night where the lighting is more consistent and always test on the track in those conditions.
  • To fix the battery issue we would use "ros2 launch ucsd_robocar_nav2_pkg all_components.launch.py" to activate all components and then send velocity commands to the motor using "ros2 topic pub /cmd_vel geometry_msgs/msg/Twist "{linear: {x: 0.0, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: 0.0}}" to find the minimum threshold every time we swapped a battery. In the future it would be nice to have an encoder on the wheels to control speed based on rotation of the tires.

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.


  • Lack of coding experience prior to the class.
  • We had trouble finding examples that implemented these libraries with ROS.
  • The examples we did find were built using a different ROS distribution.


  • The code we needed to implement tracking the low power state vehicle was already solved with the provided ROS2 code. We spent the time to learn how it tracked the lines of the road and implemented a solution to track a purple tag as well on the back of the low power state vehicle. To accomplish this we created a new camera color calibration to track the purple tag and added logic to update steering and throttle commands.


Updating Steering and Throttle Commands

Pose Estimation


Final Demonstration


Final Presentation


Future Developments