The Ongoing Democratization of
Robotics Development
Paul Foster, Microsoft
Runtime
• CCR - Coordination
and Concurrency
library
• DSS - Distributed
Services Framework
Authoring Tools
• Visual Simulation
Runtime and Editor
• Visual Programming
Language
Services
• Samples and
tutorials
• Robot services
• Robot models
• Technology services
Concurrency And Coordination
Runtime (CCR)
DispatcherDispatcherPort
Dispatcher
Queues
ThreadsArbiterArbiter
HandlerHandler
Arbiter is attached to portArbiter is attached to port
Arbiter is activated on queueArbiter is activated on queue
Dispatcher schedules items
from its queues round-robin
to run in its threads
Dispatcher schedules items
from its queues round-robin
to run in its threadsPost places a message
on the port
Post places a message
on the port
Arbiter checks whether it
can consume the message
Arbiter checks whether it
can consume the message
Creates work item from
message and handler
Creates work item from
message and handler
Enqueue work itemEnqueue work item
Thread calls handler
with message as arg
Thread calls handler
with message as arg
Scheduler picks next
work item to execute
Scheduler picks next
work item to execute
Single-PortSingle-Port
PrimitivesPrimitives
Code-SchedulingCode-Scheduling
(non port-specific)(non port-specific)
Multi-PortMulti-Port
PrimitivesPrimitives
var dispatcher = new Dispatcher(0,”default”);
var queue = new DispatcherQueue(dispatcher);
var port = new Port<string>();
port.Post("Hello, World!");
Arbiter.Activate(queue,
port.Receive(message => Console.WriteLine(message)
)
);
Port: Building block for
sending and receiving
messages
Port: Building block for
sending and receiving
messages
Post: Queues a messagePost: Queues a message
Task: Delegate that
handles the message
(message is consumed)
Task: Delegate that
handles the message
(message is consumed)
Receive coordination
primitive
Receive coordination
primitive
Dispatcher uses fixed
number of threads,
schedules from queues
in round-robin
Dispatcher uses fixed
number of threads,
schedules from queues
in round-robin
Port on which to
receive the message
Port on which to
receive the message
void Start()
{
var queue = new DispatcherQueue();
var port = new Port<string>();
port.Post("Hello"); port.Post(“World”);
Arbiter.Activate(queue,
new IterativeTask(() => Hello(port) )
);
}
IEnumerator<ITask> Hello(Port<string> port)
{
for(var i=0; i<5; i++)
{
yield return port.Receive();
var message = (string)port;
Console.WriteLine(message);
}
Schedule iterative taskSchedule iterative task
Lambda captures
arguments for iterator
Lambda captures
arguments for iterator
Yield execution until
receive is satisfied
Yield execution until
receive is satisfied
Item retrieved
after yield
Item retrieved
after yield
Loops around
asynchronous
operations are easy
Loops around
asynchronous
operations are easy
CCR Concurrent
Processing
Decentralized Software
Services (DSS)
Microsoft Open Specification PromiseMicrosoft Open Specification PromiseMicrosoft Open Specification PromiseMicrosoft Open Specification Promise
<DriveState
<Connected>true</Connected>
<DistanceBetweenWheels>0.112</DistanceBetweenWheels>
<LeftWheel>
…
</LeftWheel>
<RightWheel>
…
</RightWheel>
<PollingFrequencyMs>80</PollingFrequencyMs>
<TimeStamp>2007-10-10T13:07:45.5195866-07:00</TimeStamp>
</DriveState>
Flexible UI
Service Orchestration
[Contract(Contract.Identifier)]
class RecordKeeperService : DsspServiceBase
{
[Partner(“PeopleLookup”,
Policy = PartnerCreationPolicy.UseExistingOrCreate,
Optional = false)]
peopleLookup.OperationsPort _peopleLookupPort =
peopleLookup.OperationsPort();
[ServicePort(“/recordkeeper”,AllowMultipleInstances = true]
OperationsPort _mainPort;
protected override void Start()
{
base.Start();
}
}
Declarative, dynamic
composition, annotations
picked up by visual editor
Declarative, dynamic
composition, annotations
picked up by visual editor
Attach handlers to operation
port, publish instance URI in
service directory
Attach handlers to operation
port, publish instance URI in
service directory
[ServiceHandler(ServiceHandlerBehavior.Concurrent)]
public IEnumerator<ITask> QueryHandler(Query queryOp)
{
var response = FindItem(queryOp.Body);
queryOp.ResponsePort.Post(response);
yield break;
}
[ServiceHandler(ServiceHandlerBehavior.Exclusive)]
public IEnumerator<ITask> UpdateHandler(Update updateOp)
{
QueryAge queryAgeOp;
yield return _peopleLookupPort.Query(out queryAgeOp);
int age = (int) queryAgeOp.ResponsePort;
UpdateRecord(age, updateOp.Body.Name);
updateOp.ResponsePort.Post(new UpdateResponse());
CCR Interleave is iterator-aware,
guaranteeing atomicity across
asynchronous steps
CCR Interleave is iterator-aware,
guaranteeing atomicity across
asynchronous steps
Create causality at root
of execution graph
Create causality at root
of execution graph
Failure occurs on one
of the side branches
Failure occurs on one
of the side branchesDeal with error as
message at origin
of execution
Deal with error as
message at origin
of execution
DSS/CCR
LogSync Sample
Building applications with Microsoft
Robotics Developer Studio
Building a custom robot
and environment
Available DSS servicesAvailable DSS services
RequestRequest
NotificationNotification
ResponseResponse
Service instanceService instance
VPL Explorer
MRDS 2008 Licensing
Academic Edition Researchers and Students. Free unlimited runtime
distribution. Via Academic Portal.
Standard Edition Professional Developers. Free unlimited runtime
distribution $499
Express Edition Hobbyists. Not permitted to distribute runtime $Free
More information at http://microsoft.com/robotics
• http://imaginecup.com/
• Robotics and Algorithm challenge
– Interpreting, solution design, best algorithm
– Robotics in a virtual environment
• 2009 Worldwide Finals: Egypt
– The robots are real!
Summary:
– Simpler concurrency and distributed computing
– Reusable components and standardization
– Lower barrier to entry
– All of these advantages are now available for
mobile, embedded, desktop and server
platforms.
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.
The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market
conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation.
MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

The Ongoing Democratization of Robotics Development

  • 1.
    The Ongoing Democratizationof Robotics Development Paul Foster, Microsoft
  • 3.
    Runtime • CCR -Coordination and Concurrency library • DSS - Distributed Services Framework Authoring Tools • Visual Simulation Runtime and Editor • Visual Programming Language Services • Samples and tutorials • Robot services • Robot models • Technology services
  • 8.
  • 11.
    DispatcherDispatcherPort Dispatcher Queues ThreadsArbiterArbiter HandlerHandler Arbiter is attachedto portArbiter is attached to port Arbiter is activated on queueArbiter is activated on queue Dispatcher schedules items from its queues round-robin to run in its threads Dispatcher schedules items from its queues round-robin to run in its threadsPost places a message on the port Post places a message on the port Arbiter checks whether it can consume the message Arbiter checks whether it can consume the message Creates work item from message and handler Creates work item from message and handler Enqueue work itemEnqueue work item Thread calls handler with message as arg Thread calls handler with message as arg Scheduler picks next work item to execute Scheduler picks next work item to execute
  • 12.
  • 13.
    var dispatcher =new Dispatcher(0,”default”); var queue = new DispatcherQueue(dispatcher); var port = new Port<string>(); port.Post("Hello, World!"); Arbiter.Activate(queue, port.Receive(message => Console.WriteLine(message) ) ); Port: Building block for sending and receiving messages Port: Building block for sending and receiving messages Post: Queues a messagePost: Queues a message Task: Delegate that handles the message (message is consumed) Task: Delegate that handles the message (message is consumed) Receive coordination primitive Receive coordination primitive Dispatcher uses fixed number of threads, schedules from queues in round-robin Dispatcher uses fixed number of threads, schedules from queues in round-robin Port on which to receive the message Port on which to receive the message
  • 14.
    void Start() { var queue= new DispatcherQueue(); var port = new Port<string>(); port.Post("Hello"); port.Post(“World”); Arbiter.Activate(queue, new IterativeTask(() => Hello(port) ) ); } IEnumerator<ITask> Hello(Port<string> port) { for(var i=0; i<5; i++) { yield return port.Receive(); var message = (string)port; Console.WriteLine(message); } Schedule iterative taskSchedule iterative task Lambda captures arguments for iterator Lambda captures arguments for iterator Yield execution until receive is satisfied Yield execution until receive is satisfied Item retrieved after yield Item retrieved after yield Loops around asynchronous operations are easy Loops around asynchronous operations are easy
  • 15.
  • 16.
  • 18.
    Microsoft Open SpecificationPromiseMicrosoft Open Specification PromiseMicrosoft Open Specification PromiseMicrosoft Open Specification Promise
  • 19.
  • 23.
    [Contract(Contract.Identifier)] class RecordKeeperService :DsspServiceBase { [Partner(“PeopleLookup”, Policy = PartnerCreationPolicy.UseExistingOrCreate, Optional = false)] peopleLookup.OperationsPort _peopleLookupPort = peopleLookup.OperationsPort(); [ServicePort(“/recordkeeper”,AllowMultipleInstances = true] OperationsPort _mainPort; protected override void Start() { base.Start(); } } Declarative, dynamic composition, annotations picked up by visual editor Declarative, dynamic composition, annotations picked up by visual editor Attach handlers to operation port, publish instance URI in service directory Attach handlers to operation port, publish instance URI in service directory
  • 24.
    [ServiceHandler(ServiceHandlerBehavior.Concurrent)] public IEnumerator<ITask> QueryHandler(QueryqueryOp) { var response = FindItem(queryOp.Body); queryOp.ResponsePort.Post(response); yield break; } [ServiceHandler(ServiceHandlerBehavior.Exclusive)] public IEnumerator<ITask> UpdateHandler(Update updateOp) { QueryAge queryAgeOp; yield return _peopleLookupPort.Query(out queryAgeOp); int age = (int) queryAgeOp.ResponsePort; UpdateRecord(age, updateOp.Body.Name); updateOp.ResponsePort.Post(new UpdateResponse()); CCR Interleave is iterator-aware, guaranteeing atomicity across asynchronous steps CCR Interleave is iterator-aware, guaranteeing atomicity across asynchronous steps
  • 25.
    Create causality atroot of execution graph Create causality at root of execution graph Failure occurs on one of the side branches Failure occurs on one of the side branchesDeal with error as message at origin of execution Deal with error as message at origin of execution
  • 27.
  • 28.
    Building applications withMicrosoft Robotics Developer Studio
  • 30.
    Building a customrobot and environment
  • 31.
    Available DSS servicesAvailableDSS services RequestRequest NotificationNotification ResponseResponse Service instanceService instance
  • 32.
  • 35.
    MRDS 2008 Licensing AcademicEdition Researchers and Students. Free unlimited runtime distribution. Via Academic Portal. Standard Edition Professional Developers. Free unlimited runtime distribution $499 Express Edition Hobbyists. Not permitted to distribute runtime $Free More information at http://microsoft.com/robotics
  • 36.
    • http://imaginecup.com/ • Roboticsand Algorithm challenge – Interpreting, solution design, best algorithm – Robotics in a virtual environment • 2009 Worldwide Finals: Egypt – The robots are real!
  • 37.
    Summary: – Simpler concurrencyand distributed computing – Reusable components and standardization – Lower barrier to entry – All of these advantages are now available for mobile, embedded, desktop and server platforms.
  • 38.
    © 2008 MicrosoftCorporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Editor's Notes

  • #41 The object of the Robotics and Algorithm Competition is to test the competitors on their knowledge and skills for interpreting, designing a solution, and coding the best algorithms that will address the challenges of each Round of the Invitational. Robotics will be the virtual environment for the competitors until the moment they reach the Worldwide Finals when they will have to code the real ones.
  • #42 SESSION SUMMARY. PROVIDE A SUMMARY FOR YOUR SESSION. REVIEW COVERED TOPICS WITH AUDIENCE.