Skip to content

Commit

Permalink
Merge pull request #96 from jerryz123/v2
Browse files Browse the repository at this point in the history
Fixed pedestrian planning
  • Loading branch information
jerryz123 committed Aug 3, 2018
2 parents 73056f3 + 6706df6 commit fe9921f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fluids/assets/pedestrian.py
Expand Up @@ -3,8 +3,10 @@
import shapely
import pygame
from fluids.assets.shape import Shape

from fluids.assets.car import Car
from fluids.assets.crosswalk_light import CrossWalkLight
class Pedestrian(Shape):
collideables = [Car, CrossWalkLight]
def __init__(self, max_vel=2, vel=0, planning_depth=2, **kwargs):
Shape.__init__(self, color=(255, 250, 150), xdim=20, ydim=20, **kwargs)
self.max_vel = max_vel
Expand Down
1 change: 1 addition & 0 deletions fluids/sim.py
Expand Up @@ -307,6 +307,7 @@ def multiagent_plan(self):
solver.Add(k1v == 0)
for k1x in range(len(ped_keys)):
k1 = ped_keys[k1x]
k1v = var_map[k1]
ped1 = self.state.objects[k1]
for fl, flc in futures_crosswalks:
if abs(ped1.angle - fl.angle) < np.pi / 2:
Expand Down

0 comments on commit fe9921f

Please sign in to comment.