2019SpringTeam5

From MAE/ECE 148 - Introduction to Autonomous Vehicles
Jump to navigation Jump to search
Final Car Design

Introduction

We in team 5 worked on three main aspects of the autonomous car project:

  • Indoor autonomous driving
  • Outdoor autonomous driving
  • Object detection using Time of Flight sensors

The Team

Team Members

  • Marco Colón, 4th year Mechanical Engineer
  • Tommy Dang, 4th year Computer Engineer
  • Matthew Rice, 4th year Electrical Engineer
  • David White, 4th year Mechanical Engineer

The Project

Car Design

Mounting Plate

Mounting Plate

When designing the mounting plate, the focus was on wire accessibility and attachment points for planned and unplanned accessories, such as the camera mount.
The large cut in the center was to allow for power cables and other accessory cables to run through the center and avoid excessive overcrowding.

Camera Mount 1st Iteration

This first camera mount was made to be able to adjust the camera angle at two different joints. The implementation of multiple moving joints allows for different angles and distances from the track. Having the ability the change the angles easily allowed for optimizing the best angle for developing our self-driving models.

Camera Mount 1st Iteration

Camera Mount 2nd Iteration

Camera Mount 2nd Iteration

For the second iteration of the camera mount, the angle of the camera was fixed to give a better view of the track lines and mounts for three time of flight sensors were added.

A 30 degree angle was determined to be the best position for the camera to have the best view of the track lines while retaining enough visual data ahead of the car for possible future visual object detection.
A 15 degree deviation for each time of flight sensor was used to give a field of view which encompassed the edges of the track in front of the car, while not being too wide as to cause non-obstructive objects to interfere with the data gathered by the sensors.

Circuit Schematic

Sp19Team5Schematic.png

Autonomous Driving

Indoor

Outdoor

Object Detection

The goal of our extension project was to implement object detection in a cost-effective way using TOF sensors. We planned to add multiple TOF sensors to the front of our car and to use that data to cut the car's throttle if an object is close.

The TOF sensor we used was the VL53L1X by Pololu[1]. In order to make use of the sensor on our raspberry pi, we used an open-source Python library on GitHub[2].

One issue we encountered when trying to use this library was installing the packages necessary while working within the environment we created as instructed in the donkeycar document. We resolved this issue by adding code to /home/pi/env/lib/python3.5/site-packages/VL53L1X.py. Added at line 54:

try:
    # workaround for virtualenv
    from distutils.sysconfig import get_python_lib
    _POSSIBLE_LIBRARY_LOCATIONS += [get_python_lib()] 
except AttributeError:
    pass

Once the library was installed, we created a part for the TOF sensor in a file called tofsensor.py, which we added to the donkeycar/parts folder with the other parts.

TOF Sensor Code 1 TOF Sensor Code 2

We then added code to the manage.py file to create TOF sensor parts and use that data to make informed decisions about whether or not to stop the car. A problem we encountered was that the VL53L1X's I2C address always reset to 0x29 on startup. This is an issue since we intend to use multiple TOF sensors. Thankfully, the library we provided functions to change the address. For one of the sensors, we connect its shutdown pin to ground. We make a part for other TOF sensor and change its address. Then, when we remove the ground connection from the shutdown pin of the first sensor, it will be the only sensor using the I2C address 0x29. Since the TOF sensors now send their data to different addresses, we were able to use both of the sensors to make informed decisions.

Initializing TOF Sensors

The library we used allowed us to collect data in millimeters. We played around with different stopping values until we found one that worked reasonably well.

Using data to control car

Time of Flight Sensor

Problems encountered and lessons learned

During setup and development of our car, there were major failings in most of our electronic components which hindered our progress significantly.
We found that our data collection rate for the time of flight sensors was too low, so we had to increase it from 20 Hz to 40 Hz. The low collection rate caused our car to not sense objects until right before or when it ran into them. The change helped to make our obstacle avoidance system work more consistently and more preemptively. Afterward, our car was able to detect the incoming object and stop well before it, however, this was only true for driving slow.
Additionally, when attempting to use 3 time of flight sensors, we ran into an I2C addressing problem in our Python library that caused the first and last time of flight sensors to be connected to work but would deaddress the second sensor, and make it unusable by the Raspberry Pi. We think this may be an issue with the library itself, as multiple people have had issues with changing the address using this library according to the issues tab on the project github. Finally, in the future, instead of removing shutdown pins on startup, we could programmatically change the voltage to them by connecting them to a pin on the raspberry pi.