Tag Archives: Computer Science

Build Your Own Self-Driving Car

By Wenchao Liu

Well, I meant a self-driving “RC” car, not a real car. However, if you are as good as George Hotz, who made a real car drive itself, please give it a try. When I was a junior, I knew I wasn’t George Hotz, so I decided to build a self-driving RC car. Well, wall-following RC car at least.

The first step was to find out what was on the Internet. If you just do a quick search, you will find a lot of different resources. When I just searched “self-driving RC car,” the first result was a self-driving RC car that uses one camera and one ultrasonic sensor. Another one that’s popular is the donkey car, which is bigger and has more instructions. They actually assembled it live in Denver during the Autonomous Vehicle Competition in 2017, which I was also part of. Well, why didn’t I get some camera time? The one I chose, however, was from f1tenth.org from University of Pennsylvania, because it has the most detailed instructions, uses the biggest car and has the most powerful computing platform. In addition, JetsonHacks, a blog dedicated to NVIDIA Jetson Platform, has a lot of good resources for that as well.

I didn’t know back then, but as I learned more about the robotics industry, I realized that I made a good choice with my pick. The Raspberry Pi is cheap, but it comes with serious computation constrains. As a result, you can’t really run a standard Ubuntu operating system on it. NVIDIA Jetson platform, however, can be almost as small as a Pi and comes with Ubuntu pre-installed. In addition, f1tenth.org uses ROS, Robot Operating System, which is actually used by robotics companies, including those working on self-driving cars, such as Cruise Automation and Baidu.

After I picked the project, I immediately applied for funding. As it was my senior experience project, I was able to get funding through Lawrence University. Without the funding, I’d not be able to buy the parts for the project. If I were just some guy working in my garage, I’d probably just pick the cheapest option. Since Lawrence could pay for it, why didn’t I just get the best parts? If you don’t have the money and still want to build something with more than a Pi and a camera, check out HyphaROS and Linorobot.

After I had the parts, I buried myself in the project. No matter what project you are working on, you will encounter problems. Problem-solving will be a time-consuming task. I will skip through all the pain I had, because Angela knew it all, as I worked in the library and complained to her all the time. That’s something important as well: make sure you have someone to complaint to!

As self-driving cars get more and more attention, more universities are teaching courses about the technology with RC cars. I recently discovered two useful websites, one from UC Berkeley and one from UC San Diego.

From Wall-Following to Full Autonomy

By Wenchao Liu

When I was a happy college student at Lawrence, I made a wall-following RC car. The project was truly a blessing, because it led me to many amazing people such as Prof. Stoneking and Angela. My theoretical-physicist-turned-computer-scientist professor, Prof. Gregg, helped me a lot during the process as well. My presentation day was one of my proudest days, as I was showing a room of my professors that I was actually not that dumb. 

It’s been a year since that presentation day, and I am still living in the past. Currently I am building the second version of the car, following instructions on f1tenth.org. The second version has quite a few improvements over the first one, and I have learned quite a lot so far. This post is about such improvements and what I plan to do in the future. It’s like the project proposal I gave in college, which wasn’t fully executed.

The most obvious improvement is a mechanical one. The previous build has two layers of plastics, which are connected also by plastics. As a result, the build is not rugged and glue was frequently applied. The new build has only one layer of plastics, and it’s mounted on a lower level than the base layer of the old build.

Just One Layer!

The electrical improvement is less obvious, but still visible. I had to changed the brushed motor to a brushless one, and to buy a VESC to control that. Thus, a Teensy micro-controller is not longer needed, as the computer can just control the VESC directly. The second build also uses an Orbitty carrier board, which has a smaller form factor than the previous one. Form factor; what a jargon word!

Can you tell which one is the current one?

The software improvement is not even visible as all, but it’s always been most frustrating. Although the only functionality I had with the previous build was wall-following, the car could actually do a lot more. The main functionalities I am trying to implement now are mapping with Lidar, localizing the car, generating and following waypoints. That’s where the f1tenth.org stops, but I won’t stop learning for a long time!

Stay tuned!

Wall-Following RC Car

By Wenchao Liu

When I was a junior, I decided that I’d work on autonomous vehicles after graduation. However, as an undergraduate, I’d not be able to produce a research paper in the field. Thus, I dedicated my senior experience to building a self-driving RC car, which was within my reach. Calling it self-driving might be a stretch, since the only capability for the car was wall-following. However, the project really took me a lot of time and energy.

The first step was to build a platform where the electronics could stand. There were a lot of electronics that needed to be on the RC car, and they couldn’t just be taped on the top. Thus, I paid someone to use a laser cutter to cut out different parts of the platform from two pieces of plastics. After assembly, the electronics could safely be placed on top of the RC car. The Makerspace doesn’t have a laser cutter, but Angela purchased one on back order, so we’ll see when we will get it!

The second step was to put the electronics securely on the platform. That process requires a lot of screws, standoffs and even fasteners! In addition, I had to solder a lot of circuits and headers in the Makerspace. There are many useful communal tools in the Makerspace, such as a soldering iron, screw drivers and various types of glue! On top of that, Angela, who is in charge of the Makerspace, is also helpful and wiling to buy almost whatever tools you want! She also has great ears to listen to your complaints when things go south!

The final step was software. I used ROS on Ubuntu to analyze the data from the Lidar, and to send commands from the computer to the micro-controller. The computer uses the Lidar data to estimate the distance between the car and the wall. If the car is too far away from the desired distance, the computer tells the micro-controller to steer closer, and vice versa. How much should the car steer? Well, that is handled by a PID controller, which takes the off-set from the desired distance and outputs the steering angle.

Wenchao and his friend Sheila (not Angela)

In total, the project took me about half a year. I took a class on Arduino in the chemistry department in the spring term of my junior year (yes, chemistry!) and worked on the project through the following summer and fall. During the entire process, I spent quite some time in the Makerspace, complaining to Angela! When the project was finished, I gave a talk about it, and many people came, including Angela! Look at how much she aged after listening to all my complaints!