Getting Started
This page installs PlanSys2 and runs its first example: a robot that plans and executes how to go from one room to another, recharging its battery on the way.
Installation
Install ROS 2 as described in the official documentation.
Install PlanSys2:
sudo apt install 'ros-<distro>-plansys2-*'
Note
4.0.0 reaches the binaries of each distribution with its next sync: until then,
aptinstalls the previous release. To use 4.0.0 now, build it from source as Build and Install explains.Clone the examples in a workspace and build them:
mkdir -p ~/plansys2_ws/src cd ~/plansys2_ws/src git clone -b <distro> https://github.com/PlanSys2/ros2_planning_system_examples.git cd ~/plansys2_ws rosdep install -y -r -q --from-paths src --ignore-src colcon build --symlink-install
Running the example
In a terminal, start PlanSys2 with the domain of the example and the processes that perform its actions (simulated: each one takes the time the plan gives it):
source ~/plansys2_ws/install/setup.bash ros2 launch plansys2_simple_example plansys2_simple_example.launch.yaml
In another terminal, open the PlanSys2 terminal:
source ~/plansys2_ws/install/setup.bash ros2 run plansys2_terminal plansys2_terminal
Load the problem of the example: its rooms, the robot
leiaat the entrance with low battery, and the goal of being in the bathroom. The commands are in thecommandsfile of the example, whichsourceruns:source <path to plansys2_simple_example>/share/plansys2_simple_example/launch/commands
ros2 pkg prefix plansys2_simple_exampletells the path. The file contains commands such as:set instance leia robot set instance entrance room set predicate (connected entrance dinning) set predicate (battery_low leia) set predicate (robot_at leia entrance) set goal (and(robot_at leia bathroom))
To watch the plan run, open the TUI in a third terminal (it does not run on Humble: see Migrating to 4.0.0):
source ~/plansys2_ws/install/setup.bash ros2 run plansys2_tui_cli plansys2_tui
Its Plan Monitor panel shows the plan being executed and the progress of each action, Action Execution which performer runs each action, and Knowledge how the problem changes. The Plan log tab (key
2) tells, as they happen, what the executor does and why.In the PlanSys2 terminal, ask for a plan, and run it:
get plan run
The terminal shows the progress of each action, and
Successfully finishedat the end; the TUI shows the same, action by action.
What next
Terminal Usage explains every command of the terminal.
The other tools show what PlanSys2 knows and does while a plan runs: the TUI with its plan log (Tools), and the Reading an execution.
Tutorials build robot behaviors step by step.