|
Package Summary
Tags | No category tags. |
Version | 2.0.9 |
License | Apache License, Version 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/IntelligentRoboticsLabs/ros2_planning_system.git |
VCS Type | git |
VCS Version | humble-devel |
Last Updated | 2024-11-06 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Francisco Martin Rico
Authors
BT Actions
The purpose of this package is to provide built-in support for plansys2
actions which use Behavior Trees (BTs) for their implementation. A drop-in replacement for a vanilla plansys2::ActionExecutorClient
is provided in the form of a ROS2 node, which will execute an arbitrary BT passed in as a ROS parameter. A BehaviorTree.CPP node, plansys2::BtActionNode
, is also included to provide a convenient wrapper around a ROS2 action client (a common application for BT nodes).
ROS2 node for implementing plansys2
actions
The bt_action_node
ROS node takes in several parameters to set up its execution.
These parameters are
-
action_name
: The name of theplansys2
action to implement. Note that this name must match what is in your pddl domain file. -
bt_xml_file
: An absolute path to the BT.xml
file to execute. -
plugins
: a list of BehaviorTree.CPP shared libraries to load. Any BT node which is in the.xml
but is not provided by the BehaviorTree.CPP library itself must be in one of the libraries specified -
enable_groot_monitoring
: a boolean which specifies if ZMQ publisher should be created, for use with Groot (default isfalse
) -
publisher_port
: the ZMQ publisher port to use (ifenable_groot_monitoring
is enabled) -
server_port
: the ZMQ server port to use (ifenable_groot_monitoring
is enabled) -
max_msgs_per_second
: max ZMQ messages per second (ifenable_groot_monitoring
is enabled) -
bt_file_logging
: a boolean which enables logging of BT state changes in.fbl
files, useful for playing back behavior tree execution usingGroot
(default isfalse
) -
bt_minitrace_logging
: a boolean which enables logging of.json
files for recording the execution time of each node (default isfalse
)
Files created by the .fbl
and minitrace loggers are stored in /tmp/<node_name>/
, with names containing a timestamp.
BT node for calling ROS2 action servers
The BtActionNode
template class provides a convenient means of calling ROS2 action servers from within a BT. It takes care of the details of setting up and handling a ROS action client, reducing code duplication and providing a simple API.
The template parameter for the class is the type of ROS action (e.g. action_tutorials_interfaces::action::Fibonacci
) to be used. The node’s constructor takes in three arguments: the XML tag name, the ROS topic for the action server (e.g. /namepace/server_name
), and a BT::NodeConfiguration
. Note that the XML name and NodeConfiguration
are the same as any other BT.CPP node.
There are several functions which are provided for the end user to use/implement (some of which are optional).
-
static BT::PortsList providedPorts()
: every BT node which uses ports must define this member function. A default implementation is provided, but you are free to override it if additional ports are desired. By default, the function returns two input ports:server_name
(string) andserver_timeout
(double). These ports can be preserved when overriding usingprovidedBasicPorts
-
server_name
: an (optional) means of overriding the action server topic provided in the constructor -
server_timeout
: how long to wait for an action server before failing, in units of seconds (default is 5s)
-
-
BT::PortsList providedBasicPorts(BT::PortsList addition)
: a convenience function for preserving the default input ports when overriding theprovidedPorts()
function. An example use is shown below
static BT::PortsList providedPorts() override
{
return providedBasicPorts({ BT::InputPort<std::string>("my_additional_port") });
}
-
virtual BT::NodeStatus on_tick()
: This function is called every time the node is ticked (in the BT sense). The user is expected to set thegoal_
variable somewhere in this function, which is of the same type as the template parameter. Note that the node will likely be ticked multiple times before the action completes, so you may want to only set the goal on the first tick (i.e. when the node is IDLE). If you want to preempt the current goal and send a new one after the first tick, set thegoal_updated_
member variable to true, along with any changes to thegoal_
variable. An example is shown below.
BT::NodeStatus on_tick() override
{
if (status() == BT::NodeStatus::IDLE) { // this block will only execute on the first tick
goal_.string = "foo";
} else if (<some condition>) { // this block may execute anytime afterward
goal_.string = "bar";
goal_updated_ = true;
}
}
-
virtual void on_feedback(const std::shared_ptr<ActionT::Feedback> feedback)
: this function will be called whenever feedback is received from the action server asynchronous of BT execution (and is optional) -
virtual BT::NodeStatus on_success()
: this function is called if the action server returned successfully and will returnBT::NodeStatus::SUCCESS
by default. You may wish to override it if the node’s success depends on the result, which is placed in theresult_
member variable. -
virtual BT::NodeStatus on_aborted()
: this function is called if the action server aborted the action, returningBT::NodeStatus::FAILURE
by default. -
virtual BT::NodeStatus on_cancelled()
: this function is called if the action was cancelled, returningBT::NodeStatus::SUCCESS
by default.
Changelog for package plansys2_bt_actions
2.0.9 (2022-07-10)
- Add BT logging, Tree execution try/catch, and README
- Add try/catch to BT execution in BTAction
- log INFO in BtActionNode when sending action goal
- Add BT logging to BTAction
- Contributors: Francisco Martín Rico, Jake Keller
2.0.8 (2022-05-04)
2.0.7 (2022-05-04)
2.0.6 (2022-05-03)
2.0.5 (2022-05-03)
- Fix ROS2 Buildfarm error due to Threads
- Contributors: Francisco Martín Rico, Jake Keller
2.0.4 (2022-05-03)
- Fix version
- Fix ROS2 Buildfarm error due to Threads
- Update unit tests to match changes
- Update node name remapping to new syntax
- Update node name remapping to new syntax
- Merge branch 'origin/unique-node-names'
- Remap BB node name in source using NodeOptions
- Remove empty line to make cpplint happy
- Remove swap file
- Handle on_tick() during the first tick
- Remove holdover code from pre-refactor We should not set running explicity here as the user defined on_tick() would have no way to know that it is the first tick. The status will be set implicity by the parent class's execute_tick() method. Because the on_tick() method has been moved, a goal is no longer being set in the first block of code, making the first call to on_new_goal_received() errant.
- Remove on_wait_for_result The function is redundant now that on_tick() is called every tick
- Contributors: Francisco Martín Rico, Jake Keller
2.0.3 (2022-04-03)
2.0.2 (2022-04-03)
- action-graph-fix: Reverting timeout modification for bt_action_test.
- Refactor BTActionNode (#197)
- action-test-fix: Setting TIMEOUT value to 300 for bt_action_test. Increase default server tiemout
- Replace runtime errors w/ BT::NodeStatus::FAILURE
- Add on_feedback method
- Fix issue if child classes override providedPorts
- Add (optional) server timeout to BtActionNode
- Contributors: Francisco Martín Rico, Jake Keller, Josh Zapf
2.0.1 (2022-02-03)
- Update deprecated APIs in launchers and parameters
- Fix plansys2_bt_actions CMakeLists.txt
- Merge galactic-devel
- Contributors: Francisco Martín Rico, Jake Keller
2.0.0 (2021-07-04)
1.0.10 (2021-07-03)
- Fix tests
- Fix rate conversions
- Reduce debug output
- Update version
- Contributors: Francisco Martín Rico
1.0.9 (2021-03-15)
1.0.8 (2021-03-12)
- Moving zmq publisher creation to on_activate in BTAction, resetting the publisher in on_deactivate.
- Action execution refactoring
- Adding zeromq-based groot monitoring of plansys2 behaviortree actions. Ports are not specified by default to keep two different actions from accidentally using the same ports.
- Add support for numeric conditions and effects.
- Monitorization info
- Improving BTActions
- Change 'move' action name
- Contributors: Alexander Xydes, Fabrice Larribe, Francisco Martin Rico, Josh Zapf
1.0.7 (2021-01-04)
- Making explicit dependencies
* Contributors: Francisco Martín Rico 1.0.6 (2020-12-29) ------------------
1.0.5 (2020-12-28)
- Migration to c++17
- Contributors: Francisco Martín Rico
1.0.4 (2020-12-24)
1.0.3 (2020-12-23)
1.0.2 (2020-12-23)
- Plan solvers as plugins
- Contributors: Fabrice Larribe, Francisco Martin Rico, f269858
1.0.1 (2020-07-19)
1.0.0 (2020-07-19)
- Foxy initial version
- Contributors: Francisco Martin Rico
0.0.8 (2020-07-18)
- Boost:optional
- Contributors: Francisco Martin Rico
0.0.7 (2020-03-26)
- Fix warning in last cmake versions Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
* Contributors: Francisco Martín Rico 0.0.6 (2020-03-23) ------------------* Run in separate namespaces. Monolothic node Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>> * Add multi domain Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>> * Contributors: Francisco Martin Rico
0.0.5 (2020-01-12)
0.0.4 (2020-01-09)
- Adding missing action dependencies Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
* Contributors: Francisco Martín Rico 0.0.3 (2020-01-09) ------------------
0.0.2 (2020-01-08)
- Merge pull request #16 from IntelligentRoboticsLabs/pddl_parser_rename Rename pddl_parser
- Rename pddl_parser Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Merge pull request #8 from IntelligentRoboticsLabs/patrol_example Patrol example
- Patrol example Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Packages.xml description Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Adding documentation Signed-off-by: Francisco Martin Rico <<fmartin@gsyc.urjc.es>>
- Setting CI Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Setting CI Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Setting CI Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Setting CI Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Execute actions independiently. Example Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Change to lowercasegit Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- First version of planner complete Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Update notification in problem Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Problem expert complete with terminal support Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Problem expert client and node Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Goals in problem generation Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- ProblemExpert local complete Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Using shred_ptr. First commit Problem Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Predicate Tree and types changed Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Contributors: Francisco Martin Rico
Wiki Tutorials
Package Dependencies
Deps | Name |
---|---|
ament_cmake | |
ament_lint_common | |
ament_lint_auto | |
ament_cmake_gtest | |
plansys2_msgs | |
test_msgs | |
geometry_msgs | |
rclcpp | |
rclcpp_action | |
rclcpp_lifecycle | |
plansys2_executor | |
behaviortree_cpp_v3 | |
action_msgs |
System Dependencies
Name |
---|
libzmq3-dev |
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged plansys2_bt_actions at Robotics Stack Exchange
|
Package Summary
Tags | No category tags. |
Version | 2.0.11 |
License | Apache License, Version 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/PlanSys2/ros2_planning_system.git |
VCS Type | git |
VCS Version | iron-devel |
Last Updated | 2023-08-02 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Francisco Martin Rico
Authors
BT Actions
The purpose of this package is to provide built-in support for plansys2
actions which use Behavior Trees (BTs) for their implementation. A drop-in replacement for a vanilla plansys2::ActionExecutorClient
is provided in the form of a ROS2 node, which will execute an arbitrary BT passed in as a ROS parameter. A BehaviorTree.CPP node, plansys2::BtActionNode
, is also included to provide a convenient wrapper around a ROS2 action client (a common application for BT nodes).
ROS2 node for implementing plansys2
actions
The bt_action_node
ROS node takes in several parameters to set up its execution.
These parameters are
-
action_name
: The name of theplansys2
action to implement. Note that this name must match what is in your pddl domain file. -
bt_xml_file
: An absolute path to the BT.xml
file to execute. -
plugins
: a list of BehaviorTree.CPP shared libraries to load. Any BT node which is in the.xml
but is not provided by the BehaviorTree.CPP library itself must be in one of the libraries specified -
enable_groot_monitoring
: a boolean which specifies if ZMQ publisher should be created, for use with Groot (default isfalse
) -
publisher_port
: the ZMQ publisher port to use (ifenable_groot_monitoring
is enabled) -
server_port
: the ZMQ server port to use (ifenable_groot_monitoring
is enabled) -
max_msgs_per_second
: max ZMQ messages per second (ifenable_groot_monitoring
is enabled) -
bt_file_logging
: a boolean which enables logging of BT state changes in.fbl
files, useful for playing back behavior tree execution usingGroot
(default isfalse
) -
bt_minitrace_logging
: a boolean which enables logging of.json
files for recording the execution time of each node (default isfalse
)
Files created by the .fbl
and minitrace loggers are stored in /tmp/<node_name>/
, with names containing a timestamp.
BT node for calling ROS2 action servers
The BtActionNode
template class provides a convenient means of calling ROS2 action servers from within a BT. It takes care of the details of setting up and handling a ROS action client, reducing code duplication and providing a simple API.
The template parameter for the class is the type of ROS action (e.g. action_tutorials_interfaces::action::Fibonacci
) to be used. The node’s constructor takes in three arguments: the XML tag name, the ROS topic for the action server (e.g. /namepace/server_name
), and a BT::NodeConfiguration
. Note that the XML name and NodeConfiguration
are the same as any other BT.CPP node.
There are several functions which are provided for the end user to use/implement (some of which are optional).
-
static BT::PortsList providedPorts()
: every BT node which uses ports must define this member function. A default implementation is provided, but you are free to override it if additional ports are desired. By default, the function returns two input ports:server_name
(string) andserver_timeout
(double). These ports can be preserved when overriding usingprovidedBasicPorts
-
server_name
: an (optional) means of overriding the action server topic provided in the constructor -
server_timeout
: how long to wait for an action server before failing, in units of seconds (default is 5s)
-
-
BT::PortsList providedBasicPorts(BT::PortsList addition)
: a convenience function for preserving the default input ports when overriding theprovidedPorts()
function. An example use is shown below
static BT::PortsList providedPorts() override
{
return providedBasicPorts({ BT::InputPort<std::string>("my_additional_port") });
}
-
virtual BT::NodeStatus on_tick()
: This function is called every time the node is ticked (in the BT sense). The user is expected to set thegoal_
variable somewhere in this function, which is of the same type as the template parameter. Note that the node will likely be ticked multiple times before the action completes, so you may want to only set the goal on the first tick (i.e. when the node is IDLE). If you want to preempt the current goal and send a new one after the first tick, set thegoal_updated_
member variable to true, along with any changes to thegoal_
variable. An example is shown below.
BT::NodeStatus on_tick() override
{
if (status() == BT::NodeStatus::IDLE) { // this block will only execute on the first tick
goal_.string = "foo";
} else if (<some condition>) { // this block may execute anytime afterward
goal_.string = "bar";
goal_updated_ = true;
}
}
-
virtual void on_feedback(const std::shared_ptr<ActionT::Feedback> feedback)
: this function will be called whenever feedback is received from the action server asynchronous of BT execution (and is optional) -
virtual BT::NodeStatus on_success()
: this function is called if the action server returned successfully and will returnBT::NodeStatus::SUCCESS
by default. You may wish to override it if the node’s success depends on the result, which is placed in theresult_
member variable. -
virtual BT::NodeStatus on_aborted()
: this function is called if the action server aborted the action, returningBT::NodeStatus::FAILURE
by default. -
virtual BT::NodeStatus on_cancelled()
: this function is called if the action was cancelled, returningBT::NodeStatus::SUCCESS
by default.
Changelog for package plansys2_bt_actions
2.0.11 (2023-08-02)
- Fix logger destruction at BTActions
- Contributors: Francisco Martín Rico
2.0.10 (2023-07-17)
- Merge pull request #251 from PlanSys2/fix_bt_node Fix bt node
- Insert in blackboard the action ROS 2 Node
- Merge remote-tracking branch 'origin/master' into fix_goal_structure_issue_205
- Merge branch 'master' into bt-builder-plugins
- Merge pull request #236 from sarcasticnature/feature/misc-fixes Fixes for bt_actions and popf_plan_sover
- Correct tick function call in bt_actions test
- Merge remote-tracking branch 'origin/master' into fix_goal_structure_issue_205
- Explicitly ignore feedback in default on_feedback
- Add try/catch to bt creation, reset loggers
- Merge remote-tracking branch 'upstream/master'
- Merge branch 'IntelligentRoboticsLabs:master' into master
- Contributors: Andrianov Roman, Francisco Martín Rico, Jake Keller, Marco Roveri, Splinter1984
2.0.9 (2022-07-10)
- Add BT logging, Tree execution try/catch, and README
- Add try/catch to BT execution in BTAction
- log INFO in BtActionNode when sending action goal
- Add BT logging to BTAction
- Contributors: Francisco Martín Rico, Jake Keller
2.0.8 (2022-05-04)
2.0.7 (2022-05-04)
2.0.6 (2022-05-03)
2.0.5 (2022-05-03)
- Fix ROS2 Buildfarm error due to Threads
- Contributors: Francisco Martín Rico, Jake Keller
2.0.4 (2022-05-03)
- Fix version
- Fix ROS2 Buildfarm error due to Threads
- Update unit tests to match changes
- Update node name remapping to new syntax
- Update node name remapping to new syntax
- Merge branch 'origin/unique-node-names'
- Remap BB node name in source using NodeOptions
- Remove empty line to make cpplint happy
- Remove swap file
- Handle on_tick() during the first tick
- Remove holdover code from pre-refactor We should not set running explicity here as the user defined on_tick() would have no way to know that it is the first tick. The status will be set implicity by the parent class's execute_tick() method. Because the on_tick() method has been moved, a goal is no longer being set in the first block of code, making the first call to on_new_goal_received() errant.
- Remove on_wait_for_result The function is redundant now that on_tick() is called every tick
- Contributors: Francisco Martín Rico, Jake Keller
2.0.3 (2022-04-03)
2.0.2 (2022-04-03)
- action-graph-fix: Reverting timeout modification for bt_action_test.
- Refactor BTActionNode (#197)
- action-test-fix: Setting TIMEOUT value to 300 for bt_action_test. Increase default server tiemout
- Replace runtime errors w/ BT::NodeStatus::FAILURE
- Add on_feedback method
- Fix issue if child classes override providedPorts
- Add (optional) server timeout to BtActionNode
- Contributors: Francisco Martín Rico, Jake Keller, Josh Zapf
2.0.1 (2022-02-03)
- Update deprecated APIs in launchers and parameters
- Fix plansys2_bt_actions CMakeLists.txt
- Merge galactic-devel
- Contributors: Francisco Martín Rico, Jake Keller
2.0.0 (2021-07-04)
1.0.10 (2021-07-03)
- Fix tests
- Fix rate conversions
- Reduce debug output
- Update version
- Contributors: Francisco Martín Rico
1.0.9 (2021-03-15)
1.0.8 (2021-03-12)
- Moving zmq publisher creation to on_activate in BTAction, resetting the publisher in on_deactivate.
- Action execution refactoring
- Adding zeromq-based groot monitoring of plansys2 behaviortree actions. Ports are not specified by default to keep two different actions from accidentally using the same ports.
- Add support for numeric conditions and effects.
- Monitorization info
- Improving BTActions
- Change 'move' action name
- Contributors: Alexander Xydes, Fabrice Larribe, Francisco Martin Rico, Josh Zapf
1.0.7 (2021-01-04)
- Making explicit dependencies
* Contributors: Francisco Martín Rico 1.0.6 (2020-12-29) ------------------
1.0.5 (2020-12-28)
- Migration to c++17
- Contributors: Francisco Martín Rico
1.0.4 (2020-12-24)
1.0.3 (2020-12-23)
1.0.2 (2020-12-23)
- Plan solvers as plugins
- Contributors: Fabrice Larribe, Francisco Martin Rico, f269858
1.0.1 (2020-07-19)
1.0.0 (2020-07-19)
- Foxy initial version
- Contributors: Francisco Martin Rico
0.0.8 (2020-07-18)
- Boost:optional
- Contributors: Francisco Martin Rico
0.0.7 (2020-03-26)
- Fix warning in last cmake versions Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
* Contributors: Francisco Martín Rico 0.0.6 (2020-03-23) ------------------* Run in separate namespaces. Monolothic node Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>> * Add multi domain Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>> * Contributors: Francisco Martin Rico
0.0.5 (2020-01-12)
0.0.4 (2020-01-09)
- Adding missing action dependencies Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
* Contributors: Francisco Martín Rico 0.0.3 (2020-01-09) ------------------
0.0.2 (2020-01-08)
- Merge pull request #16 from IntelligentRoboticsLabs/pddl_parser_rename Rename pddl_parser
- Rename pddl_parser Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Merge pull request #8 from IntelligentRoboticsLabs/patrol_example Patrol example
- Patrol example Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Packages.xml description Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Adding documentation Signed-off-by: Francisco Martin Rico <<fmartin@gsyc.urjc.es>>
- Setting CI Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Setting CI Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Setting CI Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Setting CI Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Execute actions independiently. Example Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Change to lowercasegit Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- First version of planner complete Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Update notification in problem Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Problem expert complete with terminal support Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Problem expert client and node Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Goals in problem generation Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- ProblemExpert local complete Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Using shred_ptr. First commit Problem Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Predicate Tree and types changed Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Contributors: Francisco Martin Rico
Wiki Tutorials
Package Dependencies
Deps | Name |
---|---|
ament_cmake | |
ament_lint_common | |
ament_lint_auto | |
ament_cmake_gtest | |
plansys2_msgs | |
test_msgs | |
geometry_msgs | |
rclcpp | |
rclcpp_action | |
rclcpp_lifecycle | |
plansys2_executor | |
behaviortree_cpp_v3 | |
action_msgs |
System Dependencies
Name |
---|
libzmq3-dev |
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged plansys2_bt_actions at Robotics Stack Exchange
|
Package Summary
Tags | No category tags. |
Version | 2.0.14 |
License | Apache License, Version 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/PlanSys2/ros2_planning_system.git |
VCS Type | git |
VCS Version | jazzy-devel |
Last Updated | 2024-11-14 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Francisco Martin Rico
Authors
BT Actions
The purpose of this package is to provide built-in support for plansys2
actions which use Behavior Trees (BTs) for their implementation. A drop-in replacement for a vanilla plansys2::ActionExecutorClient
is provided in the form of a ROS2 node, which will execute an arbitrary BT passed in as a ROS parameter. A BehaviorTree.CPP node, plansys2::BtActionNode
, is also included to provide a convenient wrapper around a ROS2 action client (a common application for BT nodes).
ROS2 node for implementing plansys2
actions
The bt_action_node
ROS node takes in several parameters to set up its execution.
These parameters are
-
action_name
: The name of theplansys2
action to implement. Note that this name must match what is in your pddl domain file. -
bt_xml_file
: An absolute path to the BT.xml
file to execute. -
plugins
: a list of BehaviorTree.CPP shared libraries to load. Any BT node which is in the.xml
but is not provided by the BehaviorTree.CPP library itself must be in one of the libraries specified -
enable_groot_monitoring
: a boolean which specifies if ZMQ publisher should be created, for use with Groot (default isfalse
) -
publisher_port
: the ZMQ publisher port to use (ifenable_groot_monitoring
is enabled) -
server_port
: the ZMQ server port to use (ifenable_groot_monitoring
is enabled) -
max_msgs_per_second
: max ZMQ messages per second (ifenable_groot_monitoring
is enabled) -
bt_file_logging
: a boolean which enables logging of BT state changes in.fbl
files, useful for playing back behavior tree execution usingGroot
(default isfalse
) -
bt_minitrace_logging
: a boolean which enables logging of.json
files for recording the execution time of each node (default isfalse
)
Files created by the .fbl
and minitrace loggers are stored in /tmp/<node_name>/
, with names containing a timestamp.
BT node for calling ROS2 action servers
The BtActionNode
template class provides a convenient means of calling ROS2 action servers from within a BT. It takes care of the details of setting up and handling a ROS action client, reducing code duplication and providing a simple API.
The template parameter for the class is the type of ROS action (e.g. action_tutorials_interfaces::action::Fibonacci
) to be used. The node’s constructor takes in three arguments: the XML tag name, the ROS topic for the action server (e.g. /namepace/server_name
), and a BT::NodeConfig
. Note that the XML name and NodeConfig
are the same as any other BT.CPP node.
There are several functions which are provided for the end user to use/implement (some of which are optional).
-
static BT::PortsList providedPorts()
: every BT node which uses ports must define this member function. A default implementation is provided, but you are free to override it if additional ports are desired. By default, the function returns two input ports:server_name
(string) andserver_timeout
(double). These ports can be preserved when overriding usingprovidedBasicPorts
-
server_name
: an (optional) means of overriding the action server topic provided in the constructor -
server_timeout
: how long to wait for an action server before failing, in units of seconds (default is 5s)
-
-
BT::PortsList providedBasicPorts(BT::PortsList addition)
: a convenience function for preserving the default input ports when overriding theprovidedPorts()
function. An example use is shown below
static BT::PortsList providedPorts() override
{
return providedBasicPorts({ BT::InputPort<std::string>("my_additional_port") });
}
-
virtual BT::NodeStatus on_tick()
: This function is called every time the node is ticked (in the BT sense). The user is expected to set thegoal_
variable somewhere in this function, which is of the same type as the template parameter. Note that the node will likely be ticked multiple times before the action completes, so you may want to only set the goal on the first tick (i.e. when the node is IDLE). If you want to preempt the current goal and send a new one after the first tick, set thegoal_updated_
member variable to true, along with any changes to thegoal_
variable. An example is shown below.
BT::NodeStatus on_tick() override
{
if (status() == BT::NodeStatus::IDLE) { // this block will only execute on the first tick
goal_.string = "foo";
} else if (<some condition>) { // this block may execute anytime afterward
goal_.string = "bar";
goal_updated_ = true;
}
}
-
virtual void on_feedback(const std::shared_ptr<ActionT::Feedback> feedback)
: this function will be called whenever feedback is received from the action server asynchronous of BT execution (and is optional) -
virtual BT::NodeStatus on_success()
: this function is called if the action server returned successfully and will returnBT::NodeStatus::SUCCESS
by default. You may wish to override it if the node’s success depends on the result, which is placed in theresult_
member variable. -
virtual BT::NodeStatus on_aborted()
: this function is called if the action server aborted the action, returningBT::NodeStatus::FAILURE
by default. -
virtual BT::NodeStatus on_cancelled()
: this function is called if the action was cancelled, returningBT::NodeStatus::SUCCESS
by default.
Changelog for package plansys2_bt_actions
2.0.14 (2024-11-14)
2.0.13 (2024-11-06)
- Change to EventsExecutor
- Contributors: Francisco Martín Rico
2.0.12 (2024-10-16)
- Remove cmake warning
- Removed some small references still related to the old version of BehaviorTree
- Bump Behaviortree.CPP v3 to v4
- fix code style issues with uncrustify
- Update BTAction.cpp
- fix groot enabling
- Linting
- Fix logger destruction at BTActions
- Update Changelog
- Insert in blackboard the action ROS 2 Node
- Insert in blackboard the action ROS 2 Node
- Correct tick function call in bt_actions test
- Merge remote-tracking branch 'origin/master' into fix_goal_structure_issue_205
- Explicitly ignore feedback in default on_feedback
- Add try/catch to bt creation, reset loggers
- Contributors: Andrianov Roman, Francisco Martín Rico, Jake Keller, Marco Roveri, Splinter1984
2.0.9 (2022-07-10)
- Add BT logging, Tree execution try/catch, and README
- Add try/catch to BT execution in BTAction
- log INFO in BtActionNode when sending action goal
- Add BT logging to BTAction
- Contributors: Francisco Martín Rico, Jake Keller
2.0.8 (2022-05-04)
2.0.7 (2022-05-04)
2.0.6 (2022-05-03)
2.0.5 (2022-05-03)
- Fix ROS2 Buildfarm error due to Threads
- Contributors: Francisco Martín Rico, Jake Keller
2.0.4 (2022-05-03)
- Fix version
- Fix ROS2 Buildfarm error due to Threads
- Update unit tests to match changes
- Update node name remapping to new syntax
- Update node name remapping to new syntax
- Merge branch 'origin/unique-node-names'
- Remap BB node name in source using NodeOptions
- Remove empty line to make cpplint happy
- Remove swap file
- Handle on_tick() during the first tick
- Remove holdover code from pre-refactor We should not set running explicity here as the user defined on_tick() would have no way to know that it is the first tick. The status will be set implicity by the parent class's execute_tick() method. Because the on_tick() method has been moved, a goal is no longer being set in the first block of code, making the first call to on_new_goal_received() errant.
- Remove on_wait_for_result The function is redundant now that on_tick() is called every tick
- Contributors: Francisco Martín Rico, Jake Keller
2.0.3 (2022-04-03)
2.0.2 (2022-04-03)
- action-graph-fix: Reverting timeout modification for bt_action_test.
- Refactor BTActionNode (#197)
- action-test-fix: Setting TIMEOUT value to 300 for bt_action_test. Increase default server tiemout
- Replace runtime errors w/ BT::NodeStatus::FAILURE
- Add on_feedback method
- Fix issue if child classes override providedPorts
- Add (optional) server timeout to BtActionNode
- Contributors: Francisco Martín Rico, Jake Keller, Josh Zapf
2.0.1 (2022-02-03)
- Update deprecated APIs in launchers and parameters
- Fix plansys2_bt_actions CMakeLists.txt
- Merge galactic-devel
- Contributors: Francisco Martín Rico, Jake Keller
2.0.0 (2021-07-04)
1.0.10 (2021-07-03)
- Fix tests
- Fix rate conversions
- Reduce debug output
- Update version
- Contributors: Francisco Martín Rico
1.0.9 (2021-03-15)
1.0.8 (2021-03-12)
- Moving zmq publisher creation to on_activate in BTAction, resetting the publisher in on_deactivate.
- Action execution refactoring
- Adding zeromq-based groot monitoring of plansys2 behaviortree actions. Ports are not specified by default to keep two different actions from accidentally using the same ports.
- Add support for numeric conditions and effects.
- Monitorization info
- Improving BTActions
- Change 'move' action name
- Contributors: Alexander Xydes, Fabrice Larribe, Francisco Martin Rico, Josh Zapf
1.0.7 (2021-01-04)
- Making explicit dependencies
* Contributors: Francisco Martín Rico 1.0.6 (2020-12-29) ------------------
1.0.5 (2020-12-28)
- Migration to c++17
- Contributors: Francisco Martín Rico
1.0.4 (2020-12-24)
1.0.3 (2020-12-23)
1.0.2 (2020-12-23)
- Plan solvers as plugins
- Contributors: Fabrice Larribe, Francisco Martin Rico, f269858
1.0.1 (2020-07-19)
1.0.0 (2020-07-19)
- Foxy initial version
- Contributors: Francisco Martin Rico
0.0.8 (2020-07-18)
- Boost:optional
- Contributors: Francisco Martin Rico
0.0.7 (2020-03-26)
- Fix warning in last cmake versions Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
* Contributors: Francisco Martín Rico 0.0.6 (2020-03-23) ------------------* Run in separate namespaces. Monolothic node Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>> * Add multi domain Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>> * Contributors: Francisco Martin Rico
0.0.5 (2020-01-12)
0.0.4 (2020-01-09)
- Adding missing action dependencies Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
* Contributors: Francisco Martín Rico 0.0.3 (2020-01-09) ------------------
0.0.2 (2020-01-08)
- Merge pull request #16 from IntelligentRoboticsLabs/pddl_parser_rename Rename pddl_parser
- Rename pddl_parser Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Merge pull request #8 from IntelligentRoboticsLabs/patrol_example Patrol example
- Patrol example Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Packages.xml description Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Adding documentation Signed-off-by: Francisco Martin Rico <<fmartin@gsyc.urjc.es>>
- Setting CI Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Setting CI Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Setting CI Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Setting CI Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Execute actions independiently. Example Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Change to lowercasegit Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- First version of planner complete Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Update notification in problem Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Problem expert complete with terminal support Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Problem expert client and node Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Goals in problem generation Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- ProblemExpert local complete Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Using shred_ptr. First commit Problem Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Predicate Tree and types changed Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Contributors: Francisco Martin Rico
Wiki Tutorials
Package Dependencies
Deps | Name |
---|---|
ament_cmake | |
ament_lint_common | |
ament_lint_auto | |
ament_cmake_gtest | |
plansys2_msgs | |
test_msgs | |
geometry_msgs | |
rclcpp | |
rclcpp_action | |
rclcpp_lifecycle | |
plansys2_executor | |
behaviortree_cpp | |
action_msgs |
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged plansys2_bt_actions at Robotics Stack Exchange
|
Package Summary
Tags | No category tags. |
Version | 2.0.8 |
License | Apache License, Version 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/IntelligentRoboticsLabs/ros2_planning_system.git |
VCS Type | git |
VCS Version | galactic-devel |
Last Updated | 2024-11-06 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Francisco Martin Rico
Authors
Problem Expert
The Domain Expert module is responsible for maintaining the instances, predicates and goals of the PDDL problem.
The main class is plansys2::ProblemExpertNode
, which is instantiated from problem_expert_node.cpp
. plansys2::DomainExpertNode
is a rclcpp_lifecycle::LifecycleNode
, and in its configuration phase reads the model_file
parameter, which contains the .pddl file from which to read the model.
The class responsible for maintaining this domain is plansys2::DomainExpert
, which is independent of ROS2.
The Domain Expert does not change while active, accessing its functionality through ROS2 services. To facilitate the task of the application developer, an plansys2::DomainExpertClient
class has been implemented that hides the complexity of handling ROS2 messages and services. Its API is similar to that of plansys2::DomainExpert
, since both have to implement the plansys2::DomainExpertInterface
interface.
Services:
-
/domain_expert/get_domain_types
[plansys2_msgs::srv::GetDomainTypes
] -
/domain_expert/get_domain_actions
[plansys2_msgs::srv::GetDomainActions
] -
/domain_expert/get_domain_action_details
[plansys2_msgs::srv::GetDomainActionDetails
] -
/domain_expert/get_domain_predicates
[plansys2_msgs::srv::GetDomainPredicates
] -
/domain_expert/get_domain_predicate_details
[plansys2_msgs::srv::GetDomainPredicateDetails
] -
/domain_expert/get_domain
[plansys2_msgs::srv::GetDomain
]
Changelog for package plansys2_bt_actions
2.0.8 (2022-05-04)
2.0.7 (2022-05-04)
2.0.6 (2022-05-03)
2.0.5 (2022-05-03)
- Fix ROS2 Buildfarm error due to Threads
- Contributors: Francisco Martín Rico, Jake Keller
2.0.4 (2022-05-03)
- Fix version
- Fix ROS2 Buildfarm error due to Threads
- Update unit tests to match changes
- Update node name remapping to new syntax
- Update node name remapping to new syntax
- Merge branch 'origin/unique-node-names'
- Remap BB node name in source using NodeOptions
- Remove empty line to make cpplint happy
- Remove swap file
- Handle on_tick() during the first tick
- Remove holdover code from pre-refactor We should not set running explicity here as the user defined on_tick() would have no way to know that it is the first tick. The status will be set implicity by the parent class's execute_tick() method. Because the on_tick() method has been moved, a goal is no longer being set in the first block of code, making the first call to on_new_goal_received() errant.
- Remove on_wait_for_result The function is redundant now that on_tick() is called every tick
- Contributors: Francisco Martín Rico, Jake Keller
2.0.3 (2022-04-03)
2.0.2 (2022-04-03)
- action-graph-fix: Reverting timeout modification for bt_action_test.
- Refactor BTActionNode (#197)
- action-test-fix: Setting TIMEOUT value to 300 for bt_action_test. Increase default server tiemout
- Replace runtime errors w/ BT::NodeStatus::FAILURE
- Add on_feedback method
- Fix issue if child classes override providedPorts
- Add (optional) server timeout to BtActionNode
- Contributors: Francisco Martín Rico, Jake Keller, Josh Zapf
2.0.1 (2022-02-03)
- Update deprecated APIs in launchers and parameters
- Fix plansys2_bt_actions CMakeLists.txt
- Merge galactic-devel
- Contributors: Francisco Martín Rico, Jake Keller
2.0.0 (2021-07-04)
1.0.10 (2021-07-03)
- Fix tests
- Fix rate conversions
- Reduce debug output
- Update version
- Contributors: Francisco Martín Rico
1.0.9 (2021-03-15)
1.0.8 (2021-03-12)
- Moving zmq publisher creation to on_activate in BTAction, resetting the publisher in on_deactivate.
- Action execution refactoring
- Adding zeromq-based groot monitoring of plansys2 behaviortree actions. Ports are not specified by default to keep two different actions from accidentally using the same ports.
- Add support for numeric conditions and effects.
- Monitorization info
- Improving BTActions
- Change 'move' action name
- Contributors: Alexander Xydes, Fabrice Larribe, Francisco Martin Rico, Josh Zapf
1.0.7 (2021-01-04)
- Making explicit dependencies
* Contributors: Francisco Martín Rico 1.0.6 (2020-12-29) ------------------
1.0.5 (2020-12-28)
- Migration to c++17
- Contributors: Francisco Martín Rico
1.0.4 (2020-12-24)
1.0.3 (2020-12-23)
1.0.2 (2020-12-23)
- Plan solvers as plugins
- Contributors: Fabrice Larribe, Francisco Martin Rico, f269858
1.0.1 (2020-07-19)
1.0.0 (2020-07-19)
- Foxy initial version
- Contributors: Francisco Martin Rico
0.0.8 (2020-07-18)
- Boost:optional
- Contributors: Francisco Martin Rico
0.0.7 (2020-03-26)
- Fix warning in last cmake versions Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
* Contributors: Francisco Martín Rico 0.0.6 (2020-03-23) ------------------* Run in separate namespaces. Monolothic node Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>> * Add multi domain Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>> * Contributors: Francisco Martin Rico
0.0.5 (2020-01-12)
0.0.4 (2020-01-09)
- Adding missing action dependencies Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
* Contributors: Francisco Martín Rico 0.0.3 (2020-01-09) ------------------
0.0.2 (2020-01-08)
- Merge pull request #16 from IntelligentRoboticsLabs/pddl_parser_rename Rename pddl_parser
- Rename pddl_parser Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Merge pull request #8 from IntelligentRoboticsLabs/patrol_example Patrol example
- Patrol example Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Packages.xml description Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Adding documentation Signed-off-by: Francisco Martin Rico <<fmartin@gsyc.urjc.es>>
- Setting CI Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Setting CI Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Setting CI Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Setting CI Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Execute actions independiently. Example Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Change to lowercasegit Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- First version of planner complete Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Update notification in problem Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Problem expert complete with terminal support Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Problem expert client and node Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Goals in problem generation Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- ProblemExpert local complete Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Using shred_ptr. First commit Problem Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Predicate Tree and types changed Signed-off-by: Francisco Martin Rico <<fmrico@gmail.com>>
- Contributors: Francisco Martin Rico
Wiki Tutorials
Package Dependencies
Deps | Name |
---|---|
ament_cmake | |
ament_lint_common | |
ament_lint_auto | |
ament_cmake_gtest | |
plansys2_msgs | |
test_msgs | |
geometry_msgs | |
rclcpp | |
rclcpp_action | |
rclcpp_lifecycle | |
plansys2_executor | |
behaviortree_cpp_v3 | |
action_msgs |
System Dependencies
Name |
---|
libzmq3-dev |