Skip to content

Fix random track generation for config level 3#112

Merged
ratheron merged 2 commits into
mainfrom
fix.generated_tracks
Jun 30, 2026
Merged

Fix random track generation for config level 3#112
ratheron merged 2 commits into
mainfrom
fix.generated_tracks

Conversation

@amacati

@amacati amacati commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Overview

This PR fixes the track generation to no longer sample configurations where gates and obstacles would sometimes get sampled nearly on the same spot.

Redesigned sampling

Previously, if we found no good solution within the constraints of the track generator, we used position created uniformly at random. This PR turns the track generation into a three stage process, where we first sample around preferred positions, fall back to any viable position, and finally fall back to the positions that least violate our design constraints.

Algorithm

First, we initialize grids for the obstacles and gates (gate_clear, obs_clear) that track the clearance to the closest objects. We then iteratively sample gate and obstacle positions and update the clearance maps.

Gates are placed at random with a minimum distance to all objects. If there is no space left, we use the maximum clearance we can find. Previously, we fell back to uniform sampling, which lead to the collisions we saw.

Obstacles are also placed at random, but preferably between the previous and the next gate. If that is not possible, they are placed randomly in a valid position. Finally, if that is not possible, we again fall back to the maximum clearance.

We now also allow the track to randomize the drone position. To enable this setting, we have to increase the drone position randomization in the level 3 configs. This is on hold for now to not interrupt the running course.

Breaking changes

One change this PR introduces in the track generation is that we no longer attempt to stay clear of previous gate corridors. This reduces complexity and allows for a larger variety of tracks.

Related Issues

Fixes #110, fixes #107

@amacati
amacati requested a review from ratheron June 30, 2026 16:39
@amacati amacati added the bug Something isn't working label Jun 30, 2026
@ratheron
ratheron merged commit cf72371 into main Jun 30, 2026
5 checks passed
@ratheron
ratheron deleted the fix.generated_tracks branch June 30, 2026 17:49
deniz-onat added a commit to deniz-onat/lsy_drone_racing that referenced this pull request Jul 6, 2026
…b#91, learnsyslab#112)

Pull the exact upstream/main versions of the sim env's track randomization:
- learnsyslab#112: rewrite random track generation for level 3 (collision-free layouts).
- learnsyslab#91: report the randomized layout as the nominal gate/obstacle positions in
  the observation, instead of the (meaningless-under-randomization) config poses.
Includes the matching unit tests. Controllers and dependencies untouched.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
aloisi101-bit pushed a commit to aloisi101-bit/lsy_drone_racing that referenced this pull request Jul 7, 2026
* Fix random track generation

* Remove gate corridors
aloisi101-bit pushed a commit to aloisi101-bit/lsy_drone_racing that referenced this pull request Jul 7, 2026
* Fix random track generation

* Remove gate corridors
aloisi101-bit pushed a commit to aloisi101-bit/lsy_drone_racing that referenced this pull request Jul 7, 2026
* Fix random track generation

* Remove gate corridors
aloisi101-bit pushed a commit to aloisi101-bit/lsy_drone_racing that referenced this pull request Jul 7, 2026
* Fix random track generation

* Remove gate corridors
aloisi101-bit pushed a commit to aloisi101-bit/lsy_drone_racing that referenced this pull request Jul 7, 2026
* Fix random track generation

* Remove gate corridors
aloisi101-bit pushed a commit to aloisi101-bit/lsy_drone_racing that referenced this pull request Jul 7, 2026
* Fix random track generation

* Remove gate corridors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Level 3 random obstacle can spawn too close to or collide with a gate Drone pos is not randomized on level 3

2 participants