-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introducing a single agent, multi-goal, four-ways intersection enviro…
…nment (#699) * better way to handle U turn in Intersection * INIT * Revert "better way to handle U turn in Intersection" This reverts commit d9bf4bb. * add doc * fix bug * add docs * If navigation_module is set to None, remove navigation in StateObservation. (I am not 100% sure if this is OK. Might cause error.) * WIP: Implementing a navigation/goal manager * Implemented goal / navigation managers * adding a U-turn intersection block * add assert in node_road_network * fix potential bug * Now the environment is running correctly! (but reset is broken) * introduce observation * format * add more docs * introduce a config to disable navigation arrows * minor * use varying dynamics agent in multi-goal env * support use a list of types to control PG map; allow set map=None to disable shortcut config map. * allow change radius of the intersection; set accident_prob=1.0 * 1) introduce goal-agnoistic info["obs/ego/*"], 2) rename keys in info dict * optimize the reward structure, now: ===== timestep 220 ===== route completion: route_completion/goals/default: 0.92 route_completion/goals/go_straight: 0.50 route_completion/goals/left_turn: 0.46 route_completion/goals/right_turn: 0.92 route_completion/goals/u_turn: 0.53 reward: reward/default_reward: 1.27 reward/goal_agnostic_reward: 0.05 reward/goals/default: 1.27 reward/goals/go_straight: 0.14 reward/goals/left_turn: 0.06 reward/goals/right_turn: 1.27 reward/goals/u_turn: 0.01 ======================= * to follow setting, use lane_num=1 * format, ready to launch SB3 td3 * Remove varying dynamics * lane_num=1 * allow do more visualization * add default arrive_dest * add some comments * now we return full observation for different goals in info["obs/goals/xxx"] * [DANGER] allow to generate sidewalk for "negative road". Not sure the affect of this commit in other cases. Might need further check. * Add SIDEWALK to the side detector & the lane line detector. * use 240line for sidedetector, remove vehicle/lane detector * fix a bug * Fix a severe bug that messes up observation * introduce a penalty for wrong way * When draw the line to next checkpoint, also draw the line from next ckpt to next next ckpt. * Add crash_sidewalk_penalty for MetaDrive env, default crash_sidewalk_penalty=0 * Set on_continuous_line_done=False for multigoal env * Add config "out_of_road_done" for MDEnv * Remove U turn * Set out_of_road_done=False * Add penalty for out_of_route (this might be helpful in multigoal setting) * Change reward scheme * Change radius to 12 * remove goal_agnostic_reward * add GOAL_DEPENDENT_STATE * up * change obs * Add some randomness in map * enable U turn * WIP: Now support conventional RL env * fix bug * Fix a bug and use Customize Observation * Better handle lidars' configs * Remove those hyper diff from MetaDriveEnv * fix * Fix * format * remove a file * Add an example notebook for multigoalintersection * Setup FFpmeg in CI to support video gen in docs * minor * minor * Add docs * Fix test * format * try fix ffmpeg * Fix test
- Loading branch information
1 parent
880fcd0
commit 9b3fde1
Showing
26 changed files
with
1,110 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
from metadrive.component.pgblock.intersection import InterSection | ||
from metadrive.component.pg_space import Parameter | ||
from metadrive.component.pgblock.intersection import InterSection, InterSectionWithUTurn | ||
|
||
|
||
class StdInterSection(InterSection): | ||
def _try_plug_into_previous_block(self) -> bool: | ||
self._config[Parameter.change_lane_num] = 0 | ||
success = super(StdInterSection, self)._try_plug_into_previous_block() | ||
return success | ||
|
||
|
||
class StdInterSectionWithUTurn(InterSectionWithUTurn): | ||
def _try_plug_into_previous_block(self) -> bool: | ||
self._config[Parameter.change_lane_num] = 0 | ||
success = super(StdInterSectionWithUTurn, self)._try_plug_into_previous_block() | ||
return success |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.