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

Add plot expert trajectories #325

Merged
merged 2 commits into from
Jan 23, 2025

Conversation

KKGB
Copy link
Contributor

@KKGB KKGB commented Jan 20, 2025

Description

This PR adds an option to visualize expert trajectories.
This option can be turned on/off with two booleans:

draw_expert_trajectories
: A boolean indicating whether to draw expert trajectories.
draw_only_ego_expert_traj:
: A boolean indicating whether to draw only ego trajectories (only effective if draw_expert_trajectories is True)

Behavior

draw_expert_trajectories=False, draw_only_ego_expert_traj=True/False
1

draw_expert_trajectories=True, draw_only_ego_expert_traj=False
2

draw_expert_trajectories=True, draw_only_ego_expert_traj=True
3

Copy link
Contributor

@daphne-cornelisse daphne-cornelisse left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution! This looks good to me. Left a small comment, but happy to merge this otherwise.

expert_trajectories: The global state of expert from `LogTrajectory`.
"""
if self.vis_config.draw_expert_trajectories:
controlled_mask = self.controlled_agents[env_idx, :]
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like the "draw_only_ego_expert_traj" draws the trajectories for all controlled vehicles. If that is correct, I'd suggest changing the name for clarity

Copy link
Contributor Author

@KKGB KKGB Jan 20, 2025

Choose a reason for hiding this comment

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

Thanks for the comment! How about "draw_only_controllable_veh"? Let me know what you think :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I think that is more descriptive! Could you please change the name? I'll approve it so you can merge the PR after

@KKGB
Copy link
Contributor Author

KKGB commented Jan 20, 2025

I have updated the variable name as suggested. Thanks for your feedback!

@daphne-cornelisse daphne-cornelisse merged commit aba4b6f into Emerge-Lab:main Jan 23, 2025
daphne-cornelisse added a commit that referenced this pull request Jan 26, 2025
* Add plot expert trajectories (#325)

* Add: plot expert trajectories

* Refactor: rename draw_only_controllable_veh variable

* Export map names

* Handle set maps case

* Add env helper func to extract filenames from worlds

---------

Co-authored-by: Kyungbeom Kim <[email protected]>
Co-authored-by: Daphne Cornelisse <[email protected]>
daphne-cornelisse added a commit that referenced this pull request Jan 27, 2025
* Add plot expert trajectories (#325)

* Add: plot expert trajectories

* Refactor: rename draw_only_controllable_veh variable

* Export map names

* Handle set maps case

* Add env helper func to extract filenames from worlds

* Dont use sizeof() for loop indexing

---------

Co-authored-by: Kyungbeom Kim <[email protected]>
Co-authored-by: Daphne Cornelisse <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants