My F1TENTH Journey — Lab 2, Automatic Emergency Braking

This series of blogs marks the journey of my F1/10 Autonomous Racing Cars.

All my source codes can be accessed here.

Previous post:


This lab focuses on implementing an AEB (Automatic Emergency Braking) in ROS node for F1/10 racing cars. AEB is widely used in autonomous vehicles as a basic safety guarantee to avoid collisions with objects.

The lab materials can be accessed here. A PDF version is also attached below.

The lab was built on the F1Tenth Simulator, which can be accessed here.



TTC (Time-To-Collision) is the time it would take for the vehicle to collide with an obstacle given its current heading and velocity. TTC can be calculated with the following format:

TTC=r[r˙]+TTC = \frac{r}{[-\dot{r}]_+}

where rr is the distance between vehicle and obstacle, r˙\dot{r} is its 1st derivative with respect to time, and the symbol [x]+[x]_+ denotes max(0,x)\max(0,x).

In practice, we use LiDAR results to calculate TTC for each beam. Specifically, we project the current vehicle velocity onto the direction of each beam as r˙\dot{r}, namely r˙=vcos(θ)\dot{r}=v\cos(\theta).

sensor_msgs/LaserScan provides us with LiDAR beams in all directions. In each LaserScan message, we have angle_min, angle_max and angle_increment, which corresponds to the starting angle, the ending angle, and the step angle between two adjacent laser beams. All the angles are given in the local coordinate frame (positive xx direction is the vehicle’s heading) and positive xx direction is marked as angle value 00.

We also have float32[] ranges in each LaserScan message, which gives us the distance to obstacle in the corresponding direction angle. Namely, ranges[i] <--> angle_min + i * angle_increment.

Given the above information, it is not difficult for us to write our AEB ROS node.


F1/10 Autonomous Racing Lecture recordings:

Reprint policy: All articles in this blog are used except for special statements CC BY 4.0 reprint polocy. If reproduced, please indicate source Zhihao (Ryan) Ruan !