Skip to content

Commit

Permalink
Set default contact result to unset (#546)
Browse files Browse the repository at this point in the history
default contact unset
  • Loading branch information
QuanyiLi committed Nov 5, 2023
1 parent 62353d6 commit 0d43709
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions metadrive/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ class TerminationState:
MetaDriveType.LIGHT_RED: "red",
MetaDriveType.LIGHT_YELLOW: "orange",
MetaDriveType.LIGHT_GREEN: "green",
MetaDriveType.UNSET: "orange",
}


Expand Down
2 changes: 1 addition & 1 deletion metadrive/engine/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def _render_banner(self, text, color=COLLISION_INFO_COLOR["green"][1]):

def _render_contact_result(self, contacts):
contacts = sorted(list(contacts), key=lambda c: COLLISION_INFO_COLOR[COLOR[c]][0])
text = contacts[0] if len(contacts) != 0 else None
text = contacts[0] if len(contacts) != 0 else MetaDriveType.UNSET
color = COLLISION_INFO_COLOR[COLOR[text]][1]
if time.time() - self.engine._episode_start_time < 10:
text = "Press H to see help message"
Expand Down

0 comments on commit 0d43709

Please sign in to comment.