-
 

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

This package contains the Problem Expert module for the ROS2 Planning System

Additional Links

No additional links.

Maintainers

  • Francisco Martin Rico

Authors

No additional 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

  1. action_name: The name of the plansys2 action to implement. Note that this name must match what is in your pddl domain file.
  2. bt_xml_file: An absolute path to the BT .xml file to execute.
  3. 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
  4. enable_groot_monitoring: a boolean which specifies if ZMQ publisher should be created, for use with Groot (default is false)
  5. publisher_port: the ZMQ publisher port to use (if enable_groot_monitoring is enabled)
  6. server_port: the ZMQ server port to use (if enable_groot_monitoring is enabled)
  7. max_msgs_per_second: max ZMQ messages per second (if enable_groot_monitoring is enabled)
  8. bt_file_logging: a boolean which enables logging of BT state changes in .fbl files, useful for playing back behavior tree execution using Groot (default is false)
  9. bt_minitrace_logging: a boolean which enables logging of .json files for recording the execution time of each node (default is false)

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).

  1. 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) and server_timeout (double). These ports can be preserved when overriding using providedBasicPorts
    • 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)
  2. BT::PortsList providedBasicPorts(BT::PortsList addition): a convenience function for preserving the default input ports when overriding the providedPorts() function. An example use is shown below
  static BT::PortsList providedPorts() override
  {
    return providedBasicPorts({ BT::InputPort<std::string>("my_additional_port") });
  }
  
  1. 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 the goal_ 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 the goal_updated_ member variable to true, along with any changes to the goal_ 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;
    }
  }
  
  1. 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)
  2. virtual BT::NodeStatus on_success(): this function is called if the action server returned successfully and will return BT::NodeStatus::SUCCESS by default. You may wish to override it if the node’s success depends on the result, which is placed in the result_ member variable.
  3. virtual BT::NodeStatus on_aborted(): this function is called if the action server aborted the action, returning BT::NodeStatus::FAILURE by default.
  4. virtual BT::NodeStatus on_cancelled(): this function is called if the action was cancelled, returning BT::NodeStatus::SUCCESS by default.
CHANGELOG

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

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

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

This package contains the Problem Expert module for the ROS2 Planning System

Additional Links

No additional links.

Maintainers

  • Francisco Martin Rico

Authors

No additional 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:

CHANGELOG

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

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged plansys2_bt_actions at Robotics Stack Exchange