Introduction

This lab is about using Lidar and Odometry to compute TTC(Time to Collision) to force the f1Tenth racing car to make AEB(automatic emergency brake) before hitting obstacles. This task uses LaserScan, Odometry and AckermannDriveStamped messages. It subscribes LaserScan, Odometry messages and publish AckermannDriveStamped messages for car control.

Implementation Explanation

The key for making AEB is computing TTC and set a reasonable threshold of TTC. The formula of TTC is shown below: where ri denotes the range value of each lidar beam with index i. The planar Lidar and also the message definition of LaserScan is shown below. The time derivative of ri can be calculated as follow: where vx can be derived from nav_msgs/Odometry.msg twist.twist.linear.x. Note that the definitation of beam angle:

A Good Source for Beam Angle Illustration

Since the AEB is designed for safety consideration, we should reduce false positives and avoid false negatives. I set the threshold of TTC as 0.3(s) in my experiment. If TTC is less than this threshold, the AEB is applied.

My Demo

This safety node is writen with roscpp

Upenn F1/10 course Video: