rodrigoqueiroz / geoscenarioserver

8 stars 1 forks source link

Integrating pedestrian class with simple motion model #39

Closed scott-larter closed 3 years ago

scott-larter commented 3 years ago

Summary of additions:

Run python3.8 GSServer.py -s scenarios/pedestrian_scenarios/gs_intersection_redlight.osm to view pedestrian functionality.

mchlswyr commented 3 years ago

I got the scenario to run but it crashed with this error when the pedestrians were very close to each other:

Traceback (most recent call last):
  File "GSServer.py", line 97, in <module>
    start_server(args)
  File "GSServer.py", line 65, in start_server
    sim_status = traffic.tick(
  File "/home/ma/anm_unreal_sim/submodules/geoscenarioserver/SimTraffic.py", line 120, in tick
    self.vehicles[vid].tick(tick_count, delta_time, sim_time)
  File "/home/ma/anm_unreal_sim/submodules/geoscenarioserver/sv/Vehicle.py", line 125, in tick
    self.compute_vehicle_state(delta_time)
  File "/home/ma/anm_unreal_sim/submodules/geoscenarioserver/sv/Vehicle.py", line 160, in compute_vehicle_state
    raise e
  File "/home/ma/anm_unreal_sim/submodules/geoscenarioserver/sv/Vehicle.py", line 157, in compute_vehicle_state
    x_vector, y_vector = frenet_to_sim_frame(self.global_path, self.state.get_S(), self.state.get_D())
  File "/home/ma/anm_unreal_sim/submodules/geoscenarioserver/util/Transformations.py", line 175, in frenet_to_sim_frame
    position = frenet_to_sim_position(ref_path, s, d)
  File "/home/ma/anm_unreal_sim/submodules/geoscenarioserver/util/Transformations.py", line 62, in frenet_to_sim_position
    raise OutsideRefPathException("s {} d {} is outside the reference path.".format(s, d))
util.Transformations.OutsideRefPathException: s 156.15250071984397 d 0.3650485243657736 is outside the reference path.

I got the same error. When I remove the vehicle and route from the scenario, then it looks like it crashes at the same point (when the pedestrians are close to each other), but with a different error:

Traceback (most recent call last):
  File "GSServer.py", line 97, in <module>
    start_server(args)
  File "GSServer.py", line 76, in start_server
    traffic.stop_all()
  File "/home/ms/anm_unreal_sim/submodules/geoscenarioserver/SimTraffic.py", line 89, in stop_all
    self.vehicles[pid].stop()
KeyError: 1
mchlswyr commented 3 years ago

The script for running the server and client works on gs_ringroad_stress_loop.osm, and seems to run fine. I then edited this script to work for gs_intersection_redlight.osm, and recieve the messages

GeoScenario server START
...
...
Stop target position is too close. diff=0.7259056390182934
Stop target position is too close. diff=0.32261051460542944
Terminate Planner Process - vehicle 1
SIMULATION END
GeoScenario server shutdown

The ego drives through the map, but there are no pedestrians. I don't know why this doesn't work, and if it is likely something on my end let me know what setup to try!

You just need to test python3.8 GSServer.py -s scenarios/pedestrian_scenarios/gs_intersection_redlight.osm. GSClient doesn't work with pedestrians yet; only GSServer.

mantkiew commented 3 years ago

GSClient doesn't work with pedestrians yet; only GSServer.

@WAEliasmith yes! That is what I suggested that you could work on: add support for pedestrians to GSClient.