professional microsoft® robotics developer studio
Post on 08-Nov-2021
16 Views
Preview:
TRANSCRIPT
Professional Microsoft® Robotics
Developer Studio
Kyle Johns
Trevor Taylor
WILEY Wiley Publishing, Inc.
Contents
Foreword xxv Introduction xxix
Part I: Robotics Developer Studio Fundamentals 1
Chapter 1 : Exploring Microsoft Robotics Developer Studio 3
Microsoft Does Robots? 4 Microsoft Robotics Developer Studio Components 5
Concurrency and Coordination Runtime (CCR) 5 Decentralized Software Services (DSS) 6 Visual Simulation Environment 6 Visual Programming Language (VPL) 7 Robotics Samples 8 Packages 9
Support for MRDS 12 The SubjuGator 12 Prospect 12 13 The uBot-5 13 KUKA Educational Framework 14
Setting Up Your System 15 System Requirements 15 Prerequisites 16 Installing MRDS 1.5 16 Robotics Studio 1.5 Directory Structure 19 Installing the Packages 20 Installing the Sample Code for This Book 21 Verifying the Installation 21
Additional Resources and Support 27 www.Microsoft.Com/Robotics 27 Tutorials and User Guides 27 Online Forums 27 Channel 9 28
Summary 28
Contents
Chapter 2 : Concurrency and Coordination Runtime (CCR) 2 9
Overview of the MRDS Framework 30 The Need for Concurrency 30 Services — The Basic Building Blocks 31 Orchestration — Putting Services Together 31
Setting Up for This Chapter 32 Using the CCRExamples Project 33 Entering the Code Manually 34 Tips for Coding with MRDS 37
Coordination and Concurrency Runtime 38 Concurrent Execution 39 Ports and Messages 50 Receivers and Arbiters 55 Dispatchers and Dispatcher Queues 65
Implementing Common Control Structures 68 Sequential Processing 68 Scatter/Gather 69 State Machines 70 Last Message 70 Time Delays 71 Periodic Events 73 Setting Limits with Timeouts 75 Asynchronous I/O 75 Blocking I/O 76 Throttling 76
Error Handling 77 Causalities 77 Success/Failure Ports 79
Interoperation with Legacy Code 8 1 Traps for New Players 8 1 Summary 82
Chapter 3: Decentralized Software Services (DSS) 8 3
Overview of DSS 84 Contracts 86 State 87 Behavior 91 Execution Context 93 DSSP Service Operations 94 Generic Contracts 98
xiv
Contents
Running a DSS Node 98 Directory Structure of a DSS Node 99 Starting DssHost 100 Exploring the DSS Web Pages 101 Running a Robot Service 109
Creating a New Service 112 Building a Service from Scratch 112 Examining the Service Source Files 116
Compiling and Running Services 1 2 1 Compiling a Service 121 Setting Up References 122 Proxy Assemblies 123 Running Services 123 Using the Debugger 125
Defining Service State 127 Persisting Service State 129
Loading State from a Configuration File 129 Saving the State to a Config File 131
Modifying Service State 132 Replace 132 Update 133
Service Initialization 136 Composing and Coordinating Services 137
Starting and Stopping Services Programmatically 137 Using the Partner Attribute to Start Services 144 Modifying Manifests Manually 146
DSS Tools 149 Modifying Manifests Using the DSS Manifest Editor 149 Dsslnfo: Examining Contract Information 150 DssProjectMigration: Migrating Services 151
Deploying Services 1 5 1 Sharing Source Code 152 Distributing Executables 154 Viewing the Contents of a Package 155
Summary 155
Chapter 4 : Advanced Service Concepts 1 5 7
Setting Up for This Chapter 157 Hardware Setup 159 Creating the Service 160
xv
Contents
Subscribing and Notifying 163 Subscribing to State Changes 164 Unsubscribing from State Change Notifications 167 Building in Support for Subscriptions and Notifications 167
User Interfaces 170 Using Windows Forms 171 Using Web Forms 185
Using a Camera 205 Adding a Camera to a Service 206 Setting Up a WinForm for the Video Feed 207 Processing Video Frames 212
Inheriting from Abstract Services 215 Implementing a Generic Service 215 Building Virtual Services 217
More on Debugging 219 Read the Documentation First 219 Use the Visual Studio Debugger 219 Examine the State of a Node and Services 220 Traditional Debugging Techniques 220 Using Trace Level and Logging 220
Where to Go from Here 2 2 1 Summary 222
Part II: Simulations 223
Chapter 5: The MRDS Visual Simulation Environment 2 2 5
The Advantages of Simulation 226 The Difficulties with Simulation 226 Prerequisites 227
Hardware Requirements 227 Software Requirements 228
Starting the Simulator 230 Using the Simulator 2 3 1
Navigating the Simulation Environment 232 The Status Bar 234 The Help Menu 235 The Camera Menu 235 The Rendering Menu 236 Graphics Settings 240 The Physics Menu 241 Saving and Loading Scenes 243
xvi
Contents
Saving and Loading Manifests 243 Other File Menu Items 243
The Simulation Editor 244 Selecting Entities 245 Manipulating Selected Entities 246 The Entities Menu 247 Modifying Entity State 248 Other Common Entity Properties 250
Built-in Simulation Entities 252 Sky and Ground Entities 253 Lights and Shadows 257 General-Purpose Entities 259 Robot Entities 263
Summary 267
Chapter 6: Extending the MRDS Visual Simulation Environment 2 6 9
Simulation DLLs and Types 270 RoboticsCommon.DLL 270 SimulationCommon.DLL 271 SimulationEngine.DLL 272 SimulationEngine.Proxy.DLL 274 PhysicsEngine.DLL 274 Microsoft.Xna.Framework.DLL 274 Using Statements and DLL References 275
Building Your Own SRS-Robo-Magellan Simulation 276 Simulation Services 276 Creating a Simulation Service 277 Defining a Custom Robot Entity 281 The Drive Methods 293 The SimulatedQuadDifferentialDrive Service 296 Tuning the Corobot Entity 313 Adding a Camera 322 Adding Infrared Distance Sensors 323
Summary 336
Chapter 7: Using Orchestration Services to Build a Simulation Scenario 3 3 7
The Robo-Magellan Referee Service 338 Customizing the SimulationTutoriall Service 339 Starting a Service from the Browser 339 Building the World and Adding Cameras 340 Adding a Sky, Sun, and Ground 340
xvii
Contents
Adding Barriers 341 Building a Better Traffic Cone 343
The Robo-Magellan Orchestration Service 347 Generating the SimMagellan Service 347 Creating a Manifest with the Manifest Editor 349 Adding a Windows Forms User Interface 351 Creating the Form 351 Connecting the Service to the Form 352
How to Make a Robot Behave 354 Defining Behavior States 355 Implementing the Behavior for Each State 356 Processing Camera Frames 362 The Wander Behavior 367 The Approach State 369 The Final Approach State 371 The Back Away State 372 The Finished State 373 The Avoid Collision State 373
Using the SimMagellan Service 374 Future Directions 374 Summary 375
Chapter 8: Simulating Articulated Entities 3 7 7
The Joint Class 377 The Joint Frame 378 Joint Properties 378 A Joint TestBench 382
Building a Simulated Robotic Arm 394 The Physical Model of the Arm Entity 394 Running the Arm Service 405 Moving the Arm 405 A Fly in the Ointment 407 Inverse Kinematics 410 Using the Arm User Interface 412
Summary 418
Chapter 9: Adventures in Simulation 4 1 9
Simulating a Sumo Competition 419 SimulatedSumo 420 The Simulated Sumo Referee 421 Communicating with the Sumo Referee Service 423
xviii
Contents
The Sample Sumo Behavior 425 Creating a New Sumo Player 427 Where to Go from Here 430
Building a Six-Legged Walker 430 The Hexapod Entity 431 The Hexapod Differential Drive Service 438 Where to Go from Here 443
Implementing a Soccer Strategy 444 The MRDS Simulated Soccer Environment 444 Changing the Players on the Field 446 Building a Better Soccer Player 449 Where to Go from Here 457
Exploring Virtual Worlds 457 Background 458 The Modified DifferentialDrive Service 459 The Maze Simulator 461 The ExplorerSim Application 464 Where to Go from Here 466
Summary 467
Part III: Visual Programming Language 469
Chapter 10 : Microsoft Visual Programming Language Basics 4 7 1
What Is a Data Flow Language? 4 7 1 The VPL Development Environment 473 A Simple VPL Diagram 474
Creating a VPL Diagram 474 Running a VPL Diagram 475
Inputs, Outputs, and Notifications 478 Basic Activities 479 VPL Variables 480 Looping and Conditionals in VPL 482 The VPL Execution Model 484 Debugging a VPL Diagram 485 Creating Custom Activities 487
Defining a ForLoop Custom Activity 488 Improving the ForLoop Custom Activity 491
Using Lists and Switch Activities 493 An Example Using List Activities 495
The PluralNouns Activity 496 The Phrases Activity 497 The GetRandom Action 498
xix
Contents
A Final ForLoop Improvement 499 Summary 500
Chapter 1 1 : Visually Programming Robots 5 0 1
VPL Activities and Services 5 0 1 Compiling Diagrams to Services 502
Service Compilation Options 502 A Service Compilation Example 503
Configuring Activities 508 Setting the Configuration for a Diagram 509 Starting the SimpleDashboard Service Upon Execution 511 Modifying the Diagram to Use a Real Robot 512
VPL in the Driver's Seat 513 Using VPL to Read Sensors 517 The Laser Range Finder 518 Controlling Multiple Robots 520 Summary 522
Chapter 1 2 : Visual Programming Examples 5 2 3
VPL Explorer 523 Interfacing with the Xbox Controller 524 Reading the LRF Data 525
VPL Sumo 529 The VPL Sumo Main Diagram 529 The PlayerOne Start Action 530 Reading Data from the Infrared Sensors 532 Reading the Create Bumper Sensors 532 The Manouver Message 533
Arm Mover 534 The ArmMover Activity 535 The SetPol I Interval Action 536 Moving the Arm 539
Line Follower 542 The LineMesh Utility 542 Building a Brightness Sensor 547 Building the Simulation Environment 549 The Line-Follower VPL Diagram 551
Ball Follower 554 Building the Simulation Environment 554 The BallFollower VPL Diagram 556
Summary 559
xx
Contents
Part IV: Robotics Hardware 561
Chapter 13 : Using MRDS with Robotics Hardware 5 6 3
Safety Considerations Before Starting 564 Types of Robots 564
Tethered Robots 565 Autonomous Robots 572
Buying Your First Robot 573 General Recommendations 574 Robots Discussed in This Book 574 Other Robots Supported under MRDS 580
Fundamental Concepts: Sensors, Actuators, and Controllers 584 Sensors 585
Contact Sensors 586 Range Sensors 586 Light Sensors 589 Video/Image Sensors 590 Other Sensors 590
Actuators 592 Motors 592 Servo Motors 592 Digital Outputs 592 Sound and Voice Synthesis 593
Controllers 593 Understanding a Closed-Loop Control System 593 Behavior-Based Control 594
Summary 597
Chapter 14 : Remotely Controlling a Mobile Robot 5 9 9
Remote Control and Teleoperation 599 Setting Up Your Robot 600
Using a LEGO NXT Tribot with MRDS 601 Using a Parallax Вое-Bot with MRDS 611
Using the Dashboard 615 Creating a Manifest 616 Running the Manifest 621 Using a Joystick or Gamepad 623 Creating a Shortcut to Run Your Robot 624
Making a Robot Dance 625 Building a New Service 626 Partnering with a Robot Using a Manifest 630
xxi
Contents
Reviewing the Results 635 Improving the Behavior 636 Flashing and Beeping 640
Exploring Using Sensors 643 Reading from the Sensors 643 Making a LEGO NXT Wander Around 644 Making a Вое-Bot Wander Around 647
Summary 653
Chapter 15 : Using a Robotic Arm 6 5 5
Introduction to Articulated Arms 656 Servo Basics 657 Controlling Joints: Speed and Travel Constraints 658 Forward Kinematics 661 Inverse Kinematics 664
Setting Up a Lynxmotion L6 Arm 665 Building the Lynxmotion L6 Arm 666 Starting the Lynxmotion L6 Arm 666
Controlling the L6 Arm 667 Using the Generic Arm Contract 668 Recording Motions 671
Pick and Place 677 Logjam 679 Using an Overhead Camera 679
Summary 680
Chapter 16 : Autonomous Robots 6 8 1
PC-Based Robots 6 8 1 Windows XP-Based PCs 682 Onboard Laptops 682 PDAs 682 Embedded PCs 683 The Development Environment 684
Setting Up a Stinger Robot 685 Setting Up Your PDA 686 Driving a Stinger Remotely 690
Code Overview 691 Wandering Using Sensors 703
Handling the IR Sensors 703 Defining Wander Modes 704 Running the Wander Code 707
xxii
Contents
Creating a CF Version of the Service 708 Deploying a Service to a PDA 709 Debugging a Service on a PDA 711
Setting Up the eBox 713 Booting the eBox for the First Time 714 Setting Up the Serial Port 719 Setting Up Visual Studio 720 Transferring Files to the eBox 723 Building a Windows CE System Image 724
Running a Service on WinCE 725 Setting Up the Service 726 Testing Operation of the Service 727 Autonomous Operation 728
Where to Go from Here 729 Summary 730
Chapter 17 : Writing New Hardware Services 7 3 1
Integrating New Hardware 731 Microcontrollers 732 Chips with Built-in BASIC Interpreters 733 MRDS Support from Other Vendors 734
Creating a Generic Brick Service 734 Terminology 735 Design 736 Brick State 740 Brick Operations 748 Additional Components 750
The Integrator Robot 754 Integrator Robot Monitor Program 756 Creating the Integrator Robot Services 763 Creating a New Drive Service 775
Testing a Generic Brick Robot 785 The Hemisson Robot 786
Hemisson Brick Service 787 Hemisson Drive Service 791
Where to Go from Here 797 Summary 798
Index 799
top related