This pull request focuses on pedestrian behaviour based on the influence of crossing lights. The main contribution is the definition of three Levels of Aggressiveness which each determine different behaviours during certain decision times.
Decision times:
(1) selecting a target crosswalk from all possible candidates when approaching the intersection
(2) deciding when to enter the target crosswalk
Technical changes and additions:
implemented logic for decision time (1) in plan_local_path() function in SPPlanner.py for each level of aggressiveness
created three subtrees for decision time (2) corresponding to the three levels of aggressiveness
created three versions of walk.btree for each level of aggressiveness
reconfigured walk.btree to better capture all scenarios and reduce failing edge cases
added time_to_red attribute to pedestrian traffic lights to represent the "countdown" before a red light state
implemented the condition to check if pedestrians can cross a crosswalk before the light turns red with can_cross_before_red() function in ManeuverUtils.py
Additional changes after PR creation:
Changes to the method for selecting a target crosswalk between all candidates. Previously, a crosswalk was a candidate if the Euclidean distance between its exit and the pedestrian's destination is smaller than the distance between its entrance and the destination. This logic is not changed but the pedestrian's destination is no longer used. Now an "intersection exit point" is used instead (an approximation of the exit point of the last crosswalk taken before the destination). This eliminates strange edge cases where candidates were incorrectly selected or incorrectly not selected.
As usual, run the pedestrian scenarios in scenarios/pedestrian_scenarios/ with various configurations to confirm the new functionality.
This pull request focuses on pedestrian behaviour based on the influence of crossing lights. The main contribution is the definition of three Levels of Aggressiveness which each determine different behaviours during certain decision times.
Decision times: (1) selecting a target crosswalk from all possible candidates when approaching the intersection (2) deciding when to enter the target crosswalk
Technical changes and additions:
plan_local_path()
function inSPPlanner.py
for each level of aggressivenesswalk.btree
for each level of aggressivenesswalk.btree
to better capture all scenarios and reduce failing edge casestime_to_red
attribute to pedestrian traffic lights to represent the "countdown" before a red light statecan_cross_before_red()
function inManeuverUtils.py
Additional changes after PR creation:
As usual, run the pedestrian scenarios in
scenarios/pedestrian_scenarios/
with various configurations to confirm the new functionality.