Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move edt as part of track asset #117

Open
wants to merge 10 commits into
base: v1.0.0
Choose a base branch
from
Open

Move edt as part of track asset #117

wants to merge 10 commits into from

Conversation

hzheng40
Copy link
Member

@hzheng40 hzheng40 commented Feb 28, 2024

Addresses #107

  1. Added edt as part of track assets that are downloaded
  2. Fixed path where maps are saved and loaded from
  3. Load EDT if available instead of creating on the fly every time, should be quite a bit of speed up for set_map()
  4. Added example script for creating the EDT for a track

@hzheng40 hzheng40 added the enhancement New feature or request label Feb 28, 2024
Copy link
Member

@nandantumu nandantumu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good, but have a few questions

examples/create_edt.py Outdated Show resolved Hide resolved
examples/create_edt.py Outdated Show resolved Hide resolved
gym/f110_gym/envs/track/utils.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@luigiberducci luigiberducci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

I would integrate the creation of EDT directly into the track loading.
We can keep this as an example anyway or get rid of it.

gym/f110_gym/envs/track/track.py Outdated Show resolved Hide resolved
gym/f110_gym/envs/track/track.py Outdated Show resolved Hide resolved
@luigiberducci
Copy link
Collaborator

@hzheng40 I have added a test for a kind of corner case we discussed in the last meeting. The changes proposed should address it.

Scenario:
The EDT has been created, then the user modifies the map (e.g., add obstacles manually).
Now there is a mismatch between the map image and the EDT and the simulator will load the old EDT.

Current behavior:
The simulator will load an outdated dt.

Expected behavior:
The EDT must be recomputed and override the old one.

Copy link
Collaborator

@luigiberducci luigiberducci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a couple of changes necessary

@@ -0,0 +1,41 @@
from f110_gym.envs.track import Track
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
from f110_gym.envs.track import Track
from f1tenth_gym.envs.track import Track

@@ -24,7 +24,7 @@ def find_track_dir(track_name: str) -> pathlib.Path:
FileNotFoundError
if no map directory matching the track name is found
"""
map_dir = pathlib.Path(__file__).parent.parent.parent.parent / "maps"
map_dir = pathlib.Path(__file__).parent.parent.parent.parent.parent / "maps"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this? it does not point to the right "maps" directory in this way

Suggested change
map_dir = pathlib.Path(__file__).parent.parent.parent.parent.parent / "maps"
map_dir = pathlib.Path(__file__).parent.parent.parent.parent / "maps"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants