Human-AI Teaming Lab

Plan:
AI Planning and Robotics
Gerard Canal, Michael Cashmore, Daniele Magazzeni

AI Planning...
●Path Planning●Motion Planning●Task Planning○○○○

Action Planning
AI Planning
Symbolic Planning(...)

Human-AI Teaming Lab●The generation of a set of actions thatbring the system from an initial state to agoal state (possibly optimizing a metricfunction)○●A model of the world/environment is needed

Actions modify the current state○○○

If their preconditions are met.
The effects are applied to the state.
...But they can incur in costs or rewards.

ROSPlan: AI Planning and Robotics

ROSCon 20192

What does Task Planning need?
●●Planners have two input files:○Domain file → Stores the model, dynamics and rules of the world■ Predicates, Constraints, Actions (parameters, preconditions, effects)○

Problem file → Defines the task to be solved using the domain.
■ Objects of the world, Initial State, Goal state

Written in some description language: PDDL
DomainPLANNER

Plan

Problem

Human-AI Teaming Lab

ROSPlan: AI Planning and Robotics

ROSCon 20193

Motivation: let’s fit a shoe!
●“Simple task”●Low number of actions●Very easy to describe in PDDL●Very difficult to define every
possible configuration in a statemachine

Extracted from:
G. Canal, E. Pignat, G. Alenyà, S. Calinon and C. Torras, "Joining High-Level
Symbolic Planning with Low-Level Motion Primitives in Adaptive HRI: Application toDressing Assistance," IEEE International Conference on Robotics and Automation(ICRA), 2018.

Human-AI Teaming Lab

ROSPlan: AI Planning and Robotics

x4
ROSCon 20194

Shoe fitting example: PDDL domain(:predicates (shoeInHand ?s - shoe)(:action insertFootInShoe(footMoving ?f - foot):parameters (?s - shoe ?f - foot)(reachableFoot ?f - foot):precondition (and (reachableFoot ?f) (shoeInHand ?s)(footInCorrectPose ?f - foot)(correctShoe ?s ?f) (not (footMoving ?f))(correctShoe ?s - shoe ?f - foot)(not (footInShoe ?s ?f)))(footInShoe ?s - shoe ?f - foot)):effect (and (footInShoe ?s ?f) ))(:action approachFoot:parameters (?f - foot ?s - shoe):precondition (and (not (reachableFoot ?f))(shoeInHand ?s)(not (footMoving ?f)) ):effect (reachableFoot ?f))(:action releaseShoe:parameters (?s - shoe ?f - foot):precondition (and (shoeInHand ?s) (shoeInFoot ?s ?f)(not (footMoving ?f)) (informedUser) ):effect (not (shoeInHand ?s)))

Human-AI Teaming Lab

ROSPlan: AI Planning and Robotics

ROSCon 20195

Example: PDDL problem(define (problem roscon_shoefit)

0.000:(approachShoe lefts)[10.000]

10.001:(graspShoe lefts)[5.000]15.002:(goto_startpose)[15.000]30.003:(approachFoot leftf lefts)[20.000]

50.004:(insertFootInShoe lefts leftf)[25.000]

75.005:(releaseShoe lefts leftf)[5.000]80.000:(graspShoe lefts)[5.000](:goal (and(:domain shoe_fitting)(not (shoeInHand rights))(:objects(not (shoeInHand lefts))

rightf leftf - foot(footInShoe rights rightf)

rights lefts - shoe(footInShoe lefts leftf))Plan))(:init(not (shoeInHand rights))(not (shoeInHand lefts))(footInCorrectPose rightf)(footInCorrectPose leftf)105.007: (insertFootInShoe lefts leftf)[25.000]

130.008: (releaseShoe lefts leftf)[5.000])*More info on AI Planning can be found at https://planning.wiki

Human-AI Teaming Lab

ROSPlan: AI Planning and Robotics

ROSCon 20196

Why Planning with Robots?
●

Planning provides:○○○●Robustness
Adaptivity
Simplification●

Where reactive behaviors may not suffice:
○
○
○
○
○

HRI
Search & rescue
Dangerous missions
Time-constrained tasks
Task reasoning

Human-AI Teaming Lab

Many challenges arise:
○
○
○
○
○

ROSPlan: AI Planning and RoboticsFailures
Handle risk and uncertainties
Unexpected or unplanned events
Integration with control (task +motion)
Humans around!

ROSCon 20197

Task Planning with Robots (in general)●Difficult to integrate:○

Usually without an API available○

Planners are usually research oriented/non-commercial software○

Same input language, with subtleties, but output may differ●

To use a planner requires a lot of work and some coupling with the planner.

●

Try another planner… Repeat the most of the work!

Human-AI Teaming Lab!
suiodeT

ROSPlan: AI Planning and Robotics

ROSCon 20198

Process for task Planning in Robotics
1.

Store the state representation2.

Produce the Domain and Problem

3.

Generate the plan

4.

Execute the plan○

Executing the actions○Making observations

Human-AI Teaming Lab

ROSPlan: AI Planning and Robotics

ROSCon 20199

Meet ROSPlan (I wish I had done before…)●

The ROSPlan framework provides a collection of tools for AI Planning in a
ROS system.

●

ROSPlan has a variety of nodes which encapsulate planning, problem
generation, and plan execution.
○○○●

Plus many state-of-the-art planners available to use!
Extensible and modular → Easy to add new planners and new architectures.
And it’s Open Source!

In summary, makes task planning for robots simpler...

Human-AI Teaming Lab

ROSPlan: AI Planning and Robotics

ROSCon 201910

ROSPlan unleashed●

Not a default system, but a set oftools to suit the developer’s needs.

DomainPLANNER

PlanProblem

Human-AI Teaming Lab

ROSPlan: AI Planning and Robotics

ROSCon 201911

The Knowledge Base
●Stores the domain model andthe current state.

●Provides services to fetch domain
details, and to query and modify
the current state.

●Is updated based on action outcomes,
commonly obtained from sensor
observation and data processing.

Human-AI Teaming Lab

ROSPlan: AI Planning and Robotics

1.
2.
3.
4.

Store the state representation
Produce the Domain and Problem
Generate the plan
Execute the plan○
Executing the actions○
Making observations

ROSCon 201912Planning interfaces

1.
2.
3.
4.

Human-AI Teaming Lab

ROSPlan: AI Planning and Robotics

Store the state representation
Produce the Domain and Problem
Generate the plan
Execute the plan○
Executing the actions○Making observations

ROSCon 201913

Plan dispatch: taking action●The dispatcher receives a plan and is responsible of executing its actions inthe right times.

●Each action is dispatched by sending its details to a topic○●

Action executor subscribes the topic and provides feedback on the result.

Different dispatchers available:○

Sequential, Esterel (graph-based, concurrent actions), Online (new)

1.
2.
3.
4.

Human-AI Teaming Lab

ROSPlan: AI Planning and Robotics

Store the state representation
Produce the Domain and Problem
Generate the plan
Execute the plan○
Executing the actions○
Making observations

ROSCon 201914

Action Interface: The connection with the real world●

We now have seen a complete deliberative system providing plans andlaunching actions○○●

But actions need to be executed, and their outcomes checked!
This is robot/action dependent.

To simplify the task, ROSPlan provides an Action Interface○○○

Abstract C++ class to be extended that subscribes to the dispatcher and executes a callback
It also updates the Knowledge Base with the fixed outcomes of the task
In the callback, the user defines the behavior of the specific action (connection to actionlib
1.
Store the state representation
actions, calling services… doing the actual work).
2.
3.
4.

Human-AI Teaming Lab

ROSPlan: AI Planning and Robotics

Produce the Domain and Problem
Generate the plan
Execute the plan○
Executing the actions○
Making observations

ROSCon 201915

Sensing Interface: seeing the real world●

Assuming each action succeeds and its effects are applied, though useful, is○○●Unrealistic
Completely false in robotics

Updating the Knowledge Base with sensor data is a repetitive process:
1.
2.
3.

Get sensor data / state of the world
Compute predicate values
Update KB

Human-AI Teaming Lab

ROSPlan: AI Planning and Robotics

1.
2.
3.
4.

Store the state representation
Produce the Domain and Problem
Generate the plan
Execute the plan○
Executing the actions○
Making observations

ROSCon 201916

Automatic KB updating●

The new Sensing Interface provides hassle-free update of the KB○●●

With only 5 lines of YAML!

It automatically subscribes to topics and calls services at a fixed rate.
Example:topics:robot_at:params:- kenny- docking_station
topic: /amcl_pose
msg_type: geometry_msgs/PoseWithCovarianceStamped
operation: "(msg.pose.pose.position.x == 0) and (msg.pose.pose.position.y == 0)"●

More complex options can also be considered in an external python file.
Human-AI Teaming Lab

ROSPlan: AI Planning and Robotics

ROSCon 201917

Other extensions●

In addition, ROSPlan currently supports:○

Probabilistic planning (planning with uncertainty and non-deterministic effects)○

The PPDDL and RDDL languages○

Temporal plan execution with deadlines○Robustness through Robust Envelopes

Human-AI Teaming Lab

ROSPlan: AI Planning and Robotics

ROSCon 201918

What’s next?
●Improvements on support of planning constructs●

Support of conditional effects●

Integration of Explainable AI Planning to have self-explaining robots●

Goal reasoning●...And many more!

Human-AI Teaming Lab

ROSPlan: AI Planning and Robotics

ROSCon 201919

Success cases

HSR

Human-AI Teaming Lab

ROSPlan: AI Planning and Robotics

ROSCon 201920

More info at kcl-planning.github.io/ROSPlan
Available:-Documentation
TutorialsDemos

Human-AI Teaming Lab

ROSPlan: AI Planning and Robotics

ROSCon 201921

Human-AI Teaming Lab

Thank you!
Questions?
Find us at:github.com/KCL-Planning/ROSPlan

Anycontr

ibut

kcl-planning.github.io/ROSPlan | human-ai-teaming.com@ros_plan

ion

is w

elco

med!
22