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 2022-07-10
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

Wiki Tutorials

See ROS Wiki Tutorials for more details.

Source Tutorials

Not currently indexed.

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

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.11 (2023-08-02)

  • Fix logger destruction at BTActions
  • Contributors: Francisco Mart

Wiki Tutorials

See ROS Wiki Tutorials for more details.

Source Tutorials

Not currently indexed.

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

No version for distro rolling. Known supported distros are highlighted in the buttons above.
No version for distro noetic. Known supported distros are highlighted in the buttons above.
No version for distro ardent. Known supported distros are highlighted in the buttons above.
No version for distro bouncy. Known supported distros are highlighted in the buttons above.
No version for distro crystal. Known supported distros are highlighted in the buttons above.
No version for distro eloquent. Known supported distros are highlighted in the buttons above.
No version for distro dashing. Known supported distros are highlighted in the buttons above.

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 2022-05-04
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

Wiki Tutorials

See ROS Wiki Tutorials for more details.

Source Tutorials

Not currently indexed.

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 1.0.10
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 foxy-devel
Last Updated 2021-07-05
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

1.0.10 (2021-07-03)

  • Fix tests
  • Fix rate conversions
  • Reduce debug output
  • Update version
  • Contributors: Francisco Mart

Wiki Tutorials

See ROS Wiki Tutorials for more details.

Source Tutorials

Not currently indexed.

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

No version for distro lunar. Known supported distros are highlighted in the buttons above.
No version for distro jade. Known supported distros are highlighted in the buttons above.
No version for distro indigo. Known supported distros are highlighted in the buttons above.
No version for distro hydro. Known supported distros are highlighted in the buttons above.
No version for distro kinetic. Known supported distros are highlighted in the buttons above.
No version for distro melodic. Known supported distros are highlighted in the buttons above.