Presentation is loading. Please wait.

Presentation is loading. Please wait.

Microsoft Visual Programming Language Advanced Example.

Similar presentations


Presentation on theme: "Microsoft Visual Programming Language Advanced Example."— Presentation transcript:

1 Microsoft Visual Programming Language Advanced Example

2 Microsoft Visual Programming Language 2 Andreas Ulbrich Software Development Engineer Microsoft Corporation

3 Overview Autonomous behavior Factoring of activities Working with data collections Configuring programs for simulation and reality

4 Scenario Robot Laser range finder for obstacle detection Two-wheel differential drive Autonomous wandering behavior Robot roams around and ideally does not bump into obstacles Run in simulation and reality

5 Prerequisites You should be familiar with the basics of the Microsoft Visual Programming Language.

6 Hardware MobileRobots Pioneer P3DX with Sick Laser Range Finder LM200 Can easily be adapted to other hardware Laser Range Finder Two-wheel differential drive

7 Two-wheel Differential Drive Very simple drive system Controlled by applying different power to left and right motor Generic Differential Drive Service SetDrivePower action

8 Laser Range Finder Distance measurement device SICK Laser Range Finder Service Measurement notification 180° sweep, 0.5° resolution, ca. 8m range 0° 180° Distance measurement

9 Basic Idea Convert laser scan into three sectors Left, right, center For each sector find nearest measurement If center measurement is above threshold Go straight (1) Else if left is larger than right Turn left (2) Else Turn right (3) 1 2 3

10 Three Sectors Right (3/8) Left (3/8) Center (2/8 = 45°) Nearest measurement in sector (not to scale)

11 Factoring: Who does What? Create new activities when possible! Diagrams smaller and easier to read Easier to change and to reuse LaserRangeFinder activity Handles laser notifications and finds nearest measurements in sectors AutoDrive activity Based on nearest left, right, and center measurement select the best direction and turn Main diagram Coordinate LaserRangeFinder and AutoDrive

12 LaserRangeFinder Laser data is list of int Split into sectors Start index Limit index Find nearest Needs to be done for each sector  Create an action FindNearest When done send notification FoundNearest

13 LaserRangeFinder FindNearest Action List of measurments Data Nearest measurement start value is maximum range Current index i Start value is start index of sector FindNearest: If Data[ i ] < Nearest then Nearest = Data[ i ] Repeat with i = i + Increment (Recursion) Stop if outside the sector Limit and send the notification

14 LaserRangeFinder FindNearest Action Input values i – index at which to start searching (int) Increment – index step size (int) Limit – index at which to stop searching (int) Data – laser data (List of int) Nearest – nearest found so far (int) Label – sector (string: “Left”, “Right”, “Center”) Sends FoundNearest notification Nearest – nearest measurement in sector (int) Label – sector (string: “Left”, “Right”, “Center”)

15 AutoDrive UpdateDrive Action Simple state machine Variable State (“Forward”, “Turn”) Input values Left, Right, Center (int) If currently in “Forward” mode If Center > 1500 Stop driving, go to “Turn” mode If currently in “Turn” mode If Center > 2000 Go to “Forward” mode, drive forward Else turn left or right

16 Main Diagram Notifications from LaserRangeFinder Left and Right stored in variables On Center get all variable values and send to UpdateDrive action of AutoDrive

17 Simple VPL Explorer

18 Summary Autonomous behavior Constantly update actuators based on sensors and state Factoring of activities Data collections and recursion Simulation and reality

19 See also Robotics Tutorial 5 C# Path planning for smooth obstacle avoidance VplExplorer (Channel 9 Sandbox) Enhanced version of this tutorial Combines wandering with joystick drive

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


Download ppt "Microsoft Visual Programming Language Advanced Example."

Similar presentations


Ads by Google