1 - Philippe Morignot
Transcription
1 - Philippe Morignot
Planification d’actions Séance 3 Philippe Morignot [email protected] P. Morignot EPITA SCIA & CSI - Planification d'actions 1 Plan du cours 1. 2. 3. 4. 5. Notions de base Algorithmes Planification et exécution Travaux pratiques Contrôle P. Morignot EPITA SCIA & CSI - Planification d'actions 2 Illustration P. Morignot EPITA SCIA & CSI - Planification d'actions 3 Hypothèses : rappel • Hyp. 1 : l’agent est la seule cause de changement dans l’environnement. – Pas d’autre agent, artificiel ou humain. • Hyp. 2 : l’environnement est totalement observable, l’agent en a une connaissance parfaite. – L’agent ne raisonne (e.g., planifie) pas sur des choses qu’il ne connait pas. • Hyp. 3 : l’environnement est statique. – Même si l’environnement peut avoir des lois de comportements, il ne bouge pas spontanément. • Hyp. 4 : le nombre d’objets considérés est fini. – Logique des propositions. P. Morignot EPITA SCIA & CSI - Planification d'actions 4 Méthode du chemin critique (1 / 2) • Les opérateurs PDDL ont a priori une durée nulle (instantanéité). • Pour attribuer une date de début et de fin à une tâche / un opérateur qui possède une durée, méthode du chemin critique (CPM). – Problème d’ordonnancement. • L’ordonnancement suppose que l’on connait déjà les opérateurs présents dans le plan et leurs liens de précédence. – Planification avant ordonnancement. P. Morignot EPITA SCIA & CSI - Planification d'actions 5 Méthode du chemin critique (2 / 2) B (5) A (10) [0 ; 10] D (10) [10 ; 20] C (10) [10 ; 20] [15 ; 30] E (10) F (5) [30 ; 35] G (10) [35 ; 45] [20 ; 30] • Complexité : O(n b) avec b = facteur de branchement • La fenêtre de temps de la tâche D laisse apparaitre un temps disponible (5). • Le chemin A < C < E < F < G est critique parce que c’est le plus long : tout retard sur ces tâches entraine un retard sur la durée globale du planning (45). Les autres tâches ont du mou (slack time), e.g., B et D. P. Morignot EPITA SCIA & CSI - Planification d'actions 6 Planification conditionnelle (1 / 3) • Les actions peuvent maintenant échouer. Non-déterminisme. • Observer à certains moments dans le plan ce qu’il se passe dans l’environnement. – Effets conditionnels, effets disjonctifs. • Domaine de l’aspirateur (double Murphy) : Opérateurs : Gauche, Droite, Aspire. Propositions : aGauche, aDroite, GauchePropre, DroitePropre. Aspirer une pièce propre peut déposer de la poussière Se déplacer dans une pièce propre peut déposer de la poussière Action(Gauche, Pre: aDroite, Post: aGauche ∨ (aGauche ∧ SI GauchePropre : ¬ GauchePropre)) • Plans conditionnels [ A1 ; A2 ; … ; An ] : composés d’étapes SI <test> ALORS <plan-V> SINON <plan-F> Un plan conditionnel est un arbre. P. Morignot EPITA SCIA & CSI - Planification d'actions 7 Planification conditionnelle (2 / 3) Gauche BUT … P. Morignot Droite … Aspire Aspire BUT BOUCLE Gauche … … EPITA SCIA & CSI - Planification d'actions Aspire BOUCLE 8 Planification conditionnelle (3 / 3) Fonction Recherche-ET-OU(problème) Recherche-OU(EtatInitial(problème), problème, []) Fonction Recherche-OU(etat, problème, chemin) // Nœud « Etat » SI TestBut[problème](etat) ALORS renvoie [] SI etat est-dans chemin ALORS renvoie ECHEC // Pas de cycle POUR TOUT action etats dans SUCCESSEURS[problème](etat) FAIRE plan <- Recherche-ET(etats, problème, [etat | chemin]) SI plan != ECHEC ALORS renvoie [ action | plan ] // Succès si un seul plan (OU) Fonction Recherche-ET(etats, problème, chemin) // Nœud « nature » POUR TOUT ei dans etats FAIRE plani <- Recherche-OU(ei, problème, chemin) SI plani == ECHEC ALORS renvoie ECHEC // Echec s’il manque 1 seul plan (ET) renvoie [SI e1 ALORS plan1 SINON SI e2 ALORS plan2 … ALORS plann-1 SINON plann] P. Morignot EPITA SCIA & CSI - Planification d'actions 9 Re-planification (1 / 20) Etat initial f1 f2 … fn P. Morignot But(s) b1 b2 … bl EPITA SCIA & CSI - Planification d'actions 10 Re-planification (2 / 20) Etat initial f1 f2 A1 … fn P. Morignot But(s) A2 … Ai EPITA SCIA & CSI - Planification d'actions Ai+1 … b1 b2 … bl Am 11 Re-planification (3 / 20) A1 P. Morignot A2 … Ai EPITA SCIA & CSI - Planification d'actions Ai+1 … Am 12 Re-planification (4 / 20) Instant présent A1 P. Morignot A2 … Ai EPITA SCIA & CSI - Planification d'actions Ai+1 … Am 13 Re-planification (5 / 20) Instant présent A1 P. Morignot A2 … Ai EPITA SCIA & CSI - Planification d'actions Ai+1 … Am 14 Re-planification (6 / 20) Instant présent A1 P. Morignot A2 … Ai EPITA SCIA & CSI - Planification d'actions Ai+1 … Am 15 Re-planification (7 / 20) Instant présent A1 P. Morignot A2 … Ai EPITA SCIA & CSI - Planification d'actions Ai+1 … Am 16 Re-planification (8 / 20) Instant présent A1 P. Morignot A2 … Ai EPITA SCIA & CSI - Planification d'actions Ai+1 … Am 17 Re-planification (9 / 20) Instant présent A1 P. Morignot A2 … Ai EPITA SCIA & CSI - Planification d'actions Ai+1 … Am 18 Re-planification (10 / 20) Etat initial f1 f2 A1 … fn P. Morignot But(s) A2 … Ai EPITA SCIA & CSI - Planification d'actions Ai+1 … Am b1 b2 … bl 19 Re-planification (11 / 20) Etat initial f1 f2 A1 … fn P. Morignot But(s) A2 … b1 b2 … bl Ai EPITA SCIA & CSI - Planification d'actions 20 Re-planification (12 / 20) Etat initial f1 f2 A1 … fn P. Morignot A2 Nouvel état f’1 f’2 … f’n But(s) b1 b2 … bl … EPITA SCIA & CSI - Planification d'actions 21 Re-planification (13 / 20) Etat initial f1 f2 A1 … fn P. Morignot A2 Nouvel état f’1 f’2 A’1 … f’n … EPITA SCIA & CSI - Planification d'actions But(s) A’2 … b1 b2 … bl A’k 22 Re-planification (14 / 20) A1 P. Morignot A2 … A’1 EPITA SCIA & CSI - Planification d'actions A’2 … A’k 23 Re-planification (15 / 20) Instant présent A1 P. Morignot A2 … A’1 EPITA SCIA & CSI - Planification d'actions A’2 … A’k 24 Re-planification (16 / 20) Instant présent A1 P. Morignot A2 … A’1 EPITA SCIA & CSI - Planification d'actions A’2 … A’k 25 Re-planification (17 / 20) Instant présent A1 P. Morignot A2 … A’1 EPITA SCIA & CSI - Planification d'actions A’2 … A’k 26 Re-planification (18 / 20) Instant présent A1 P. Morignot A2 … A’1 EPITA SCIA & CSI - Planification d'actions A’2 … A’k 27 Re-planification (19 / 20) Instant présent A1 P. Morignot A2 … A’1 EPITA SCIA & CSI - Planification d'actions A’2 … A’k 28 Re-planification (20 / 20) A1 A2 … A’1 A’2 … A’k Les buts b1, …, bl sont maintenant satisfaits : L’agent a généré un plan, a commencé à l’exécuter, a re-généré en ligne un plan et l’a exécuté. P. Morignot EPITA SCIA & CSI - Planification d'actions 29 Temps de réponse Planification en ligne : la difficulté P. Morignot Délibération Réaction Une dimension du problème 30 EPITA SCIA & CSI - Planification d'actions Architecture Sense-Plan-Act Agent robotique Perception Planification Capteurs Exécution Actionneurs Environnement P. Morignot EPITA SCIA & CSI - Planification d'actions 31 Architecture de Subsomption • Pas de symboles. Agent robotique Automate à états finis n … Paramètres Automate à états finis 2 Automate à états finis 1 Capteurs Actionneurs Environnement EPITA SCIA & CSI - Planification d'actions P. Morignot 32 Architecture 2 niveaux Cognitif Reconnaissance de situation Réactif Agent robotique Perception Capteurs Planification Suivi de plan Action Actionneurs Environnement P. Morignot EPITA SCIA & CSI - Planification d'actions 33 Architecture 2 niveaux : exemple Agent cycliste Niveau décisionnel Reconnaissance de situation Suivi de plan Feux, virages, obstacles, ... Planification d’actions Planification de chemin Tourner, accélérer, ... Niveau réactif Pédaler assis Pédaler en danseuse Gravitation, inertie, position du vélo, ... Se pencher pour tourner Mettre pied à terre Guidon, pédales, sonnette,phare, ... Environnement : routes, voitures, cyclistes, piétons, feux, ... P. Morignot EPITA SCIA & CSI - Planification d'actions 34 Architecture 2 niveaux++ Réactif Cognitif Agent robotique Reconnaissance de situation Perception Planification Plan contingent Capteurs Suivi de plan Action Actionneurs Environnement P. Morignot EPITA SCIA & CSI - Planification d'actions 35 Architecture 3 niveaux Agent robotique Délibérateur Algo. 1 … Algo. m Comportement 1 … Comportement n Séquenceur Contrôleur Capteurs Actionneurs Environnement P. Morignot EPITA SCIA & CSI - Planification d'actions 36 Architecture du LAAS Agent robotique Délibératif Système de Raisonnement Procédural (PRS) Planification d’actions (IxTeT) Fonctionnel Exécutif Comportement 1 … Capteurs Comportement n Actionneurs Environnement P. Morignot EPITA SCIA & CSI - Planification d'actions 37 Références (1 / 2) • [Alami et al. 98] R. Alami, R. Chatila, S. Fleury, M. Ghallab, F. Ingrand. An Architecture for Autonomy. In International Journal of Robotics Research (Special Issue on ``Integrated Architectures for Robot Control and Programming''), Vol 17, N° 4, Apri1 1998. LAAS Report N°97352. • [Baille et al. 99] Gérard Baille & al, Le CyCab de l’INRIA Rhône-Alpes. Rapport de recherche de l’INRIA RhôneAlpes n°0229, April 1999 (in French). • [Baltie et al. 07] J. Baltié, E. Bensana, P. Fabiani, J. – L. Farges, S. Millet, P. Morignot, B. Patin, G. Petitjean, G. Pitois, J. – C. Poncet. Multi-Vehicle Missions: Architecture and Algorithms for Distributed On Line Planning. In Dimitri Vrakas and Ioannis Vlahavas (eds.), Artificial Intelligence for Advanced Problem Solving Techniques, Information Science Reference. December 2007. • [Beetz et al. 10] M. Beetz, D. Jain, L. Mösenlechner, M. Tenorth. Towards Performing Everyday Manipulation Activities. Robotics and Autonomous Systems, April 2010. • [Brooks 85] Brooks, R. A. A Robust Layered Control System for a Mobile Robot. In IEEE Journal of Robotics and Automation, Vol. 2, No. 1, March 1986, pp. 14–23. • [Brooks 91] R. Brooks. Intelligence without reason. Proceedings of 12th Int. Joint Conf. on Artificial Intelligence (IJCAI’91), Sydney, Australia, August 1991, pp. 569–595. • [Campa et al. 96] Giampiero Campa, Mario Innocenti, Jacqueline Wilkie. Model-Based Robust Control for a Towed Underwater Vehicle. AIAA Guidance, Navigation and Control Conference, San Diego, California, July 29-31, 1996. • [Gat 98] Gat, E. Three-layer architectures. In D. Kortenkamp et al. Eds. A.I. and mobile robots. AAAI Press, 1998. • [Hayes-Roth et al. 95] Hayes-Roth, B.; Pfleger, K.; Morignot, P.; & Lalanda, P. Plans and Behavior in Intelligent Agents. Knowledge Systems Laboratory, KSL-95-35, Stanford Univ., CA, March, 1995. P. Morignot EPITA SCIA & CSI - Planification d'actions 38 Références (2 / 2) • [Nilsson 80] Nils J. Nilsson. Principles of ArtificialIntelligence. Palo Alto: Tioga. 1980. • [Muscettola et al. 98] N. Muscettota, P. Pandurag Nayak, Barney Pell and B.C. Williams. Remote Agent: to Boldly go where no AI System Has Gone Before. Artificial Intelligence, Elsevier, 103, pp.5-47, 1998. • [Russel 2010] Stuart Russell, Peter Norvig. Artificial Intelligence: A Modern Approach. Prentice Hall, 2010, 3rd edition. Chapitre 11. • [Schoppers 95] Schoppers, M. The use of dynamics in an intelligent controller for a space faring rescue robot. In Artificial Intelligence Journal, 73 (1995):175-230. • [Teichteil et al. 11] F. Teichteil-Königsburg, C. Lesire, G. Infantes. A Generic Framework for Anytime Execution-Driven Planning in Robotics. In Proceedings of the International Conference on Robotics and Automation, Shanghai, China, May 2011, pages 299-304. • [Wolfe et al. 10] J. Wolfe, B. Marthi, S. Russell. Combining Task and Motion Planning for Mobile Manipulation. In Proceedings of the International Conference on Automated Planning and Scheduling, Toronto, Canada, 2010. P. Morignot EPITA SCIA & CSI - Planification d'actions 39 Conclusion • Les hypothèses de la planification classique ne sont pas toujours vérifiées dans la réalité. • La méthode du chemin critique (ordonnancement) est un moyen de représenter l’aspect numérique du temps. • Un plan conditionnel permet de représenter un plan si les actions peuvent échouer. Une recherche ET/OU permet de générer un plan conditionnel. • La re-planification en ligne permet d’entremêler planification et exécution, pour le cas où une action planifiée devient non exécutable. • Un planificateur d’actions peut être intégré de plusieurs façons dans un agent (robotique) --- planification continue via une architecture d’agents. P. Morignot EPITA SCIA & CSI - Planification d'actions 40