Testing Racing-Stack with Simulation
This guide explains how to run Racing-Stack in a simulation environment, allowing you to test without an actual vehicle.
You can use this for logic verification and testing before operating the actual vehicle.
Mapping
- Since you cannot create a map within the simulation environment, you need map.png and map.yaml files.
Note) File generation process on the actual vehicle:
- Run
roscore- Launch vehicle sensors (LIDAR, IMU, VESC) with
roslaunch stack_master low_level.launch- Generate files with
roslaunch stack_master mapping.launch map:=map_name create_map:=true(drive one lap around the closed-loop map)
File Example
| Field | Description |
|---|---|
| image | Filename |
| resolution | 1 pixel = 0.05m |
| origin | Map origin point |
| occupied_thresh | Obstacle detection threshold |
| free_thresh | Free space detection threshold |
| negate | Image inversion flag |
- Calculate the optimal path based on the map.
1
roslaunch stack_master mapping.launch map:=map_name create_map:=false create_global_path:=true
- Extract centerline based on map.png
- Set Speed sector for speed tuning per section
- Set Overtaking sector to define overtaking allowed zones
Three files are generated in the end.
global_waypoints.json: Optimal path and speed profilespeed_scaling.yaml: Speed limits per sectionot_sectors.yaml: Overtaking allowed zones
Head to head
- Launch the simulation environment.
1
roslaunch stack_master base_system.launch map:=map_name sim:=true
- Enable obstacle detection, driving state judgment, and vehicle control functions.
1
roslaunch stack_master headtohead.launch perception:=false
Obstacle
1. Static obstacle avoidance
You can create static obstacles using Publish Point in rviz.
The system detects the static obstacle and generates an avoidance path, showing collision-free obstacle avoidance.
2. Dynamic obstacle overtaking
You can create a dynamic obstacle that travels along the optimal path at a slower speed (0.4x).
1
roslaunch obstacle_publisher obstacle_publisher.launch speed_scaler:=0.4
The system detects the dynamic obstacle and generates an overtaking path, demonstrating successful overtaking behavior.
Conclusion
This guide covered how to test Racing-Stack in a simulation environment.
- You can verify racing-stack logic using simulation.
- You can generate map-based driving data (optimal path, speed profile, overtaking zones).
- You can test virtual obstacle scenarios (static obstacle avoidance and dynamic obstacle overtaking).
We recommend thoroughly verifying in simulation before deploying to the actual vehicle.




