Robotics Tutorial Controlling a Robot with MSRS

Slides:



Advertisements
Similar presentations
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Advertisements

© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Preface Demo A Quick Thank You How Did We Do It?
Windows 8 (1) (2) (3) Windows 8 (1) (2) (3)
Feature: Identity Management - Login © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
© 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Feature: Reprint Outstanding Transactions Report © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
Feature: Purchase Requisitions - Requester © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
MIX 09 4/15/ :14 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
demo Default WANGPSLookup Default WANGPS.
Co- location Mass Market Managed Hosting ISV Hosting.
Windows 7 Training Microsoft Confidential. Windows ® 7 Compatibility Version Checking.
Multitenant Model Request/Response General Model.
Feature: Purchase Order Prepayments II © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
Announcing Demo Announcing.
Feature: OLE Notes Migration Utility
Feature: Web Client Keyboard Shortcuts © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
Feature: SmartList Usability Enhancements © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
Session 1.
Built by Developers for Developers…. © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
 Rico Mariani Architect Microsoft Corporation.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Assign an Item to Multiple Sites © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Print Remaining Documents © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
Connect with life Connect with life
Windows Azure Connect Name Title Microsoft Corporation.
NEXT: Overview – Sharing skills & code.
demo Receive Inventory Export Parse and Normalize.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Document Attachment –Replace OLE Notes © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
Feature: Suggested Item Enhancements – Sales Script and Additional Information © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows.
Microsoft Visual Programming Language Advanced Example.
Building Social Games for Windows 8 with Windows Azure Name Title Microsoft Corporation.
Feature: Customer Combiner and Modifier © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
Feature: Employee Self Service Timecard Entry © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
Ian Ellison-Taylor General Manager Microsoft Corporation PC27.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
demo Instance AInstance B Read “7” Write “8”

customer.
demo © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
demo Demo.
Feature: Void Historical/Open Transaction Updates © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
demo QueryForeign KeyInstance /sm:body()/x:Order/x:Delivery/y:TrackingId1Z
Feature: Suggested Item Enhancements – Analysis and Assignment © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and.
projekt202 © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
The CLR CoreCLRCoreCLR © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
Sr. Dir. – Systems Architecture Inlet Technologies.

IoCompleteRequest (Irp);... p = NULL; …f(p);
Ctrl-K, X Ctrl-K, S
demo User Signs Up Temporary Account is Created with Verification Link Sent User Clicks Link Account is Activated Login.Register(userName,
Возможности Excel 2010, о которых следует знать
Title of Presentation 11/22/2018 3:34 PM
Office Mac /30/2018 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Title of Presentation 12/2/2018 3:48 PM
1/3/2019 1:21 PM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
8/04/2019 9:13 PM © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Виктор Хаджийски Катедра “Металургия на желязото и металолеене”
Title of Presentation 5/12/ :53 PM
Шитманов Дархан Қаражанұлы Тарих пәнінің
Title of Presentation 5/24/2019 1:26 PM
Title of Presentation 7/24/2019 8:53 PM
Presentation transcript:

Robotics Tutorial Controlling a Robot with MSRS

Robotics Tutorial David Lee Sr. Software Development Engineer Microsoft Corporation Controlling a Robot with Microsoft Robotics Studio

Overview The Idea Write an MSRS Application which will: Drive a LEGO NXT Tribot Open a Direction Dialog Wait for Button Press Send Commands to the Robot Stop when the button is released DialogDrive Application

Overview The Idea Write an MSRS Application which will: Drive a LEGO NXT Tribot Open a Direction Dialog Wait for Button Press Send Commands to the Robot Stop when the button is released Direction Dialog State DialogDrive Generic Differential Drive State

Robotics Tutorial Prerequisites A basic understanding of MSRS To create this demo yourself Visual Studio Pro or Express A basic knowledge of CSharp A LEGO NXT which has already been paired with your Bluetooth adapter

Overview Direction Dialog MSRS Sample Service Five Buttons Two Notifications ButtonPressButtonReleaseName:LeftRightForwardsBackwards Stop Direction Dialog State

Overview Generic Differential Drive Very simple drive system Controlled by applying power individually to the left and right motors SetDrivePower Action LeftWheelPower, RightWheelPower: values between -1.0 and 1.0 (double) Generic Differential Drive State

Overview Generic Differential Drive Generic Contract Intended to be implemented by multiple services Describes the state and behavior of a service Identified by a unique contract Generic Differential Drive Contract: MSRS ships with several Differential Drive services: Lego “NXT Generic Drive” “iRobot® Generic Drive” “Simulated Generic Differential Drive” Pioneer “Arcos Drive” “Traxster Generic Drive” Generic Differential Drive State

Overview DialogDrive Create a Service DssNewService.exe Partner with the Generic Differential Drive Partner with the Direction Dialog sample Coordination Use direction buttons to drive the Robot Test the Service Generic contracts and switching hardware DialogDrive State

Overview DialogDrive MethodsStart()InitializationSubscribeToDirectionDialog() Send Button Notifications to my Handlers DialogButtonPressHandler() “Forwards”, “Backwards” “Left”, “Right”, “Stop” DialogButtonReleaseHandler() Stop Driving DialogDrive State

Dialog Drive Application

Robotics Tutorial Creating a Service DssNewService.exe dssnewservice /service:DialogDrive Partner with your mobile Robot Add references: RoboticsCommon.Proxy.dllDirectionDialog.Y2006.M08.proxy.dll Add using … with namespace prefix: using dialog = Microsoft.Robotics.Services.Sample.DirectionDialog.Proxy; using drive = Microsoft.Robotics.Services.Drive.Proxy;

Robotics Tutorial Creating a Service Set up Operation Ports for the dialog and drive services. CreateAlways vs. UseExisting [Partner("dialog", Contract = dialog.Contract.Identifier, CreationPolicy = PartnerCreationPolicy.CreateAlways)] CreationPolicy = PartnerCreationPolicy.CreateAlways)] private dialog.DirectionDialogOperations _dialogPort = new dialog.DirectionDialogOperations(); [Partner("drive", Contract = drive.Contract.Identifier, CreationPolicy = PartnerCreationPolicy.UseExisting)] CreationPolicy = PartnerCreationPolicy.UseExisting)] private drive.DriveOperations _drivePort = new drive.DriveOperations();

Robotics Tutorial Creating a Service On Start, enable the drive and Subscribe to “button” Notifications protected override void Start() { base.Start(); base.Start(); _drivePort.EnableDrive( _drivePort.EnableDrive( new drive.EnableDriveRequest(true)); SubscribeToDirectionDialog(); SubscribeToDirectionDialog();}

Robotics Tutorial Creating a Service Listen for button pressed and released and call the appropriate handler. private void SubscribeToDirectionDialog() { dialog.DirectionDialogOperations dialogNotifications = new dialog.DirectionDialogOperations(); _dialogPort.Subscribe(dialogNotifications); Activate<ITask>( Arbiter.Receive ( true, Arbiter.Receive ( true, dialogNotifications, DialogButtonPressHandler), dialogNotifications, DialogButtonPressHandler), Arbiter.Receive ( true, Arbiter.Receive ( true, dialogNotifications, DialogButtonReleaseHandler)); dialogNotifications, DialogButtonReleaseHandler));}

Robotics Tutorial Coordination Dialog Button Press Handler “Name” identifies which button was pressed. While the button is being pressed, start driving our robot in the specified direction. private void DialogButtonPressHandler (dialog.ButtonPress buttonPress) private void DialogButtonPressHandler (dialog.ButtonPress buttonPress) { LogInfo(LogGroups.Console, buttonPress.Body.Name + " Pressed"); LogInfo(LogGroups.Console, buttonPress.Body.Name + " Pressed"); switch (buttonPress.Body.Name) switch (buttonPress.Body.Name) { case "Forwards": _drivePort.SetDrivePower(new _drivePort.SetDrivePower(new drive.SetDrivePowerRequest(1.0, 1.0)); break; break;

Robotics Tutorial Coordination Dialog Button Press Handler case "Forwards": _drivePort.SetDrivePower(new drive. SetDrivePowerRequest(1.0, 1.0) ); _drivePort.SetDrivePower(new drive. SetDrivePowerRequest(1.0, 1.0) ); break; break; case "Left": _drivePort.SetDrivePower(new drive. SetDrivePowerRequest(-1.0, 1.0) ); _drivePort.SetDrivePower(new drive. SetDrivePowerRequest(-1.0, 1.0) ); break; break; case "Right": _drivePort.SetDrivePower(new drive. SetDrivePowerRequest(1.0, -1.0) ); _drivePort.SetDrivePower(new drive. SetDrivePowerRequest(1.0, -1.0) ); break; break; case "Backwards": _drivePort.SetDrivePower(new drive. SetDrivePowerRequest(-1.0, -1.0) ); _drivePort.SetDrivePower(new drive. SetDrivePowerRequest(-1.0, -1.0) ); break; break; case "Stop": _drivePort.SetDrivePower(new drive. SetDrivePowerRequest(0, 0) ); _drivePort.SetDrivePower(new drive. SetDrivePowerRequest(0, 0) ); break; break;

Robotics Tutorial Coordination Button Release Notifications Stop driving when a button is released private void DialogButtonReleaseHandler( dialog.ButtonRelease buttonRelease) dialog.ButtonRelease buttonRelease){ LogInfo(LogGroups.Console, LogInfo(LogGroups.Console, buttonRelease.Body.Name + " Released"); buttonRelease.Body.Name + " Released"); _drivePort.SetDrivePower( _drivePort.SetDrivePower( new drive.SetDrivePowerRequest(0, 0)); new drive.SetDrivePowerRequest(0, 0));}Compile!

Robotics Tutorial Test the Service Manifests A Manifest contains a list of services to be started DssNewService created a default manifest: DialogDrive.manifest.xml The DirectionDialog service was marked “CreateAlways” It will be started automatically by our service. LEGO “NXT Generic Drive” is instantiated by: LEGO.NXT.Tribot.manifest.xml Direction Dialog State Dialog Drive State Generic Differential Drive State

Robotics Tutorial Test the Service How did I find the LEGO manifest? Use VPL to look up Service to Manifest relationships

Robotics Tutorial Test the Service Start a DSS Node with DssHost.exe Using two manifests: LEGO.NXT.TriBot.manifest.xmlDialogDrive.manifest.xml

Robotics Tutorial Test the Service Inspect the running service with a browser Configure the LEGO Brick Presss [Connect] Press and hold an arrow on the direction dialog

Summary Controlling a Robot with MSRS Create an orchestration service that: Drives a Robot Partners with a robotics service Connects to a Generic Contract Subscribes to Notifications Issues commands to the robotic service

© 2006 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.