forked from ros-navigation/navigation2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from logivations/feature_WMO-55690_detect_and_a…
…void_obstacles_on_w2mo_paths WMO-55690 Detect and avoid obstacles on w2mo paths
- Loading branch information
Showing
13 changed files
with
147 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
...behavior_tree/include/nav2_behavior_tree/plugins/action/find_free_goal_on_path_action.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// Copyright (c) 2018 Intel Corporation | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#ifndef NAV2_BEHAVIOR_TREE__PLUGINS__ACTION__FIND_FREE_GOAL_ON_PATH_ACTION_HPP_ | ||
#define NAV2_BEHAVIOR_TREE__PLUGINS__ACTION__FIND_FREE_GOAL_ON_PATH_ACTION_HPP_ | ||
|
||
#include <string> | ||
|
||
#include "nav2_msgs/action/find_free_goal_on_path.hpp" | ||
#include "nav_msgs/msg/path.h" | ||
#include "nav2_behavior_tree/bt_action_node.hpp" | ||
|
||
namespace nav2_behavior_tree | ||
{ | ||
|
||
class FindFreeGoalOnPathAction : public BtActionNode<nav2_msgs::action::FindFreeGoalOnPath> | ||
{ | ||
public: | ||
FindFreeGoalOnPathAction( | ||
const std::string & xml_tag_name, | ||
const std::string & action_name, | ||
const BT::NodeConfiguration & conf); | ||
|
||
void on_tick() override; | ||
|
||
BT::NodeStatus on_success() override; | ||
|
||
static BT::PortsList providedPorts() | ||
{ | ||
return providedBasicPorts( | ||
{ | ||
BT::InputPort<nav_msgs::msg::Path>("waypoints", "Waypoints to follow"), | ||
BT::OutputPort<nav_msgs::msg::Path>("skip_waypoints", "Waypoints to skip"), | ||
BT::OutputPort<geometry_msgs::msg::PoseStamped>("goal", "Destination to plan to"), | ||
}); | ||
} | ||
|
||
private: | ||
bool first_time_{true}; | ||
}; | ||
|
||
} // namespace nav2_behavior_tree | ||
|
||
#endif // NAV2_BEHAVIOR_TREE__PLUGINS__ACTION__FIND_FREE_GOAL_ON_PATH_ACTION_HPP_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
nav2_behavior_tree/plugins/action/find_free_goal_on_path_action.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// Copyright (c) 2018 Intel Corporation | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#include <memory> | ||
#include <string> | ||
|
||
#include "nav2_behavior_tree/plugins/action/find_free_goal_on_path_action.hpp" | ||
|
||
namespace nav2_behavior_tree | ||
{ | ||
|
||
FindFreeGoalOnPathAction::FindFreeGoalOnPathAction( | ||
const std::string & xml_tag_name, | ||
const std::string & action_name, | ||
const BT::NodeConfiguration & conf) | ||
: BtActionNode<nav2_msgs::action::FindFreeGoalOnPath>(xml_tag_name, action_name, conf) | ||
{ | ||
} | ||
|
||
void FindFreeGoalOnPathAction::on_tick() | ||
{ | ||
getInput("waypoints", goal_.waypoints); | ||
} | ||
|
||
BT::NodeStatus FindFreeGoalOnPathAction::on_success() | ||
{ | ||
setOutput("goal", result_.result->pose); | ||
setOutput("skip_waypoints", result_.result->skip_waypoints); | ||
return BT::NodeStatus::SUCCESS; | ||
} | ||
|
||
} // namespace nav2_behavior_tree | ||
|
||
#include "behaviortree_cpp_v3/bt_factory.h" | ||
BT_REGISTER_NODES(factory) | ||
{ | ||
BT::NodeBuilder builder = | ||
[](const std::string & name, const BT::NodeConfiguration & config) | ||
{ | ||
return std::make_unique<nav2_behavior_tree::FindFreeGoalOnPathAction>( | ||
name, "find_free_goal_on_path", config); | ||
}; | ||
|
||
factory.registerBuilder<nav2_behavior_tree::FindFreeGoalOnPathAction>( | ||
"FindFreeGoalOnPath", builder); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#goal definition | ||
nav_msgs/Path waypoints | ||
nav_msgs/Path skip_waypoints | ||
string planner_id | ||
--- | ||
#result definition | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#goal definition | ||
nav_msgs/Path waypoints | ||
--- | ||
#result definition | ||
geometry_msgs/PoseStamped pose | ||
nav_msgs/Path skip_waypoints | ||
builtin_interfaces/Duration planning_time | ||
--- | ||
#feedback |