This PR contains clean-up fixes to the pedestrian path planning process.
Summary of changes:
In TrafficLight.py, calculate the traffic light time_to_red attribute on init instead of waiting for first tick.
In sp/SPPlanner.py, calculate an "intersection entry point" which finds an average point between all entry points of the crosswalks accessible to the pedestrian on initialization. This is used to check if the pedestrian is close to the intersection when they spawn and if they are, then they should take the light states into consideration when planning their first local path.
Create sp/ConditionConfig.py which is similar to sp/ManeuverConfig.py except defines config parameters for conditions. This was mainly added for the dist_from_xwalk_exit and speed_increase_pct parameters used to judge whether a pedestrian can cross before a red light. These parameters are now accessible by SPPlanner to use in the crosswalk selection process. These specific parameter values can be overridden by specifying values in the btree file.
Run the usual pedestrian scenarios to test, specifically gs_intersection_xwalk_signal.osm because pedestrian_2's crossing decisions can be influenced by different parameter values of dist_from_xwalk_exit and speed_increase_pct.
This PR contains clean-up fixes to the pedestrian path planning process.
Summary of changes:
TrafficLight.py
, calculate the traffic lighttime_to_red
attribute on init instead of waiting for first tick.sp/SPPlanner.py
, calculate an "intersection entry point" which finds an average point between all entry points of the crosswalks accessible to the pedestrian on initialization. This is used to check if the pedestrian is close to the intersection when they spawn and if they are, then they should take the light states into consideration when planning their first local path.sp/ConditionConfig.py
which is similar tosp/ManeuverConfig.py
except defines config parameters for conditions. This was mainly added for thedist_from_xwalk_exit
andspeed_increase_pct
parameters used to judge whether a pedestrian can cross before a red light. These parameters are now accessible bySPPlanner
to use in the crosswalk selection process. These specific parameter values can be overridden by specifying values in the btree file.Run the usual pedestrian scenarios to test, specifically
gs_intersection_xwalk_signal.osm
becausepedestrian_2
's crossing decisions can be influenced by different parameter values ofdist_from_xwalk_exit
andspeed_increase_pct
.