Skip to content

Commit

Permalink
Merge pull request #49 from jerryz123/collision_Fix
Browse files Browse the repository at this point in the history
Fixed collision checking in collides_any_dynamic
  • Loading branch information
jerryz123 committed Apr 13, 2018
2 parents 949afb6 + c35fe01 commit 88e6773
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gym_urbandriving/state/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ def collides_any_dynamic(self, agentnum,type_of_agent = 'background_cars'):
dynamic_collisions, static_collisions, _ = self.get_collisions()

for coll in dynamic_collisions:
if (agentnum in coll) and (type_of_agent in coll):
id1, id2, t1, t2 = coll
if (agentnum, type_of_agent) in [(id1, t1), (id2, t2)]:
return True

return False
Expand Down

0 comments on commit 88e6773

Please sign in to comment.