This repository contains the plugin for PlanSys2 that uses the unified-planning (UP) as a solver. There are two ROS 2 packages:
- upf_solver: Contains a ROS 2 node that, given the domain and problem files in .pddl format and the path to save the plan, loads the domain/problem and saves the found solution.
- plansys2_upf_plan_solver: Contains the actual plugin for PlanSys2.
To install the plugin, follow these steps:
-
Clone the repository (in workspace src):
git clone https://github.com/JRL-CARI-CNR-UNIBS/plansys2_upf_plugin.git
-
If you have not yet installed plansys2 (in workspace src):
vcs import < plansys2_upf_plugin/dependencies.repos
-
Install dependencies using
rosdep
(in workspace level):rosdep install --from-paths src --ignore-src -r -y
-
Install Python dependencies (in workspace src):
pip install -r plansys2_upf_plugin/upf_solver/requirements.txt
-
Build the packages (in workspace level):
colcon build --symlink-install
The upf_solver
package contains a ROS 2 node that performs the following tasks:
- Inputs:
- Domain and problem files in .pddl format.
- Path where the plan should be saved.
- Functionality:
- Loads the domain and problem.
- Computes the plan using UPF.
- Saves the found solution to the specified path. Example:
To use the upf_solver
node, you need to start it with appropriate parameters. Example usage:
ros2 run upf_solver upf_solver --ros-args -p solver:='tamer' -p domain_path:='{$DOMAIN_PATH.PDDL}' -p problem_path:='{$PROBLEM_PATH.PDDL}' -p output_plan_path:='OUTPUT_PLAN.PDDL'
The plansys2_upf_plan_solver package contains the PlanSys2 plugin that integrates the UPF solver. This plugin allows PlanSys2 to use UPF as a planning solver.
To configure PlanSys2 to use the UPF plugin, set the following parameters in your plansys2_bringup or planner node configuration file:
To use this plugin in PlanSys2, set the following parameters in the plansys2_bringup
or the planner node configuration:
planner:
ros__parameters:
plan_solver_timeout: 15.0 # Adjust as needed
plan_solver_plugins: ["UPF"]
UPF:
plugin: "plansys2/UPFPlanSolver"
solver: "tamer" # tamer is by default (can be avoided the arg in that case), but there are others like "lpg"