ForzaETH / race_stack

The autonomous racing stack for the ForzaETH team at PBL
MIT License
93 stars 23 forks source link

Head-to-Head simulation #15

Closed Abc11c closed 7 hours ago

Abc11c commented 2 months ago

Hi,

Thank you for releasing the code! I was wondering how to generate head-to-head simulations for overtaking/trailing strategies (similar to Figure 20). Specifically, how can I initialize the simulation with 2 agents? (resolved)

I'm able to generate the time trials based on the instructions as follows:

roslaunch stack_master base_system.launch map_name:=test_map racecar_version:=NUC2
roslaunch stack_master time_trials.launch racecar_version:=NUC2

Also the head-to-head simulation with a dummy agent with a same racing line as the agent:

roslaunch stack_master base_system.launch map_name:=test_map racecar_version:=SIM
roslaunch stack_master headtohead.launch racecar_version:=SIM ctrl_algo:=PP  overtake_mode:=spliner
roslaunch obstacle_publisher obstacle_publisher.launch speed:=0.5

However, when it tries to overtake it results in a collision? get the following logs, any suggestions ?

[INFO] [1725658353.376683]: [obs_spliner_node]: Can't switch sides, because we are not on the raceline
[INFO] [1725658356.179634]: [obs_spliner_node]: Evasion trajectory too close to TRACKBOUNDS, aborting evasion
[INFO] [1725659219.072810]: [Dummy OD] Back Collision with Opponent detected! Position Frenet s: 0.48098854423642123 [m]

image

Thanks!

NadineImholz commented 1 month ago

Hi there,

The root of the issue is that the obstacle_publisher is sending messages on the same topic as the output of the perception pipeline. Since the virtual opponent isn't detectable by LiDAR our perception pipeline can't detect it. This creates a mix of messages where the opponent is not detected, and others where the opponent is detected. This inconsistency is causing the car to switch between trailing the opponent and tracking the raceline, which can lead to crashes.

A quick way to address this is to temporarily disable the perception pipeline. You can do this by not launching the perception pipline in the headtohead.launch. We're currently developing a better fix and will be integrating it soon.

If you want to enable overtaking behavior, make sure that:

Hope this helps!