Skip to content
Snippets Groups Projects
Commit a2d8f0c9 authored by sayanmitracode's avatar sayanmitracode
Browse files

ball collision checks

parent bf1d4b0d
No related branches found
No related tags found
No related merge requests found
...@@ -40,11 +40,18 @@ def controller(ego:State, others:State): ...@@ -40,11 +40,18 @@ def controller(ego:State, others:State):
output.vy = -ego.vy output.vy = -ego.vy
output.y=0 output.y=0
if ego.x>20: if ego.x>20:
# Q. If I change this to ego.x >= 20 then the model does not work.
# I suspect this is because the same transition can be take many, many times.
# We need to figure out a clean solution
output.vx = -ego.vx output.vx = -ego.vx
output.x=20 output.x=20
if ego.y>20: if ego.y>20:
output.vy = -ego.vy output.vy = -ego.vy
output.y=20 output.y=20
''' if ego.x - others[1].x < 1 and ego.y - others[1].y < 1:
output.vy = -ego.vy
output.vx = -ego.vx'''
# We would like to be able to write something like this, but currently not allowed.
return output return output
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment