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.
AGVFM-320 Pallet pickup in odom space (#71)
* add GetPalletPositionFromDepthCameras.action and GetGoalFromPalletPosition.action * set lift level action * fix * add missing method * fixed naming for ports in action nodes GetGoalFromPalletPositionAction and GetPalletPositionFromDepthCamerasAction; * add pallet_drive_obst and set LiftLevel inside pallet_pickup_without_obstacles BT Co-authored-by: Johannes Plapp <johannes.plapp@logivations.com> Co-authored-by: sofia.semianchuk <sofia.semianchuk@logivations.com>
- Loading branch information
1 parent
0862932
commit 53b8195
Showing
16 changed files
with
408 additions
and
25 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
54 changes: 54 additions & 0 deletions
54
...r_tree/include/nav2_behavior_tree/plugins/action/get_goal_from_pallet_position_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,54 @@ | ||
// 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__GET_GOAL_FROM_PALLET_POSITION_ACTION_HPP_ | ||
#define NAV2_BEHAVIOR_TREE__PLUGINS__ACTION__GET_GOAL_FROM_PALLET_POSITION_ACTION_HPP_ | ||
|
||
#include <string> | ||
|
||
#include "nav2_msgs/action/get_goal_from_pallet_position.hpp" | ||
#include "nav_msgs/msg/path.h" | ||
#include "nav2_behavior_tree/bt_action_node.hpp" | ||
|
||
namespace nav2_behavior_tree | ||
{ | ||
|
||
class GetGoalFromPalletPositionAction : public BtActionNode<nav2_msgs::action::GetGoalFromPalletPosition> | ||
{ | ||
public: | ||
GetGoalFromPalletPositionAction( | ||
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::OutputPort<geometry_msgs::msg::PoseStamped>("pallet_pickup_goal", "goal for picking up the pallet gets from the pallet position"), | ||
BT::InputPort<geometry_msgs::msg::PoseStamped>("pallet_pos", "pallet position get from both agv fork depth cameras"), | ||
}); | ||
} | ||
|
||
private: | ||
bool first_time_{true}; | ||
}; | ||
|
||
} // namespace nav2_behavior_tree | ||
|
||
#endif // NAV2_BEHAVIOR_TREE__PLUGINS__ACTION__GET_GOAL_FROM_PALLET_POSITION_ACTION_HPP_ |
53 changes: 53 additions & 0 deletions
53
...clude/nav2_behavior_tree/plugins/action/get_pallet_position_from_depth_cameras_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,53 @@ | ||
// 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__GET_PALLET_POSITION_FROM_DEPTH_CAMERAS_ACTION_HPP_ | ||
#define NAV2_BEHAVIOR_TREE__PLUGINS__ACTION__GET_PALLET_POSITION_FROM_DEPTH_CAMERAS_ACTION_HPP_ | ||
|
||
#include <string> | ||
|
||
#include "nav2_msgs/action/get_pallet_position_from_depth_cameras.hpp" | ||
#include "nav_msgs/msg/path.h" | ||
#include "nav2_behavior_tree/bt_action_node.hpp" | ||
|
||
namespace nav2_behavior_tree | ||
{ | ||
|
||
class GetPalletPositionFromDepthCamerasAction : public BtActionNode<nav2_msgs::action::GetPalletPositionFromDepthCameras> | ||
{ | ||
public: | ||
GetPalletPositionFromDepthCamerasAction( | ||
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::OutputPort<geometry_msgs::msg::PoseStamped>("pallet_pos","pallet position get from both agv fork depth cameras"), | ||
}); | ||
} | ||
|
||
private: | ||
bool first_time_{true}; | ||
}; | ||
|
||
} // namespace nav2_behavior_tree | ||
|
||
#endif // NAV2_BEHAVIOR_TREE__PLUGINS__ACTION__GET_PALLET_POSITION_FROM_DEPTH_CAMERAS_ACTION_HPP_ |
52 changes: 52 additions & 0 deletions
52
nav2_behavior_tree/include/nav2_behavior_tree/plugins/action/set_lift_level_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,52 @@ | ||
// 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__SET_LIFT_LEVEL_ACTION_HPP_ | ||
#define NAV2_BEHAVIOR_TREE__PLUGINS__ACTION__SET_LIFT_LEVEL_ACTION_HPP_ | ||
|
||
#include <string> | ||
|
||
#include "nav2_msgs/action/set_lift_level.hpp" | ||
#include "nav2_behavior_tree/bt_action_node.hpp" | ||
|
||
namespace nav2_behavior_tree | ||
{ | ||
|
||
class SetLiftLevelAction : public BtActionNode<nav2_msgs::action::SetLiftLevel> | ||
{ | ||
public: | ||
SetLiftLevelAction( | ||
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<std::string>("lift_level", "Target lift level for the fork"), | ||
}); | ||
} | ||
|
||
private: | ||
bool first_time_{true}; | ||
}; | ||
|
||
} // namespace nav2_behavior_tree | ||
|
||
#endif // NAV2_BEHAVIOR_TREE__PLUGINS__ACTION__SET_LIFT_LEVEL_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
56 changes: 56 additions & 0 deletions
56
nav2_behavior_tree/plugins/action/get_goal_from_pallet_position_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,56 @@ | ||
// 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/get_goal_from_pallet_position_action.hpp" | ||
|
||
namespace nav2_behavior_tree | ||
{ | ||
|
||
GetGoalFromPalletPositionAction::GetGoalFromPalletPositionAction( | ||
const std::string & xml_tag_name, | ||
const std::string & action_name, | ||
const BT::NodeConfiguration & conf) | ||
: BtActionNode<nav2_msgs::action::GetGoalFromPalletPosition>(xml_tag_name, action_name, conf) | ||
{ | ||
} | ||
|
||
void GetGoalFromPalletPositionAction::on_tick() | ||
{ | ||
getInput("pallet_pos", goal_.pallet_pos); | ||
} | ||
|
||
BT::NodeStatus GetGoalFromPalletPositionAction::on_success() | ||
{ | ||
setOutput("pallet_pickup_goal", result_.result->pallet_pickup_goal); | ||
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::GetGoalFromPalletPositionAction>( | ||
name, "get_goal_from_pallet_position", config); | ||
}; | ||
|
||
factory.registerBuilder<nav2_behavior_tree::GetGoalFromPalletPositionAction>( | ||
"GetGoalFromPalletPosition", builder); | ||
} |
55 changes: 55 additions & 0 deletions
55
nav2_behavior_tree/plugins/action/get_pallet_position_from_depth_cameras_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,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. | ||
|
||
#include <memory> | ||
#include <string> | ||
|
||
#include "nav2_behavior_tree/plugins/action/get_pallet_position_from_depth_cameras_action.hpp" | ||
|
||
namespace nav2_behavior_tree | ||
{ | ||
|
||
GetPalletPositionFromDepthCamerasAction::GetPalletPositionFromDepthCamerasAction( | ||
const std::string & xml_tag_name, | ||
const std::string & action_name, | ||
const BT::NodeConfiguration & conf) | ||
: BtActionNode<nav2_msgs::action::GetPalletPositionFromDepthCameras>(xml_tag_name, action_name, conf) | ||
{ | ||
} | ||
|
||
void GetPalletPositionFromDepthCamerasAction::on_tick() | ||
{ | ||
} | ||
|
||
BT::NodeStatus GetPalletPositionFromDepthCamerasAction::on_success() | ||
{ | ||
setOutput("pallet_pos", result_.result->pallet_pos); | ||
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::GetPalletPositionFromDepthCamerasAction>( | ||
name, "get_pallet_position_from_depth_cameras", config); | ||
}; | ||
|
||
factory.registerBuilder<nav2_behavior_tree::GetPalletPositionFromDepthCamerasAction>( | ||
"GetPalletPositionFromDepthCameras", builder); | ||
} |
55 changes: 55 additions & 0 deletions
55
nav2_behavior_tree/plugins/action/set_lift_level_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,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. | ||
|
||
#include <memory> | ||
#include <string> | ||
|
||
#include "nav2_behavior_tree/plugins/action/set_lift_level_action.hpp" | ||
|
||
namespace nav2_behavior_tree | ||
{ | ||
|
||
SetLiftLevelAction::SetLiftLevelAction( | ||
const std::string & xml_tag_name, | ||
const std::string & action_name, | ||
const BT::NodeConfiguration & conf) | ||
: BtActionNode<nav2_msgs::action::SetLiftLevel>(xml_tag_name, action_name, conf) | ||
{ | ||
} | ||
|
||
void SetLiftLevelAction::on_tick() | ||
{ | ||
getInput("lift_level", goal_.lift_level); | ||
} | ||
|
||
BT::NodeStatus SetLiftLevelAction::on_success() | ||
{ | ||
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::SetLiftLevelAction>( | ||
name, "set_lift_level", config); | ||
}; | ||
|
||
factory.registerBuilder<nav2_behavior_tree::SetLiftLevelAction>( | ||
"SetLiftLevel", 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
Oops, something went wrong.