Petri Net Plans Execution Framework Luca Iocchi Luca Iocchi Dipartimento di Ingegneria Dipartimento di Ingegneria Informatica Informatica, Automatica e Gestionale Automatica e Gestionale
Petri Net Plans • High-level plan representation formalism based on Petri nets • Explicit and formal representation of actions and conditions • Execution Algorithm implemented and tested in many robotic applications • Open-source release with support for different robots and development environments (ROS, Naoqi, …) AI Planning for Robotics and Human-Robot Interaction - ICAPS 2017 2
Petri Net Plans library PNP library contains pnp.dis.uniroma1.it • PNP execution engine • PNP generation tools • Bridges: ROS, Naoqi (Nao, Pepper) [Ziparo et al., JAAMAS 2011] AI Planning for Robotics and Human-Robot Interaction - ICAPS 2017 3
Plan representation in PNP • Petri nets are exponentially more compact than other structures (e.g., transition graphs) and can thus efficiently represent several kinds of plans: – Linear plans – Contingent/conditional plans – Plans with loop – Policies – … • PNP can be used as a general plan execution framework AI Planning for Robotics and Human-Robot Interaction - ICAPS 2017 4
Plan traslation in PNP • PNPgen is a library that translates a plan (the output of some planning system) in a PNP. • PNPgen includes additional facilities to extend the generated PNP with constructs that are not available on the planning system (e.g., interrupt and recovery procedures). • Plan formats supported: ROSPlan (linear/conditional), HATP, MDP policies AI Planning for Robotics and Human-Robot Interaction - ICAPS 2017 5
PNP ROS • PNP-ROS is a bridge for executing PNPs in a ROS-based system. • PNP-ROS uses the ROS actionlib protocol to control the execution of the actions and ROS topics and parameters to access the robot's knowledge. AI Planning for Robotics and Human-Robot Interaction - ICAPS 2017 6
PNP execution framework π Domain ROSPlan Robustification PNP Contingent-FF Goal PNP-ROS Execution Rules Planning and Execution Component AI Planning for Robotics and Human-Robot Interaction - ICAPS 2017 7
ROSPlan + PNPgen + PNP-ROS • A proper integration of o Plan generation o Plan execution o ROS action execution and condition monitoring provides an effective framework for robot planning and execution. AI Planning for Robotics and Human-Robot Interaction - ICAPS 2017 8
Outline • Petri Nets • Petri Net Plans • Execution rules • PNP-ROS • Demo AI Planning for Robotics and Human-Robot Interaction - ICAPS 2017 9
Petri Net definition AI Planning for Robotics and Human-Robot Interaction - ICAPS 2017 10
Petri Net firing rule AI Planning for Robotics and Human-Robot Interaction - ICAPS 2017 11
Petri Net Plans • Petri Net Plans (PNP) are defined in terms of • Operators • Actions - sequence, conditional and - ordinary actions loops - sensing actions - interrupt - fork/join AI Planning for Robotics and Human-Robot Interaction - ICAPS 2017 12
PNP Actions AI Planning for Robotics and Human-Robot Interaction - ICAPS 2017 13
PNP Actions AI Planning for Robotics and Human-Robot Interaction - ICAPS 2017 14
PNP Operators AI Planning for Robotics and Human-Robot Interaction - ICAPS 2017 15
PNP interrupt AI Planning for Robotics and Human-Robot Interaction - ICAPS 2017 16
PNP concurrency AI Planning for Robotics and Human-Robot Interaction - ICAPS 2017 17
Plan 1: sequence and loop AI Planning for Robotics and Human-Robot Interaction - ICAPS 2017 18
Plan 2: fork and join AI Planning for Robotics and Human-Robot Interaction - ICAPS 2017 19
Plan 3: sensing and loop AI Planning for Robotics and Human-Robot Interaction - ICAPS 2017 20
Plan 4: interrupt AI Planning for Robotics and Human-Robot Interaction - ICAPS 2017 21
Plan 5: multi robot AI Planning for Robotics and Human-Robot Interaction - ICAPS 2017 22
PNP Execution Algorithm AI Planning for Robotics and Human-Robot Interaction - ICAPS 2017 23
Correctness of PNP execution • PNP execution is correct with respect to an operational semantics based on Petri nets and the robot's local knowledge. AI Planning for Robotics and Human-Robot Interaction - ICAPS 2017 24
PNP sub-plans • Plans can be organized in a hierarchy, allowing for modularity and reuse • Sub-plans are like actions: – when started, the initial marking is set – when goal marking is reached, the sub-plan ends AI Planning for Robotics and Human-Robot Interaction - ICAPS 2017 25
Plans with variables [condition_@X] sets the value of variable X action_@X uses the value of variable X Example: given a condition personAt_@X, the occurrence of personAt_B115 sets the variable @X to “B115”, next action goto_@X will be interpreted as goto_B115 AI Planning for Robotics and Human-Robot Interaction - ICAPS 2017 26
Execution rules Adding to the conditional plan • interrupt (special conditions that determine interruption of an action) • recovery paths (how to recovery from an interrupt) • social norms • parallel execution Main feature • Execution variables are generally different from the ones in the planning domain (thus not affecting complexity of planning) AI Planning for Robotics and Human-Robot Interaction - ICAPS 2017 27
Execution rules Examples if personhere and closetotarget during goto do skip_action if personhere and not closetotarget during goto do say_hello; waitfor_not_personhere; restart_action if lowbattery during * do recharge; fail_plan after receivedhelp do say_thanks after endinteraction do say_goodbye when say do display AI Planning for Robotics and Human-Robot Interaction - ICAPS 2017 28
PNP-ROS • Bridge between PNP and ROS • Allows execution of PNP under ROS using the actionlib module • Defines a generic PNPAction and an ActionClient for PNPActions • Defines a client service PNPConditionEval to evaluate conditions AI Planning for Robotics and Human-Robot Interaction - ICAPS 2017 29
PNP-ROS User PNP-ROS Application PNP PNP MyPNPAS ActionClient ActionServer PNP PNP Actions and ServiceClient Service conditions PNP lib PNP AI Planning for Robotics and Human-Robot Interaction - ICAPS 2017 30
PNP-ROS User development: 1. implement actions and conditions 2. write a PNPActionServer AI Planning for Robotics and Human-Robot Interaction - ICAPS 2017 31
PNPActionServer class PNPActionServer { public: PNPActionServer(); ~PNPActionServer(); void start(); // To be provided by actual implementation virtual void actionExecutionThread(string action_name, string action_params, bool *run); virtual int evalCondition(string condition); // 1: true, 0: false; - 1:unknown } AI Planning for Robotics and Human-Robot Interaction - ICAPS 2017 32
PNPActionServer class PNPActionServer { public: … // For registering action functions (MR=multi-robot version ) void register_action(string actionname, action_fn_t actionfn); void register_MRaction(string actionname, MRaction_fn_t actionfn); … } AI Planning for Robotics and Human-Robot Interaction - ICAPS 2017 33
MyPNPActionServer #Include "MyActions.h" class MyPNPActionServer : public PNPActionServer { MyPNPActionServer() : PNPActionServer() { register_action("init",&init); …. } } AI Planning for Robotics and Human-Robot Interaction - ICAPS 2017 34
MyPNPActionServer PNP_cond_pub = // asynchronous conditions handle.advertise<std_msgs::String>("PNPConditionEvent", 10); Function SensorProcessing { … std_msgs::String out; out.data = condition; // symbol of the condition PNP_cond_pub.publish(out); } AI Planning for Robotics and Human-Robot Interaction - ICAPS 2017 35
MyPNPActionServer Function SensorProcessing { … string param = “PNPconditionsBuffer/<CONDITION>”; node_handle.setParam(param, <VALUE {1|0}>); } AI Planning for Robotics and Human-Robot Interaction - ICAPS 2017 36
Demo Virtual machine available in the Tutorial web site AI Planning for Robotics and Human-Robot Interaction - ICAPS 2017 37
Demo Virtual machine available in the Tutorial web site AI Planning for Robotics and Human-Robot Interaction - ICAPS 2017 38
Demo Inspired by RoboCup@Home tasks • RoboCup@Home domain • Planning problems for @Home tasks – Navigation (rulebook 2016) – Cocktail Party (rulebook 2017) NOTE: We are using this framework in our SPQReL team that will compete in RoboCup@Home 2017 SSPL AI Planning for Robotics and Human-Robot Interaction - ICAPS 2017 39
Recommend
More recommend