Introduction

Autonomous racing technology has recently emerged as a frontier where robotics and artificial intelligence converge. The F1 Tenth Autonomous Racing project endeavors to revolutionize this domain by redefining the capabilities of RC cars. By integrating cutting-edge technology and time-tested algorithms, this initiative seeks to transform standard RC cars into programmable racing entities, paving the way for advancements in autonomous vehicle research and application. In the burgeoning field of robotics and AI, this project serves as a trailblazer, showcasing the potential of autonomous systems in real-world applications. 

Needs assignment

In the rapidly evolving landscape of autonomous vehicles, there is a pressing need for innovative solutions that bridge the gap between theoretical algorithms and practical implementation. Current research in this area lacks comprehensive integration of advanced sensor technologies like LiDAR and ultrasonic sensors with robust algorithms such as the A* algorithm and Model Predictive Control (MPC). The industry demands a paradigm shift from conventional remote-controlled cars to intelligent, adaptable racing entities. Addressing this need, our project seeks to develop a holistic approach by fusing sensor data management, pathfinding algorithms, and machine learning techniques, thereby pushing the boundaries of autonomous racing and, by extension, autonomous systems research. 

Education and Research Problem

The educational problem at hand lies in nurturing a generation of engineers and researchers capable of bridging theoretical knowledge with practical applications in the field of robotics and AI. There exists a gap between classroom learning and real-world problem-solving. This project provides a unique opportunity for students to apply theoretical concepts in a tangible, hands-on manner. Moreover, the research problem centers on the lack of a standardized, integrated framework for autonomous racing. While individual components like LiDAR and A* algorithms are well-studied, their amalgamation into a cohesive, functional system remains a challenge. This project aims to address this gap by developing a unified platform that can serve as a benchmark for future research and education in the domain of autonomous systems. 

System Structure

System Overview

  Our project is fundamentally segmented into two primary components: Software and Hardware. Within the software domain, the selection of both the platform and the algorithmic framework is of paramount importance. Detailed expositions of these distinct segments methodically presented in the subsequent sections above.

  • Ubuntu

We are using the Ubuntu 20.04 (the latest version which Jetson NX can support) as our development system. Robotics Operation System 2 (ROS2) supports Windows as well, but Ubuntu(Linux) is more friendly for hardware.

  • ROS2

ROS2 would create communication between the nodes(NX, ESC, LiDar… ).  There is the data flow diagram below which shows the communication between the nodes we have.

Data Flow Diagram

In the Robot Operating System (ROS), computational processes are distributed across a network of nodes rather than being centralized in a single processing unit. This decentralized architecture is a defining feature of ROS and marks a departure from systems like Arduino, where operations are typically managed by a central CPU. In ROS, the framework establishes a communication protocol where nodes can publish messages that are then subscribed to by one or multiple listeners, facilitating a many-to-many relationship between nodes. This approach allows for a scalable and flexible exchange of information within the robotic system.

Algorithm

The algorithm is designed to address two fundamental objectives: driving and path planning.

  1. Driving:
    Driving encompasses more than simply powering the motor; it involves the correction of various operational errors. These errors may be due to several factors, including sensor inaccuracies, differential wheel friction, or wheel damage. To compensate for these imperfections, we utilize a control algorithm that functions similarly to an adept human driver, but with potentially greater precision. The Proportional-Integral-Derivative (PID) control method is selected for its straightforwardness and effectiveness. It assists in guiding the vehicle to a designated target and maintaining a set distance from walls. Although flawless driving is unattainable, the PID controller adeptly reduces these errors, ensuring the driving mechanism remains within acceptable parameters.  (PID is not the only option but a relative easy way to implement)
  2. Path Planning:
    Path planning is the more intricate challenge within the project. We will commence with the A* algorithm as a foundational strategy, with the intention of advancing to more complex algorithms over time. The F1 Tenth Competition presents multifaceted challenges that include accurate mapping, path optimization, and the evasion of obstacles. Addressing these challenges is essential for developing a comprehensive path planning system capable of handling the demanding conditions of the competition.

For the hardware, there are four functionalities and a series of components in order to achieve these functionalities:

  1. Power: LiPo Battery, Power Board (concentrate the power supply on one board with 8V/12V outputs)
  2. Sensing: LiDar
  3. Driving: Servo motor, Brushless motor, ESC, Chasiss
  4. Computing: Nvida Jetson Xavier NX

Stage 1 (Beginer) Keyboard Control:

In this stage, we initiate the F1 Tenth autonomous racing project by setting up the fundamental components. We hope the audience will learn some practical skills and get a better understanding of the project as a  system.

Needed skillset: Soldering, Laser Cutting, CAD 

  • Hardware

Chassis Design

Hardware  focuses on building up the F1 Tenth racing car for future process. The completed process in here 

–Jim, Yujie Huang

  • Software

Software Architeture

  • Ubuntu

       You can follow the instructions of the below link to install your Ubuntu easily. Please don’t install any version newer than 20.04. Nvida Jetson Xavier NX only supports Ubuntu 20.04.  Besides, please do not use a virtual machine since you will need to connect to hardwares later, and the VM can not. The tutorial is here

  • ROS2

Please install ROS2 foxy after you install Ubuntu successfully, follow the tutorial here.

–Jim, Yujie Huang, Jiyuan Sun, Wentao Zhang

RViz

RVIZ (ROS Visualization) is a key visualization tool in ROS 2, aiding in robot system development and troubleshooting by providing a visual interface for data display and analysis. It supports visualization of various data types, like sensor data and robot state, in a 3D environment. RViz facilitates real-time or recorded data debugging, and offers interactive features for modifying robot configurations. It’s highly customizable with plugin support, integrates seamlessly with ROS 2, and provides an easy setup for managing different visualization configurations. You will be able to control the car by keyboard command. Here

–Wentao Zhang

Stage 2 (Intermediate) PID Control:​

In this section , we will NOT directly implement a PID controller. Since the code in the ROS is not easy to read and understand. We do understand that working with hardware can be hard and stressful. Therefore, we hope audiences can try to learn and fully understand PID control instead of struggling with code. In the next stage — A*, PID control would be our main control method for driving, including adjusting the orientation offset and driving smoothly and accurately. 

Needed skillset: Calculus, Python/C++(Strongly recommended), General Physics

Here is a link for PID controller lecture. Hope it helps! 

If you are curious about the performance of different PID coefficients. The VESC Tool (Windows version) has internal PID velocity controller. You play with those coefficients, if you set up the VESC and motor in stage 1. 

–Jiyuan Sun

Stage 3 (Advanced) A* Algorithm:

In this stage, there are tons of work to do. It is suitable for junior college students or high education level. The order is Ubuntu Setup –> ROS Setup –> Hardware Connection –> Control Motors –> Using LiDar –> Locomotion –> Implementing A*. 

Needed skillset: Python (might need C++ as well ), Probability, Sensing,  Linear algebra, PID, ROS2, Github

  •  There a software list we will use or recommand to use:
  • Git (must): enables multiple developers to track and manage changes to code repositories efficiently.
  • Github Desktop (optional): Connect to your Github repo and commit in a easier way.
  • VScode (optional): IDE for python 
  • Terminator(strong recommended): A window split tool. Very useful when you need to check multiple outputs at the same time. 
  • Vim (must): Editor of .bash and other system setting files. YOU WILL NOT WANT TO FIND OUT WHERE ARE THEY. 
  • Vesc Tool (must): The official app for VESC setting.

Here is the tutorial for these. 

  • Configure Nvidia jetson xavier NX 

 

Here is a link for detailed configuration of Nvidia jetson Xavier NX with reComputer J2021  carrier board. https://wiki.seeedstudio.com/reComputer_J2021_J202_Flash_Jetpack/

Topics and Nodes are the most important part of understanding how ROS works.  

Nodes: a node is a software component that performs specific tasks in a robot’s system. Nodes communicate by sharing messages on named topics, enabling modular and lightweight design for complex robotic systems.

Key characteristics of ROS nodes include:

  1. Independence: Nodes are typically independent processes that can run on different hardware or even different computers, making ROS a distributed system.

  2. Communication: Nodes communicate with each other by publishing messages to topics and subscribing to messages from topics. This publish-subscribe model enables data exchange and coordination between nodes.

  3. Modular Design: ROS encourages a modular software design, where different nodes perform specific tasks or functions. This modularity makes it easier to develop, test, and maintain robotic software.

  4. Language Flexibility: ROS supports multiple programming languages, allowing developers to write nodes in languages like C++, Python, and more.

  5. Centralized Naming: ROS provides a centralized naming system (ROS Master) that helps nodes discover and communicate with each other by name.

Topics: a topic is a named communication channel that enables nodes to exchange messages in a publish-subscribe fashion. Nodes can publish data on topics, and other nodes can subscribe to those topics to receive and process messages, facilitating data exchange and coordination in a robotic system.

Key characteristics of ROS topics include:

  1. Named Channels: Each topic has a unique name, which enables nodes to specify which topic they want to publish to or subscribe to.

  2. Publish-Subscribe Model: Topics follow a publish-subscribe messaging pattern, where multiple nodes can publish messages to a topic, and multiple nodes can subscribe to that same topic to receive the messages. This decouples the communication between nodes, making the system more flexible and modular.

  3. Message Types: Messages published on topics are defined by message types, which specify the data structure and content of the messages. ROS provides a variety of predefined message types for common data types and also allows users to define custom message types for specific applications.

  4. Asynchronous Communication: ROS topics facilitate asynchronous communication, meaning that nodes can publish and subscribe to topics independently without waiting for each other. This allows nodes to work at their own pace and helps in building concurrent and distributed robotic systems.

  5. Data Flow: Messages flow in one direction, from publishers to subscribers, on a topic. Subscribers can process the received messages as soon as they become available on the topic.

Check out the “Data Flow Diagram” in the previous “Platform” section.

The tutorial is coming soon.

SLAM further explores the simultaneous localization and mapping process, detailing how the car uses sensor data to localize itself within the mapped environment, providing essential spatial awareness crucial for obstacle avoidance and efficient path planning.

We are using the package “Google Cartographer“. It is not state-of-the-art nowadays, but it is good enough for our purpose. 

–Wentao Zhang, Yujie Huang

What is A* Search Algorithm? 

A* Search algorithm is one of the best and most popular techniques used in path-finding and graph traversals.  It is a way to find the shortest path on a known static map. Literally, there are two conditions to use A*, “KNOWN” and “STATIC”.  In the previous section, we provide the SLAM to get a map of the environment. Thus we can do A* on this map. A* doesn’t work well in a dynamic environment, since it needs to calculate every single cell until it finds the path which takes many time. If something was not there previously, we need to do the calculation again.

Why A* Search Algorithm? ‘
Informally speaking, A* Search algorithms, unlike other traversal techniques, it has “brains”. It means that it is a smart algorithm that separates it from the other conventional algorithms. This fact is cleared in detail in the below sections.
It is also worth mentioning that many games and web-based maps use this algorithm to find the shortest path very efficiently (approximation).

Regarding educational purposes, we believe it is a suitable difficulty for junior or senior college students.  A* is an algorithm that is strong enough to support some innovative idea or build a sweeping robot. Check out the link here to help you further study. Besides, if you don’t have our hardware, you can try it in MATLAB, and the link is here. (Strongly suggest everyone try!)

–Wentao Zhang, Jim Huang

Stage 4 (Expert) Machine Learning and MPC

Needed skillset: Python (might need C++ as well ), Pytorch, Model Predictive Control, Reinforcement Learning

ML&MPC

Reinforcement Learning  with MPC

  • Improve the driving speed
  • Selecting properly acceleration
  • Avoiding collision

Result

This semester, we went through stage 1 and part of stage 2. We faced the problem of GPU and ROS bridge communication issues. Without the WIFI modulus, the vehicle can move forward and backward at different speeds controlled by the host computer. The WIFI modulus was the main reason that the car can not be controlled by a keypad in the race track, because we can not set up the SSH on the GPU with the host computer to remote control the vehicle.

ESC Adjustment

This video shows the ESC adjustment process. The left side shows the real-time control interface where you could check the speed, power, temperature, and battery.  The right side shows the dynamic control of vehicle on the desk.

Simulator

This video shows the keyboard controlled simulator on Rivz . As shown in the video, you can use the keyboard to speed up, slow down and make a turn. The colorful areas are the places detected by our liar system. 

Future Work

Next semester, we will continuously reach out to this F1 tenth project to solve the problems and make the vehicle move. The goals for next semester are to fix up the old version of the vehicle, apply the motion planning algorithm to the vehicle to reach stage 3 & stage 4, and try to join the competition held in Canada next year. The configuration of NX GPU and ESC needs to be rewritten next semester. We also want to test different algorithms for motion planning, for example, A*, D*, RRT, and RRT*. For obstacle detection, we want to utilize the YOLO algorithm to detect obstacles in real time and get the location, distance, and size of the obstacles.

Meet the Team!

Click the images below to know more about us!

Jim Huang

Yujie Huang

Wentao Zhang

Jiyuan Sun

Acknowledgements

Duke MEMS
Instructor: Dr. George Delagrammatikas
TA: Paavana Srinivas

Advisor:​
Dr. Siobhan Oca
Dr. Leila Bridgeman