├── plansys2_tools
├── README.md
├── scripts
│ ├── rqt_plansys2_plan
│ ├── rqt_plansys2_knowledge
│ └── rqt_plansys2_performers
├── plugin_plan.xml
├── src
│ ├── rqt_plansys2_plan
│ │ ├── rqt_plansys2_plan.ui
│ │ └── PlanTree.cpp
│ ├── rqt_plansys2_performers
│ │ ├── rqt_plansys2_performers.ui
│ │ └── PerformersTree.cpp
│ ├── rqt_plansys2_knowledge
│ │ ├── rqt_plansys2_knowledge.ui
│ │ └── KnowledgeTree.cpp
│ └── logger.cpp
├── plugin_knowledge.xml
├── setup.py
├── plugin_performers.xml
├── include
│ ├── rqt_plansys2_plan
│ │ └── PlanTree.hpp
│ ├── rqt_plansys2_knowledge
│ │ └── KnowledgeTree.hpp
│ └── rqt_plansys2_performers
│ │ └── PerformersTree.hpp
└── package.xml
├── plansys2_support_py
├── resource
│ └── plansys2_support_py
├── setup.cfg
├── plansys2_support_py
│ ├── core
│ │ └── __init__.py
│ └── __init__.py
├── CHANGELOG.rst
├── package.xml
├── test
│ ├── test_pep257.py
│ ├── test_copyright.py
│ └── test_flake8.py
└── setup.py
├── plansys2_tests
├── README.md
├── test_4
│ ├── CMakeLists.txt
│ ├── pddl
│ │ └── test_4.pddl
│ └── README.md
├── test_2
│ ├── CMakeLists.txt
│ └── pddl
│ │ ├── problem_2.pddl
│ │ └── test_2.pddl
├── test_1
│ ├── CMakeLists.txt
│ └── pddl
│ │ └── test_1.pddl
├── test_3
│ └── CMakeLists.txt
├── package.xml
├── CMakeLists.txt
├── src
│ └── plansys2_tests
│ │ └── test_action_node.cpp
└── include
│ └── plansys2_tests
│ └── test_action_node.hpp
├── plansys2_msgs
├── msg
│ ├── Plan.msg
│ ├── PlanArray.msg
│ ├── Param.msg
│ ├── Problem.msg
│ ├── PlanItem.msg
│ ├── Derived.msg
│ ├── Knowledge.msg
│ ├── Tree.msg
│ ├── Action.msg
│ ├── State.msg
│ ├── ActionPerformerStatus.msg
│ ├── DurativeAction.msg
│ ├── ActionExecution.msg
│ ├── ActionExecutionInfo.msg
│ └── Node.msg
├── srv
│ ├── ExistNode.srv
│ ├── AddProblem.srv
│ ├── ValidateDomain.srv
│ ├── AffectNode.srv
│ ├── RemoveProblemGoal.srv
│ ├── AddProblemGoal.srv
│ ├── AffectParam.srv
│ ├── ClearProblemKnowledge.srv
│ ├── GetDomain.srv
│ ├── GetDomainConstants.srv
│ ├── GetDomainName.srv
│ ├── GetDomainActions.srv
│ ├── GetDomainTypes.srv
│ ├── GetNodeDetails.srv
│ ├── GetProblemGoal.srv
│ ├── GetStates.srv
│ ├── IsProblemGoalSatisfied.srv
│ ├── GetPlan.srv
│ ├── GetProblemInstanceDetails.srv
│ ├── GetOrderedSubGoals.srv
│ ├── GetProblemInstances.srv
│ ├── GetPlanArray.srv
│ ├── GetDomainDerivedPredicateDetails.srv
│ ├── GetProblem.srv
│ ├── GetDomainActionDetails.srv
│ └── GetDomainDurativeActionDetails.srv
├── action
│ └── ExecutePlan.action
├── package.xml
└── CMakeLists.txt
├── plansys2_bt_actions
├── test
│ ├── CMakeLists.txt
│ ├── behavior_tree
│ │ ├── assemble.xml
│ │ ├── transport.xml
│ │ ├── OpenGripper.hpp
│ │ ├── CloseGripper.hpp
│ │ ├── FailureNodes.cpp
│ │ ├── OpenGripper.cpp
│ │ ├── CloseGripper.cpp
│ │ └── Move.hpp
│ └── unit
│ │ └── CMakeLists.txt
├── package.xml
└── src
│ └── bt_action_node.cpp
├── plansys2_domain_expert
├── test
│ ├── pddl
│ │ ├── problem_0.pddl
│ │ ├── problem_simple_1.pddl
│ │ ├── domain_simple_ext.pddl
│ │ ├── domain_simple_processed.pddl
│ │ ├── domain_2_error.pddl
│ │ ├── domain_1_ok.pddl
│ │ └── problem_charging.pddl
│ ├── CMakeLists.txt
│ └── unit
│ │ └── CMakeLists.txt
├── package.xml
└── src
│ └── domain_expert_node.cpp
├── plansys2_docs
├── plansys2_arch.png
├── plansys2_logo.png
├── Executor_graph.png
├── plansys2_logo_v2.png
├── plansys2_logo_v2.xcf
├── plansys2_logo_v3.png
├── developer_guide.md
├── tutorials.md
└── FAQ.md
├── plansys2
├── CMakeLists.txt
├── CHANGELOG.rst
└── package.xml
├── codecov.yaml
├── plansys2_popf_plan_solver
├── README.md
├── test
│ ├── unit
│ │ └── CMakeLists.txt
│ ├── CMakeLists.txt
│ └── pddl
│ │ ├── problem_simple_3.pddl
│ │ ├── problem_simple_2.pddl
│ │ ├── problem_simple_1.pddl
│ │ ├── domain_simple.pddl
│ │ ├── domain_1_ok.pddl
│ │ └── domain_2_error.pddl
├── plansys2_popf_plan_solver_plugin.xml
├── package.xml
└── CMakeLists.txt
├── plansys2_core
├── README.md
├── test
│ ├── pddl
│ │ ├── problem_simple_3.pddl
│ │ ├── problem_simple_2.pddl
│ │ ├── problem_simple_1.pddl
│ │ └── domain_2_error.pddl
│ └── CMakeLists.txt
├── package.xml
└── CMakeLists.txt
├── plansys2_pddl_parser
├── test
│ ├── pddl
│ │ ├── prob2.pddl
│ │ ├── dom2.pddl
│ │ └── prob1.pddl
│ └── CMakeLists.txt
├── src
│ ├── plansys2_pddl_parser
│ │ ├── ParamCond.cpp
│ │ ├── Function.cpp
│ │ ├── Lifted.cpp
│ │ ├── Oneof.cpp
│ │ └── Not.cpp
│ └── parser.cpp
├── package.xml
├── include
│ └── plansys2_pddl_parser
│ │ ├── EitherType.hpp
│ │ ├── CondIter.hpp
│ │ ├── ParamCond.hpp
│ │ ├── Function.hpp
│ │ ├── GroundFunc.hpp
│ │ ├── TypeGround.hpp
│ │ ├── Lifted.hpp
│ │ ├── Task.hpp
│ │ └── Exists.hpp
└── LICENSE
├── plansys2_lifecycle_manager
├── test
│ └── CMakeLists.txt
├── package.xml
└── CMakeLists.txt
├── plansys2_executor
├── behavior_trees
│ ├── plansys2_start_action_bt.xml
│ ├── plansys2_end_action_bt.xml
│ ├── plansys2_action_bt.xml
│ └── plansys2_action_bt_with_undo.xml
├── test
│ ├── test_behavior_trees
│ │ ├── test_action_timeout_start_bt.xml
│ │ ├── test_action_timeout_end_bt.xml
│ │ └── test_action_timeout_bt.xml
│ ├── test_data
│ │ ├── road_trip_graph.csv
│ │ └── elevator_graph.csv
│ ├── pddl
│ │ ├── problem_simple_3.pddl
│ │ ├── problem_simple_2.pddl
│ │ ├── problem_simple_1.pddl
│ │ ├── simple_move_example.pddl
│ │ ├── elevator_problem.pddl
│ │ ├── domain_simple.pddl
│ │ └── problem_factory_1.pddl
│ ├── CMakeLists.txt
│ └── unit
│ │ └── CMakeLists.txt
├── plugins.xml
├── src
│ ├── executor_node.cpp
│ ├── compute_bt.cpp
│ └── plansys2_executor
│ │ └── behavior_tree
│ │ ├── wait_action_node.cpp
│ │ ├── apply_atend_effect_node.cpp
│ │ └── apply_atstart_effect_node.cpp
└── package.xml
├── plansys2_terminal
├── test
│ ├── CMakeLists.txt
│ └── pddl
│ │ ├── plan
│ │ ├── problem_empty_domain.pddl
│ │ ├── problem_charging.pddl
│ │ ├── commands
│ │ └── simple_example.pddl
├── README.md
├── src
│ └── terminal_node.cpp
└── package.xml
├── plansys2_planner
├── test
│ ├── CMakeLists.txt
│ ├── unit
│ │ └── CMakeLists.txt
│ └── pddl
│ │ ├── problem_simple_constants_1.pddl
│ │ ├── problem_simple_constants_2.pddl
│ │ ├── problem_simple_3.pddl
│ │ ├── problem_simple_2.pddl
│ │ ├── problem_simple_1.pddl
│ │ └── domain_simple.pddl
├── README.md
├── src
│ └── planner_node.cpp
├── package.xml
└── launch
│ └── planner_launch.py
├── plansys2_problem_expert
├── test
│ ├── CMakeLists.txt
│ ├── pddl
│ │ ├── problem_simple_constants_1.pddl
│ │ ├── problem_simple_constants_2.pddl
│ │ ├── problem_empty_domain.pddl
│ │ ├── problem_simple_1.pddl
│ │ ├── problem_unexpected_syntax.pddl
│ │ ├── domain_exists.pddl
│ │ └── problem_charging.pddl
│ └── unit
│ │ └── CMakeLists.txt
├── src
│ └── problem_expert_node.cpp
└── package.xml
├── dependency_repos.repos
├── .gitignore
├── plansys2_bringup
├── params
│ └── plansys2_params.yaml
├── package.xml
└── CMakeLists.txt
└── .github
└── workflows
├── doxygen-doc.yml
├── humble-devel.yaml
├── foxy-devel.yaml
├── kilted-devel.yaml
├── iron-devel.yaml
├── rolling.yaml
├── galactic-devel.yaml
└── jazzy-devel.yaml
/plansys2_tools/README.md:
--------------------------------------------------------------------------------
1 | # Tools
2 |
--------------------------------------------------------------------------------
/plansys2_support_py/resource/plansys2_support_py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/plansys2_tests/README.md:
--------------------------------------------------------------------------------
1 | # PlanSys2 tests
2 |
3 |
--------------------------------------------------------------------------------
/plansys2_msgs/msg/Plan.msg:
--------------------------------------------------------------------------------
1 | plansys2_msgs/PlanItem[] items
2 |
--------------------------------------------------------------------------------
/plansys2_bt_actions/test/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_subdirectory(unit)
2 |
--------------------------------------------------------------------------------
/plansys2_msgs/msg/PlanArray.msg:
--------------------------------------------------------------------------------
1 | plansys2_msgs/Plan[] plan_array
2 |
--------------------------------------------------------------------------------
/plansys2_msgs/msg/Param.msg:
--------------------------------------------------------------------------------
1 | string name
2 | string type
3 | string[] sub_types
4 |
--------------------------------------------------------------------------------
/plansys2_msgs/msg/Problem.msg:
--------------------------------------------------------------------------------
1 | builtin_interfaces/Time stamp
2 | string problem
3 |
--------------------------------------------------------------------------------
/plansys2_msgs/srv/ExistNode.srv:
--------------------------------------------------------------------------------
1 | plansys2_msgs/Node node
2 | ---
3 | bool exist
4 |
--------------------------------------------------------------------------------
/plansys2_msgs/msg/PlanItem.msg:
--------------------------------------------------------------------------------
1 | float32 time
2 | string action
3 | float32 duration
4 |
--------------------------------------------------------------------------------
/plansys2_msgs/srv/AddProblem.srv:
--------------------------------------------------------------------------------
1 | string problem
2 | ---
3 | bool success
4 | string error_info
5 |
--------------------------------------------------------------------------------
/plansys2_msgs/msg/Derived.msg:
--------------------------------------------------------------------------------
1 | plansys2_msgs/Node predicate
2 | plansys2_msgs/Tree preconditions
3 |
--------------------------------------------------------------------------------
/plansys2_msgs/srv/ValidateDomain.srv:
--------------------------------------------------------------------------------
1 | string domain
2 | ---
3 | bool success
4 | string error_info
5 |
--------------------------------------------------------------------------------
/plansys2_domain_expert/test/pddl/problem_0.pddl:
--------------------------------------------------------------------------------
1 | (define (problem void)
2 | (:domain plansys2)
3 | )
4 |
--------------------------------------------------------------------------------
/plansys2_msgs/srv/AffectNode.srv:
--------------------------------------------------------------------------------
1 | plansys2_msgs/Node node
2 | ---
3 | bool success
4 | string error_info
5 |
--------------------------------------------------------------------------------
/plansys2_msgs/srv/RemoveProblemGoal.srv:
--------------------------------------------------------------------------------
1 | std_msgs/Empty request
2 | ---
3 | bool success
4 | string error_info
--------------------------------------------------------------------------------
/plansys2_msgs/srv/AddProblemGoal.srv:
--------------------------------------------------------------------------------
1 | plansys2_msgs/Tree tree
2 | ---
3 | bool success
4 | string error_info
5 |
--------------------------------------------------------------------------------
/plansys2_msgs/srv/AffectParam.srv:
--------------------------------------------------------------------------------
1 | plansys2_msgs/Param param
2 | ---
3 | bool success
4 | string error_info
5 |
--------------------------------------------------------------------------------
/plansys2_msgs/srv/ClearProblemKnowledge.srv:
--------------------------------------------------------------------------------
1 | std_msgs/Empty request
2 | ---
3 | bool success
4 | string error_info
--------------------------------------------------------------------------------
/plansys2_msgs/msg/Knowledge.msg:
--------------------------------------------------------------------------------
1 | string[] instances
2 | string[] predicates
3 | string[] functions
4 | string goal
5 |
--------------------------------------------------------------------------------
/plansys2_msgs/msg/Tree.msg:
--------------------------------------------------------------------------------
1 | # A tree used to represent a PDDL construct in PlanSys2
2 |
3 | plansys2_msgs/Node[] nodes
4 |
--------------------------------------------------------------------------------
/plansys2_msgs/srv/GetDomain.srv:
--------------------------------------------------------------------------------
1 | std_msgs/Empty request
2 | ---
3 | bool success
4 | string domain
5 | string error_info
6 |
--------------------------------------------------------------------------------
/plansys2_docs/plansys2_arch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlanSys2/ros2_planning_system/HEAD/plansys2_docs/plansys2_arch.png
--------------------------------------------------------------------------------
/plansys2_docs/plansys2_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlanSys2/ros2_planning_system/HEAD/plansys2_docs/plansys2_logo.png
--------------------------------------------------------------------------------
/plansys2_msgs/srv/GetDomainConstants.srv:
--------------------------------------------------------------------------------
1 | string type
2 | ---
3 | bool success
4 | string[] constants
5 | string error_info
6 |
--------------------------------------------------------------------------------
/plansys2_msgs/srv/GetDomainName.srv:
--------------------------------------------------------------------------------
1 | std_msgs/Empty request
2 | ---
3 | bool success
4 | string name
5 | string error_info
6 |
--------------------------------------------------------------------------------
/plansys2_docs/Executor_graph.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlanSys2/ros2_planning_system/HEAD/plansys2_docs/Executor_graph.png
--------------------------------------------------------------------------------
/plansys2_docs/plansys2_logo_v2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlanSys2/ros2_planning_system/HEAD/plansys2_docs/plansys2_logo_v2.png
--------------------------------------------------------------------------------
/plansys2_docs/plansys2_logo_v2.xcf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlanSys2/ros2_planning_system/HEAD/plansys2_docs/plansys2_logo_v2.xcf
--------------------------------------------------------------------------------
/plansys2_docs/plansys2_logo_v3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlanSys2/ros2_planning_system/HEAD/plansys2_docs/plansys2_logo_v3.png
--------------------------------------------------------------------------------
/plansys2_msgs/srv/GetDomainActions.srv:
--------------------------------------------------------------------------------
1 | std_msgs/Empty request
2 | ---
3 | bool success
4 | string[] actions
5 | string error_info
6 |
--------------------------------------------------------------------------------
/plansys2_msgs/srv/GetDomainTypes.srv:
--------------------------------------------------------------------------------
1 | std_msgs/Empty request
2 | ---
3 | bool success
4 | string[] types
5 | string error_info
6 |
--------------------------------------------------------------------------------
/plansys2_msgs/srv/GetNodeDetails.srv:
--------------------------------------------------------------------------------
1 | string expression
2 | ---
3 | bool success
4 | plansys2_msgs/Node node
5 | string error_info
6 |
--------------------------------------------------------------------------------
/plansys2_msgs/srv/GetProblemGoal.srv:
--------------------------------------------------------------------------------
1 | std_msgs/Empty request
2 | ---
3 | bool success
4 | plansys2_msgs/Tree tree
5 | string error_info
6 |
--------------------------------------------------------------------------------
/plansys2_msgs/srv/GetStates.srv:
--------------------------------------------------------------------------------
1 | std_msgs/Empty request
2 | ---
3 | bool success
4 | plansys2_msgs/Node[] states
5 | string error_info
6 |
--------------------------------------------------------------------------------
/plansys2_msgs/srv/IsProblemGoalSatisfied.srv:
--------------------------------------------------------------------------------
1 | plansys2_msgs/Tree tree
2 | ---
3 | bool success
4 | bool satisfied
5 | string error_info
6 |
--------------------------------------------------------------------------------
/plansys2_msgs/srv/GetPlan.srv:
--------------------------------------------------------------------------------
1 | string domain
2 | string problem
3 | ---
4 | bool success
5 | plansys2_msgs/Plan plan
6 | string error_info
7 |
--------------------------------------------------------------------------------
/plansys2_msgs/srv/GetProblemInstanceDetails.srv:
--------------------------------------------------------------------------------
1 | string instance
2 | ---
3 | bool success
4 | plansys2_msgs/Param instance
5 | string error_info
6 |
--------------------------------------------------------------------------------
/plansys2_msgs/srv/GetOrderedSubGoals.srv:
--------------------------------------------------------------------------------
1 | std_msgs/Empty request
2 | ---
3 | bool success
4 | plansys2_msgs/Tree[] sub_goals
5 | string error_info
6 |
--------------------------------------------------------------------------------
/plansys2_msgs/srv/GetProblemInstances.srv:
--------------------------------------------------------------------------------
1 | std_msgs/Empty request
2 | ---
3 | bool success
4 | plansys2_msgs/Param[] instances
5 | string error_info
6 |
--------------------------------------------------------------------------------
/plansys2_support_py/setup.cfg:
--------------------------------------------------------------------------------
1 | [develop]
2 | script_dir=$base/lib/plansys2_support_py
3 | [install]
4 | install_scripts=$base/lib/plansys2_support_py
5 |
--------------------------------------------------------------------------------
/plansys2/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.5)
2 | project(plansys2)
3 |
4 | find_package(ament_cmake REQUIRED)
5 |
6 | ament_package()
7 |
--------------------------------------------------------------------------------
/plansys2_msgs/msg/Action.msg:
--------------------------------------------------------------------------------
1 | string name
2 | plansys2_msgs/Param[] parameters
3 |
4 | plansys2_msgs/Tree preconditions
5 | plansys2_msgs/Tree effects
6 |
--------------------------------------------------------------------------------
/plansys2_msgs/srv/GetPlanArray.srv:
--------------------------------------------------------------------------------
1 | string domain
2 | string problem
3 | ---
4 | bool success
5 | plansys2_msgs/PlanArray plan_array
6 | string error_info
7 |
--------------------------------------------------------------------------------
/plansys2_msgs/srv/GetDomainDerivedPredicateDetails.srv:
--------------------------------------------------------------------------------
1 | string predicate
2 | ---
3 | plansys2_msgs/Derived[] predicates
4 | bool success
5 | string error_info
6 |
--------------------------------------------------------------------------------
/plansys2_msgs/srv/GetProblem.srv:
--------------------------------------------------------------------------------
1 | std_msgs/Empty request
2 | ---
3 | builtin_interfaces/Time stamp
4 | bool success
5 | string problem
6 | string error_info
7 |
--------------------------------------------------------------------------------
/codecov.yaml:
--------------------------------------------------------------------------------
1 | fixes:
2 | - "ros_ws/src/*/ros2_planning_system/::"
3 | ignore:
4 | - "ros_ws/build"
5 | - "ros_ws/*/**/test/*"
6 | - "ros_ws/*/**/**/test/*"
7 |
--------------------------------------------------------------------------------
/plansys2_msgs/srv/GetDomainActionDetails.srv:
--------------------------------------------------------------------------------
1 | string action
2 | string[] parameters
3 | ---
4 | plansys2_msgs/Action action
5 | bool success
6 | string error_info
7 |
--------------------------------------------------------------------------------
/plansys2_popf_plan_solver/README.md:
--------------------------------------------------------------------------------
1 | # POPF Plan solver
2 |
3 | This package contains a plan solver that uses [popf](https://github.com/fmrico/popf) for solving PDDL plans.
4 |
--------------------------------------------------------------------------------
/plansys2_core/README.md:
--------------------------------------------------------------------------------
1 | # PlanSys2 Core
2 |
3 | This package hosts the abstract interface (virtual base classes) for plugins to be used with the following:
4 | - Planner (e.g., `popf`, `downward`)
5 |
--------------------------------------------------------------------------------
/plansys2_msgs/srv/GetDomainDurativeActionDetails.srv:
--------------------------------------------------------------------------------
1 | string durative_action
2 | string[] parameters
3 | ---
4 | bool success
5 | plansys2_msgs/DurativeAction durative_action
6 | string error_info
7 |
--------------------------------------------------------------------------------
/plansys2_pddl_parser/test/pddl/prob2.pddl:
--------------------------------------------------------------------------------
1 | (define (problem open-the-door)
2 | (:domain simple-door)
3 | (:init
4 | (not_door_open)
5 | )
6 | (:goal
7 | (and (door_open))
8 | )
9 | )
10 |
--------------------------------------------------------------------------------
/plansys2_tests/test_4/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | install(DIRECTORY pddl
2 | DESTINATION share/${PROJECT_NAME}/test_4
3 | )
4 |
5 | ament_add_gtest(test_4 test_4.cpp)
6 | target_link_libraries(test_4 ${PROJECT_NAME})
7 |
--------------------------------------------------------------------------------
/plansys2_lifecycle_manager/test/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | ament_add_gtest(lf_manager_test lf_manager_test.cpp)
2 | target_link_libraries(lf_manager_test
3 | ${PROJECT_NAME}
4 | rclcpp_lifecycle::rclcpp_lifecycle
5 | )
6 |
--------------------------------------------------------------------------------
/plansys2_executor/behavior_trees/plansys2_start_action_bt.xml:
--------------------------------------------------------------------------------
1 |
2 | WAIT_PREV_ACTIONS
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/plansys2_msgs/msg/State.msg:
--------------------------------------------------------------------------------
1 | plansys2_msgs/Param[] instances
2 | plansys2_msgs/Node[] predicates
3 | plansys2_msgs/Node[] inferred_predicates
4 | plansys2_msgs/Node[] functions
5 |
6 | plansys2_msgs/Derived[] derived_predicates
7 |
--------------------------------------------------------------------------------
/plansys2_executor/test/test_behavior_trees/test_action_timeout_start_bt.xml:
--------------------------------------------------------------------------------
1 |
2 | WAIT_PREV_ACTIONS
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/plansys2_support_py/plansys2_support_py/core/__init__.py:
--------------------------------------------------------------------------------
1 | """
2 | PlanSys2 Core Module.
3 |
4 | This module contains core components for PlanSys2, including the planner node,
5 | plugin provider, and base classes for plan solvers.
6 | """
7 |
--------------------------------------------------------------------------------
/plansys2_msgs/msg/ActionPerformerStatus.msg:
--------------------------------------------------------------------------------
1 | int8 NOT_READY=0
2 | int8 READY=1
3 | int8 RUNNING=2
4 | int8 FAILURE=4
5 |
6 | builtin_interfaces/Time status_stamp
7 |
8 | int8 state
9 | string action
10 | string[] specialized_arguments
11 | string node_name
12 |
--------------------------------------------------------------------------------
/plansys2_msgs/action/ExecutePlan.action:
--------------------------------------------------------------------------------
1 | plansys2_msgs/Plan plan
2 | ---
3 | int8 SUCCESS=1
4 | int8 FAILURE=2
5 | int8 PREEMPT=3
6 | int8 result
7 | plansys2_msgs/ActionExecutionInfo[] action_execution_status
8 | ---
9 | plansys2_msgs/ActionExecutionInfo[] action_execution_status
10 |
--------------------------------------------------------------------------------
/plansys2_msgs/msg/DurativeAction.msg:
--------------------------------------------------------------------------------
1 | string name
2 | plansys2_msgs/Param[] parameters
3 |
4 | plansys2_msgs/Tree at_start_requirements
5 | plansys2_msgs/Tree over_all_requirements
6 | plansys2_msgs/Tree at_end_requirements
7 | plansys2_msgs/Tree at_start_effects
8 | plansys2_msgs/Tree at_end_effects
9 |
--------------------------------------------------------------------------------
/plansys2_terminal/test/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | ament_add_gtest(terminal_test terminal_test.cpp TIMEOUT 500)
2 | target_link_libraries(terminal_test
3 | terminal
4 | readline
5 | ament_index_cpp::ament_index_cpp
6 | )
7 |
8 | install(DIRECTORY
9 | pddl
10 | DESTINATION share/${PROJECT_NAME}
11 | )
12 |
--------------------------------------------------------------------------------
/plansys2_popf_plan_solver/test/unit/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | ament_add_gtest(popf_test popf_test.cpp)
2 | target_link_libraries(popf_test
3 | ${PROJECT_NAME}
4 | ament_index_cpp::ament_index_cpp
5 | dl
6 | pluginlib::pluginlib
7 | )
8 | target_compile_definitions(popf_test PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS")
--------------------------------------------------------------------------------
/plansys2_support_py/CHANGELOG.rst:
--------------------------------------------------------------------------------
1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 | Changelog for package plansys2_support_py
3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 |
5 | 3.0.0 (2025-06-06)
6 | ------------------
7 | * Support action performers in Python
8 | * Contributors: Francisco Martín Rico, Marco Roveri
9 |
--------------------------------------------------------------------------------
/plansys2_planner/test/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(TEST_PDDL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/pddl)
2 | set(TEST_LAUNCH_DIR ${CMAKE_CURRENT_SOURCE_DIR}/test_launch_files)
3 |
4 | install(DIRECTORY
5 | ${TEST_PDDL_DIR}
6 | DESTINATION share/${PROJECT_NAME}
7 | )
8 |
9 | add_subdirectory(unit)
10 | #add_subdirectory(integration)
--------------------------------------------------------------------------------
/plansys2_support_py/plansys2_support_py/__init__.py:
--------------------------------------------------------------------------------
1 | """
2 | PlanSys2 Support Python Package.
3 |
4 | This package provides Python support for PlanSys2 (Planning System 2),
5 | including client interfaces for domain, problem, planner, and executor
6 | experts, as well as utilities for PDDL parsing and action execution.
7 | """
8 |
--------------------------------------------------------------------------------
/plansys2_docs/developer_guide.md:
--------------------------------------------------------------------------------
1 | # Developer Guide
2 |
3 | Plansys2 is composed by next modules:
4 |
5 | - [Domain Expert Module](../plansys2_domain_expert/README.md)
6 | - [Problem Expert Module](../plansys2_problem_expert/README.md)
7 | - [Planner](../plansys2_planner/README.md)
8 | - [Executor](../plansys2_executor/README.md)
9 |
--------------------------------------------------------------------------------
/plansys2_domain_expert/test/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(TEST_PDDL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/pddl)
2 | set(TEST_LAUNCH_DIR ${CMAKE_CURRENT_SOURCE_DIR}/test_launch_files)
3 |
4 | install(DIRECTORY
5 | ${TEST_PDDL_DIR}
6 | DESTINATION share/${PROJECT_NAME}
7 | )
8 |
9 | add_subdirectory(unit)
10 | #add_subdirectory(integration)
--------------------------------------------------------------------------------
/plansys2_pddl_parser/test/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | ament_add_gtest(pddl_parser_test pddl_parser_test.cpp TIMEOUT 120)
2 | target_link_libraries(pddl_parser_test
3 | ament_index_cpp::ament_index_cpp
4 | rclcpp::rclcpp
5 | ${PROJECT_NAME}
6 | )
7 |
8 | install(DIRECTORY
9 | pddl
10 | DESTINATION share/${PROJECT_NAME}
11 | )
12 |
--------------------------------------------------------------------------------
/plansys2_problem_expert/test/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(TEST_PDDL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/pddl)
2 | set(TEST_LAUNCH_DIR ${CMAKE_CURRENT_SOURCE_DIR}/test_launch_files)
3 |
4 | install(DIRECTORY
5 | ${TEST_PDDL_DIR}
6 | DESTINATION share/${PROJECT_NAME}
7 | )
8 |
9 | add_subdirectory(unit)
10 | #add_subdirectory(integration)
--------------------------------------------------------------------------------
/plansys2_msgs/msg/ActionExecution.msg:
--------------------------------------------------------------------------------
1 | int16 REQUEST=1
2 | int16 RESPONSE=2
3 | int16 CONFIRM=3
4 | int16 REJECT=4
5 | int16 FEEDBACK=5
6 | int16 FINISH=6
7 | int16 CANCEL=7
8 |
9 | int16 type
10 | string node_id
11 |
12 | string action
13 | string[] arguments
14 |
15 | bool success
16 | float32 completion
17 | string status
18 |
--------------------------------------------------------------------------------
/plansys2_planner/test/unit/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | ament_add_gtest(planner_test planner_test.cpp)
2 | target_link_libraries(planner_test
3 | ${PROJECT_NAME}
4 | ament_index_cpp::ament_index_cpp
5 | dl
6 | plansys2_pddl_parser::plansys2_pddl_parser
7 | )
8 | target_compile_definitions(planner_test PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS")
--------------------------------------------------------------------------------
/plansys2_popf_plan_solver/test/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(TEST_PDDL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/pddl)
2 | set(TEST_LAUNCH_DIR ${CMAKE_CURRENT_SOURCE_DIR}/test_launch_files)
3 |
4 | install(DIRECTORY
5 | ${TEST_PDDL_DIR}
6 | DESTINATION share/${PROJECT_NAME}
7 | )
8 |
9 | add_subdirectory(unit)
10 | #add_subdirectory(integration)
--------------------------------------------------------------------------------
/plansys2_planner/test/pddl/problem_simple_constants_1.pddl:
--------------------------------------------------------------------------------
1 | ( define ( problem problem_1 )
2 | ( :domain plansys2 )
3 | ( :objects
4 | m1 - message
5 | kitchen bedroom - room
6 | )
7 | ( :init
8 | ( robot_at leia kitchen )
9 | ( person_at jack bedroom )
10 | )
11 | ( :goal
12 | ( and
13 | ( robot_talk leia m1 jack )
14 | ))
15 | )
16 |
--------------------------------------------------------------------------------
/plansys2_popf_plan_solver/plansys2_popf_plan_solver_plugin.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/plansys2_bt_actions/test/behavior_tree/assemble.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/plansys2_problem_expert/test/pddl/problem_simple_constants_1.pddl:
--------------------------------------------------------------------------------
1 | ( define ( problem problem_1 )
2 | ( :domain plansys2 )
3 | ( :objects
4 | m1 - message
5 | kitchen bedroom - room
6 | )
7 | ( :init
8 | ( robot_at leia kitchen )
9 | ( person_at jack bedroom )
10 | )
11 | ( :goal
12 | ( and
13 | ( robot_talk leia m1 jack )
14 | ))
15 | )
16 |
--------------------------------------------------------------------------------
/plansys2_terminal/test/pddl/plan:
--------------------------------------------------------------------------------
1 | 0.000: (askcharge leia entrance chargingroom) [5.000]
2 | 5.001: (charge leia chargingroom) [5.000]
3 | 10.002: (move leia chargingroom kitchen) [5.000]
4 | 15.003: (move leia kitchen dinning) [5.000]
5 | 20.004: (move leia dinning bedroom) [5.000]
6 | 25.005: (move leia bedroom bathroom) [5.000]
7 |
--------------------------------------------------------------------------------
/plansys2_tests/test_2/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | install(DIRECTORY pddl
2 | DESTINATION share/${PROJECT_NAME}/test_2
3 | )
4 |
5 | ament_add_gtest(test_2 test_2.cpp)
6 | target_link_libraries(test_2
7 | ${PROJECT_NAME}
8 | plansys2_domain_expert::plansys2_domain_expert
9 | plansys2_problem_expert::plansys2_problem_expert
10 | plansys2_planner::plansys2_planner
11 | )
12 |
--------------------------------------------------------------------------------
/plansys2_executor/behavior_trees/plansys2_end_action_bt.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | CHECK_PREV_ACTIONS
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/plansys2_planner/test/pddl/problem_simple_constants_2.pddl:
--------------------------------------------------------------------------------
1 | ( define ( problem problem_1 )
2 | ( :domain plansys2 )
3 | ( :objects
4 | jack john - person
5 | m1 - message
6 | leia lema - robot
7 | kitchen bedroom - room
8 | )
9 | ( :init
10 | ( robot_at leia kitchen )
11 | ( person_at jack bedroom )
12 | )
13 | ( :goal
14 | ( and
15 | ( robot_talk leia m1 jack )
16 | )
17 | )
18 | )
19 |
--------------------------------------------------------------------------------
/plansys2_problem_expert/test/pddl/problem_simple_constants_2.pddl:
--------------------------------------------------------------------------------
1 | ( define ( problem problem_1 )
2 | ( :domain plansys2 )
3 | ( :objects
4 | jack john - person
5 | m1 - message
6 | leia lema - robot
7 | kitchen bedroom - room
8 | )
9 | ( :init
10 | ( robot_at leia kitchen )
11 | ( person_at jack bedroom )
12 | )
13 | ( :goal
14 | ( and
15 | ( robot_talk leia m1 jack )
16 | )
17 | )
18 | )
19 |
--------------------------------------------------------------------------------
/plansys2_tests/test_1/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | install(DIRECTORY pddl
2 | DESTINATION share/${PROJECT_NAME}/test_1
3 | )
4 |
5 | ament_add_gtest(test_1 test_1.cpp)
6 | target_link_libraries(test_1
7 | ${PROJECT_NAME}
8 | ament_index_cpp::ament_index_cpp
9 | plansys2_domain_expert::plansys2_domain_expert
10 | plansys2_problem_expert::plansys2_problem_expert
11 | plansys2_planner::plansys2_planner
12 | )
13 |
--------------------------------------------------------------------------------
/dependency_repos.repos:
--------------------------------------------------------------------------------
1 | repositories:
2 | cascade_lifecycle:
3 | type: git
4 | url: https://github.com/fmrico/cascade_lifecycle.git
5 | version: rolling
6 | popf:
7 | type: git
8 | url: https://github.com/fmrico/popf.git
9 | version: rolling-devel
10 | # behavior_tree_cpp:
11 | # type: git
12 | # url: https://github.com/BehaviorTree/BehaviorTree.CPP.git
13 | # version: 4.7.0
14 |
15 |
--------------------------------------------------------------------------------
/plansys2_executor/test/test_behavior_trees/test_action_timeout_end_bt.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | CHECK_PREV_ACTIONS
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/plansys2_executor/test/test_data/road_trip_graph.csv:
--------------------------------------------------------------------------------
1 | 0, 0, 0, move herbie wp0 wp1, visit herbie wp1
2 | 0, 1, 1, visit herbie wp1, move herbie wp1 rp0
3 | 0, 2, 2, move herbie wp1 rp0, refuel herbie rp0
4 | 0, 3, 3, refuel herbie rp0, move herbie rp0 wp3
5 | 0, 4, 4, move herbie rp0 wp3, visit herbie wp3
6 | 0, 5, 5, visit herbie wp3, move herbie wp3 wp2
7 | 0, 6, 6, move herbie wp3 wp2, visit herbie wp2
8 | 0, 7, 7, visit herbie wp2
9 |
--------------------------------------------------------------------------------
/plansys2/CHANGELOG.rst:
--------------------------------------------------------------------------------
1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 | Changelog for package plansys2
3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 |
5 | 3.0.0 (2025-06-06)
6 | ------------------
7 | * Merge pull request `#366 `_ from fmrico/add_exports
8 | Modify export target. Rename metapackage
9 | * Modify export target. Rename metapackage
10 | * Contributors: Francisco Martín Rico
11 |
--------------------------------------------------------------------------------
/plansys2_core/test/pddl/problem_simple_3.pddl:
--------------------------------------------------------------------------------
1 | (define (problem simple_1)
2 | (:domain simple)
3 | (:objects
4 | leia - robot
5 | Jack - person
6 | kitchen bedroom - room
7 | m1 - message
8 | )
9 | (:init
10 | (robot_at leia kitchen)
11 | )
12 |
13 | ;; The goal is to have both packages delivered to their destinations:
14 | (:goa (and
15 | (robot_talk leia m1 Jack)
16 |
17 | )
18 | )
19 |
--------------------------------------------------------------------------------
/plansys2_executor/test/pddl/problem_simple_3.pddl:
--------------------------------------------------------------------------------
1 | (define (problem simple_1)
2 | (:domain simple)
3 | (:objects
4 | leia - robot
5 | Jack - person
6 | kitchen bedroom - room
7 | m1 - message
8 | )
9 | (:init
10 | (robot_at leia kitchen)
11 | )
12 |
13 | ;; The goal is to have both packages delivered to their destinations:
14 | (:goa (and
15 | (robot_talk leia m1 Jack)
16 |
17 | )
18 | )
19 |
--------------------------------------------------------------------------------
/plansys2_planner/test/pddl/problem_simple_3.pddl:
--------------------------------------------------------------------------------
1 | (define (problem simple_1)
2 | (:domain simple)
3 | (:objects
4 | leia - robot
5 | Jack - person
6 | kitchen bedroom - room
7 | m1 - message
8 | )
9 | (:init
10 | (robot_at leia kitchen)
11 | )
12 |
13 | ;; The goal is to have both packages delivered to their destinations:
14 | (:goa (and
15 | (robot_talk leia m1 Jack)
16 |
17 | )
18 | )
19 |
--------------------------------------------------------------------------------
/plansys2_bt_actions/test/behavior_tree/transport.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/plansys2_core/test/pddl/problem_simple_2.pddl:
--------------------------------------------------------------------------------
1 | (define (problem simple_1)
2 | (:domain simple)
3 | (:objects
4 | leia - robot
5 | Jack - person
6 | kitchen bedroom - room
7 | m1 - message
8 | )
9 | (:init
10 | (robot_at leia kitchen)
11 |
12 |
13 | )
14 |
15 | ;; The goal is to have both packages delivered to their destinations:
16 | (:goal (and
17 | (robot_talk leia m1 Jack)
18 | )
19 | )
20 | )
21 |
--------------------------------------------------------------------------------
/plansys2_popf_plan_solver/test/pddl/problem_simple_3.pddl:
--------------------------------------------------------------------------------
1 | (define (problem simple_1)
2 | (:domain simple)
3 | (:objects
4 | leia - robot
5 | Jack - person
6 | kitchen bedroom - room
7 | m1 - message
8 | )
9 | (:init
10 | (robot_at leia kitchen)
11 | )
12 |
13 | ;; The goal is to have both packages delivered to their destinations:
14 | (:goa (and
15 | (robot_talk leia m1 Jack)
16 |
17 | )
18 | )
19 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /.vscode/**
2 | *.swp
3 |
4 | # Python
5 | __pycache__/
6 | *.py[cod]
7 | *$py.class
8 | *.so
9 | *.egg
10 | *.egg-info/
11 | dist/
12 | build/
13 | *.whl
14 | .Python
15 | .eggs/
16 | .pytest_cache/
17 | .coverage
18 | htmlcov/
19 | *.cover
20 | .hypothesis/
21 | pip-log.txt
22 | pip-delete-this-directory.txt
23 | .tox/
24 | .nox/
25 | venv/
26 | ENV/
27 | env/
28 | .venv
29 | *.pyc
30 | *.pyo
31 | *.pyd
32 |
--------------------------------------------------------------------------------
/plansys2_executor/behavior_trees/plansys2_action_bt.xml:
--------------------------------------------------------------------------------
1 |
2 | WAIT_PREV_ACTIONS
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/plansys2_executor/test/pddl/problem_simple_2.pddl:
--------------------------------------------------------------------------------
1 | (define (problem simple_1)
2 | (:domain simple)
3 | (:objects
4 | leia - robot
5 | Jack - person
6 | kitchen bedroom - room
7 | m1 - message
8 | )
9 | (:init
10 | (robot_at leia kitchen)
11 |
12 |
13 | )
14 |
15 | ;; The goal is to have both packages delivered to their destinations:
16 | (:goal (and
17 | (robot_talk leia m1 Jack)
18 | )
19 | )
20 | )
21 |
--------------------------------------------------------------------------------
/plansys2_planner/test/pddl/problem_simple_2.pddl:
--------------------------------------------------------------------------------
1 | (define (problem simple_1)
2 | (:domain simple)
3 | (:objects
4 | leia - robot
5 | Jack - person
6 | kitchen bedroom - room
7 | m1 - message
8 | )
9 | (:init
10 | (robot_at leia kitchen)
11 |
12 |
13 | )
14 |
15 | ;; The goal is to have both packages delivered to their destinations:
16 | (:goal (and
17 | (robot_talk leia m1 Jack)
18 | )
19 | )
20 | )
21 |
--------------------------------------------------------------------------------
/plansys2_docs/tutorials.md:
--------------------------------------------------------------------------------
1 | # Tutorials
2 |
3 | Plansys2 is a PDDL-based planning system, so maybe the first reads are PDDL basics [1](https://arxiv.org/pdf/1106.4561.pdf), [2](http://www.cs.toronto.edu/~sheila/2542/w09/A1/introtopddl2.pdf) and [3](http://www.cs.toronto.edu/~sheila/384/w11/Assignments/A3/veloso-PDDL_by_Example.pdf)
4 |
5 | 1. [Working with Plansys2 and Terminal](tutorials/tut_1_terminal.md)
6 | 1. [Patrol navigation Example](tutorials/tut_2_patrol.md)
7 |
--------------------------------------------------------------------------------
/plansys2_popf_plan_solver/test/pddl/problem_simple_2.pddl:
--------------------------------------------------------------------------------
1 | (define (problem simple_1)
2 | (:domain simple)
3 | (:objects
4 | leia - robot
5 | Jack - person
6 | kitchen bedroom - room
7 | m1 - message
8 | )
9 | (:init
10 | (robot_at leia kitchen)
11 |
12 |
13 | )
14 |
15 | ;; The goal is to have both packages delivered to their destinations:
16 | (:goal (and
17 | (robot_talk leia m1 Jack)
18 | )
19 | )
20 | )
21 |
--------------------------------------------------------------------------------
/plansys2_tests/test_3/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | install(DIRECTORY pddl
2 | DESTINATION share/${PROJECT_NAME}/test_3
3 | )
4 |
5 | ament_add_gtest(test_3 test_3.cpp TIMEOUT 300)
6 | target_link_libraries(test_3
7 | ${PROJECT_NAME}
8 | ament_index_cpp::ament_index_cpp
9 | plansys2_domain_expert::plansys2_domain_expert
10 | plansys2_problem_expert::plansys2_problem_expert
11 | plansys2_planner::plansys2_planner
12 | plansys2_pddl_parser::plansys2_pddl_parser
13 | )
14 |
--------------------------------------------------------------------------------
/plansys2_core/test/pddl/problem_simple_1.pddl:
--------------------------------------------------------------------------------
1 | (define (problem simple_1)
2 | (:domain simple)
3 | (:objects
4 | leia - robot
5 | Jack - person
6 | kitchen bedroom - room
7 | m1 - message
8 | )
9 | (:init
10 | (robot_at leia kitchen)
11 | (person_at Jack bedroom)
12 |
13 |
14 | )
15 |
16 | ;; The goal is to have both packages delivered to their destinations:
17 | (:goal (and
18 | (robot_at leia bedroom)
19 | )
20 | )
21 | )
22 |
--------------------------------------------------------------------------------
/plansys2_terminal/test/pddl/problem_empty_domain.pddl:
--------------------------------------------------------------------------------
1 | (define (problem simple_1)
2 | (:domain )
3 | (:objects
4 | leia - robot
5 | Jack - person
6 | kitchen bedroom - room
7 | m1 - message
8 | )
9 | (:init
10 | (robot_at leia kitchen)
11 | (person_at Jack bedroom)
12 |
13 |
14 | )
15 |
16 | ;; The goal is to have both packages delivered to their destinations:
17 | (:goal (and
18 | (robot_talk leia m1 Jack)
19 | )
20 | )
21 | )
22 |
--------------------------------------------------------------------------------
/plansys2_executor/test/pddl/problem_simple_1.pddl:
--------------------------------------------------------------------------------
1 | (define (problem simple_1)
2 | (:domain simple)
3 | (:objects
4 | leia - robot
5 | Jack - person
6 | kitchen bedroom - room
7 | m1 - message
8 | )
9 | (:init
10 | (robot_at leia kitchen)
11 | (person_at Jack bedroom)
12 |
13 |
14 | )
15 |
16 | ;; The goal is to have both packages delivered to their destinations:
17 | (:goal (and
18 | (robot_talk leia m1 Jack)
19 | )
20 | )
21 | )
22 |
--------------------------------------------------------------------------------
/plansys2_planner/test/pddl/problem_simple_1.pddl:
--------------------------------------------------------------------------------
1 | (define (problem simple_1)
2 | (:domain simple)
3 | (:objects
4 | leia - robot
5 | Jack - person
6 | kitchen bedroom - room
7 | m1 - message
8 | )
9 | (:init
10 | (robot_at leia kitchen)
11 | (person_at Jack bedroom)
12 |
13 |
14 | )
15 |
16 | ;; The goal is to have both packages delivered to their destinations:
17 | (:goal (and
18 | (robot_talk leia m1 Jack)
19 | )
20 | )
21 | )
22 |
--------------------------------------------------------------------------------
/plansys2_popf_plan_solver/test/pddl/problem_simple_1.pddl:
--------------------------------------------------------------------------------
1 | (define (problem simple_1)
2 | (:domain simple)
3 | (:objects
4 | leia - robot
5 | Jack - person
6 | kitchen bedroom - room
7 | m1 - message
8 | )
9 | (:init
10 | (robot_at leia kitchen)
11 | (person_at Jack bedroom)
12 |
13 |
14 | )
15 |
16 | ;; The goal is to have both packages delivered to their destinations:
17 | (:goal (and
18 | (robot_talk leia m1 Jack)
19 | )
20 | )
21 | )
22 |
--------------------------------------------------------------------------------
/plansys2_problem_expert/test/pddl/problem_empty_domain.pddl:
--------------------------------------------------------------------------------
1 | (define (problem simple_1)
2 | (:domain )
3 | (:objects
4 | leia - robot
5 | Jack - person
6 | kitchen bedroom - room
7 | m1 - message
8 | )
9 | (:init
10 | (robot_at leia kitchen)
11 | (person_at Jack bedroom)
12 |
13 |
14 | )
15 |
16 | ;; The goal is to have both packages delivered to their destinations:
17 | (:goal (and
18 | (robot_talk leia m1 Jack)
19 | )
20 | )
21 | )
22 |
--------------------------------------------------------------------------------
/plansys2_domain_expert/test/pddl/problem_simple_1.pddl:
--------------------------------------------------------------------------------
1 | (define (problem plansys2_1)
2 | (:domain plansys2)
3 | (:objects
4 | leia - robot
5 | Jack - person
6 | kitchen bedroom - room
7 | m1 - message
8 | )
9 | (:init
10 | (robot_at leia kitchen)
11 | (person_at Jack bedroom)
12 |
13 |
14 | )
15 |
16 | ;; The goal is to have both packages delivered to their destinations:
17 | (:goal (and
18 | (robot_talk leia m1 Jack)
19 | )
20 | )
21 | )
22 |
--------------------------------------------------------------------------------
/plansys2_msgs/msg/ActionExecutionInfo.msg:
--------------------------------------------------------------------------------
1 | int8 NOT_EXECUTED=1
2 | int8 EXECUTING=2
3 | int8 FAILED=3
4 | int8 SUCCEEDED=4
5 | int8 CANCELLED=5
6 |
7 | int8 status
8 |
9 | builtin_interfaces/Time start_stamp
10 | builtin_interfaces/Time status_stamp
11 |
12 | string action_full_name
13 |
14 | string action
15 | string[] arguments
16 |
17 | # predicted duration of the action from the planner
18 | builtin_interfaces/Duration duration
19 |
20 | float32 completion
21 | string message_status
22 |
--------------------------------------------------------------------------------
/plansys2_tools/scripts/rqt_plansys2_plan:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 |
3 | import sys
4 |
5 | from rqt_gui.main import Main
6 |
7 |
8 | def add_arguments(parser):
9 | group = parser.add_argument_group('Options for rqt_plansys2_plan plugin')
10 | group.add_argument('topic', nargs='?', help='The topic name to subscribe to')
11 |
12 | main = Main()
13 | sys.exit(main.main(
14 | sys.argv,
15 | standalone='rqt_plansys2_plan/RQTPlan',
16 | plugin_argument_provider=add_arguments))
17 |
--------------------------------------------------------------------------------
/plansys2_executor/test/test_behavior_trees/test_action_timeout_bt.xml:
--------------------------------------------------------------------------------
1 |
2 | WAIT_PREV_ACTIONS
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/plansys2_tools/scripts/rqt_plansys2_knowledge:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 |
3 | import sys
4 |
5 | from rqt_gui.main import Main
6 |
7 |
8 | def add_arguments(parser):
9 | group = parser.add_argument_group('Options for rqt_plansys2_knowledge plugin')
10 | group.add_argument('topic', nargs='?', help='The topic name to subscribe to')
11 |
12 | main = Main()
13 | sys.exit(main.main(
14 | sys.argv,
15 | standalone='rqt_plansys2_knowledge/RQTKnowledge',
16 | plugin_argument_provider=add_arguments))
17 |
--------------------------------------------------------------------------------
/plansys2_tools/scripts/rqt_plansys2_performers:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 |
3 | import sys
4 |
5 | from rqt_gui.main import Main
6 |
7 |
8 | def add_arguments(parser):
9 | group = parser.add_argument_group('Options for rqt_plansys2_performers plugin')
10 | group.add_argument('topic', nargs='?', help='The topic name to subscribe to')
11 |
12 | main = Main()
13 | sys.exit(main.main(
14 | sys.argv,
15 | standalone='rqt_plansys2_performers/RQTPerformers',
16 | plugin_argument_provider=add_arguments))
17 |
--------------------------------------------------------------------------------
/plansys2_executor/test/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(TEST_PDDL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/pddl)
2 | set(TEST_BEHAVIOR_TREES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/test_behavior_trees)
3 | set(TEST_DATA_DIR ${CMAKE_CURRENT_SOURCE_DIR}/test_data)
4 | set(TEST_LAUNCH_DIR ${CMAKE_CURRENT_SOURCE_DIR}/test_launch_files)
5 |
6 | install(DIRECTORY
7 | ${TEST_PDDL_DIR}
8 | ${TEST_BEHAVIOR_TREES_DIR}
9 | ${TEST_DATA_DIR}
10 | DESTINATION share/${PROJECT_NAME}
11 | )
12 |
13 | add_subdirectory(unit)
14 | #add_subdirectory(integration)
15 |
--------------------------------------------------------------------------------
/plansys2_bringup/params/plansys2_params.yaml:
--------------------------------------------------------------------------------
1 | plansys2:
2 | ros__parameters:
3 | use_real_time: false
4 | planner_client:
5 | ros__parameters:
6 | plan_solver_timeout: 15.0
7 | planner:
8 | ros__parameters:
9 | plan_solver_timeout: 15.0
10 | plan_solver_plugins: ["POPF"]
11 | POPF:
12 | plugin: "plansys2/POPFPlanSolver"
13 | TFD:
14 | plugin: "plansys2/TFDPlanSolver"
15 | executor:
16 | ros__parameters:
17 | bt_builder_plugin: "SimpleBTBuilder"
18 | # bt_builder_plugin: "STNBTBuilder"
19 |
--------------------------------------------------------------------------------
/plansys2_problem_expert/test/pddl/problem_simple_1.pddl:
--------------------------------------------------------------------------------
1 | (define (problem simple_1)
2 | (:domain simple)
3 | (:objects
4 | leia - robot
5 | Jack Alice - person
6 | kitchen bedroom - room
7 | m1 - message
8 | )
9 | (:init
10 | (robot_at leia kitchen)
11 | (person_at Jack bedroom)
12 | (= (room_distance kitchen bedroom) 10)
13 |
14 |
15 | )
16 |
17 | ;; The goal is to have both packages delivered to their destinations:
18 | (:goal (and
19 | (robot_talk leia m1 Jack)
20 | )
21 | )
22 | )
23 |
--------------------------------------------------------------------------------
/plansys2_executor/plugins.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/plansys2_problem_expert/test/unit/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | ament_add_gtest(utils_test utils_test.cpp)
2 | target_link_libraries(utils_test
3 | ${PROJECT_NAME}
4 | ament_index_cpp::ament_index_cpp
5 | )
6 |
7 | ament_add_gtest(problem_expert_test problem_expert_test.cpp)
8 | target_link_libraries(problem_expert_test
9 | ${PROJECT_NAME}
10 | ament_index_cpp::ament_index_cpp
11 | )
12 |
13 | ament_add_gtest(problem_expert_node_test problem_expert_node_test.cpp)
14 | target_link_libraries(problem_expert_node_test
15 | ${PROJECT_NAME}
16 | ament_index_cpp::ament_index_cpp
17 | )
18 |
--------------------------------------------------------------------------------
/plansys2_executor/behavior_trees/plansys2_action_bt_with_undo.xml:
--------------------------------------------------------------------------------
1 |
2 | WAIT_PREV_ACTIONS
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/plansys2_terminal/test/pddl/problem_charging.pddl:
--------------------------------------------------------------------------------
1 | (define (problem simple-problem)
2 | (:domain simple)
3 |
4 | ;; Instantiate the objects.
5 | (:objects
6 | r2d2 - robot
7 | rm0 rm1 rm2 - room
8 | )
9 |
10 | (:init
11 | ;; Define the initial state predicates.
12 | (robot_at r2d2 rm0)
13 | (charging_point_at rm0)
14 |
15 | (connected rm0 rm1)
16 | (connected rm1 rm0)
17 | (connected rm1 rm2)
18 | (connected rm2 rm1)
19 | (battery_low r2d2)
20 | )
21 |
22 | (:goal (and
23 | (robot_at r2d2 rm2)
24 | ))
25 |
26 | (:metric
27 | minimize (total-time)
28 | )
29 | )
30 |
--------------------------------------------------------------------------------
/plansys2_tools/plugin_plan.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | A GUI plugin to view PlanSys2 Plan
5 |
6 |
7 |
8 |
9 | applications-accesories
10 | PlanSys2 Plugins.
11 |
12 |
13 | utilities-system-monitor
14 | A GUI plugin for viewing Plan.
15 |
16 |
17 |
--------------------------------------------------------------------------------
/plansys2_tools/src/rqt_plansys2_plan/rqt_plansys2_plan.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | RqtPlansys2Plan
4 |
5 |
6 | RqtPlansys2Plan
7 |
8 |
9 |
10 |
11 | 0
12 | 10
13 | 1600
14 | 431
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/plansys2_executor/test/test_data/elevator_graph.csv:
--------------------------------------------------------------------------------
1 | 0, 0, 0, move-down e2 n5 n4, board p3 n4 e2
2 | 0, 2, 1, board p3 n4 e2, move-down e2 n4 n3
3 | 0, 5, 3, move-down e2 n4 n3, move-down e2 n3 n2
4 | 0, 6, 4, move-down e2 n3 n2, move-down e2 n2 n1
5 | 0, 8, 6, move-down e2 n2 n1, leave p3 n1 e2
6 | 0, 11, 8, leave p3 n1 e2
7 | 1, 1, 0, move-up e1 n1 n2, board p1 n2 e1, board p2 n2 e1
8 | 1, 3, 2, board p1 n2 e1, move-down e1 n2 n1
9 | 1, 7, 5, move-down e1 n2 n1, leave p1 n1 e1, leave p2 n1 e1
10 | 1, 9, 7, leave p1 n1 e1
11 | 1, 10, 7, leave p2 n1 e1
12 | 1, 4, 2, board p2 n2 e1, move-down e1 n2 n1
13 | 1, 7, 5, move-down e1 n2 n1, leave p1 n1 e1, leave p2 n1 e1
14 | 1, 9, 7, leave p1 n1 e1
15 | 1, 10, 7, leave p2 n1 e1
16 |
--------------------------------------------------------------------------------
/plansys2_tools/plugin_knowledge.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | A GUI plugin to view PlanSys2 Knowledge
5 |
6 |
7 |
8 |
9 | applications-accesories
10 | PlanSys2 Plugins.
11 |
12 |
13 | utilities-system-monitor
14 | A GUI plugin for viewing Knowledge.
15 |
16 |
17 |
--------------------------------------------------------------------------------
/plansys2_tools/src/rqt_plansys2_performers/rqt_plansys2_performers.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | RqtPlansys2Performers
4 |
5 |
6 | RqtPlansys2Performers
7 |
8 |
9 |
10 |
11 | 0
12 | 10
13 | 791
14 | 431
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/plansys2_tools/setup.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | from distutils.core import setup
4 |
5 | from catkin_pkg.python_setup import generate_distutils_setup
6 |
7 | d = generate_distutils_setup(
8 | packages=['plansys2_tools'],
9 | package_dir={'': 'src'},
10 | scripts=['scripts/rqt_plansys2_knowledge']
11 | )
12 |
13 | setup(**d)
14 |
15 | d2 = generate_distutils_setup(
16 | packages=['plansys2_tools'],
17 | package_dir={'': 'src'},
18 | scripts=['scripts/rqt_plansys2_performers']
19 | )
20 |
21 | setup(**d2)
22 |
23 | d3 = generate_distutils_setup(
24 | packages=['plansys2_tools'],
25 | package_dir={'': 'src'},
26 | scripts=['scripts/rqt_plansys2_plan']
27 | )
28 |
29 | setup(**d2)
30 |
--------------------------------------------------------------------------------
/plansys2_tools/plugin_performers.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | A GUI plugin to view PlanSys2 Performers
5 |
6 |
7 |
8 |
9 | applications-accesories
10 | PlanSys2 Plugins.
11 |
12 |
13 | utilities-system-monitor
14 | A GUI plugin for viewing Performers.
15 |
16 |
17 |
--------------------------------------------------------------------------------
/plansys2_problem_expert/test/pddl/problem_unexpected_syntax.pddl:
--------------------------------------------------------------------------------
1 | (define (problem simple_1)
2 | (:domain simple)
3 | (:objects
4 | leia - robot
5 | Jack - person
6 | kitchen bedroom - room
7 | m1 - message
8 | )
9 | (:init
10 | (robot_at leia kitchen)
11 | (person_at Jack bedroom)
12 | (= (room_distance kitchen bedroom) 10)
13 |
14 | ;; problem syntax below
15 | ;; too many rooms specified
16 | (is_teleporter_destination kitchen bedroom)
17 | ;; robot erroneously specified
18 | (= (room_distance leia kitchen) 10)
19 |
20 |
21 | )
22 |
23 | ;; The goal is to have both packages delivered to their destinations:
24 | (:goal (and
25 | (robot_talk leia m1 Jack)
26 | )
27 | )
28 | )
29 |
--------------------------------------------------------------------------------
/plansys2_terminal/README.md:
--------------------------------------------------------------------------------
1 | # Terminal
2 |
3 | The Plansys2 Terminal module is a tool to directly monitor and edit your application. See the tutorial [here](https://github.com/IntelligentRoboticsLabs/ros2_planning_system/blob/master/plansys2_docs/tutorials/tut_1_terminal.md).
4 |
5 | The node is created inside a Terminal object, which starts a looping run_console() method reading the terminal input and calling the corresponding services and actions.
6 |
7 | To enable for using parameters specified in a YAML file for e.g. specifying the timeout for the planner and planner client, you can use the following command:
8 | ``ros2 run plansys2_terminal plansys2_terminal --ros-args --params-file `ros2 pkg prefix --share plansys2_bringup`/params/plansys2_params.yaml``
9 |
10 |
--------------------------------------------------------------------------------
/plansys2_domain_expert/test/unit/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | ament_add_gtest(domain_expert_test domain_expert_test.cpp)
2 | target_link_libraries(domain_expert_test
3 | ${PROJECT_NAME}
4 | ament_index_cpp::ament_index_cpp
5 | ${lifecycle_msgs_TARGETS}
6 | )
7 |
8 | ament_add_gtest(domain_expert_node_test domain_expert_node_test.cpp)
9 | target_link_libraries(domain_expert_node_test
10 | ${PROJECT_NAME}
11 | ament_index_cpp::ament_index_cpp
12 | )
13 |
14 | ament_add_gtest(domain_reader_test domain_reader_test.cpp)
15 | target_link_libraries(domain_reader_test
16 | ${PROJECT_NAME}
17 | ament_index_cpp::ament_index_cpp
18 | )
19 |
20 | ament_add_gtest(types_test types_test.cpp)
21 | target_link_libraries(types_test
22 | ${PROJECT_NAME}
23 | ament_index_cpp::ament_index_cpp
24 | )
--------------------------------------------------------------------------------
/plansys2_core/test/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | ament_add_gtest(utils_test utils_test.cpp)
2 | target_link_libraries(utils_test
3 | ${PROJECT_NAME}
4 | ament_index_cpp::ament_index_cpp
5 | )
6 |
7 | ament_add_gtest(types_test types_test.cpp)
8 | target_link_libraries(types_test ${PROJECT_NAME})
9 |
10 | ament_add_gtest(node_variant_test node_variant_test.cpp)
11 | target_link_libraries(node_variant_test ${PROJECT_NAME})
12 |
13 | ament_add_gtest(graph_test graph_test.cpp)
14 | target_link_libraries(graph_test ${PROJECT_NAME})
15 |
16 | ament_add_gtest(state_test state_test.cpp)
17 | target_link_libraries(state_test ${PROJECT_NAME})
18 |
19 | set(TEST_PDDL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/pddl)
20 |
21 | install(DIRECTORY
22 | ${TEST_PDDL_DIR}
23 | DESTINATION share/${PROJECT_NAME}
24 | )
25 |
--------------------------------------------------------------------------------
/plansys2_tests/test_2/pddl/problem_2.pddl:
--------------------------------------------------------------------------------
1 | ( define ( problem problem_1 )
2 | ( :domain test2 )
3 | ( :objects
4 | leia - robot
5 | room_1 room_2 - room
6 | corridor_1 - corridor
7 | zone_1_1 zone_1_2 zone_recharge - zone
8 | )
9 | ( :init
10 | ( connected room_1 corridor_1 )
11 | ( connected corridor_1 room_1 )
12 | ( connected room_2 corridor_1 )
13 | ( connected corridor_1 room_2 )
14 | ( connected room_1 zone_1_1 )
15 | ( connected zone_1_1 room_1 )
16 | ( connected room_1 zone_1_2 )
17 | ( connected zone_1_2 room_1 )
18 | ( connected room_2 zone_recharge )
19 | ( connected zone_recharge room_2 )
20 | ( charging_point_at zone_recharge )
21 | ( battery_low leia )
22 | ( robot_at leia zone_1_1 )
23 | )
24 | ( :goal
25 | ( and
26 | ( robot_at leia zone_1_2 )
27 | )
28 | )
29 | )
--------------------------------------------------------------------------------
/plansys2_tests/test_4/pddl/test_4.pddl:
--------------------------------------------------------------------------------
1 | (define (domain simple-door)
2 | (:requirements :strips :typing :adl :fluents :durative-actions :existential-preconditions)
3 |
4 | (:predicates
5 | (door_open)
6 | (not_door_open)
7 | )
8 |
9 | (:durative-action open_door
10 | :parameters ()
11 | :duration ( = ?duration 1)
12 | :condition (and
13 | (at start (not_door_open))
14 | )
15 | :effect (and
16 | (at end (door_open))
17 | (at end (not (not_door_open)))
18 | )
19 | )
20 |
21 | (:durative-action close_door
22 | :parameters ()
23 | :duration ( = ?duration 1)
24 | :condition (and
25 | (at start (door_open))
26 | )
27 | :effect (and
28 | (at end (not_door_open))
29 | (at end (not (door_open)))
30 | )
31 | )
32 | )
33 |
--------------------------------------------------------------------------------
/plansys2_pddl_parser/test/pddl/dom2.pddl:
--------------------------------------------------------------------------------
1 | (define (domain simple-door)
2 | (:requirements :strips :typing :adl :fluents :durative-actions :existential-preconditions)
3 |
4 | (:predicates
5 | (door_open)
6 | (not_door_open)
7 | )
8 |
9 | (:durative-action open_door
10 | :parameters ()
11 | :duration ( = ?duration 1)
12 | :condition (and
13 | (at start (not_door_open))
14 | )
15 | :effect (and
16 | (at start (door_open))
17 | (at start (not (not_door_open)))
18 | )
19 | )
20 |
21 | (:durative-action close_door
22 | :parameters ()
23 | :duration ( = ?duration 1)
24 | :condition (and
25 | (at start (door_open))
26 | )
27 | :effect (and
28 | (at start (not_door_open))
29 | (at start (not (door_open)))
30 | )
31 | )
32 | )
33 |
--------------------------------------------------------------------------------
/.github/workflows/doxygen-doc.yml:
--------------------------------------------------------------------------------
1 | name: Doxygen Deployment
2 |
3 | on:
4 | push:
5 | branches:
6 | - rolling
7 | schedule:
8 | - cron: '0 0 * * 6'
9 | workflow_dispatch:
10 |
11 | jobs:
12 | doxygen_generation:
13 | runs-on: ubuntu-latest
14 |
15 | permissions:
16 | contents: write
17 |
18 | steps:
19 | - name: Checkout code
20 | uses: actions/checkout@v4
21 |
22 | - name: Generate Doxygen for PlanSys2
23 | uses: mattnotmitt/doxygen-action@edge
24 | with:
25 | doxyfile-path: ".github/Doxyfile"
26 |
27 | - name: Doxygen Deployment
28 | uses: peaceiris/actions-gh-pages@v4
29 | with:
30 | github_token: ${{ secrets.GITHUB_TOKEN }}
31 | publish_branch: gh-pages
32 | publish_dir: docs/html
33 |
--------------------------------------------------------------------------------
/plansys2_docs/FAQ.md:
--------------------------------------------------------------------------------
1 | # FAQ
2 |
3 | ## 1. How to debug errors in PDDL?
4 |
5 | Working with PDDL is difficult. If the PDDL domain is not well designed, or predicates or instances are missing, it is impossible to generate a plan. Plansys2 will notify you, but it is difficult to debug and solve the problem.
6 |
7 | When it is required to generate a plan, Plansys2 generates a file with the domain, `/tmp/${namespace}/domain.pddl` and another with the problem `/tmp/${namespace}/domain.pddl`. In addition, the output of the plan solver (popf) is saved in /tmp/${namespace}/plan.pddl.
8 |
9 | It is possible to execute the plan solver in isolation using the command:
10 |
11 | ``` shell
12 | ros2 run popf popf /tmp/${namespace}/domain.pddl /tmp/${namespace}/problem.pddl
13 | ```
14 |
15 | Use `ros2 run popf popf -h` for more help.
16 |
--------------------------------------------------------------------------------
/plansys2_planner/README.md:
--------------------------------------------------------------------------------
1 | # Planner
2 |
3 | The Planner module is responsible for creating plans. By default, it uses [popf](https://github.com/fmrico/popf), that is a PDDL solver.
4 |
5 | This module is very simple, as its only task is calling the popf binary and parsing the result.
6 |
7 | The main class is [`plansys2::PlannerNode`](include/include/plansys2_planner/PlannerNode.hpp), which is instantiated from [`planner_node.cpp`](src/planner_node.cpp). `plansys2::PlannerNode` is a also `rclcpp_lifecycle::LifecycleNode`, but currently the functionality is in the active phase.
8 |
9 | Plan solvers are specified in the `plan_solver_plugins` parameter. In case of more than one specified, the first one will be used. If this parameter is not specified, POPF will be used by default.
10 |
11 | ## Services
12 |
13 | - `/planner/get_plan` [[`plansys2_msgs::srv::GetPlan`](../plansys2_msgs/srv/GetPlan.srv)]
14 |
--------------------------------------------------------------------------------
/plansys2_pddl_parser/test/pddl/prob1.pddl:
--------------------------------------------------------------------------------
1 | (define (problem test) (:domain simple)
2 | (:objects
3 | bot - robot
4 | entrance - room
5 | kitchen - room
6 | bedroom - room
7 | dinning - room
8 | bathroom - room
9 | chargingroom - room
10 | )
11 |
12 | (:init
13 | (connected entrance dinning)
14 | (connected dinning entrance)
15 | (connected dinning kitchen)
16 | (connected kitchen dinning)
17 | (connected dinning bedroom)
18 | (connected bedroom dinning)
19 | (connected bathroom bedroom)
20 | (connected bedroom bathroom)
21 | (connected chargingroom kitchen)
22 | (connected kitchen chargingroom)
23 | (charging_point_at chargingroom)
24 | (robot_at bot entrance)
25 | (robot_at rob1 entrance)
26 | (= (battery_level bot) 90)
27 | (= (battery_level rob1) 100)
28 | )
29 |
30 | (:goal (and
31 | (robot_at bot bathroom)
32 | ))
33 |
34 |
35 | )
--------------------------------------------------------------------------------
/plansys2_lifecycle_manager/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | plansys2_lifecycle_manager
5 | 3.0.0
6 |
7 | A controller/manager for the lifecycle nodes of the ROS2 Planning System
8 |
9 | Francisco Martin Rico
10 |
11 | Apache License, Version 2.0
12 |
13 | ament_cmake
14 |
15 | rclcpp
16 | lifecycle_msgs
17 |
18 | ament_lint_common
19 | ament_lint_auto
20 | ament_cmake_gtest
21 |
22 |
23 | ament_cmake
24 |
25 |
26 |
--------------------------------------------------------------------------------
/plansys2_msgs/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | plansys2_msgs
5 | 3.0.0
6 |
7 | Messages and service files for the ROS2 Planning System
8 |
9 | Francisco Martin Rico
10 |
11 | Apache License, Version 2.0
12 |
13 | ament_cmake
14 |
15 | rclcpp
16 | std_msgs
17 | action_msgs
18 | builtin_interfaces
19 | rosidl_default_generators
20 |
21 | rosidl_interface_packages
22 |
23 |
24 | ament_cmake
25 |
26 |
27 |
--------------------------------------------------------------------------------
/plansys2_support_py/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | plansys2_support_py
5 | 3.0.0
6 |
7 | This package contains modules for developing PlanSys components in Python
8 |
9 | Francisco Martin Rico
10 |
11 | Apache License, Version 2.0
12 |
13 | rclpy
14 | lifecycle_msgs
15 | plansys2_msgs
16 |
17 | ament_copyright
18 | ament_flake8
19 | ament_pep257
20 | python3-pytest
21 |
22 |
23 | ament_python
24 |
25 |
26 |
--------------------------------------------------------------------------------
/plansys2_support_py/test/test_pep257.py:
--------------------------------------------------------------------------------
1 | # Copyright 2015 Open Source Robotics Foundation, Inc.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | from ament_pep257.main import main
16 | import pytest
17 |
18 |
19 | @pytest.mark.linter
20 | @pytest.mark.pep257
21 | def test_pep257():
22 | rc = main(argv=['.', 'test'])
23 | assert rc == 0, 'Found code style errors / warnings'
24 |
--------------------------------------------------------------------------------
/plansys2_support_py/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages, setup
2 |
3 | package_name = 'plansys2_support_py'
4 |
5 | setup(
6 | name=package_name,
7 | version='3.0.0',
8 | packages=find_packages(exclude=['test']),
9 | data_files=[
10 | ('share/ament_index/resource_index/packages',
11 | ['resource/' + package_name]),
12 | ('share/' + package_name, ['package.xml']),
13 | ],
14 | install_requires=['setuptools'],
15 | zip_safe=True,
16 | maintainer='Francisco Martin Rico',
17 | maintainer_email='fmrico@gmail.com',
18 | description='This package contains modules for developing PlanSys components in Python',
19 | license='Apache-2.0',
20 | extras_require={
21 | 'test': [
22 | 'pytest',
23 | ],
24 | },
25 | entry_points={
26 | 'console_scripts': [
27 | 'planner = ' + package_name + '.Planner:main',
28 | ],
29 | },
30 | )
31 |
--------------------------------------------------------------------------------
/plansys2_core/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | plansys2_core
5 | 3.0.0
6 |
7 | This package contains the PDDL-based core for the ROS2 Planning System
8 |
9 | Francisco Martin Rico
10 |
11 | Apache License, Version 2.0
12 |
13 | ament_cmake
14 |
15 | rclcpp
16 | rclcpp_lifecycle
17 | plansys2_pddl_parser
18 | plansys2_msgs
19 |
20 | ament_lint_common
21 | ament_lint_auto
22 | ament_cmake_gtest
23 |
24 |
25 | ament_cmake
26 |
27 |
28 |
--------------------------------------------------------------------------------
/plansys2_msgs/msg/Node.msg:
--------------------------------------------------------------------------------
1 | # Unknown type
2 | uint8 UNKNOWN = 0
3 |
4 | # Node types
5 | uint8 AND = 1
6 | uint8 OR = 2
7 | uint8 NOT = 3
8 | uint8 ACTION = 4
9 | uint8 PREDICATE = 5
10 | uint8 FUNCTION = 6
11 | uint8 EXPRESSION = 7
12 | uint8 FUNCTION_MODIFIER = 8
13 | uint8 NUMBER = 9
14 | uint8 CONSTANT = 10
15 | uint8 PARAMETER = 11
16 | uint8 EXISTS = 12
17 |
18 | # Expression types
19 | uint8 COMP_EQ = 13
20 | uint8 COMP_GE = 14
21 | uint8 COMP_GT = 15
22 | uint8 COMP_LE = 16
23 | uint8 COMP_LT = 17
24 | uint8 ARITH_MULT = 18
25 | uint8 ARITH_DIV = 19
26 | uint8 ARITH_ADD = 20
27 | uint8 ARITH_SUB = 21
28 |
29 | # Function modifier types
30 | uint8 ASSIGN = 22
31 | uint8 INCREASE = 23
32 | uint8 DECREASE = 24
33 | uint8 SCALE_UP = 25
34 | uint8 SCALE_DOWN = 26
35 |
36 | uint8 node_type
37 | uint8 expression_type
38 | uint8 modifier_type
39 |
40 | uint32 node_id
41 | uint32[] children
42 |
43 | string name
44 | plansys2_msgs/Param[] parameters
45 | float64 value
46 | bool negate
47 |
--------------------------------------------------------------------------------
/plansys2_tools/src/rqt_plansys2_knowledge/rqt_plansys2_knowledge.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | RqtPlansys2Knowledge
4 |
5 |
6 | RqtPlansys2Knowledge
7 |
8 |
9 |
10 |
11 | 0
12 | 10
13 | 791
14 | 431
15 |
16 |
17 |
18 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/plansys2_tools/src/logger.cpp:
--------------------------------------------------------------------------------
1 | // Copyright 2022 Intelligent Robotics Lab
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 |
16 | #include
17 |
18 | #include "rclcpp/rclcpp.hpp"
19 |
20 | #include "plansys2_logger/LoggerNode.hpp"
21 |
22 | int main(int argc, char ** argv)
23 | {
24 | rclcpp::init(argc, argv);
25 | auto logger_node = std::make_shared();
26 |
27 | rclcpp::spin(logger_node);
28 |
29 | rclcpp::shutdown();
30 | return 0;
31 | }
32 |
--------------------------------------------------------------------------------
/plansys2_executor/test/pddl/simple_move_example.pddl:
--------------------------------------------------------------------------------
1 | (define (domain replan)
2 | (:requirements :strips :typing :adl :fluents :durative-actions)
3 |
4 | ;; Types ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5 | (:types
6 | robot
7 | waypoint
8 | );; end Types ;;;;;;;;;;;;;;;;;;;;;;;;;
9 |
10 | ;; Predicates ;;;;;;;;;;;;;;;;;;;;;;;;;
11 | (:predicates
12 |
13 |
14 | (robot_at ?r - robot ?wp - waypoint)
15 | (connected ?wp_from ?wp_to - waypoint)
16 |
17 |
18 | );; end Predicates ;;;;;;;;;;;;;;;;;;;;
19 | ;; Functions ;;;;;;;;;;;;;;;;;;;;;;;;;
20 | (:functions
21 |
22 | );; end Functions ;;;;;;;;;;;;;;;;;;;;
23 | ;; Actions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
24 | (:durative-action move
25 | :parameters (?r - robot ?from ?to - waypoint)
26 | :duration ( = ?duration 5)
27 | :condition (and
28 | (at start(robot_at ?r ?from))
29 | (over all(connected ?from ?to))
30 | )
31 | :effect (and
32 | (at end(not(robot_at ?r ?from)))
33 | (at end(robot_at ?r ?to))
34 | )
35 | )
36 |
37 | );; end Domain ;;;;;;;;;;;;;;;;;;;;;;;;
38 |
--------------------------------------------------------------------------------
/plansys2_planner/src/planner_node.cpp:
--------------------------------------------------------------------------------
1 | // Copyright 2019 Intelligent Robotics Lab
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #include
16 |
17 | #include "plansys2_planner/PlannerNode.hpp"
18 | #include "rclcpp/rclcpp.hpp"
19 |
20 | int main(int argc, char ** argv)
21 | {
22 | rclcpp::init(argc, argv);
23 | auto node = std::make_shared();
24 |
25 | rclcpp::spin(node->get_node_base_interface());
26 |
27 | rclcpp::shutdown();
28 |
29 | return 0;
30 | }
31 |
--------------------------------------------------------------------------------
/plansys2_executor/src/executor_node.cpp:
--------------------------------------------------------------------------------
1 | // Copyright 2019 Intelligent Robotics Lab
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #include
16 |
17 | #include "plansys2_executor/ExecutorNode.hpp"
18 | #include "rclcpp/rclcpp.hpp"
19 |
20 | int main(int argc, char ** argv)
21 | {
22 | rclcpp::init(argc, argv);
23 | auto node = std::make_shared();
24 |
25 | rclcpp::spin(node->get_node_base_interface());
26 |
27 | rclcpp::shutdown();
28 |
29 | return 0;
30 | }
31 |
--------------------------------------------------------------------------------
/plansys2_terminal/src/terminal_node.cpp:
--------------------------------------------------------------------------------
1 | // Copyright 2019 Intelligent Robotics Lab
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 |
16 | #include
17 |
18 | #include "rclcpp/rclcpp.hpp"
19 |
20 | #include "plansys2_terminal/Terminal.hpp"
21 |
22 | int main(int argc, char ** argv)
23 | {
24 | rclcpp::init(argc, argv);
25 | auto terminal_node = std::make_shared();
26 |
27 | terminal_node->run_console();
28 |
29 | rclcpp::shutdown();
30 | return 0;
31 | }
32 |
--------------------------------------------------------------------------------
/plansys2_problem_expert/src/problem_expert_node.cpp:
--------------------------------------------------------------------------------
1 | // Copyright 2019 Intelligent Robotics Lab
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #include
16 |
17 | #include "plansys2_problem_expert/ProblemExpertNode.hpp"
18 | #include "rclcpp/rclcpp.hpp"
19 |
20 | int main(int argc, char ** argv)
21 | {
22 | rclcpp::init(argc, argv);
23 | auto node = std::make_shared();
24 | rclcpp::spin(node->get_node_base_interface());
25 | rclcpp::shutdown();
26 |
27 | return 0;
28 | }
29 |
--------------------------------------------------------------------------------
/plansys2_support_py/test/test_copyright.py:
--------------------------------------------------------------------------------
1 | # Copyright 2015 Open Source Robotics Foundation, Inc.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | from ament_copyright.main import main
16 | import pytest
17 |
18 |
19 | # Remove the `skip` decorator once the source file(s) have a copyright header
20 | @pytest.mark.skip(reason='No copyright header has been placed in the generated source file.')
21 | @pytest.mark.copyright
22 | @pytest.mark.linter
23 | def test_copyright():
24 | rc = main(argv=['.', 'test'])
25 | assert rc == 0, 'Found errors'
26 |
--------------------------------------------------------------------------------
/plansys2_tools/include/rqt_plansys2_plan/PlanTree.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2022 Intelligent Robotics Lab
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RQT_PLANSYS2_PLAN__PLANTREE_HPP_
16 | #define RQT_PLANSYS2_PLAN__PLANTREE_HPP_
17 |
18 | #include
19 | #include
20 |
21 | namespace rqt_plansys2_plan
22 | {
23 |
24 | class PlanTree : public QTreeWidget
25 | {
26 | public:
27 | PlanTree();
28 |
29 | void clearAllItems();
30 | };
31 |
32 | } // namespace rqt_plansys2_plan
33 |
34 | #endif // RQT_PLANSYS2_PLAN__PLANTREE_HPP_
35 |
--------------------------------------------------------------------------------
/plansys2_problem_expert/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | plansys2_problem_expert
5 | 3.0.0
6 |
7 | This package contains the Problem Expert module for the ROS2 Planning System
8 |
9 | Francisco Martin Rico
10 |
11 | Apache License, Version 2.0
12 |
13 | ament_cmake
14 |
15 | rclcpp
16 | rclcpp_lifecycle
17 | ament_index_cpp
18 | plansys2_pddl_parser
19 | plansys2_msgs
20 | plansys2_domain_expert
21 | std_msgs
22 | lifecycle_msgs
23 |
24 | ament_lint_common
25 | ament_lint_auto
26 | ament_cmake_gtest
27 |
28 |
29 | ament_cmake
30 |
31 |
32 |
--------------------------------------------------------------------------------
/plansys2_bringup/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | plansys2_bringup
5 | 3.0.0
6 |
7 | Bringup scripts and configurations for the ROS2 Planning System
8 |
9 | Francisco Martin Rico
10 |
11 | Apache License, Version 2.0
12 |
13 | ament_cmake
14 |
15 | rclcpp
16 | plansys2_domain_expert
17 | plansys2_problem_expert
18 | plansys2_planner
19 | plansys2_executor
20 | plansys2_lifecycle_manager
21 |
22 | launch_ros
23 |
24 | ament_lint_common
25 | ament_lint_auto
26 | launch
27 | launch_testing
28 |
29 |
30 | ament_cmake
31 |
32 |
33 |
--------------------------------------------------------------------------------
/plansys2_terminal/test/pddl/commands:
--------------------------------------------------------------------------------
1 | set instance leia robot
2 | set instance entrance room
3 | set instance kitchen room
4 | set instance bedroom room
5 | set instance dinning room
6 | set instance bathroom room
7 | set instance chargingroom room
8 |
9 | set predicate (connected entrance dinning)
10 | set predicate (connected dinning entrance)
11 | set predicate (connected dinning kitchen)
12 | set predicate (connected kitchen dinning)
13 | set predicate (connected dinning bedroom)
14 | set predicate (connected bedroom dinning)
15 | set predicate (connected bathroom bedroom)
16 | set predicate (connected bedroom bathroom)
17 | set predicate (connected chargingroom kitchen)
18 | set predicate (connected kitchen chargingroom)
19 | set predicate (charging_point_at chargingroom)
20 | set predicate (battery_low leia)
21 | set predicate (robot_at leia entrance)
22 |
23 | set goal (and(robot_at leia bathroom))
24 |
25 | quit
26 |
27 | get plan
28 |
29 | run
30 |
31 | get plan
32 |
33 | run (move leia entrance dinning)
34 | run (askcharge leia entrance)
35 |
36 | run (move leia bedroom kitchen)
37 |
38 | remove predicate battery_full leia
39 | set predicate battery_low leia
40 |
--------------------------------------------------------------------------------
/plansys2_tools/include/rqt_plansys2_knowledge/KnowledgeTree.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2022 Intelligent Robotics Lab
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RQT_PLANSYS2_KNOWLEDGE__KNOWLEDGETREE_HPP_
16 | #define RQT_PLANSYS2_KNOWLEDGE__KNOWLEDGETREE_HPP_
17 |
18 | #include
19 | #include
20 |
21 | namespace rqt_plansys2_knowledge
22 | {
23 |
24 | class KnowledgeTree : public QTreeWidget
25 | {
26 | public:
27 | KnowledgeTree();
28 |
29 | void clearAllItems();
30 | };
31 |
32 | } // namespace rqt_plansys2_knowledge
33 |
34 | #endif // RQT_PLANSYS2_KNOWLEDGE__KNOWLEDGETREE_HPP_
35 |
--------------------------------------------------------------------------------
/plansys2_popf_plan_solver/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | plansys2_popf_plan_solver
5 | 3.0.0
6 |
7 | This package contains the PDDL-based Planner module for the ROS2 Planning System
8 |
9 | Francisco Martin Rico
10 |
11 | Apache License, Version 2.0
12 |
13 | ament_cmake
14 |
15 | rclcpp
16 |
17 | plansys2_core
18 | pluginlib
19 |
20 | popf
21 |
22 | ament_lint_common
23 | ament_lint_auto
24 | ament_cmake_gtest
25 | ros2run
26 | ament_index_cpp
27 |
28 |
29 | ament_cmake
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/plansys2_tools/include/rqt_plansys2_performers/PerformersTree.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2022 Intelligent Robotics Lab
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef RQT_PLANSYS2_PERFORMERS__PERFORMERSTREE_HPP_
16 | #define RQT_PLANSYS2_PERFORMERS__PERFORMERSTREE_HPP_
17 |
18 | #include
19 | #include
20 |
21 | namespace rqt_plansys2_performers
22 | {
23 |
24 | class PerformersTree : public QTreeWidget
25 | {
26 | public:
27 | PerformersTree();
28 |
29 | void clearAllItems();
30 | };
31 |
32 | } // namespace rqt_plansys2_performers
33 |
34 | #endif // RQT_PLANSYS2_PERFORMERS__PERFORMERSTREE_HPP_
35 |
--------------------------------------------------------------------------------
/plansys2_problem_expert/test/pddl/domain_exists.pddl:
--------------------------------------------------------------------------------
1 | (define (domain simple)
2 | (:requirements :strips :typing :adl :fluents :durative-actions :existential-preconditions)
3 | (:types
4 | robot
5 | room
6 | )
7 |
8 | (:predicates
9 | (robot_at ?r - robot ?ro - room)
10 | (connected ?ro1 ?ro2 - room)
11 | (battery_full ?r - robot)
12 | (charging_point_at ?ro - room)
13 | )
14 |
15 | (:constants
16 | rob1 rob2 - robot
17 | bedroom bathroom - room
18 | )
19 |
20 | (:functions
21 | (battery_level ?r - robot)
22 | )
23 |
24 | (:action action_test
25 | :parameters (?r - robot)
26 | :precondition (and
27 | (exists (?ro)
28 | (and
29 | (robot_at ?r ?ro)
30 | (charging_point_at ?ro)
31 | )
32 | )
33 | (and (> (battery_level ?r) 1) (< (battery_level ?r) 200))
34 | )
35 | :effect (and
36 | (battery_full ?r)
37 | )
38 | )
39 |
40 | (:action action_test2
41 | :parameters (?r - robot)
42 | :precondition
43 | (exists (?ro1 ?ro2)
44 | (and
45 | (robot_at ?r ?ro1)
46 | (connected ?ro1 ?ro2)
47 | )
48 | )
49 | :effect (and )
50 | )
51 |
52 |
53 | )
54 |
--------------------------------------------------------------------------------
/plansys2_terminal/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | plansys2_terminal
5 | 3.0.0
6 |
7 | A terminal tool for monitor and manage the ROS2 Planning System
8 |
9 | Francisco Martin Rico
10 |
11 | Apache License, Version 2.0
12 |
13 | ament_cmake
14 |
15 | rclcpp
16 | plansys2_msgs
17 | plansys2_domain_expert
18 | plansys2_problem_expert
19 | plansys2_planner
20 | plansys2_executor
21 | plansys2_pddl_parser
22 | libreadline
23 |
24 | ament_lint_common
25 | ament_lint_auto
26 | ament_cmake_gtest
27 | ament_index_cpp
28 |
29 |
30 | ament_cmake
31 |
32 |
33 |
--------------------------------------------------------------------------------
/plansys2_domain_expert/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | plansys2_domain_expert
5 | 3.0.0
6 |
7 | This package contains the Domain Expert module for the ROS2 Planning System
8 |
9 | Francisco Martin Rico
10 |
11 | Apache License, Version 2.0
12 |
13 | ament_cmake
14 |
15 | rclcpp
16 | rclcpp_lifecycle
17 | ament_index_cpp
18 | plansys2_pddl_parser
19 | plansys2_msgs
20 | plansys2_core
21 | plansys2_popf_plan_solver
22 | std_msgs
23 |
24 |
25 | ament_lint_common
26 | ament_lint_auto
27 | ament_cmake_gtest
28 | lifecycle_msgs
29 |
30 |
31 | ament_cmake
32 |
33 |
34 |
--------------------------------------------------------------------------------
/plansys2_domain_expert/src/domain_expert_node.cpp:
--------------------------------------------------------------------------------
1 | // Copyright 2019 Intelligent Robotics Lab
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #include
16 |
17 | #include "plansys2_domain_expert/DomainExpertNode.hpp"
18 | #include "rclcpp/rclcpp.hpp"
19 |
20 | int main(int argc, char ** argv)
21 | {
22 | rclcpp::init(argc, argv);
23 | auto node = std::make_shared();
24 |
25 | rclcpp::experimental::executors::EventsExecutor executor;
26 | executor.add_node(node->get_node_base_interface());
27 | executor.spin();
28 | executor.remove_node(node->get_node_base_interface());
29 | rclcpp::shutdown();
30 |
31 | return 0;
32 | }
33 |
--------------------------------------------------------------------------------
/plansys2_tests/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | plansys2_tests
5 | 3.0.0
6 |
7 | This package contains the tests package for the ROS2 Planning System
8 |
9 | Francisco Martin Rico
10 |
11 | Apache License, Version 2.0
12 |
13 | ament_cmake
14 |
15 | rclcpp
16 | plansys2_msgs
17 | plansys2_executor
18 |
19 | popf
20 |
21 | ament_lint_common
22 | ament_lint_auto
23 | ament_cmake_gtest
24 | ament_index_cpp
25 | plansys2_domain_expert
26 | plansys2_problem_expert
27 | plansys2_planner
28 | plansys2_pddl_parser
29 |
30 |
31 | ament_cmake
32 |
33 |
34 |
--------------------------------------------------------------------------------
/plansys2_tools/src/rqt_plansys2_plan/PlanTree.cpp:
--------------------------------------------------------------------------------
1 | // Copyright 2022 Intelligent Robotics Lab
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 |
16 | #include
17 | #include
18 |
19 | #include "rqt_plansys2_plan/PlanTree.hpp"
20 |
21 | namespace rqt_plansys2_plan
22 | {
23 |
24 | PlanTree::PlanTree()
25 | : QTreeWidget()
26 | {
27 | }
28 |
29 | void
30 | PlanTree::clearAllItems()
31 | {
32 | int rows = topLevelItemCount();
33 |
34 | while (topLevelItemCount() > 0) {
35 | rowsAboutToBeRemoved(rootIndex(), 0, 0);
36 | delete takeTopLevelItem(0);
37 | rowsRemoved(rootIndex(), 0, 0);/* code */
38 | }
39 | }
40 |
41 | } // namespace rqt_plansys2_plan
42 |
--------------------------------------------------------------------------------
/plansys2_bt_actions/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | plansys2_bt_actions
5 | 3.0.0
6 |
7 | This package contains the Problem Expert module for the ROS2 Planning System
8 |
9 | Francisco Martin Rico
10 |
11 | Apache License, Version 2.0
12 |
13 | ament_cmake
14 |
15 | rclcpp
16 | rclcpp_action
17 | rclcpp_lifecycle
18 | plansys2_executor
19 | behaviortree_cpp
20 | lifecycle_msgs
21 | std_msgs
22 |
23 | ament_lint_common
24 | ament_lint_auto
25 | ament_cmake_gtest
26 | plansys2_msgs
27 | test_msgs
28 | geometry_msgs
29 | tf2_geometry_msgs
30 |
31 |
32 | ament_cmake
33 |
34 |
35 |
--------------------------------------------------------------------------------
/plansys2_tools/src/rqt_plansys2_knowledge/KnowledgeTree.cpp:
--------------------------------------------------------------------------------
1 | // Copyright 2022 Intelligent Robotics Lab
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 |
16 | #include
17 | #include
18 |
19 | #include "rqt_plansys2_knowledge/KnowledgeTree.hpp"
20 |
21 | namespace rqt_plansys2_knowledge
22 | {
23 |
24 | KnowledgeTree::KnowledgeTree()
25 | : QTreeWidget()
26 | {
27 | }
28 |
29 | void
30 | KnowledgeTree::clearAllItems()
31 | {
32 | int rows = topLevelItemCount();
33 |
34 | while (topLevelItemCount() > 0) {
35 | rowsAboutToBeRemoved(rootIndex(), 0, 0);
36 | delete takeTopLevelItem(0);
37 | rowsRemoved(rootIndex(), 0, 0);/* code */
38 | }
39 | }
40 |
41 | } // namespace rqt_plansys2_knowledge
42 |
--------------------------------------------------------------------------------
/plansys2_tools/src/rqt_plansys2_performers/PerformersTree.cpp:
--------------------------------------------------------------------------------
1 | // Copyright 2022 Intelligent Robotics Lab
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 |
16 | #include
17 | #include
18 |
19 | #include "rqt_plansys2_performers/PerformersTree.hpp"
20 |
21 | namespace rqt_plansys2_performers
22 | {
23 |
24 | PerformersTree::PerformersTree()
25 | : QTreeWidget()
26 | {
27 | }
28 |
29 | void
30 | PerformersTree::clearAllItems()
31 | {
32 | int rows = topLevelItemCount();
33 |
34 | while (topLevelItemCount() > 0) {
35 | rowsAboutToBeRemoved(rootIndex(), 0, 0);
36 | delete takeTopLevelItem(0);
37 | rowsRemoved(rootIndex(), 0, 0);/* code */
38 | }
39 | }
40 |
41 | } // namespace rqt_plansys2_performers
42 |
--------------------------------------------------------------------------------
/plansys2_bt_actions/src/bt_action_node.cpp:
--------------------------------------------------------------------------------
1 | // Copyright 2019 Intelligent Robotics Lab
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #include
16 | #include
17 |
18 | #include "plansys2_bt_actions/BTAction.hpp"
19 | #include "lifecycle_msgs/msg/transition.hpp"
20 | #include "rclcpp/rclcpp.hpp"
21 |
22 |
23 | using namespace std::chrono_literals;
24 |
25 | int main(int argc, char ** argv)
26 | {
27 | rclcpp::init(argc, argv);
28 |
29 | auto action_node = std::make_shared("default");
30 |
31 | action_node->trigger_transition(lifecycle_msgs::msg::Transition::TRANSITION_CONFIGURE);
32 |
33 | rclcpp::spin(action_node->get_node_base_interface());
34 |
35 | rclcpp::shutdown();
36 |
37 | return 0;
38 | }
39 |
--------------------------------------------------------------------------------
/plansys2_planner/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | plansys2_planner
5 | 3.0.0
6 |
7 | This package contains the PDDL-based Planner module for the ROS2 Planning System
8 |
9 | Francisco Martin Rico
10 |
11 | Apache License, Version 2.0
12 |
13 | ament_cmake
14 |
15 | rclcpp
16 | rclcpp_lifecycle
17 | ament_index_cpp
18 | plansys2_core
19 | plansys2_pddl_parser
20 | plansys2_msgs
21 | plansys2_domain_expert
22 | plansys2_problem_expert
23 | plansys2_popf_plan_solver
24 | pluginlib
25 | lifecycle_msgs
26 |
27 | ament_lint_common
28 | ament_lint_auto
29 | ament_cmake_gtest
30 | ros2run
31 |
32 |
33 | ament_cmake
34 |
35 |
36 |
--------------------------------------------------------------------------------
/plansys2_pddl_parser/src/plansys2_pddl_parser/ParamCond.cpp:
--------------------------------------------------------------------------------
1 | // Copyright 2024 Intelligent Robotics Lab
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 | #include "plansys2_pddl_parser/Domain.hpp"
15 |
16 | namespace parser
17 | {
18 | namespace pddl
19 | {
20 |
21 | void ParamCond::printParams(
22 | unsigned first, std::ostream & s, TokenStruct & ts, const Domain & d) const
23 | {
24 | s << "(";
25 | for (unsigned i = first; i < params.size(); ++i) {
26 | std::stringstream ss;
27 | ss << "?" << d.types[params[i]]->getName() << ts.size();
28 | ts.insert(ss.str());
29 | s << " " << ss.str();
30 | if (d.typed) {s << " - " << d.types[params[i]]->name;}
31 | }
32 | s << " )\n";
33 | }
34 |
35 | } // namespace pddl
36 | } // namespace parser
37 |
--------------------------------------------------------------------------------
/plansys2_support_py/test/test_flake8.py:
--------------------------------------------------------------------------------
1 | # Copyright 2017 Open Source Robotics Foundation, Inc.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the 'License');
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an 'AS IS' BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | import os
16 | import subprocess
17 | import sys
18 |
19 | import pytest
20 |
21 |
22 | @pytest.mark.flake8
23 | @pytest.mark.linter
24 | def test_flake8():
25 | env = os.environ.copy()
26 | env['FLAKE8_JOBS'] = '1'
27 |
28 | # Runs ament_flake8 in a fresh interpreter process.
29 | result = subprocess.run(
30 | [sys.executable, '-m', 'ament_flake8.main'],
31 | env=env,
32 | capture_output=True,
33 | text=True,
34 | )
35 | assert result.returncode == 0, (
36 | 'ament_flake8 failed.\n'
37 | f'STDOUT:\n{result.stdout}\n'
38 | f'STDERR:\n{result.stderr}\n'
39 | )
40 |
--------------------------------------------------------------------------------
/plansys2/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | plansys2
5 | 3.0.0
6 |
7 | ROS2 Planning System
8 |
9 | Francisco Martin Rico
10 |
11 | Apache License, Version 2.0
12 |
13 | ament_cmake
14 |
15 | plansys2_bringup
16 | plansys2_bt_actions
17 | plansys2_core
18 | plansys2_domain_expert
19 | plansys2_executor
20 | plansys2_lifecycle_manager
21 | plansys2_msgs
22 | plansys2_pddl_parser
23 | plansys2_planner
24 | plansys2_popf_plan_solver
25 | plansys2_problem_expert
26 | plansys2_support_py
27 | plansys2_terminal
28 | plansys2_tools
29 |
30 |
31 | ament_cmake
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/plansys2_executor/src/compute_bt.cpp:
--------------------------------------------------------------------------------
1 | // Copyright 2019 Intelligent Robotics Lab
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #include
16 |
17 | #include "plansys2_executor/ComputeBT.hpp"
18 | #include "rclcpp/rclcpp.hpp"
19 |
20 | int main(int argc, char ** argv)
21 | {
22 | rclcpp::init(argc, argv);
23 | auto node = std::make_shared();
24 |
25 | node->trigger_transition(lifecycle_msgs::msg::Transition::TRANSITION_CONFIGURE);
26 | std::this_thread::sleep_for(std::chrono::milliseconds(500));
27 | node->trigger_transition(lifecycle_msgs::msg::Transition::TRANSITION_ACTIVATE);
28 | std::this_thread::sleep_for(std::chrono::milliseconds(500));
29 |
30 | rclcpp::spin(node->get_node_base_interface());
31 |
32 | rclcpp::shutdown();
33 |
34 | return 0;
35 | }
36 |
--------------------------------------------------------------------------------
/plansys2_tools/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | plansys2_tools
5 | 3.0.0
6 |
7 | A set of tools for monitoring ROS2 Planning System
8 |
9 | Francisco Martin Rico
10 |
11 | Apache License, Version 2.0
12 |
13 | ament_cmake
14 |
15 | qtbase5-dev
16 |
17 | rclcpp
18 | rclcpp_lifecycle
19 | plansys2_msgs
20 | rqt_gui
21 | rqt_gui_cpp
22 | qt_gui_cpp
23 | plansys2_problem_expert
24 |
25 | libqt5-widgets
26 |
27 | ament_lint_common
28 | ament_lint_auto
29 | ament_cmake_gtest
30 | ament_index_cpp
31 |
32 |
33 | ament_cmake
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/plansys2_pddl_parser/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | plansys2_pddl_parser
5 | 3.0.0
6 |
7 | This package contains a library for parsing PDDL domains and problems.
8 |
9 | This package derives from the work of Anders Jonsson, contained in https://github.com/wisdompoet/universal-pddl-parser.git
10 | with many modifications by Francisco Martin:
11 | * ROS2 packaging
12 | * Source code structure refactor
13 | * CMakeLists.txt for cmake compilation
14 | * Reading from String instead of files
15 | * Licensing
16 |
17 |
18 | Francisco Martin Rico
19 |
20 | Apache License, Version 2.0
21 |
22 | Anders Jonsson
23 | Francisco Martin
24 |
25 | ament_cmake
26 |
27 | plansys2_msgs
28 |
29 | ament_lint_common
30 | ament_lint_auto
31 | ament_cmake_gtest
32 | ament_index_cpp
33 | rclcpp
34 |
35 |
36 | ament_cmake
37 |
38 |
39 |
--------------------------------------------------------------------------------
/plansys2_bt_actions/test/behavior_tree/OpenGripper.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2019 Intelligent Robotics Lab
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef BEHAVIOR_TREE__OPENGRIPPER_HPP_
16 | #define BEHAVIOR_TREE__OPENGRIPPER_HPP_
17 |
18 | #include
19 |
20 | #include "behaviortree_cpp/behavior_tree.h"
21 | #include "behaviortree_cpp/bt_factory.h"
22 |
23 | namespace plansys2_bt_tests
24 | {
25 |
26 | class OpenGripper : public BT::ActionNodeBase
27 | {
28 | public:
29 | explicit OpenGripper(
30 | const std::string & xml_tag_name,
31 | const BT::NodeConfig & conf);
32 |
33 | void halt();
34 | BT::NodeStatus tick();
35 |
36 | static BT::PortsList providedPorts()
37 | {
38 | return BT::PortsList({});
39 | }
40 |
41 | private:
42 | int counter_;
43 | };
44 |
45 | } // namespace plansys2_bt_tests
46 |
47 | #endif // BEHAVIOR_TREE__OPENGRIPPER_HPP_
48 |
--------------------------------------------------------------------------------
/plansys2_executor/test/pddl/elevator_problem.pddl:
--------------------------------------------------------------------------------
1 | (define (problem elevators-problem)
2 | (:domain temporal-elevators)
3 |
4 | ;; Instantiate the objects.
5 | (:objects
6 | n1 n2 n3 n4 n5 - num
7 | p1 p2 p3 - passenger
8 | e1 e2 - elevator
9 | )
10 |
11 | (:init
12 | ; Same fluents as the classical planning example
13 | (next n1 n2)
14 | (next n2 n3)
15 | (next n3 n4)
16 | (next n4 n5)
17 |
18 | (lift_at e1 n1)
19 | (lift_at e2 n5)
20 |
21 | (passenger_at p1 n2)
22 | (passenger_at p2 n2)
23 | (passenger_at p3 n4)
24 |
25 | ; Define how fast each of the passengers move (in seconds)
26 | (= (person_speed p1) 2)
27 | (= (person_speed p2) 3)
28 | (= (person_speed p3) 2)
29 |
30 | ; Define the speed of the elevators (in meters / second)
31 | (= (elevator_speed e1) 2)
32 | (= (elevator_speed e2) 3)
33 |
34 | ; Define the distance between the floors (in meters)
35 | (= (floor_distance n1 n2) 3)
36 | (= (floor_distance n2 n3) 4)
37 | (= (floor_distance n3 n4) 4)
38 | (= (floor_distance n4 n5) 3)
39 | (= (floor_distance n5 n4) 3)
40 | (= (floor_distance n4 n3) 4)
41 | (= (floor_distance n3 n2) 4)
42 | (= (floor_distance n2 n1) 3)
43 | )
44 |
45 | (:goal (and
46 | (passenger_at p1 n1)
47 | (passenger_at p2 n1)
48 | (passenger_at p3 n1)
49 | ))
50 |
51 | (:metric
52 | minimize (total-time)
53 | )
54 | )
55 |
--------------------------------------------------------------------------------
/plansys2_bt_actions/test/behavior_tree/CloseGripper.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2019 Intelligent Robotics Lab
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef BEHAVIOR_TREE__CLOSEGRIPPER_HPP_
16 | #define BEHAVIOR_TREE__CLOSEGRIPPER_HPP_
17 |
18 | #include
19 |
20 | #include "behaviortree_cpp/behavior_tree.h"
21 | #include "behaviortree_cpp/bt_factory.h"
22 |
23 | namespace plansys2_bt_tests
24 | {
25 |
26 | class CloseGripper : public BT::ActionNodeBase
27 | {
28 | public:
29 | explicit CloseGripper(
30 | const std::string & xml_tag_name,
31 | const BT::NodeConfig & conf);
32 |
33 | void halt();
34 | BT::NodeStatus tick();
35 |
36 | static BT::PortsList providedPorts()
37 | {
38 | return BT::PortsList({});
39 | }
40 |
41 | private:
42 | int counter_;
43 | };
44 |
45 | } // namespace plansys2_bt_tests
46 |
47 | #endif // BEHAVIOR_TREE__CLOSEGRIPPER_HPP_
48 |
--------------------------------------------------------------------------------
/plansys2_pddl_parser/include/plansys2_pddl_parser/EitherType.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2024 Intelligent Robotics Lab
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 | #pragma once
15 |
16 | #include
17 |
18 | #include "plansys2_pddl_parser/Type.hpp"
19 |
20 | namespace parser
21 | {
22 | namespace pddl
23 | {
24 |
25 | class EitherType : public Type
26 | {
27 | public:
28 | explicit EitherType(const std::string & s)
29 | : Type(s) {}
30 |
31 | explicit EitherType(const EitherType * t)
32 | : Type(t) {}
33 |
34 | std::string getName() const
35 | {
36 | std::string out = "either";
37 | for (unsigned i = 0; i < subtypes.size(); ++i) {out += "_" + subtypes[i]->getName();}
38 | return out;
39 | }
40 |
41 | void PDDLPrint(std::ostream & s) const override {}
42 |
43 | Type * copy() {return new EitherType(this);}
44 | };
45 |
46 | } // namespace pddl
47 | } // namespace parser
48 |
--------------------------------------------------------------------------------
/plansys2_tests/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.5)
2 |
3 | project(plansys2_tests)
4 |
5 | set(CMAKE_CXX_STANDARD 23)
6 | set(CMAKE_CXX_STANDARD_REQUIRED ON)
7 | set(CMAKE_CXX_EXTENSIONS OFF)
8 |
9 | find_package(ament_cmake REQUIRED)
10 | find_package(plansys2_executor REQUIRED)
11 | find_package(plansys2_msgs REQUIRED)
12 | find_package(rclcpp REQUIRED)
13 |
14 | set(${PROJECT_NAME}_SOURCES
15 | src/plansys2_tests/test_action_node.cpp
16 | src/plansys2_tests/execution_logger.cpp
17 | )
18 |
19 | add_library(${PROJECT_NAME} SHARED ${${PROJECT_NAME}_SOURCES})
20 | target_include_directories(${PROJECT_NAME} PUBLIC
21 | "$"
22 | "$"
23 | )
24 | target_link_libraries(${PROJECT_NAME}
25 | PUBLIC
26 | ${plansys2_msgs_TARGETS}
27 | plansys2_executor::plansys2_executor
28 | rclcpp::rclcpp
29 | )
30 |
31 | if(BUILD_TESTING)
32 | find_package(ament_lint_auto REQUIRED)
33 | ament_lint_auto_find_test_dependencies()
34 |
35 | find_package(ament_cmake_gtest REQUIRED)
36 | find_package(ament_index_cpp REQUIRED)
37 | find_package(plansys2_domain_expert REQUIRED)
38 | find_package(plansys2_problem_expert REQUIRED)
39 | find_package(plansys2_planner REQUIRED)
40 | find_package(plansys2_pddl_parser REQUIRED)
41 |
42 | add_subdirectory(test_1)
43 | add_subdirectory(test_2)
44 | add_subdirectory(test_3)
45 | add_subdirectory(test_4)
46 | endif()
47 |
48 | ament_package()
49 |
--------------------------------------------------------------------------------
/plansys2_tests/src/plansys2_tests/test_action_node.cpp:
--------------------------------------------------------------------------------
1 | // Copyright 2019 Intelligent Robotics Lab
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #include
16 |
17 | #include "plansys2_tests/test_action_node.hpp"
18 |
19 | #include "plansys2_executor/ActionExecutorClient.hpp"
20 |
21 | #include "rclcpp/rclcpp.hpp"
22 |
23 |
24 | namespace plansys2_tests
25 | {
26 |
27 | int TestAction::node_name_counter_ = 0;
28 |
29 | TestAction::TestAction(const std::string & action_name, float increment)
30 | : plansys2::ActionExecutorClient(action_name + std::to_string(node_name_counter_++)),
31 | increment_(increment)
32 | {
33 | progress_ = 0.0;
34 | }
35 |
36 | void
37 | TestAction::do_work()
38 | {
39 | if (progress_ < 1.0) {
40 | progress_ += increment_;
41 | send_feedback(progress_, "Action running");
42 | } else {
43 | finish(true, 1.0, "Action completed");
44 | progress_ = 0.0;
45 | }
46 | }
47 |
48 | } // namespace plansys2_tests
49 |
--------------------------------------------------------------------------------
/plansys2_bt_actions/test/behavior_tree/FailureNodes.cpp:
--------------------------------------------------------------------------------
1 | // Copyright 2022 Intelligent Robotics Lab
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #include
16 | #include
17 |
18 | #include "behaviortree_cpp/bt_factory.h"
19 |
20 | #include "FailureNodes.hpp"
21 |
22 | BT_REGISTER_NODES(factory)
23 | {
24 | BT::NodeBuilder builder =
25 | [](const std::string & name, const BT::NodeConfig & config)
26 | {
27 | return std::make_unique(
28 | name, "move", config);
29 | };
30 |
31 | factory.registerBuilder(
32 | "OnTickFail", builder);
33 |
34 | builder =
35 | [](const std::string & name, const BT::NodeConfig & config)
36 | {
37 | return std::make_unique(
38 | name, "move", config);
39 | };
40 |
41 | factory.registerBuilder(
42 | "OnFeedbackFail", builder);
43 | }
44 |
--------------------------------------------------------------------------------
/plansys2_domain_expert/test/pddl/domain_simple_ext.pddl:
--------------------------------------------------------------------------------
1 | (define (domain plansys2)
2 | (:requirements :strips :typing :adl :fluents :durative-actions)
3 |
4 | ;; Types ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5 | (:types
6 | robot
7 | pickable_object
8 | room
9 | );; end Types ;;;;;;;;;;;;;;;;;;;;;;;;;
10 |
11 | ;; Predicates ;;;;;;;;;;;;;;;;;;;;;;;;;
12 | (:predicates
13 |
14 | (robot_at ?r - robot ?ro - room)
15 | (object_at_robot ?o - pickable_object ?r - robot)
16 | (object_at_room ?o - pickable_object ?ro - room)
17 |
18 | );; end Predicates ;;;;;;;;;;;;;;;;;;;;
19 | ;; Functions ;;;;;;;;;;;;;;;;;;;;;;;;;
20 | (:functions
21 |
22 | );; end Functions ;;;;;;;;;;;;;;;;;;;;
23 | ;; Actions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
24 | (:durative-action pick_object
25 | :parameters (?r - robot ?ro - room ?o - pickable_object)
26 | :duration ( = ?duration 5)
27 | :condition (and
28 | (at start(object_at_room ?o ?ro))
29 | (at start(robot_at ?r ?ro))
30 | )
31 | :effect (and
32 | (at start(not(object_at_room ?o ?ro)))
33 | (at end(object_at_robot ?o ?r))
34 | )
35 | )
36 |
37 | (:durative-action place_object
38 | :parameters (?r - robot ?ro - room ?o - pickable_object)
39 | :duration ( = ?duration 5)
40 | :condition (and
41 | (at start(object_at_robot ?o ?r))
42 | (at start(robot_at ?r ?ro))
43 | )
44 | :effect (and
45 | (at start(not(object_at_robot ?o ?r)))
46 | (at end(object_at_room ?o ?ro))
47 | )
48 | )
49 | );; end Domain ;;;;;;;;;;;;;;;;;;;;;;;;
50 |
--------------------------------------------------------------------------------
/plansys2_tests/test_4/README.md:
--------------------------------------------------------------------------------
1 | # Test 4
2 |
3 | Short lineal plan with 1 action.
4 |
5 | ## PlanSys2
6 |
7 | - [x] Regular PlanSys2 actions
8 | - [ ] Regular PlanSys2 actions with ROS2 action client
9 | - [ ] PlanSys2 BT actions
10 | - [ ] PlanSys2 BT actions with ROS2 action client
11 |
12 | ## PDDL
13 |
14 | - [ ] Types
15 | - [x] Predicates
16 | - [ ] Durative actions
17 | - [x] at start req
18 | - [ ] over all req
19 | - [ ] at end req
20 | - [ ] at start effect
21 | - [x] at end effect
22 |
23 | ### Domain
24 |
25 | ```
26 | (define (domain simple-door)
27 | (:requirements :strips :typing :adl :fluents :durative-actions :existential-preconditions)
28 |
29 | (:predicates
30 | (door_open)
31 | (not_door_open)
32 | )
33 |
34 | (:durative-action open-door
35 | :parameters ()
36 | :duration ( = ?duration 1)
37 | :condition (and
38 | (at start (not_door_open))
39 | )
40 | :effect (and
41 | (at end (door_open))
42 | )
43 | )
44 |
45 | (:durative-action close-door
46 | :parameters ()
47 | :duration ( = ?duration 1)
48 | :condition (and
49 | (at start (door_open))
50 | )
51 | :effect (and
52 | (at end (not_door_open))
53 | )
54 | )
55 | )
56 |
57 | ```
58 |
59 | ### Problem
60 |
61 | ```
62 | (define (problem open-the-door)
63 | (:domain simple-door)
64 | (:init
65 | (not_door_open)
66 | )
67 | (:goal
68 | (and (door_open))
69 | )
70 | )
71 | ```
72 |
73 | ### Plan
74 |
75 | ```
76 | 0.000: (open-door) [1.000]
77 | ```
78 |
79 |
--------------------------------------------------------------------------------
/plansys2_bringup/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.5)
2 |
3 | project(plansys2_bringup)
4 |
5 | set(CMAKE_CXX_STANDARD 23)
6 | set(CMAKE_CXX_STANDARD_REQUIRED ON)
7 | set(CMAKE_CXX_EXTENSIONS OFF)
8 |
9 | find_package(ament_cmake REQUIRED)
10 | find_package(rclcpp REQUIRED)
11 | find_package(plansys2_domain_expert REQUIRED)
12 | find_package(plansys2_problem_expert REQUIRED)
13 | find_package(plansys2_planner REQUIRED)
14 | find_package(plansys2_executor REQUIRED)
15 | find_package(plansys2_lifecycle_manager REQUIRED)
16 |
17 | add_executable(plansys2_node
18 | src/plansys2_node.cpp
19 | )
20 | target_link_libraries(plansys2_node
21 | PRIVATE
22 | rclcpp::rclcpp
23 | plansys2_domain_expert::plansys2_domain_expert
24 | plansys2_problem_expert::plansys2_problem_expert
25 | plansys2_planner::plansys2_planner
26 | plansys2_executor::plansys2_executor
27 | plansys2_lifecycle_manager::plansys2_lifecycle_manager
28 | )
29 | target_compile_definitions(plansys2_node PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS")
30 |
31 | if(BUILD_TESTING)
32 | find_package(ament_lint_auto REQUIRED)
33 | ament_lint_auto_find_test_dependencies()
34 | endif()
35 |
36 | install(DIRECTORY launch params
37 | DESTINATION share/${PROJECT_NAME}
38 | )
39 | install(TARGETS plansys2_node
40 | RUNTIME DESTINATION lib/${PROJECT_NAME}
41 | )
42 |
43 | ament_export_dependencies(
44 | rclcpp
45 | plansys2_domain_expert
46 | plansys2_problem_expert
47 | plansys2_planner
48 | plansys2_executor
49 | plansys2_lifecycle_manager)
50 | ament_package()
51 |
--------------------------------------------------------------------------------
/plansys2_pddl_parser/src/parser.cpp:
--------------------------------------------------------------------------------
1 | // Copyright 2024 Intelligent Robotics Lab
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 | #include
15 | #include
16 | #include
17 | #include
18 |
19 | #include "plansys2_pddl_parser/Instance.hpp"
20 |
21 | int main(int argc, char * argv[])
22 | {
23 | if (argc < 3) {
24 | std::cout << "Usage: parser \n";
25 | exit(1);
26 | }
27 | std::ifstream domain_ifs(argv[1]);
28 | std::string domain_str(
29 | (std::istreambuf_iterator(domain_ifs)), std::istreambuf_iterator());
30 |
31 | std::ifstream instance_ifs(argv[2]);
32 | std::string instance_str(
33 | (std::istreambuf_iterator(instance_ifs)), std::istreambuf_iterator());
34 |
35 | // Read multiagent domain and instance
36 | parser::pddl::Domain domain(domain_str);
37 |
38 | std::cout << domain << std::endl;
39 |
40 | parser::pddl::Instance instance(domain, instance_str);
41 |
42 | std::cout << instance << std::endl;
43 | }
44 |
--------------------------------------------------------------------------------
/plansys2_pddl_parser/LICENSE:
--------------------------------------------------------------------------------
1 | BSD 3-Clause License
2 |
3 | Copyright (c) 2019, Intelligent Robotics Labs
4 | All rights reserved.
5 |
6 | Redistribution and use in source and binary forms, with or without
7 | modification, are permitted provided that the following conditions are met:
8 |
9 | 1. Redistributions of source code must retain the above copyright notice, this
10 | list of conditions and the following disclaimer.
11 |
12 | 2. Redistributions in binary form must reproduce the above copyright notice,
13 | this list of conditions and the following disclaimer in the documentation
14 | and/or other materials provided with the distribution.
15 |
16 | 3. Neither the name of the copyright holder nor the names of its
17 | contributors may be used to endorse or promote products derived from
18 | this software without specific prior written permission.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 |
--------------------------------------------------------------------------------
/plansys2_pddl_parser/include/plansys2_pddl_parser/CondIter.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2024 Intelligent Robotics Lab
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 | #pragma once
15 |
16 | #include
17 | #include
18 |
19 | #include "plansys2_pddl_parser/Condition.hpp"
20 |
21 | namespace parser
22 | {
23 | namespace pddl
24 | {
25 |
26 | typedef std::list> CondList;
27 |
28 | class CondIter : public std::iterator
29 | {
30 | public:
31 | CondList condStack;
32 |
33 | explicit CondIter(Condition * c)
34 | {
35 | condStack.push_back(std::make_pair(c, 0));
36 | (*this)++;
37 | }
38 |
39 | explicit CondIter(const CondIter & ci)
40 | : condStack(ci.condStack) {}
41 |
42 | MyIterator & operator++()
43 | {
44 | while (condStack().size() && condStack.last().done()) {condStack.pop_back();}
45 |
46 | return *this;
47 | }
48 |
49 | bool hasNext() {return condStack.size();}
50 |
51 | Condition * operator*() {return condStack.last();}
52 | };
53 |
54 | } // namespace pddl
55 | } // namespace parser
56 |
--------------------------------------------------------------------------------
/plansys2_bt_actions/test/unit/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_library(plansys2_close_gripper_bt_node SHARED
2 | ../behavior_tree/CloseGripper.cpp
3 | )
4 | list(APPEND plugin_libs plansys2_close_gripper_bt_node)
5 |
6 | add_library(plansys2_open_gripper_bt_node SHARED
7 | ../behavior_tree/OpenGripper.cpp
8 | )
9 | list(APPEND plugin_libs plansys2_open_gripper_bt_node)
10 |
11 | add_library(plansys2_move_bt_test_node SHARED ../behavior_tree/Move.cpp)
12 | list(APPEND plugin_libs plansys2_move_bt_test_node)
13 |
14 | add_library(plansys2_failure_test_nodes SHARED
15 | ../behavior_tree/FailureNodes.cpp
16 | )
17 | list(APPEND plugin_libs plansys2_failure_test_nodes)
18 |
19 | foreach(bt_plugin ${plugin_libs})
20 | target_include_directories(${bt_plugin}
21 | PRIVATE
22 | "$")
23 | target_link_libraries(${bt_plugin}
24 | behaviortree_cpp::behaviortree_cpp
25 | ${geometry_msgs_TARGETS}
26 | tf2_geometry_msgs::tf2_geometry_msgs
27 | rclcpp::rclcpp
28 | rclcpp_action::rclcpp_action
29 | rclcpp_lifecycle::rclcpp_lifecycle
30 | ${test_msgs_TARGETS}
31 | )
32 | target_compile_definitions(${bt_plugin} PRIVATE BT_PLUGIN_EXPORT)
33 | endforeach()
34 |
35 | ament_add_gtest(bt_action_test bt_action_test.cpp)
36 | target_link_libraries(bt_action_test
37 | ${PROJECT_NAME}
38 | ${geometry_msgs_TARGETS}
39 | ${lifecycle_msgs_TARGETS}
40 | ${test_msgs_TARGETS}
41 | )
42 |
43 | install(DIRECTORY ../behavior_tree
44 | DESTINATION share/${PROJECT_NAME}/test
45 | )
46 |
47 | install(TARGETS ${plugin_libs}
48 | ARCHIVE DESTINATION lib
49 | LIBRARY DESTINATION lib
50 | RUNTIME DESTINATION bin
51 | )
52 |
--------------------------------------------------------------------------------
/plansys2_executor/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | plansys2_executor
5 | 3.0.0
6 |
7 | This package contains the Executor module for the ROS2 Planning System
8 |
9 | Francisco Martin Rico
10 |
11 | Apache License, Version 2.0
12 |
13 | ament_cmake
14 | eigen3_cmake_module
15 |
16 | eigen
17 |
18 | rclcpp
19 | rclcpp_action
20 | rclcpp_lifecycle
21 | lifecycle_msgs
22 | rclcpp_cascade_lifecycle
23 | ament_index_cpp
24 | plansys2_core
25 | plansys2_pddl_parser
26 | plansys2_msgs
27 | plansys2_domain_expert
28 | plansys2_problem_expert
29 | plansys2_planner
30 | pluginlib
31 | behaviortree_cpp
32 | std_msgs
33 | std_srvs
34 |
35 | popf
36 |
37 | ament_lint_common
38 | ament_lint_auto
39 | ament_cmake_gtest
40 |
41 |
42 | ament_cmake
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/plansys2_bt_actions/test/behavior_tree/OpenGripper.cpp:
--------------------------------------------------------------------------------
1 | // Copyright 2019 Intelligent Robotics Lab
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #include
16 | #include
17 |
18 | #include "OpenGripper.hpp"
19 |
20 | #include "behaviortree_cpp/behavior_tree.h"
21 |
22 | namespace plansys2_bt_tests
23 | {
24 |
25 | OpenGripper::OpenGripper(
26 | const std::string & xml_tag_name,
27 | const BT::NodeConfig & conf)
28 | : BT::ActionNodeBase(xml_tag_name, conf), counter_(0)
29 | {
30 | }
31 |
32 | void
33 | OpenGripper::halt()
34 | {
35 | std::cout << "OpenGripper halt" << std::endl;
36 | }
37 |
38 | BT::NodeStatus
39 | OpenGripper::tick()
40 | {
41 | std::cout << "OpenGripper tick " << counter_ << std::endl;
42 |
43 | if (counter_++ < 5) {
44 | return BT::NodeStatus::RUNNING;
45 | } else {
46 | counter_ = 0;
47 | return BT::NodeStatus::SUCCESS;
48 | }
49 | }
50 |
51 | } // namespace plansys2_bt_tests
52 |
53 | #include "behaviortree_cpp/bt_factory.h"
54 | BT_REGISTER_NODES(factory)
55 | {
56 | factory.registerNodeType("OpenGripper");
57 | }
58 |
--------------------------------------------------------------------------------
/plansys2_bt_actions/test/behavior_tree/CloseGripper.cpp:
--------------------------------------------------------------------------------
1 | // Copyright 2019 Intelligent Robotics Lab
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #include
16 | #include
17 |
18 | #include "CloseGripper.hpp"
19 |
20 | #include "behaviortree_cpp/behavior_tree.h"
21 |
22 | namespace plansys2_bt_tests
23 | {
24 |
25 | CloseGripper::CloseGripper(
26 | const std::string & xml_tag_name,
27 | const BT::NodeConfig & conf)
28 | : BT::ActionNodeBase(xml_tag_name, conf), counter_(0)
29 | {
30 | }
31 |
32 | void
33 | CloseGripper::halt()
34 | {
35 | std::cout << "CloseGripper halt" << std::endl;
36 | }
37 |
38 | BT::NodeStatus
39 | CloseGripper::tick()
40 | {
41 | std::cout << "CloseGripper tick " << counter_ << std::endl;
42 |
43 | if (counter_++ < 5) {
44 | return BT::NodeStatus::RUNNING;
45 | } else {
46 | counter_ = 0;
47 | return BT::NodeStatus::SUCCESS;
48 | }
49 | }
50 |
51 | } // namespace plansys2_bt_tests
52 |
53 | #include "behaviortree_cpp/bt_factory.h"
54 | BT_REGISTER_NODES(factory)
55 | {
56 | factory.registerNodeType("CloseGripper");
57 | }
58 |
--------------------------------------------------------------------------------
/plansys2_planner/launch/planner_launch.py:
--------------------------------------------------------------------------------
1 | # Copyright 2019 Intelligent Robotics Lab
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | from launch import LaunchDescription
16 | from launch.actions import DeclareLaunchArgument
17 | from launch.substitutions import LaunchConfiguration
18 | from launch_ros.actions import Node
19 |
20 |
21 | def generate_launch_description():
22 | namespace = LaunchConfiguration('namespace')
23 | params_file = LaunchConfiguration('params_file')
24 |
25 | declare_namespace_cmd = DeclareLaunchArgument(
26 | 'namespace',
27 | default_value='',
28 | description='Namespace')
29 |
30 | # Specify the actions
31 | planner_cmd = Node(
32 | package='plansys2_planner',
33 | executable='planner_node',
34 | name='planner',
35 | namespace=namespace,
36 | output='screen',
37 | parameters=[params_file])
38 |
39 | # Create the launch description and populate
40 | ld = LaunchDescription()
41 |
42 | ld.add_action(declare_namespace_cmd)
43 |
44 | # Declare the launch options
45 | ld.add_action(planner_cmd)
46 |
47 | return ld
48 |
--------------------------------------------------------------------------------
/plansys2_planner/test/pddl/domain_simple.pddl:
--------------------------------------------------------------------------------
1 | (define (domain simple)
2 | (:requirements :strips :typing :adl :fluents :durative-actions)
3 |
4 | ;; Types ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5 | (:types
6 | person
7 | message
8 | robot
9 | room
10 | );; end Types ;;;;;;;;;;;;;;;;;;;;;;;;;
11 |
12 | ;; Predicates ;;;;;;;;;;;;;;;;;;;;;;;;;
13 | (:predicates
14 |
15 | (robot_talk ?r - robot ?m - message ?p - person)
16 | (robot_near_person ?r - robot ?p - person)
17 | (robot_at ?r - robot ?ro - room)
18 | (person_at ?p - person ?ro - room)
19 |
20 | );; end Predicates ;;;;;;;;;;;;;;;;;;;;
21 | ;; Functions ;;;;;;;;;;;;;;;;;;;;;;;;;
22 | (:functions
23 |
24 | );; end Functions ;;;;;;;;;;;;;;;;;;;;
25 | ;; Actions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
26 | (:durative-action move
27 | :parameters (?r - robot ?r1 ?r2 - room)
28 | :duration ( = ?duration 5)
29 | :condition (and
30 | (at start(robot_at ?r ?r1)))
31 | :effect (and
32 | (at start(not(robot_at ?r ?r1)))
33 | (at end(robot_at ?r ?r2))
34 | )
35 | )
36 |
37 | (:durative-action talk
38 | :parameters (?r - robot ?p - person ?m - message)
39 | :duration ( = ?duration 5)
40 | :condition (and
41 | (over all(robot_near_person ?r ?p))
42 | )
43 | :effect (and
44 | (at end(robot_talk ?r ?m ?p))
45 | )
46 | )
47 |
48 | (:durative-action approach
49 | :parameters (?r - robot ?ro - room ?p - person)
50 | :duration ( = ?duration 5)
51 | :condition (and
52 | (over all(robot_at ?r ?ro))
53 | (over all(person_at ?p ?ro))
54 | )
55 | :effect (and
56 | (at end(robot_near_person ?r ?p))
57 | )
58 | )
59 |
60 |
61 |
62 | );; end Domain ;;;;;;;;;;;;;;;;;;;;;;;;
63 |
--------------------------------------------------------------------------------
/plansys2_executor/test/pddl/domain_simple.pddl:
--------------------------------------------------------------------------------
1 | (define (domain simple)
2 | (:requirements :strips :typing :adl :fluents :durative-actions)
3 |
4 | ;; Types ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5 | (:types
6 | person
7 | message
8 | robot
9 | room
10 | );; end Types ;;;;;;;;;;;;;;;;;;;;;;;;;
11 |
12 | ;; Predicates ;;;;;;;;;;;;;;;;;;;;;;;;;
13 | (:predicates
14 |
15 | (robot_talk ?r - robot ?m - message ?p - person)
16 | (robot_near_person ?r - robot ?p - person)
17 | (robot_at ?r - robot ?ro - room)
18 | (person_at ?p - person ?ro - room)
19 |
20 | );; end Predicates ;;;;;;;;;;;;;;;;;;;;
21 | ;; Functions ;;;;;;;;;;;;;;;;;;;;;;;;;
22 | (:functions
23 |
24 | );; end Functions ;;;;;;;;;;;;;;;;;;;;
25 | ;; Actions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
26 | (:durative-action move
27 | :parameters (?r - robot ?r1 ?r2 - room)
28 | :duration ( = ?duration 5)
29 | :condition (and
30 | (at start(robot_at ?r ?r1)))
31 | :effect (and
32 | (at start(not(robot_at ?r ?r1)))
33 | (at end(robot_at ?r ?r2))
34 | )
35 | )
36 |
37 | (:durative-action talk
38 | :parameters (?r - robot ?from ?p - person ?m - message)
39 | :duration ( = ?duration 5)
40 | :condition (and
41 | (over all(robot_near_person ?r ?p))
42 | )
43 | :effect (and
44 | (at end(robot_talk ?r ?m ?p))
45 | )
46 | )
47 |
48 | (:durative-action approach
49 | :parameters (?r - robot ?ro - room ?p - person)
50 | :duration ( = ?duration 5)
51 | :condition (and
52 | (over all(robot_at ?r ?ro))
53 | (over all(person_at ?p ?ro))
54 | )
55 | :effect (and
56 | (at end(robot_near_person ?r ?p))
57 | )
58 | )
59 |
60 |
61 |
62 | );; end Domain ;;;;;;;;;;;;;;;;;;;;;;;;
63 |
--------------------------------------------------------------------------------
/plansys2_popf_plan_solver/test/pddl/domain_simple.pddl:
--------------------------------------------------------------------------------
1 | (define (domain simple)
2 | (:requirements :strips :typing :adl :fluents :durative-actions)
3 |
4 | ;; Types ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5 | (:types
6 | person
7 | message
8 | robot
9 | room
10 | );; end Types ;;;;;;;;;;;;;;;;;;;;;;;;;
11 |
12 | ;; Predicates ;;;;;;;;;;;;;;;;;;;;;;;;;
13 | (:predicates
14 |
15 | (robot_talk ?r - robot ?m - message ?p - person)
16 | (robot_near_person ?r - robot ?p - person)
17 | (robot_at ?r - robot ?ro - room)
18 | (person_at ?p - person ?ro - room)
19 |
20 | );; end Predicates ;;;;;;;;;;;;;;;;;;;;
21 | ;; Functions ;;;;;;;;;;;;;;;;;;;;;;;;;
22 | (:functions
23 |
24 | );; end Functions ;;;;;;;;;;;;;;;;;;;;
25 | ;; Actions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
26 | (:durative-action move
27 | :parameters (?r - robot ?r1 ?r2 - room)
28 | :duration ( = ?duration 5)
29 | :condition (and
30 | (at start(robot_at ?r ?r1)))
31 | :effect (and
32 | (at start(not(robot_at ?r ?r1)))
33 | (at end(robot_at ?r ?r2))
34 | )
35 | )
36 |
37 | (:durative-action talk
38 | :parameters (?r - robot ?from ?p - person ?m - message)
39 | :duration ( = ?duration 5)
40 | :condition (and
41 | (over all(robot_near_person ?r ?p))
42 | )
43 | :effect (and
44 | (at end(robot_talk ?r ?m ?p))
45 | )
46 | )
47 |
48 | (:durative-action approach
49 | :parameters (?r - robot ?ro - room ?p - person)
50 | :duration ( = ?duration 5)
51 | :condition (and
52 | (over all(robot_at ?r ?ro))
53 | (over all(person_at ?p ?ro))
54 | )
55 | :effect (and
56 | (at end(robot_near_person ?r ?p))
57 | )
58 | )
59 |
60 |
61 |
62 | );; end Domain ;;;;;;;;;;;;;;;;;;;;;;;;
63 |
--------------------------------------------------------------------------------
/plansys2_executor/src/plansys2_executor/behavior_tree/wait_action_node.cpp:
--------------------------------------------------------------------------------
1 | // Copyright 2020 Intelligent Robotics Lab
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #include
16 | #include