The main purpose of this PR is to merge the functionality of pedestrian dynamic route selection. This means that the pedestrians plan a route (as a list of crosswalk entrances and exits) from their starting position to their destination. The route selection algorithm is primitive and will have future improvements, but it seems to work well in most cases. This planning step is done by the plan_route() function in sp/SPPlanner.py.
In this PR, the pedestrian planning and behaviour tree tick steps have been moved to a new file, sp/SPPlanner.py, similar to the structure for dynamic vehicles.
Summary of major changes:
sp/SPPlanner.py file added to handle planing crosswalk route and ticking behaviour trees (formerly handled by Pedestrian.py)
A dictionary of all the crosswalk entrance and exit points are stored in sim_traffic that pedestrians have access to for route planning. This dict is generated by get_crosswalks_entry_pts() in LaneletMap.py.
Traffic island areas added to scenarios/maps/lanelet2_university_weber_alt_walkways.osm
Added function get_occupying_area() in LaneletMap.py since pedestrians can be in an area on the map that is not a lanelet (e.g. traffic island)
Changed language of 'update destination' maneuver to 'update waypoint' for clarity. List of destinations is now called the pedestrian's route.
To test, run any of the pedestrian scenarios in scenarios/pedestrian_scenarios and note the starting positions, final destinations, and the planned route taken by the agents. You can also move the starting positions and destinations to make the pedestrians choose a different set of crosswalks to cross the intersection.
The main purpose of this PR is to merge the functionality of pedestrian dynamic route selection. This means that the pedestrians plan a route (as a list of crosswalk entrances and exits) from their starting position to their destination. The route selection algorithm is primitive and will have future improvements, but it seems to work well in most cases. This planning step is done by the
plan_route()
function insp/SPPlanner.py
.In this PR, the pedestrian planning and behaviour tree tick steps have been moved to a new file,
sp/SPPlanner.py
, similar to the structure for dynamic vehicles.Summary of major changes:
sp/SPPlanner.py
file added to handle planing crosswalk route and ticking behaviour trees (formerly handled byPedestrian.py
)sim_traffic
that pedestrians have access to for route planning. This dict is generated byget_crosswalks_entry_pts()
inLaneletMap.py
.scenarios/maps/lanelet2_university_weber_alt_walkways.osm
get_occupying_area()
inLaneletMap.py
since pedestrians can be in an area on the map that is not a lanelet (e.g. traffic island)To test, run any of the pedestrian scenarios in
scenarios/pedestrian_scenarios
and note the starting positions, final destinations, and the planned route taken by the agents. You can also move the starting positions and destinations to make the pedestrians choose a different set of crosswalks to cross the intersection.