Fix nullopt dereference in GoToPlace goal selection of 'one_of' #130
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bug fix
Fixed bug
When using 'one_of' feature in GoToPlace, a reachable goal followed by an unreachable goal (eg. lane closed) combination will trigger a runtime failure. eg:
The root cause is a nullopt dereference during goal selection, where the estimate time comparison unconditionally accesses
invariant_duration_optfor a subsequent unreachable goal while generating the GoToPlace model.Fix applied
Applied a nullopt check before
else if (shortest_travel_time.value() > invariant_duration_opt.value()).If
invariant_duration_optis nullopt then we skip this goal candidate.To test
a. Before fix:
tinyRobot1_charger, and tintRobot2 is at waypointtinyRobot2_charger.presupplies& waypointpatrol_D2ros2 topic pub /lane_closure_requests rmf_fleet_msgs/msg/LaneRequest "{fleet_name: 'tinyRobot', open_lanes: [], close_lanes: [0,1]}" --oncecoe&supplies)ros2 run rmf_demos_tasks dispatch_go_to_place -p coe supplies --use_sim_timeb. After fix:
GenAI Use
We follow OSRA's policy on GenAI tools
Generated-by: