Use parameters on behaviour tree conditions set in .btree files to allow different configurations of conditions. Specifically added two parameters to the c_can_cross_before_red condition in btrees/sp/cross_xwalk_before_red.btree: speed_increase_pct and dist_from_xwalk_exit.
This condition is used when a pedestrian is faced with a yellow (countdown to red) signal state and judges whether they can sufficiently cross before the next red state. In general, the pedestrian considers the time to the red state, their current desired speed, and the distance they must travel to cross. Descriptions for the added parameters are as follows:
speed_increase_pct - A maximum percentage increase of the desired speed the pedestrian is willing to make in order to cross.
dist_from_xwalk_exit - Distance in meters from the crosswalk exit the pedestrian must be to have sufficiently crossed it. It is common for pedestrians to not have fully crossed the crosswalk by the red state.
To test, run scenario scenarios/pedestrian_scenarios/gs_intersection_xwalk_signal.osm where pedestrian p2 judges whether to cross on a yellow. Consider the following test cases:
speed_increase_pct=0.0 and dist_from_xwalk_exit=0.0 - pedestrian does not cross on yellow
speed_increase_pct=0.5 and dist_from_xwalk_exit=0.0 - pedestrian does cross on yellow
speed_increase_pct=0.0 and dist_from_xwalk_exit=5.5 - pedestrian does cross on yellow
Use parameters on behaviour tree conditions set in
.btree
files to allow different configurations of conditions. Specifically added two parameters to thec_can_cross_before_red
condition inbtrees/sp/cross_xwalk_before_red.btree
:speed_increase_pct
anddist_from_xwalk_exit
.This condition is used when a pedestrian is faced with a yellow (countdown to red) signal state and judges whether they can sufficiently cross before the next red state. In general, the pedestrian considers the time to the red state, their current desired speed, and the distance they must travel to cross. Descriptions for the added parameters are as follows:
speed_increase_pct
- A maximum percentage increase of the desired speed the pedestrian is willing to make in order to cross.dist_from_xwalk_exit
- Distance in meters from the crosswalk exit the pedestrian must be to have sufficiently crossed it. It is common for pedestrians to not have fully crossed the crosswalk by the red state.To test, run scenario
scenarios/pedestrian_scenarios/gs_intersection_xwalk_signal.osm
where pedestrianp2
judges whether to cross on a yellow. Consider the following test cases:speed_increase_pct=0.0
anddist_from_xwalk_exit=0.0
- pedestrian does not cross on yellowspeed_increase_pct=0.5
anddist_from_xwalk_exit=0.0
- pedestrian does cross on yellowspeed_increase_pct=0.0
anddist_from_xwalk_exit=5.5
- pedestrian does cross on yellowFiles affected:
.btree
files inbtrees/sp/
scenarios/pedestrian_scenarios/gs_intersection_xwalk_signal.osm
sp/ManeuverUtils.py
sp/btree/BehaviorModels.py