300 likes | 497 Views
Creating Architectures with Syndicate and TDL. Ace Project Robotics Institute, Carnegie Mellon September 12, 2007. Outline. What are the layers of Syndicate? Designing a task tree Writing in TDL to create a task tree Exploring concurrency. Syndicate. There are three layers: Planning
E N D
Creating Architectures with Syndicate and TDL Ace Project Robotics Institute, Carnegie Mellon September 12, 2007
Outline • What are the layers of Syndicate? • Designing a task tree • Writing in TDL to create a task tree • Exploring concurrency
Syndicate • There are three layers: • Planning • Executive • Behavioral • But what are the layers? What do they do?
Syndicate Layers: Behavioral • Made up of “blocks” • Each block is a small thread/function/process • Represent hardware capabilities or repeatable behaviors • “Stateless”: relies on current data; no knowledge of past or future • Communicate with sensors • Send commands to robots and get feedback • Communicate data to other blocks
Syndicate Layers: Executive • Made up of “tasks” • Each task is concerned with achieving a single goal • Tasks can be arranged temporally • Spawn subtasks • Enable and connect blocks in the behavioral layer to achieve the task • Enable tell a block to start running • Connect tell blocks to send data to other blocks • Monitor blocks for failure • Provide failure recovery
Syndicate Layers: Planning • Has knowledge of robots’ mission • Receives feedback from system • Decides what tasks to spawn to achieve mission • And on which robots • These tasks form a “task tree”
Syndicate for the Ace Project: Some Examples • Behavioral layer • Block to talk to fiducial tracker • Block to command base and get pos. feedback • Block to command arm and get pos. feedback • Executive layer • Task to pick up plug • Task to move robot to task board • Task to dock plug • No planning layer!
Where is the planning layer? • Planning layer creates task trees online • Based on knowledge of the system • Example: New task to be done. Planner knows which robots are available/capable to achieve it.Spawn the task on the desired robot. • Our tasks are straightforward • Number and type of robots is known • We hard-code our own task tree • One super-task spawns the main tree
Example: Docking a Plug • Let’s start with a simplified version of our scenario • We have one robot • It needs to pick up a plug and then dock it
Docking a Plug • Our main task is RetrieveAndDock • Break it down: • Go up to the stanchion where the plug is • Pick up the plug • Go to the task board • Dock the plug
GoTowardsPlug • Want the robot to go towards the stanchion and put itself in position to get the plug • Spawn additional subtasks • Turn towards the stanchion • Drive to the stanchion • Turn to face the stanchion
PickUpPlug • Plug is in a fixed position • Assign waypoints relative to that position • As robot’s end-effector goes to those waypoints, it picks up plug • Run one visual servo task for each waypoint
Filling in the Task Tree EstimatePoses and MoveArmAndBase run concurrently on our single robot
Shape of the Task Tree • We’ve grouped some tasks into supertasks • Sometimes this is for repeatability and reuse • Like grouping many VisualServo tasks into one VisuallyServoToWaypoints task • Sometimes this is for aesthetics • Like grouping turn/move/turn into one GoTowardsStanchion task
Shape of the Task Tree • This tree is fundamentally the same as the previous one, but is harder to read and understand
Example: Coding in TDL • Assume these tasks exist: • MoveRobotForward (x meters) • TurnRobot (y degrees) • Let’s code the new task ApproachTarget • We’ll use this task twice: • Approaching the stanchion • Approaching the task board
Code for ApproachTarget Goal ApproachTarget (double firstAngle, double moveDist, double secondAngle) { TurnTowardsTarget : spawn TurnRobot (firstAngle); MoveTowardsTarget: spawn MoveRobot (moveDist) WITH SERIAL TurnTowardsTarget; TurnToFaceTarget: spawn TurnRobot (secondAngle) WITH SERIAL MoveTowardsTarget; }
Code for ApproachTarget Just a keyword that says this is not supposed to be a “leaf” in the task tree Goal ApproachTarget (double firstAngle, double moveDist, double secondAngle) { TurnTowardsTarget : spawn TurnRobot (firstAngle); MoveTowardsTarget: spawn MoveRobot (moveDist) WITH SERIAL TurnTowardsTarget; TurnToFaceTarget: spawn TurnRobot (secondAngle) WITH SERIAL MoveTowardsTarget; }
Code for ApproachTarget Parameters to the task Goal ApproachTarget (double firstAngle, double moveDist, double secondAngle) { TurnTowardsTarget : spawn TurnRobot (firstAngle); MoveTowardsTarget: spawn MoveRobot (moveDist) WITH SERIAL TurnTowardsTarget; TurnToFaceTarget: spawn TurnRobot (secondAngle) WITH SERIAL MoveTowardsTarget; }
Code for ApproachTarget Goal ApproachTarget (double firstAngle, double moveDist, double secondAngle) { TurnTowardsTarget : spawn TurnRobot (firstAngle); MoveTowardsTarget: spawn MoveRobot (moveDist) WITH SERIAL TurnTowardsTarget; TurnToFaceTarget: spawn TurnRobot (secondAngle) WITH SERIAL MoveTowardsTarget; } Notice how we call TurnRobotwith different parameters in different task instances
Code for ApproachTarget Goal ApproachTarget (double firstAngle, double moveDist, double secondAngle) { TurnTowardsTarget : spawn TurnRobot (firstAngle); MoveTowardsTarget: spawn MoveRobot (moveDist) WITH SERIAL TurnTowardsTarget; TurnToFaceTarget: spawn TurnRobot (secondAngle) WITH SERIAL MoveTowardsTarget; } In the tree, this is the task name, but this is the actual function being executed
Code for ApproachTarget Goal ApproachTarget (double firstAngle, double moveDist, double secondAngle) { TurnTowardsTarget : spawn TurnRobot (firstAngle); MoveTowardsTarget: spawn MoveRobot (moveDist) WITH SERIAL TurnTowardsTarget; TurnToFaceTarget: spawn TurnRobot (secondAngle) WITH SERIAL MoveTowardsTarget; } Tells the system toexecute this task afterTurnTowardsTarget completes
Code for ApproachTarget Goal ApproachTarget (double firstAngle, double moveDist, double secondAngle) { TurnTowardsTarget : spawn TurnRobot (firstAngle); MoveTowardsTarget: spawn MoveRobot (moveDist) WITH SERIAL TurnTowardsTarget; TurnToFaceTarget: spawn TurnRobot (secondAngle) WITH SERIAL MoveTowardsTarget; } Any questions?
Coding in TDL • Now let’s use ApproachTarget • This code: ApproachTaskBoard: spawn ApproachTarget (30, 2, -30) WITH SERIAL PickUpPlug; • Creates this task tree:
Serial or Concurrent? • We have one robot, so a lot of our tasks are serial with each other • Like turn/move/turn • However, the robot has multiple sensors and controllable pieces • We could have some tasks run concurrently • Read positions from VisTracker while moving arm towards the task board • Move the arm to a safe configuration while moving the base away from the stanchion
More Complicated Task Trees:Example with Multiple Robots • Multiple robots lends itself to more concurrency • Temporal constraints make an acyclic graph