Modelbased Hierarchical Control of a Mobile Manipulation ... · Timelinebased Execution A Timeline...

24
 Model-based Hierarchical Control of a Mobile Manipulation Platform

Transcript of Modelbased Hierarchical Control of a Mobile Manipulation ... · Timelinebased Execution A Timeline...

Page 1: Modelbased Hierarchical Control of a Mobile Manipulation ... · Timelinebased Execution A Timeline describes the evolution of a state variable in the past, present and future. A Plan

 

Model­based Hierarchical Control of a 

Mobile Manipulation Platform

Page 2: Modelbased Hierarchical Control of a Mobile Manipulation ... · Timelinebased Execution A Timeline describes the evolution of a state variable in the past, present and future. A Plan

 

Outline

● Motivation● Related Work● Key TREX Concepts● Field Trials with PR2● Next steps

Page 3: Modelbased Hierarchical Control of a Mobile Manipulation ... · Timelinebased Execution A Timeline describes the evolution of a state variable in the past, present and future. A Plan

 

The Robot Programmer's Dilemma● Many components to integrate & 

manage● Often, there are interactions 

among components● Often many alternatives to 

consider to achieve good behavior

● Choices made in­situ● Murphy's Law is true

– Everything that can go wrong will

Page 4: Modelbased Hierarchical Control of a Mobile Manipulation ... · Timelinebased Execution A Timeline describes the evolution of a state variable in the past, present and future. A Plan

 

Case Study – The PR2 Triathlon

DRIVE●Topological/Metric Map●Regions and Connectors●Doorways, Doors and Outlets

OPEN DOOR●Clear, Open, Locked, Latched●Door/Handle Detection & Manipulation●Whole­body Control

RECHARGE●Plug & Outlet Detection●Plug Manipulation●Visual Servoing

10 Recharge Goals distributed around the building, to be achieved in under 2 hours

Page 5: Modelbased Hierarchical Control of a Mobile Manipulation ... · Timelinebased Execution A Timeline describes the evolution of a state variable in the past, present and future. A Plan

 

Case Study – The PR2 Triathlon● Long term planning for top­level goals● Large number of components

– 25 robot action primitives + other nodes– 5 mechanisms ­ arm, base, head, tilt_laser, gripper– 20 low­level, real­time controllers

● Concurrent actions– while moving through the door, push it

● Precedence constraints– push_door must start before move_base_door 

Page 6: Modelbased Hierarchical Control of a Mobile Manipulation ... · Timelinebased Execution A Timeline describes the evolution of a state variable in the past, present and future. A Plan

 

Case Study – The PR2 Triathlon● Safety Constraints

– The arm must be stowed while driving– The plug must be on the base while driving

● Configuration Interactions– The tilt laser must be running while driving

–  unlatch_handle requires● r_arm_cartesian_wrench_controller● r_arm_cartesian_twist_controller● r_arm_cartesian_pose_controller● r_arm_cartesian_trajectory_controller

Page 7: Modelbased Hierarchical Control of a Mobile Manipulation ... · Timelinebased Execution A Timeline describes the evolution of a state variable in the past, present and future. A Plan

 

Case Study – The PR2 Triathlon● Discrete States

– Controller is up or down– Plug stowed or not

● Continuous States– Battery level (M1)– Base pose

● Uncertainty– Action duration– Action SUCCESS or FAILURE– Action Feedback Parameters

Page 8: Modelbased Hierarchical Control of a Mobile Manipulation ... · Timelinebased Execution A Timeline describes the evolution of a state variable in the past, present and future. A Plan

 

Related Work

DeliberativePlanner

ReactiveExecutive

ActionsSkills

BehaviorsCommands

ReactiveExecutive

ProceduresScriptsPlans

Goals

ActionsSkills

BehaviorsCommands

DeliberativePlanner

ReactivePlanner

ActionsSkills

BehaviorsCommands

Model

Goals

Model

ActionsSkills

BehaviorsCommands

Planner

Goals

Model

Structured Reactive Controllers (Beetz00)Kirk (Kim01), Titan (Williams03)

IDEA(Muscettola02)

TREX (McGann08*)3T (Bonasso97)Remote Agent (Muscettola98)

LAAS (Alami98)Saphira(Konolige96)

PRS (Georgeff89)PRS­Lite (Meyers96)Colbert (Konolige97)

RAP(Firby87)TDL(Simmons98)

Planner

Planner

Reactive ExecutiveNo Planning

Add 'Deliberative' PlannerLimited Scope for planningLose integration

Expand scope of PlanningShared modelsTighter Integration

Evolved from IDEAPlanning is ubiquitousDivide­and­conquer by designShared models at all levelsImplementation based directly on EUROPA (Frank03)

Page 9: Modelbased Hierarchical Control of a Mobile Manipulation ... · Timelinebased Execution A Timeline describes the evolution of a state variable in the past, present and future. A Plan

 

Key TREX Concepts

● Timelines, Tokens & Timeline­based Execution● Sense­Plan­Act and the Wonder Widget

– The reusable DeliberativeReactor– Planning can be trivial

● Divide­and­conquer– Partitioning and Composition

Page 10: Modelbased Hierarchical Control of a Mobile Manipulation ... · Timelinebased Execution A Timeline describes the evolution of a state variable in the past, present and future. A Plan

 

Timeline­based Execution

●A Timeline describes the evolution of a state variable in the past, present and future.●A Plan is thus a desired trajectory for a state variable, captured as a timeline.●A Timeline is naturally mapped to executing code.

Client­side

Server­side

A temporally flexible, partial plan (move_base)

A grounded execution history (move_base)

Page 11: Modelbased Hierarchical Control of a Mobile Manipulation ... · Timelinebased Execution A Timeline describes the evolution of a state variable in the past, present and future. A Plan

 

The Wonder WidgetA Teleo­Reactor

●A general purpose component that integrates planning and execution●Continuous Sense­Plan­Act loop●Can span a spectrum of reactive and deliberative behavior●Leverages automated planning to augment programmer●Renders programs model­compliant by construction

Page 12: Modelbased Hierarchical Control of a Mobile Manipulation ... · Timelinebased Execution A Timeline describes the evolution of a state variable in the past, present and future. A Plan

 

Divide­and­Conquer

● A software agent can be viewed as a collection of concurrent control loops (a.k.a. [Teleo­]Reactors).

• Reactors are differentiated by– functional scope – which state variables to consider– temporal scope ­ how far to look ahead

• Reactors have internal and external state– they share as little state as possible– they share as much state as necessary– they can task each other, allowing composition

● Composition of Wonder­Widgets & other variants as needed

Application of good engineering principles to achieve scalability and manage complexity.

Page 13: Modelbased Hierarchical Control of a Mobile Manipulation ... · Timelinebased Execution A Timeline describes the evolution of a state variable in the past, present and future. A Plan

 

• π = 22 hrs• λ = 60 s

• π = 5 s• λ = 1 s

• π = 1 s• λ = 0 s

Divide­and­Conquer (AUV)Information Exchange

Courtesy: Frederic Py, MBARI

Page 14: Modelbased Hierarchical Control of a Mobile Manipulation ... · Timelinebased Execution A Timeline describes the evolution of a state variable in the past, present and future. A Plan

 

A Running Example (AUV)

14Courtesy: Frederic Py, MBARI

Page 15: Modelbased Hierarchical Control of a Mobile Manipulation ... · Timelinebased Execution A Timeline describes the evolution of a state variable in the past, present and future. A Plan

 

Case Study – The PR2 Triathlon

DRIVE●Topological/Metric Map●Regions and Connectors●Doorways, Doors and Outlets

OPEN DOOR●Clear, Open, Locked, Latched●Door/Handle Detection & Manipulation●Whole­body Control

RECHARGE●Plug & Outlet Detection●Plug Manipulation●Visual Servoing

10 Recharge Goals distributed around the building, to be achieved in under 2 hours

Page 16: Modelbased Hierarchical Control of a Mobile Manipulation ... · Timelinebased Execution A Timeline describes the evolution of a state variable in the past, present and future. A Plan

 

Divide­and­Conquer (PR2)(Partitioning and Composition)

The Reactor Topology for the PR2 Triathlon

reactor­name(lookahead, latency, I, E)●Can close control loops locally●Can recover locally●Can simplify by separating out separable parts●Can and did develop & test incrementally

Actually, each external action is aninstance of a TeleoReactor which isan adapter to a ROS robot action

Page 17: Modelbased Hierarchical Control of a Mobile Manipulation ... · Timelinebased Execution A Timeline describes the evolution of a state variable in the past, present and future. A Plan

 

A State Machine for Door Opening

Page 18: Modelbased Hierarchical Control of a Mobile Manipulation ... · Timelinebased Execution A Timeline describes the evolution of a state variable in the past, present and future. A Plan

 

Door Controller Class Declarationclass DoorController extends AgentTimeline {  // Idle  predicate Inactive{}  // Checking the doorway to see if we can drive thru without having to contact the door  predicate CheckingDoorway{}  // For positioning the robot at the approach point to the door from which it can detect the door  predicate Positioning{}  // For detecting the door.  predicate DetectingDoor{}  // For detecting the handle.  predicate DetectingHandle{}  // For moving towards the door. Used prior to grasping, and/or opening the door  predicate ApproachingDoor{}  // Just to grab the handle. Relevant if the door is latched  predicate GraspingHandle{}  // Just to unlatch the handle. Relevant if the door is latched  predicate UnlatchingHandle{}  // To simply drive thru the doorway with no door contact. Requires a clear path  predicate DriveThruDoorway{}  // To actually physically open the door which requires base and arm motion. The base must drive  // through while contact the door either with or without the handle  predicate OpenDoor{    bool use_handle;  }  // Constructor  DoorController(){ super(Internal, “Inactive”); }};

Page 19: Modelbased Hierarchical Control of a Mobile Manipulation ... · Timelinebased Execution A Timeline describes the evolution of a state variable in the past, present and future. A Plan

 

Simple Decomposition Rule for DetectingDoor

DoorController::DetectingDoor{  // Detect door action  contains(detect_door.Active cmd);  ends cmd;  // if we succeed, then depending on the latch state we can go straight for the door  // or we need to detect the handle first. If it fails, maybe the door has been opened!    // We might as well check the doorway for a clear path again  if(isSucceded(cmd.object) == true){    cmd meets(detect_door.Inactive cmd_feedback);    if(cmd_feedback.latch_state == LATCH_STATE_UNLATCHED){      meets(ApproachingDoor);    }    else{      meets(DetectingHandle);    }  }  else {    meets(CheckingDoorway);  }}

Page 20: Modelbased Hierarchical Control of a Mobile Manipulation ... · Timelinebased Execution A Timeline describes the evolution of a state variable in the past, present and future. A Plan

 

Decomposition for OpenDoorDoorController::OpenDoor{  contained_by(doorman.Active);  contains(move_base_door.Active cmd_move_base_door);  cmd_move_base_door.max_duration <= MOVE_BASE_DOOR_DURATION_BOUND;  cmd_move_base_door before(stop_action.Active cmd_stop_action);

  // Conditionally generate steps with or without the handle  if(use_handle == true){    contains(open_door.Active cmd_open_door);    cmd_open_door starts_before cmd_move_base_door;    cmd_stop_action.action_name == "open_door";    ends cmd_open_door;  }  else {    // Need to touch the door and then push it. Both must succeed    contains(touch_door.Active cmd_touch_door);    cmd_touch_door before(push_door.Active cmd_push_door);    cmd_push_door starts_before cmd_move_base_door;    isSucceded(cmd_touch_door.object) == true;    cmd_stop_action.action_name == "push_door";    cmd_push_door.end == end;  }  // Disjunction for successor state  if(isSucceded(cmd_move_base_door.object)){    meets(Inactive s);    s.status == SUCCESS;  }  else{    meets(OpenDoor s);    s.use_handle == false;  }}

Page 21: Modelbased Hierarchical Control of a Mobile Manipulation ... · Timelinebased Execution A Timeline describes the evolution of a state variable in the past, present and future. A Plan

 

Generative Planning to Augment Programmer

RechargeController::Positioning{  contained_by(recharger.Active rc);  if(isTimedOut(rc.object)){    duration == 1;    meets(Inactive s);    s.status == PREEMPTED;  }  else {    contains(move_base.Active cmd);    ends cmd;    isSucceded(cmd.object) == true;    cmd.max_duration <= MOVE_BASE_DURATION_BOUND;    // Bind pose based on approach pose for the outlet    map_get_outlet_approach_pose(cmd.x, cmd.y, cmd.z,                                                         cmd.qx, cmd.qy, cmd.qz, cmd.qw, rc.outlet_id);    cmd.frame_id == rc.frame_id;    meets(FindingOutlet);  }}

●Programmer specifies what should happen in the local context of the recharge controller state machine.●The model and the planner fill in details based on model constraints. 

Page 22: Modelbased Hierarchical Control of a Mobile Manipulation ... · Timelinebased Execution A Timeline describes the evolution of a state variable in the past, present and future. A Plan

 

Quantitative & Qualitative ResultsMeasurement ValueExecutive control rate 10 Hz

476687

Mission duration 3799 secsTotal number of actions executed 494Total number of action failures 29Total number of planning cycles 907Memory consumption of the executive 10 MBEstimated model line count 1207TREX CPU utilization (mean) 9.80%TREX CPU utilization (std) 5.00%

Total number of internal timelinesTotal number of external timelinesTotal number of EUROPA timelines

Explanation of timeline counts●26 RCS internal state variables●21 TREX internal state variables●Replicated timelines in EUROPA = 87­47 = 40●87 = 66 + 47 ­ 26

Explanation of action statistics●Many actions for tilt_laser configuration and controller switching●Failure implies action aborted or timed out●Planning cycle is initiated whenever reactor receives a goal, or flaw entailed by the model

Qualitative Assessments●The model size was very modest for a demonstration of this scale●Computational resources were also quite modest●Control rate of 10 Hz is quite 'snappy' for action transitions●The model provides a very high­level way to program a robot●The use of the model and plan database for augmenting programming is very powerful (simple planning – no search typically)

Page 23: Modelbased Hierarchical Control of a Mobile Manipulation ... · Timelinebased Execution A Timeline describes the evolution of a state variable in the past, present and future. A Plan

 

Thank you!

● NASA for ongoing collaboration on EUROPA, and making it available.

● MBARI– seeding open­source TREX code base with version 

developed for the AUV. – Kanna Rajan & Frederic Py for ongoing 

collaboration.

● Willow Garage for supporting the work.

Page 24: Modelbased Hierarchical Control of a Mobile Manipulation ... · Timelinebased Execution A Timeline describes the evolution of a state variable in the past, present and future. A Plan

 

References● [Alami98] R. Alami, R. Chatila, S. Fleury, M. Ghallab, F. Ingrand. International Journal of Robotics Research (Special Issue on ``Integrated Architectures 

for Robot Control and Programming'', Vol 17, N° 4, Apri1 1998).

● [Allen83] James F. Allen. Maintaining Knowledge about Temporal Intervals. Communications of the ACM, 26(11):832­843. 1983

● [Beetz00] Michael Beetz.  Runtime Plan Adaptation in Structured Reactive Controllers. ICAA, 2000

● [Bonasso97] R. Peter Bonasso, R. James Firby, Erann Gat, David Kortenkamp, David P. Miller, Marc G. Slack: Experiences with an architecture for intelligent, reactive agents. J. Exp. Theor. Artif. Intell. 9(2­3): 237­256 (1997)

● [Dechetr91] Rina Dechter, Itay Meiri, Judea Pearl: Temporal Constraint Networks. Artif. Intell. 49(1­3): 61­95 (1991)

● [Firby87] R. James Firby.  An Investigation into Reactive Planning in Complex Domains. AAAI 1987: 202­206 

● [Frank03] J. Frank and A. K. Jonsson: Constraint­based Attribute and Interval Planning. Constraints 8(4): 339­364

● [Georgeff89]  M. P.  Georgeff and A. L. Lansky,  (1987). Reactive reasoning and planning. In Proceedings of the Sixth National Conference on Artificial Intelligence (AAAI­87), pages 677­682, Seattle, WA. 

● [Kim01] P. Kim, B. C. Williams, and Mark Abramson. Executing Reactive, Model­based Programs through Graph­based Temporal Planning. IJCAI 2001.

● [Konolige97] K. Konolige. Colbert: A language for reactive control in sapphira. In G. Brewka, C. Habel, and B. Nebel, editors, Advances in Artificial Intelligence, volume 1303 of Lecture Notes in Computer Science. Springer, 1997

● [McGann08a] C. McGann, F. Py, K. Rajan, H. Thomas, R. Henthorn, R. McEwen. A deliberative architecture for AUV control. ICRA, 2008, 1049­1054.

● [McGann08b] C. McGann, F. Py, K. Rajan, J. Ryan, R. Henthron. Adaptive Control for Autonomous Underwater Vehicles. AAAI, 2008, 1319­1324.

● [Muscettola98] Nicola Muscettola, P. Pandurang Nayak, Barney Pell, Brian C. Williams. Remote Agent: To Boldly Go Where No AI System Has Gone Before. AI 103{1­2):5­47

● [Muscettola02] Nicola Muscettola and Gregory A. Dorais and Chuck Fry and Richard Levinson and Christian Plaunt. IDEA: Planning at the Core of Autonomous Reactive Agents. 3rd International NASA Workshop on Planning and Scheduling for Space. 2002.

● [Nilsson84] Nils J. Nilsson, ed. Shakey the Robot. SRI Technical Note no 323 (1984), SRI, Menlo Park, California.

● [Nilsson94] Nils J. Nilsson. Teleo­Reactive Programs for Agent Control. J. Artif. Intell. Res. (JAIR),1:139­158

● [Simmons98] Reid Simmons ,  David Apfelbaum: A Task Description Language for Robot Control. IROS, 1998 

● [Williams03] Brian C. Williams and Michel D. Ingham and Seung H. Chung and Paul H. Elliott. Model­Based Programming of Intelligent Embedded Systems and Robotic Space Explorers. IEEE: Special Issue on Modeling and Design of Embedded Software (212­237), 2003.