diff --git a/nav2_behavior_tree/include/nav2_behavior_tree/plugins/action/drive_on_heading_action.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/plugins/action/drive_on_heading_action.hpp index 3fb5a56fb8c..7bb0e49f6e1 100644 --- a/nav2_behavior_tree/include/nav2_behavior_tree/plugins/action/drive_on_heading_action.hpp +++ b/nav2_behavior_tree/include/nav2_behavior_tree/plugins/action/drive_on_heading_action.hpp @@ -86,9 +86,6 @@ class DriveOnHeadingAction : public BtActionNode(xml_tag_name, action_name, conf), - initialized_(false) +: BtActionNode(xml_tag_name, action_name, conf) { } @@ -47,12 +46,11 @@ void DriveOnHeadingAction::initialize() goal_.speed = speed; goal_.time_allowance = rclcpp::Duration::from_seconds(time_allowance); goal_.disable_collision_checks = disable_collision_checks; - initialized_ = true; } void DriveOnHeadingAction::on_tick() { - if (!initialized_) { + if (!BT::isStatusActive(status())) { initialize(); } }