rodrigoqueiroz / geoscenarioserver

9 stars 1 forks source link

Add configurable behaviour tree condition parameters #87

Closed scott-larter closed 2 years ago

scott-larter commented 2 years ago

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:

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:

  1. speed_increase_pct=0.0 and dist_from_xwalk_exit=0.0 - pedestrian does not cross on yellow
  2. speed_increase_pct=0.5 and dist_from_xwalk_exit=0.0 - pedestrian does cross on yellow
  3. speed_increase_pct=0.0 and dist_from_xwalk_exit=5.5 - pedestrian does cross on yellow

Files affected: