### Launch Patrol Navigation Example Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_docs/tutorials/tut_2_patrol.md Launches the PlanSys2 and associated nodes for the patrol navigation example. This command sets up the navigation parameters and the robot's starting position. ```shell ros2 launch patrol_navigation_example patrol_example_launch.py ``` -------------------------------- ### Basic CMake Setup and Package Finding Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_tools/CMakeLists.txt Sets the minimum CMake version, project name, C++ standard, and finds essential ROS 2 and PLANSYS2 packages. Ensure these packages are installed and discoverable by CMake. ```cmake cmake_minimum_required(VERSION 3.5) project(plansys2_tools) set(CMAKE_CXX_STANDARD 23) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) find_package(ament_cmake REQUIRED) find_package(rclcpp REQUIRED) find_package(pluginlib REQUIRED) find_package(plansys2_msgs REQUIRED) find_package(qt_gui_cpp REQUIRED) find_package(rqt_gui_cpp REQUIRED) find_package(plansys2_problem_expert REQUIRED) find_package(Qt5 REQUIRED COMPONENTS Widgets) # Find includes in corresponding build directories set(CMAKE_INCLUDE_CURRENT_DIR ON) ``` -------------------------------- ### Installation Rules Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_bt_actions/CMakeLists.txt Specifies how to install the library headers, the main library, and the executable. ```cmake install(DIRECTORY include/ DESTINATION include/${PROJECT_NAME} ) install(TARGETS ${PROJECT_NAME} EXPORT export_${PROJECT_NAME} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib RUNTIME DESTINATION bin ) install(TARGETS bt_action_node RUNTIME DESTINATION lib/${PROJECT_NAME} ) ``` -------------------------------- ### Installation Rules Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_lifecycle_manager/CMakeLists.txt Installs the library, executable, and include files to their respective destinations. ```cmake install(DIRECTORY include/ DESTINATION include/${PROJECT_NAME} ) install(TARGETS ${PROJECT_NAME} EXPORT export_${PROJECT_NAME} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib RUNTIME DESTINATION bin ) install(TARGETS lifecycle_manager_node RUNTIME DESTINATION lib/${PROJECT_NAME} ) ``` -------------------------------- ### Installation Rules Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_bringup/CMakeLists.txt Installs launch files, parameters, and the executable to the appropriate share and lib directories. ```cmake install(DIRECTORY launch params DESTINATION share/${PROJECT_NAME} ) install(TARGETS plansys2_node RUNTIME DESTINATION lib/${PROJECT_NAME} ) ``` -------------------------------- ### Initialize Knowledge Base for Patrolling Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_docs/tutorials/tut_2_patrol.md Initializes the PlanSys2 knowledge base by adding robot and waypoint instances, and defining predicates for the robot's starting location and connections between waypoints. This setup is crucial for the patrolling behavior. ```cpp problem_expert_->addInstance(plansys2::Instance{"r2d2", "robot"}); problem_expert_->addInstance(plansys2::Instance{"wp_control", "waypoint"}); problem_expert_->addInstance(plansys2::Instance{"wp1", "waypoint"}); problem_expert_->addInstance(plansys2::Instance{"wp2", "waypoint"}); problem_expert_->addInstance(plansys2::Instance{"wp3", "waypoint"}); problem_expert_->addInstance(plansys2::Instance{"wp4", "waypoint"}); problem_expert_->addPredicate(plansys2::Predicate("(robot_at r2d2 wp_control)")); problem_expert_->addPredicate(plansys2::Predicate("(connected wp_control wp1)")); problem_expert_->addPredicate(plansys2::Predicate("(connected wp1 wp_control)")); problem_expert_->addPredicate(plansys2::Predicate("(connected wp_control wp2)")); problem_expert_->addPredicate(plansys2::Predicate("(connected wp2 wp_control)")); problem_expert_->addPredicate(plansys2::Predicate("(connected wp_control wp3)")); problem_expert_->addPredicate(plansys2::Predicate("(connected wp3 wp_control)")); problem_expert_->addPredicate(plansys2::Predicate("(connected wp_control wp4)")); problem_expert_->addPredicate(plansys2::Predicate("(connected wp4 wp_control)")); ``` -------------------------------- ### Launch Plansys2 Simple Example Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_docs/tutorials/tut_1_terminal.md Launches the Plansys2 simple example with the default namespace. This includes the main planning system, specific action nodes, and selects the domain. ```shell ros2 launch plansys2_simple_example plansys2_simple_example_launch.py ``` -------------------------------- ### Launch Plansys2 Simple Example with Namespace Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_docs/tutorials/tut_1_terminal.md Launches the Plansys2 simple example within a specified namespace. This is useful for isolating planning system instances. ```shell ros2 launch plansys2_simple_example plansys2_simple_example_launch.py namespace:=my_namespace ``` -------------------------------- ### Install Test Directories Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_executor/test/CMakeLists.txt Installs the PDDL, behavior trees, and test data directories to the share directory of the project. ```cmake install(DIRECTORY ${TEST_PDDL_DIR} ${TEST_BEHAVIOR_TREES_DIR} ${TEST_DATA_DIR} DESTINATION share/${PROJECT_NAME} ) ``` -------------------------------- ### Install PDDL directory Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_pddl_parser/test/CMakeLists.txt Installs the 'pddl' directory to the 'share/plansys2_pddl_parser' destination within the installed package structure. ```cmake install(DIRECTORY pddl DESTINATION share/${PROJECT_NAME} ) ``` -------------------------------- ### Install PDDL Files Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_tests/test_4/CMakeLists.txt Installs PDDL files to the share directory of the project. This is typically used for test data or configuration files. ```cmake install(DIRECTORY pddl DESTINATION share/${PROJECT_NAME}/test_4 ) ``` -------------------------------- ### Project Setup and Dependencies Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_bringup/CMakeLists.txt Configures the CMake version, project name, C++ standard, and finds necessary ROS 2 and plansys2 packages. ```cmake cmake_minimum_required(VERSION 3.5) project(plansys2_bringup) set(CMAKE_CXX_STANDARD 23) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) find_package(ament_cmake REQUIRED) find_package(rclcpp REQUIRED) find_package(plansys2_domain_expert REQUIRED) find_package(plansys2_problem_expert REQUIRED) find_package(plansys2_planner REQUIRED) find_package(plansys2_executor REQUIRED) find_package(plansys2_lifecycle_manager REQUIRED) ``` -------------------------------- ### Install Behavior Tree Test Directory Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_bt_actions/test/unit/CMakeLists.txt Installs the behavior tree test directory to the package's share directory. This makes test-related files accessible after installation. ```cmake install(DIRECTORY ../behavior_tree DESTINATION share/${PROJECT_NAME}/test ) ``` -------------------------------- ### Install PDDL test directory Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_core/test/CMakeLists.txt Installs the PDDL test directory to the share directory of the current project. ```cmake set(TEST_PDDL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/pddl) install( DIRECTORY ${TEST_PDDL_DIR} DESTINATION share/${PROJECT_NAME} ) ``` -------------------------------- ### Project Setup and Standards Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_lifecycle_manager/CMakeLists.txt Sets the minimum CMake version, project name, and C++ standard to C++23, enforcing standard compliance and disabling extensions. ```cmake cmake_minimum_required(VERSION 3.5) project(plansys2_lifecycle_manager) set(CMAKE_CXX_STANDARD 23) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) ``` -------------------------------- ### Install Behavior Tree Plugin Libraries Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_bt_actions/test/unit/CMakeLists.txt Installs the compiled behavior tree plugin libraries to the appropriate locations (lib, runtime). This makes the plugins available for use by the ROS 2 system. ```cmake install(TARGETS ${plugin_libs} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib RUNTIME DESTINATION bin ) ``` -------------------------------- ### Install PDDL Directory in CMake Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_domain_expert/test/CMakeLists.txt Installs the PDDL directory to the share destination of the project. This makes PDDL files available in the installed package. ```cmake install(DIRECTORY ${TEST_PDDL_DIR} DESTINATION share/${PROJECT_NAME} ) ``` -------------------------------- ### Library Definition and Includes Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_lifecycle_manager/CMakeLists.txt Defines the main library for the project and configures public include directories for build and installation. ```cmake add_library(${PROJECT_NAME} src/plansys2_lifecycle_manager/lifecycle_manager.cpp ) target_include_directories(${PROJECT_NAME} PUBLIC "$" "$" "$" ) ``` -------------------------------- ### Define CMake Minimum Version and Project Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2/CMakeLists.txt Sets the minimum required CMake version and defines the project name. This is a standard starting point for CMake projects. ```cmake cmake_minimum_required(VERSION 3.5) project(plansys2) ``` -------------------------------- ### Get Plansys2 Problem Instances Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_docs/tutorials/tut_1_terminal.md Displays the current instances (objects and their types) defined in the Plansys2 problem. ```plansys2_terminal > get problem instances ``` -------------------------------- ### Executor Action Timeouts Configuration Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_executor/README.md Configure allowable time overruns for actions during plan execution. This example sets a 20% overrun for the 'move' action. ```yaml executor: ros__parameters: action_timeouts: actions: ["move"] move: duration_overrun_percentage: 20.0 ``` -------------------------------- ### Configure ament_add_gtest for simple_btbuilder_tests Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_executor/test/unit/CMakeLists.txt Configures 'simple_btbuilder_tests' as a Google Test target. This setup includes a compile definition and links the test to the main project library and the 'bt_builder_plugins' library. ```cmake ament_add_gtest(simple_btbuilder_tests simple_btbuilder_tests.cpp) target_compile_definitions(simple_btbuilder_tests PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS") target_link_libraries(simple_btbuilder_tests ${PROJECT_NAME} bt_builder_plugins ) ``` -------------------------------- ### Preserving Default Ports in BtActionNode Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_bt_actions/README.md This example shows how to override the providedPorts() function while preserving the default input ports using providedBasicPorts(). It also adds a custom input port named 'my_additional_port'. ```cpp static BT::PortsList providedPorts() override { return providedBasicPorts({ BT::InputPort("my_additional_port") }); } ``` -------------------------------- ### PDDL Expression Example Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_msgs/README.md An example of a PDDL expression that can be represented as a tree structure. ```plaintext (and (robot_at r2d2 millennium_falcon)(not (robot_at r2d2 death_star))) ``` -------------------------------- ### GetOrderedSubGoals Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_msgs/README.md Returns an ordered list of sub-goals based on their start times in the plan. ```APIDOC ## GetOrderedSubGoals ### Description Returns an ordered list of sub-goals where each sub-goal is represented as a `plansys2_msgs::msg::Tree`. The sub-goals are ordered according their start times as specified in the plan. ### Service `plansys2_msgs::srv::GetOrderedSubGoals` ``` -------------------------------- ### Get Plansys2 Plan Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_docs/tutorials/tut_1_terminal.md Calculates and displays a plan to achieve the currently set goal. This command only generates the plan, it does not execute it. ```plansys2_terminal > get plan ``` -------------------------------- ### Get Plansys2 Problem Predicates Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_docs/tutorials/tut_1_terminal.md Displays the current state of predicates (facts) defined in the Plansys2 problem. ```plansys2_terminal > get problem predicates ``` -------------------------------- ### Set Test Directories in CMake Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_domain_expert/test/CMakeLists.txt Defines CMake variables for the PDDL and test launch file directories relative to the current source directory. These are used for subsequent build and installation steps. ```cmake set(TEST_PDDL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/pddl) set(TEST_LAUNCH_DIR ${CMAKE_CURRENT_SOURCE_DIR}/test_launch_files) ``` -------------------------------- ### Execute PDDL Plan Solver in Isolation Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_docs/FAQ.md Run the popf plan solver independently to debug PDDL domain and problem files. Use this command to test your PDDL setup outside of the Plansys2 environment. ```shell ros2 run popf popf /tmp/${namespace}/domain.pddl /tmp/${namespace}/problem.pddl ``` -------------------------------- ### Sample Plan Output Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_tests/test_3/README.md This snippet displays a typical plan output from PlanSys2, showing a sequence of actions with timestamps and associated costs. It illustrates robot movements and transport operations for an assembly task. ```plaintext 0.000: (move robot1 assembly_zone body_car_zone) [2.000] 0.000: (move robot2 assembly_zone sterwheel_zone) [2.000] 0.000: (move robot3 assembly_zone wheels_zone) [2.000] 2.001: (transport robot1 body_car_1 body_car_zone assembly_zone) [3.000] 2.001: (transport robot2 sterwheel_1 sterwheel_zone assembly_zone) [3.000] 2.001: (transport robot3 wheel_1 wheels_zone assembly_zone) [3.000] 5.002: (assemble robot1 assembly_zone wheel_1 body_car_1 sterwheel_1 car1) [5.000] 5.002: (move robot2 assembly_zone body_car_zone) [2.000] 5.002: (move robot3 assembly_zone sterwheel_zone) [2.000] 7.003: (transport robot2 body_car_2 body_car_zone assembly_zone) [3.000] 7.003: (transport robot3 sterwheel_2 sterwheel_zone assembly_zone) [3.000] 10.003: (move robot1 assembly_zone wheels_zone) [2.000] 10.004: (move robot3 assembly_zone body_car_zone) [2.000] 12.004: (transport robot1 wheel_2 wheels_zone assembly_zone) [3.000] 12.005: (transport robot3 body_car_3 body_car_zone assembly_zone) [3.000] 15.005: (assemble robot2 assembly_zone wheel_2 body_car_2 sterwheel_2 car2) [5.000] 15.005: (move robot1 assembly_zone sterwheel_zone) [2.000] 15.006: (move robot3 assembly_zone wheels_zone) [2.000] 17.006: (transport robot1 sterwheel_3 sterwheel_zone assembly_zone) [3.000] 17.007: (transport robot3 wheel_3 wheels_zone assembly_zone) [3.000] 20.008: (assemble robot1 assembly_zone wheel_3 body_car_3 sterwheel_3 car3) [5.000] ``` -------------------------------- ### GetPlan Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_msgs/README.md Returns the generated plan, including times, actions, and durations. ```APIDOC ## GetPlan ### Description Returns a generated plan as a list of times, actions (represented as strings), and durations. ### Service `plansys2_msgs::srv::GetPlan` ``` -------------------------------- ### Basic CMake Configuration Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_bt_actions/CMakeLists.txt Sets the minimum CMake version, project name, and C++ standard. It also appends the cmake module path. ```cmake cmake_minimum_required(VERSION 3.5) project(plansys2_bt_actions) set(CMAKE_CXX_STANDARD 23) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) ``` -------------------------------- ### Generated Plan for Opening Door Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_tests/test_4/README.md Shows a sample plan generated for the 'open-the-door' problem. It indicates the 'open-door' action is executed from time 0.000 with a duration of 1.000. ```text 0.000: (open-door) [1.000] ``` -------------------------------- ### Testing Configuration Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_lifecycle_manager/CMakeLists.txt Configures build testing, finds necessary linting and testing dependencies, and adds a subdirectory for tests. ```cmake if(BUILD_TESTING) find_package(ament_lint_auto REQUIRED) ament_lint_auto_find_test_dependencies() find_package(ament_cmake_gtest REQUIRED) find_package(rclcpp_lifecycle REQUIRED) add_subdirectory(test) endif() ``` -------------------------------- ### Configure ament_add_gtest for sequential_bt_builder_test Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_executor/test/unit/CMakeLists.txt Sets up 'sequential_bt_builder_test' as a Google Test target. It defines a compile macro and links the test to the main project library and 'bt_builder_plugins'. ```cmake ament_add_gtest(sequential_bt_builder_test sequential_bt_builder_test.cpp) target_compile_definitions(sequential_bt_builder_test PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS") target_link_libraries(sequential_bt_builder_test ${PROJECT_NAME} bt_builder_plugins ) ``` -------------------------------- ### Get Plansys2 Domain Information Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_docs/tutorials/tut_1_terminal.md Retrieves and displays the PDDL domain definition currently loaded by the Plansys2 system. ```plansys2_terminal > get domain ``` -------------------------------- ### Set Plansys2 Problem Instances and Predicates Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_docs/tutorials/tut_1_terminal.md Adds instances (objects) and predicates (facts) to the current Plansys2 problem definition. This establishes the initial state for planning. ```plansys2_terminal > set instance leia robot > set instance entrance room > set instance kitchen room > set instance bedroom room > set instance dinning room > set instance bathroom room > set instance chargingroom room > set predicate (connected entrance dinning) > set predicate (connected dinning entrance) > set predicate (connected dinning kitchen) > set predicate (connected kitchen dinning) > set predicate (connected dinning bedroom) > set predicate (connected bedroom dinning) > set predicate (connected bathroom bedroom) > set predicate (connected bedroom bathroom) > set predicate (connected chargingroom kitchen) > set predicate (connected kitchen chargingroom) > set predicate (charging_point_at chargingroom) > set predicate (battery_low leia) > set predicate (robot_at leia entrance) ``` -------------------------------- ### ament_package() Configuration Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2/CMakeLists.txt Configures the package metadata and installation rules for the plansys2 package using ament_package. This is essential for ROS 2 package management. ```cmake ament_package() ``` -------------------------------- ### Configure ament_add_gtest for bt_node_test_charging Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_executor/test/unit/CMakeLists.txt Sets up 'bt_node_test_charging' as a Google Test target. It defines a compile macro and links the test to the main project library. ```cmake ament_add_gtest(bt_node_test_charging bt_node_test_charging.cpp) target_compile_definitions(bt_node_test_charging PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS") target_link_libraries(bt_node_test_charging ${PROJECT_NAME} ) ``` -------------------------------- ### Define RQT Knowledge Plugin Library Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_tools/CMakeLists.txt Builds the rqt_plansys2_knowledge shared library. This involves wrapping UI files and C++ headers, and linking against Qt5 Widgets, PLANSYS2, and RQT dependencies. ```cmake set(rqt_plansys2_knowledge_SRCS src/rqt_plansys2_knowledge/RQTKnowledge.cpp src/rqt_plansys2_knowledge/KnowledgeTree.cpp ) set(rqt_plansys2_knowledge_HDRS include/rqt_plansys2_knowledge/RQTKnowledge.hpp include/rqt_plansys2_knowledge/KnowledgeTree.hpp ) set(rqt_plansys2_knowledge_UIS src/rqt_plansys2_knowledge/rqt_plansys2_knowledge.ui ) qt5_wrap_cpp(rqt_plansys2_knowledge_MOCS ${rqt_plansys2_knowledge_HDRS}) qt5_wrap_ui(rqt_plansys2_knowledge_UIS_H ${rqt_plansys2_knowledge_UIS}) add_library(rqt_plansys2_knowledge SHARED ${rqt_plansys2_knowledge_SRCS} ${rqt_plansys2_knowledge_MOCS} ${rqt_plansys2_knowledge_UIS_H} ) target_include_directories(rqt_plansys2_knowledge PUBLIC ${Qt5Widgets_INCLUDE_DIRS} "$" "$" ) target_link_libraries(rqt_plansys2_knowledge PUBLIC plansys2_problem_expert::plansys2_problem_expert ${plansys2_msgs_TARGETS} rqt_gui_cpp::rqt_gui_cpp rclcpp::rclcpp Qt5::Widgets PRIVATE pluginlib::pluginlib ) ``` -------------------------------- ### Run Plansys2 Terminal with YAML Parameters Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_terminal/README.md Launches the Plansys2 Terminal node, specifying a YAML file for configuration parameters like planner timeouts. Ensure the correct package path is used. ```bash ros2 run plansys2_terminal plansys2_terminal --ros-args --params-file `ros2 pkg prefix --share plansys2_bringup`/params/plansys2_params.yaml ``` -------------------------------- ### Execution Plan for Test 2 Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_tests/test_2/README.md The sequence of actions executed to achieve the goal, including timestamps, action names, parameters, and durations. ```text 0.000: (askcharge leia zone_1_1 zone_recharge) [5.000] 0.001: (charge leia zone_recharge) [5.000] 5.002: (move leia zone_recharge room_2) [5.000] 10.003: (move leia room_2 corridor_1) [5.000] 15.004: (move leia corridor_1 room_1) [5.000] 20.005: (move leia room_1 zone_1_2) [5.000] ``` -------------------------------- ### Defining Planner Node Executable Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_planner/CMakeLists.txt Creates an executable for the planner node, specifying its source file, include directories, compile definitions, and linked libraries. ```cmake add_executable(planner_node src/planner_node.cpp ) target_include_directories(planner_node PRIVATE "$" "$" ) target_compile_definitions(planner_node PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS") target_link_libraries(planner_node PRIVATE ${PROJECT_NAME} rclcpp::rclcpp ) ``` -------------------------------- ### Setting Goal in BtActionNode on Tick Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_bt_actions/README.md Demonstrates how to set the goal for a ROS2 action within the on_tick() function of a BtActionNode. It shows setting the goal on the first tick (when the node is IDLE) and how to update the goal and flag it for update on subsequent ticks. ```cpp BT::NodeStatus on_tick() override { if (status() == BT::NodeStatus::IDLE) { // this block will only execute on the first tick goal_.string = "foo"; } else if () { // this block may execute anytime afterward goal_.string = "bar"; goal_updated_ = true; } } ``` -------------------------------- ### PDDL Problem Instance Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_tests/test_3/README.md Defines the problem instance for Test 3, including objects, initial state, and the goal for assembling three cars. ```pddl ( define ( problem problem_1 ) ( :domain plansys2 ) ( :objects robot1 robot2 robot3 - robot wheels_zone sterwheel_zone body_car_zone assembly_zone recharge_zone - zone wheel_1 wheel_2 wheel_3 body_car_1 body_car_2 body_car_3 sterwheel_1 sterwheel_2 sterwheel_3 - piece car1 car2 car3 - car ) ( :init ( robot_at robot1 assembly_zone ) ( robot_at robot2 assembly_zone ) ( robot_at robot3 assembly_zone ) ( is_assembly_zone assembly_zone ) ( robot_available robot1 ) ( robot_available robot2 ) ( robot_available robot3 ) ( piece_at wheel_1 wheels_zone ) ( piece_at body_car_1 body_car_zone ) ( piece_at sterwheel_1 sterwheel_zone ) ( piece_is_wheel wheel_1 ) ( piece_is_body_car body_car_1 ) ( piece_is_steering_wheel sterwheel_1 ) ( piece_at wheel_2 wheels_zone ) ( piece_at body_car_2 body_car_zone ) ( piece_at sterwheel_2 sterwheel_zone ) ( piece_is_wheel wheel_2 ) ( piece_is_body_car body_car_2 ) ( piece_is_steering_wheel sterwheel_2 ) ( piece_at wheel_3 wheels_zone ) ( piece_at body_car_3 body_car_zone ) ( piece_at sterwheel_3 sterwheel_zone ) ( piece_is_wheel wheel_3 ) ( piece_is_body_car body_car_3 ) ( piece_is_steering_wheel sterwheel_3 ) ( piece_not_used wheel_1 ) ( piece_not_used wheel_2 ) ( piece_not_used wheel_3 ) ( piece_not_used body_car_1 ) ( piece_not_used body_car_2 ) ( piece_not_used body_car_3 ) ( piece_not_used sterwheel_1 ) ( piece_not_used sterwheel_2 ) ( piece_not_used sterwheel_3 ) ) ( :goal ( and ( car_assembled car1 ) ( car_assembled car2 ) ( car_assembled car3 ) ) ) ) ``` -------------------------------- ### Define RQT Performers Plugin Library Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_tools/CMakeLists.txt Builds the rqt_plansys2_performers shared library. Similar to the knowledge plugin, it wraps UI and header files and links against relevant Qt5, PLANSYS2, and RQT libraries. ```cmake set(rqt_plansys2_performers_SRCS src/rqt_plansys2_performers/RQTPerformers.cpp src/rqt_plansys2_performers/PerformersTree.cpp ) set(rqt_plansys2_performers_HDRS include/rqt_plansys2_performers/RQTPerformers.hpp include/rqt_plansys2_performers/PerformersTree.hpp ) set(rqt_plansys2_performers_UIS src/rqt_plansys2_performers/rqt_plansys2_performers.ui ) qt5_wrap_cpp(rqt_plansys2_performers_MOCS ${rqt_plansys2_performers_HDRS}) qt5_wrap_ui(rqt_plansys2_performers_UIS_H ${rqt_plansys2_performers_UIS}) add_library(rqt_plansys2_performers SHARED ${rqt_plansys2_performers_SRCS} ${rqt_plansys2_performers_MOCS} ${rqt_plansys2_performers_UIS_H} ) target_include_directories(rqt_plansys2_performers PUBLIC ${Qt5Widgets_INCLUDE_DIRS} "$" "$" ) target_link_libraries(rqt_plansys2_performers PUBLIC plansys2_problem_expert::plansys2_problem_expert ${plansys2_msgs_TARGETS} rqt_gui_cpp::rqt_gui_cpp rclcpp::rclcpp Qt5::Widgets PRIVATE pluginlib::pluginlib ) ``` -------------------------------- ### Defining the BT Action Node Executable Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_bt_actions/CMakeLists.txt Defines the executable for the BT action node, specifying its source file, include directories, and linked libraries. ```cmake add_executable(bt_action_node src/bt_action_node.cpp ) target_include_directories(bt_action_node PRIVATE "$" "$" ) target_link_libraries(bt_action_node PRIVATE ${PROJECT_NAME} rclcpp::rclcpp ${lifecycle_msgs_TARGETS} ) ``` -------------------------------- ### GetProblem Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_msgs/README.md Returns the entire problem definition as a string. ```APIDOC ## GetProblem ### Description Returns the problem as a string. ### Service `plansys2_msgs::srv::GetProblem` ``` -------------------------------- ### Launch Plansys2 Terminal with Namespace Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_docs/tutorials/tut_1_terminal.md Opens the Plansys2 terminal interface, connecting to a planning system instance running in a specific namespace. ```shell ros2 run plansys2_terminal plansys2_terminal --ros-args -r __ns:=/my_namespace ``` -------------------------------- ### GetDomain Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_msgs/README.md Returns the entire domain as a string. ```APIDOC ## GetDomain ### Description Returns the domain as a string. ### Service `plansys2_msgs::srv::GetDomain` ``` -------------------------------- ### Simple Door PDDL Problem Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_tests/test_4/README.md Defines a PDDL problem for the 'simple-door' domain. It initializes the door to a closed state and sets the goal to have the door open. ```pddl (define (problem open-the-door) (:domain simple-door) (:init (not_door_open) ) (:goal (and (door_open)) ) ) ``` -------------------------------- ### Add Google Test Target Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_tests/test_2/CMakeLists.txt Configures the build system to use Google Test for the test_2 executable. This requires a test_2.cpp source file. ```cmake ament_add_gtest(test_2 test_2.cpp) ``` -------------------------------- ### ament Package and Export Configuration Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_bt_actions/CMakeLists.txt Exports include directories, libraries, targets, and dependencies for the ament build system. ```cmake ament_export_include_directories("include/${PROJECT_NAME}") ament_export_libraries(${PROJECT_NAME}) ament_export_targets(export_${PROJECT_NAME}) ament_export_dependencies( rclcpp rclcpp_action rclcpp_lifecycle plansys2_executor behaviortree_cpp ) ament_package() ``` -------------------------------- ### Add Google Test for popf_test Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_popf_plan_solver/test/unit/CMakeLists.txt Configures a Google Test executable named 'popf_test' using the 'popf_test.cpp' source file. This is a standard way to set up unit tests in ROS 2 packages. ```cmake ament_add_gtest(popf_test popf_test.cpp) ``` -------------------------------- ### Executable Definition and Includes Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_lifecycle_manager/CMakeLists.txt Defines the lifecycle_manager_node executable and configures private include directories. ```cmake add_executable(lifecycle_manager_node src/lifecycle_manager_node.cpp) target_include_directories(lifecycle_manager_node PRIVATE "$" "$" ) ``` -------------------------------- ### Finding ROS 2 and Behavior Tree Packages Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_bt_actions/CMakeLists.txt Finds and makes required ROS 2 packages and the Behavior Tree C++ library available for the project. ```cmake find_package(ament_cmake REQUIRED) find_package(rclcpp REQUIRED) find_package(rclcpp_action REQUIRED) find_package(rclcpp_lifecycle REQUIRED) find_package(plansys2_executor REQUIRED) find_package(behaviortree_cpp REQUIRED) find_package(lifecycle_msgs REQUIRED) find_package(std_msgs REQUIRED) ``` -------------------------------- ### GetProblemInstances Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_msgs/README.md Returns a list of all problem instances, each represented as a Param message. ```APIDOC ## GetProblemInstances ### Description Returns a list of problem instances where each instance is represented as a `plansys2_msgs::msg::Param`. ### Service `plansys2_msgs::srv::GetProblemInstances` ``` -------------------------------- ### Run Patrolling Controller Node Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_docs/tutorials/tut_2_patrol.md Runs the patrolling controller node, which manages the robot's behavior using a Finite State Machine. This node sets goals, generates plans, and executes them to achieve the patrolling objective. ```shell ros2 run patrol_navigation_example patrolling_controller_node ``` -------------------------------- ### Simple PDDL Problem Definition Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_tests/test_1/README.md Defines the objects, initial state, and goal for the PDDL problem. Specifies a robot 'leia' and several rooms, with the goal of reaching the bathroom. ```pddl ( define ( problem problem_1 ) ( :domain plansys2 ) ( :objects leia - robot entrance kitchen bedroom dinning bathroom chargingroom - room ) ( :init ( connected entrance dinning ) ( connected dinning entrance ) ( connected dinning kitchen ) ( connected kitchen dinning ) ( connected dinning bedroom ) ( connected bedroom dinning ) ( connected bathroom bedroom ) ( connected bedroom bathroom ) ( connected chargingroom kitchen ) ( connected kitchen chargingroom ) ( charging_point_at chargingroom ) ( battery_low leia ) ( robot_at leia entrance ) ) ( :goal ( and ( robot_at leia bathroom ) ) ) ) ``` -------------------------------- ### Add and Link Domain Reader Test Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_domain_expert/test/unit/CMakeLists.txt Defines a Google Test target for domain_reader_test and links it to the project and ament_index_cpp. ```cmake ament_add_gtest(domain_reader_test domain_reader_test.cpp) target_link_libraries(domain_reader_test ${PROJECT_NAME} ament_index_cpp::ament_index_cpp ) ``` -------------------------------- ### Testing Configuration Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_bt_actions/CMakeLists.txt Configures testing dependencies and adds the test subdirectory if testing is enabled. ```cmake if(BUILD_TESTING) find_package(ament_lint_auto REQUIRED) ament_lint_auto_find_test_dependencies() find_package(ament_cmake_gtest REQUIRED) find_package(plansys2_msgs REQUIRED) find_package(test_msgs REQUIRED) find_package(geometry_msgs REQUIRED) find_package(tf2_geometry_msgs) add_subdirectory(test) endif() ``` -------------------------------- ### Configure ament_add_gtest for executor_test Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_executor/test/unit/CMakeLists.txt Sets up the 'executor_test' executable as a Google Test target, specifying the source file and a timeout. It also defines a compile-time macro and links the test executable to the main project library. ```cmake ament_add_gtest(executor_test executor_test.cpp TIMEOUT 300) target_compile_definitions(executor_test PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS") target_link_libraries(executor_test ${PROJECT_NAME} ) ``` -------------------------------- ### GetProblemGoal Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_msgs/README.md Returns the complete problem goal, represented as a Tree message. ```APIDOC ## GetProblemGoal ### Description Returns the entire problem goal represented as a `plansys2_msgs::msg::Tree`. ### Service `plansys2_msgs::srv::GetProblemGoal` ``` -------------------------------- ### Link Libraries to Test Target Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_tests/test_1/CMakeLists.txt Links the 'test_1' target with the project's main library and several other ROS 2 planning system libraries. ```cmake target_link_libraries(test_1 ${PROJECT_NAME} ament_index_cpp::ament_index_cpp plansys2_domain_expert::plansys2_domain_expert plansys2_problem_expert::plansys2_problem_expert plansys2_planner::plansys2_planner ) ``` -------------------------------- ### Configure ament_add_gtest for bt_node_test Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_executor/test/unit/CMakeLists.txt Configures 'bt_node_test' as a Google Test target. This involves setting a compile definition and linking the test executable to the main project library. ```cmake ament_add_gtest(bt_node_test bt_node_test.cpp) target_compile_definitions(bt_node_test PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS") target_link_libraries(bt_node_test ${PROJECT_NAME} ) ``` -------------------------------- ### GetDomainActions Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_msgs/README.md Returns a list of all available domain action names. ```APIDOC ## GetDomainActions ### Description Returns a list of the domain action names. ### Service `plansys2_msgs::srv::GetDomainActions` ``` -------------------------------- ### GetStates Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_msgs/README.md Returns a list of predicates or functions, each represented as a Node message. ```APIDOC ## GetStates ### Description Used to return a list of predicates or functions where each predicate or function is defined as a `plansys2_msgs::msg::Node`. ### Service `plansys2_msgs::srv::GetStates` ``` -------------------------------- ### Add gtest for utils_test Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_core/test/CMakeLists.txt Adds a Google Test target for the 'utils_test.cpp' file and links it with the main project library and ament_index_cpp. ```cmake ament_add_gtest(utils_test utils_test.cpp) target_link_libraries(utils_test ${PROJECT_NAME} ament_index_cpp::ament_index_cpp ) ``` -------------------------------- ### Add Google Test for Terminal Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_terminal/test/CMakeLists.txt Configures a Google Test target named 'terminal_test' using the 'terminal_test.cpp' source file with a timeout of 500 seconds. ```cmake ament_add_gtest(terminal_test terminal_test.cpp TIMEOUT 500) ``` -------------------------------- ### Add and Link Domain Expert Node Test Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_domain_expert/test/unit/CMakeLists.txt Defines a Google Test target for domain_expert_node_test and links it to the project and ament_index_cpp. ```cmake ament_add_gtest(domain_expert_node_test domain_expert_node_test.cpp) target_link_libraries(domain_expert_node_test ${PROJECT_NAME} ament_index_cpp::ament_index_cpp ) ``` -------------------------------- ### Link Libraries for Test Target Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_planner/test/unit/CMakeLists.txt Links the 'planner_test' target to various libraries required for its execution, including the main project library, ament index, dl, and plansys2_pddl_parser. ```cmake target_link_libraries(planner_test ${PROJECT_NAME} ament_index_cpp::ament_index_cpp dl plansys2_pddl_parser::plansys2_pddl_parser ) ``` -------------------------------- ### Link Libraries for popf_test Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_popf_plan_solver/test/unit/CMakeLists.txt Links the 'popf_test' executable with required libraries, including the main project library, ament index, dl, and pluginlib. This ensures the test can access necessary functionalities. ```cmake target_link_libraries(popf_test ${PROJECT_NAME} ament_index_cpp::ament_index_cpp dl pluginlib::pluginlib ) ``` -------------------------------- ### Simple PDDL Domain Definition Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_tests/test_1/README.md Defines the types, predicates, and durative actions for a simple robot navigation and charging scenario. Includes actions like move, askcharge, and charge. ```pddl (define (domain simple) (:requirements :strips :typing :adl :fluents :durative-actions) ;; Types ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (:types robot room );; end Types ;;;;;;;;;;;;;;;;;;;;;;;;; ;; Predicates ;;;;;;;;;;;;;;;;;;;;;;;;; (:predicates (robot_at ?r - robot ?ro - room) (connected ?ro1 ?ro2 - room) (battery_full ?r - robot) (battery_low ?r - robot) (charging_point_at ?ro - room) );; end Predicates ;;;;;;;;;;;;;;;;;;;; ;; Functions ;;;;;;;;;;;;;;;;;;;;;;;;; (:functions );; end Functions ;;;;;;;;;;;;;;;;;;;; ;; Actions ;;;;;;;;;;;;;;;;;;;;;;;;;;;; (:durative-action move :parameters (?r - robot ?r1 ?r2 - room) :duration ( = ?duration 5) :condition (and (at start(connected ?r1 ?r2)) (at start(robot_at ?r ?r1)) (over all(battery_full ?r)) ) :effect (and (at start(not(robot_at ?r ?r1))) (at end(robot_at ?r ?r2)) ) ) (:durative-action askcharge :parameters (?r - robot ?r1 ?r2 - room) :duration ( = ?duration 5) :condition (and (at start(robot_at ?r ?r1)) (at start(charging_point_at ?r2)) ) :effect (and (at start(not(robot_at ?r ?r1))) (at start(robot_at ?r ?r2)) ) ) (:durative-action charge :parameters (?r - robot ?ro - room) :duration ( = ?duration 5) :condition (and (at start(robot_at ?r ?ro)) (at start(charging_point_at ?ro)) ) :effect (and (at end(not(battery_low ?r))) (at end(battery_full ?r)) ) ) );; end Domain ;;;;;;;;;;;;;;;;;;;;;;;; ``` -------------------------------- ### Define Behavior Tree Action Libraries Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_bt_actions/test/unit/CMakeLists.txt Defines shared libraries for various behavior tree action nodes used in the package. These libraries encapsulate the logic for specific actions like opening or closing grippers. ```cmake add_library(plansys2_close_gripper_bt_node SHARED ../behavior_tree/CloseGripper.cpp ) list(APPEND plugin_libs plansys2_close_gripper_bt_node) add_library(plansys2_open_gripper_bt_node SHARED ../behavior_tree/OpenGripper.cpp ) list(APPEND plugin_libs plansys2_open_gripper_bt_node) add_library(plansys2_move_bt_test_node SHARED ../behavior_tree/Move.cpp) list(APPEND plugin_libs plansys2_move_bt_test_node) add_library(plansys2_failure_test_nodes SHARED ../behavior_tree/FailureNodes.cpp ) list(APPEND plugin_libs plansys2_failure_test_nodes) ``` -------------------------------- ### Run Plansys2 Plan Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_docs/tutorials/tut_1_terminal.md Executes the previously generated plan. This involves invoking the corresponding ROS 2 action nodes for each step in the plan. ```plansys2_terminal run ``` -------------------------------- ### Configure ament_add_gtest for execution_tree_test Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_executor/test/unit/CMakeLists.txt Sets up 'execution_tree_test' as a Google Test target. It defines a compile macro and links the test executable to the main project library. ```cmake ament_add_gtest(execution_tree_test execution_tree_test.cpp) target_compile_definitions(execution_tree_test PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS") target_link_libraries(execution_tree_test ${PROJECT_NAME} ) ``` -------------------------------- ### Add Google Test Target Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_tests/test_1/CMakeLists.txt Defines a Google Test executable named 'test_1' using the 'test_1.cpp' source file. ```cmake ament_add_gtest(test_1 test_1.cpp) ``` -------------------------------- ### Add Google Test for Behavior Tree Actions Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_bt_actions/test/unit/CMakeLists.txt Configures a Google Test executable for testing behavior tree actions. It links the test executable with the project's main library and necessary ROS 2 message types. ```cmake ament_add_gtest(bt_action_test bt_action_test.cpp) target_link_libraries(bt_action_test ${PROJECT_NAME} ${geometry_msgs_TARGETS} ${lifecycle_msgs_TARGETS} ${test_msgs_TARGETS} ) ``` -------------------------------- ### Defining Planner Library Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_planner/CMakeLists.txt Defines the shared library for the planner, specifying source files, include directories, and linked libraries. It also sets compile definitions. ```cmake set(PLANNER_SOURCES src/plansys2_planner/PlannerClient.cpp src/plansys2_planner/PlannerNode.cpp ) add_library(${PROJECT_NAME} SHARED ${PLANNER_SOURCES}) target_include_directories(${PROJECT_NAME} PUBLIC "$" "$" "$" ) target_link_libraries(${PROJECT_NAME} PUBLIC ${lifecycle_msgs_TARGETS} plansys2_core::plansys2_core plansys2_domain_expert::plansys2_domain_expert plansys2_problem_expert::plansys2_problem_expert ${plansys2_msgs_TARGETS} pluginlib::pluginlib rclcpp::rclcpp rclcpp_lifecycle::rclcpp_lifecycle PRIVATE plansys2_popf_plan_solver::plansys2_popf_plan_solver ) target_compile_definitions(${PROJECT_NAME} PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS") ``` -------------------------------- ### Add and Link Domain Expert Test Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_domain_expert/test/unit/CMakeLists.txt Defines a Google Test target for domain_expert_test and links it to the project and ament_index_cpp. ```cmake ament_add_gtest(domain_expert_test domain_expert_test.cpp) target_link_libraries(domain_expert_test ${PROJECT_NAME} ament_index_cpp::ament_index_cpp ${lifecycle_msgs_TARGETS} ) ``` -------------------------------- ### GetDomainTypes Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_msgs/README.md Returns a list of all types defined in the domain. ```APIDOC ## GetDomainTypes ### Description Returns the domain types. ### Service `plansys2_msgs::srv::GetDomainTypes` ``` -------------------------------- ### Link Libraries for test_2 Target Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_tests/test_2/CMakeLists.txt Links the test_2 target with its required libraries, including the main project library and several plansys2 components. Ensure these components are correctly defined and available. ```cmake target_link_libraries(test_2 ${PROJECT_NAME} plansys2_domain_expert::plansys2_domain_expert plansys2_problem_expert::plansys2_problem_expert plansys2_planner::plansys2_planner ) ``` -------------------------------- ### Executable Target and Linking Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_bringup/CMakeLists.txt Defines the 'plansys2_node' executable and links it with required ROS 2 and plansys2 libraries. ```cmake add_executable(plansys2_node src/plansys2_node.cpp ) target_link_libraries(plansys2_node PRIVATE rclcpp::rclcpp plansys2_domain_expert::plansys2_domain_expert plansys2_problem_expert::plansys2_problem_expert plansys2_planner::plansys2_planner plansys2_executor::plansys2_executor plansys2_lifecycle_manager::plansys2_lifecycle_manager ) target_compile_definitions(plansys2_node PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS") ``` -------------------------------- ### Configure Behavior Tree Plugin Dependencies Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_bt_actions/test/unit/CMakeLists.txt Iterates through defined behavior tree plugins to set include directories, link libraries, and define compile options. This ensures plugins have access to necessary headers and libraries. ```cmake foreach(bt_plugin ${plugin_libs}) target_include_directories(${bt_plugin} PRIVATE "$") target_link_libraries(${bt_plugin} behaviortree_cpp::behaviortree_cpp ${geometry_msgs_TARGETS} tf2_geometry_msgs::tf2_geometry_msgs rclcpp::rclcpp rclcpp_action::rclcpp_action rclcpp_lifecycle::rclcpp_lifecycle ${test_msgs_TARGETS} ) target_compile_definitions(${bt_plugin} PRIVATE BT_PLUGIN_EXPORT) endforeach() ``` -------------------------------- ### Executable Linking Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_lifecycle_manager/CMakeLists.txt Links the lifecycle_manager_node executable with the main library and rclcpp. ```cmake target_link_libraries(lifecycle_manager_node PRIVATE ${PROJECT_NAME} rclcpp::rclcpp ) ``` -------------------------------- ### PDDL Problem Definition for Test 2 Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_tests/test_2/README.md Defines the problem instance for test 2, specifying objects, initial states (like robot location and battery status), and the goal condition. ```pddl ( define ( problem problem_1 ) ( :domain plansys2 ) ( :objects leia - robot room_1 room_2 - room corridor_1 - corridor zone_1_1 zone_1_2 zone_recharge - zone ) ( :init ( connected room_1 corridor_1 ) ( connected corridor_1 room_1 ) ( connected room_2 corridor_1 ) ( connected corridor_1 room_2 ) ( connected room_1 zone_1_1 ) ( connected zone_1_1 room_1 ) ( connected room_1 zone_1_2 ) ( connected zone_1_2 room_1 ) ( connected room_2 zone_recharge ) ( connected zone_recharge room_2 ) ( charging_point_at zone_recharge ) ( battery_low leia ) ( robot_at leia zone_1_1 ) ) ( :goal ( and ( robot_at leia zone_1_2 ) ) ) ) ``` -------------------------------- ### Testing Configuration Source: https://github.com/plansys2/ros2_planning_system/blob/rolling/plansys2_planner/CMakeLists.txt Enables testing if BUILD_TESTING is set, finding test dependencies, and adding subdirectories for tests. This section is conditional. ```cmake if(BUILD_TESTING) find_package(ament_lint_auto REQUIRED) ament_lint_auto_find_test_dependencies() find_package(ament_cmake_gtest REQUIRED) find_package(ament_index_cpp REQUIRED) find_package(plansys2_pddl_parser REQUIRED) add_subdirectory(test) endif() ```