7.4.7
Abstract
This PR contains a bug fix for the issue described here.
After applying this fix, the scenario in question now passes.
Details
- The problem arises when
behavior_plugin_ptr_->getWaypoints()
is called while theBlackboard
does not contain theWaypoints
value yet. In this function:
https://github.com/tier4/scenario_simulator_v2/blob/ee61ede05d2969a395e9a946d0d035b73c845910/simulation/traffic_simulator/src/entity/vehicle_entity.cpp#L114-L127 - Default-initializing the missing values (that is,
Waypoints
andObstacle
) in the vehicle constructor seems to be fixing the issue. - But after a deeper dive into the behavior tree actions, I have found an abnormality in the code:
https://github.com/tier4/scenario_simulator_v2/blob/ee61ede05d2969a395e9a946d0d035b73c845910/simulation/behavior_tree_plugin/src/vehicle/follow_lane_sequence/follow_lane_action.cpp#L69-L138
- There are multiple actions overloading
tick()
method (such asStopAtStopLineAction
orFollowFrontEntityAction
). - if the
tick()
method returnsBT::NodeStatus::RUNNING
orBT::NodeStatus::SUCCESS
there is alwayssetOutput("waypoints", waypoints); setOutput("obstacle", calculateObstacle(waypoints));
. - if the
tick()
method returnsBT::NodeStatus::FAILURE
waypoints and obstacle is never set. - the only exception to this rule is changed in this PR.
- removing this abnormality also fixes the issue.
References
Regressions OK