Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ class ComputePathToPoseAction : public BtActionNode<nav2_msgs::action::ComputePa
*/
BT::NodeStatus on_cancelled() override;

/**
* \brief Override required by the a BT action. Cancel the action and set the path output
*/
void halt() override;

/**
* @brief Creates list of BT ports
* @return BT::PortsList Containing basic ports along with node-specific ports
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ BT::NodeStatus ComputePathToPoseAction::on_cancelled()
return BT::NodeStatus::SUCCESS;
}

void ComputePathToPoseAction::halt()
{
nav_msgs::msg::Path empty_path;
setOutput("path", empty_path);
BtActionNode::halt();
}

} // namespace nav2_behavior_tree

#include "behaviortree_cpp_v3/bt_factory.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ BT::NodeStatus GloballyUpdatedGoalCondition::tick()
first_time = false;
config().blackboard->get<std::vector<geometry_msgs::msg::PoseStamped>>("goals", goals_);
config().blackboard->get<geometry_msgs::msg::PoseStamped>("goal", goal_);
return BT::NodeStatus::FAILURE;
return BT::NodeStatus::SUCCESS;
}

std::vector<geometry_msgs::msg::PoseStamped> current_goals;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ TEST_F(GloballyUpdatedGoalConditionTestFixture, test_behavior)
config_->blackboard->set("goal", goal);

EXPECT_EQ(bt_node_->status(), BT::NodeStatus::IDLE);
EXPECT_EQ(bt_node_->executeTick(), BT::NodeStatus::FAILURE);
EXPECT_EQ(bt_node_->executeTick(), BT::NodeStatus::SUCCESS);

goal.pose.position.x = 1.0;
config_->blackboard->set("goal", goal);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
#ifndef NAV2_COLLISION_MONITOR__RANGE_HPP_
#define NAV2_COLLISION_MONITOR__RANGE_HPP_

#include <memory>
#include <vector>
#include <string>

#include "sensor_msgs/msg/range.hpp"

#include "nav2_collision_monitor/source.hpp"
Expand Down