Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Automatic Emergency Braking (AEB) for F1TENTH Simulator

This repository contains a ROS 2 C++ node that enables Automatic Emergency Braking (AEB) for an autonomous vehicle in the F1TENTH simulator using Time-To-Collision (TTC) logic.


🚗 What It Does

The node monitors:

  • LIDAR data from the /scan topic
  • Velocity data from /ego_racecar/odom

It computes the Time-To-Collision (TTC) for each laser beam. If the TTC falls below a defined safety threshold, it publishes a brake message to the /drive topic to stop the car.


🧠 TTC Logic

For each laser beam:

$$TTC = range / (speed * cos(angle))$$
  • Only beams with a forward velocity component (cos(angle) > 0) are considered.
  • If any TTC is below the safety threshold (e.g. 1.0 seconds), braking is triggered immediately.

🧪 How to Run / Test

Step 1: Launch the Simulator

Make sure to use the working launch command you’ve been using:

cd ~/f1tenth_ws
source install/setup.bash
ros2 launch f1tenth_gym_ros gym_bridge_launch.py

Step 2: Run the C++ Safety Node (in a new terminal)

cd ~/lab2_ws
source install/setup.bash
ros2 run safety_node safety_node

Step 3: Drive the Car with Keyboard (In another terminal)

ros2 run teleop_twist_keyboard teleop_twist_keyboard

About

ROS 2 safety node for F1TENTH simulator using LiDAR and odometry data to calculate time-to-collision and trigger automatic emergency braking.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages