科技之路分享 http://blog.sciencenet.cn/u/whq2008 科学之路戒骄戒躁

博文

Microsoft Robotics Studio基础教程

已有 9031 次阅读 2009-11-2 16:59 |个人分类:未分类|系统分类:科研笔记|关键词:学者

http://www.msuniversity.edu.cn/m_RepositoryIntro/Detail.aspx?id=744

The basic robotics tutorials help you getting started writing the very first service for your robot. The tutorials take you from getting input from a single sensor to control an actuator to being able to write a "drive-by-wire" application where you can move your robot around.

Robotics Tutorial 1 - Accessing a Service

Understanding how to use services is a key to the Microsoft Robotics Studio programming model. This tutorial starts you off with how to access a service for a simple sensor.

Robotics Tutorial 1 (VPL) - Accessing a Service

 

2008-1-16

Writing an application using the Microsoft Robotics Studio is a simple matter of orchestrating input and output between a set of services. Services represent the interface to software or hardware and allow you to communicate between processes that perform specific functions.

This tutorial teaches you how to use a basic service that reads the output of a contact sensor (referred in this tutorial as a bumper) and displays a message in the Console window.

This tutorial is provided in the Microsoft Visual Programming Language (VPL) language. You can find the project files for this tutorial at the following location under the Microsoft Robotics Studio installation folder:

Sample location
 SamplesRoboticsTutorialsTutorial1mvpl

This tutorial teaches you how to:

Prerequisites

Hardware

You need a robot with microcontroller and a contact sensor. Contact sensors are typically simple mechanical switches that send a signal when physical contact is made. The sensor can also be distance detection devices (like sonars or infrared sensors) that provide a simple binary signal when a particular threshold is detected. Connect the sensor to your robot's microcontroller following the normal conventions for the hardware you are using.

To determine if support is included in Microsoft Robotics Studio for your robot and to setup your hardware, see Setting Up Your Hardware Overview. You may be able to apply this tutorial for other robots that provide similar services (or create your own services by performing the Service Tutorials included in Microsoft Robotics Studio). Setting up Your Hardware may also provide you with any recommended guidelines for setting up your PC to communicate with your robot.

Software

This tutorial is designed for use with Microsoft Visual Programming Language.

Microsoft Visual Programming Language (VPL) is an application development environment designed on a graphical dataflow-based programming model rather than control flow typically found in conventional programming. Rather than a series of imperative commands sequentially executed, a dataflow program is more like a series of workers on an assembly line who do their assigned task as the materials arrive. As a result, VPL is well suited to programming a variety of concurrent or distributed processing scenarios.

VPL is targeted for beginning programmers with a basic understanding of concepts like variables and logic. However, VPL is not limited to novices. The compositional nature of the programming language may appeal to more advanced programmers for rapid prototyping or code development. In addition, while its toolbox is tailored for developing robot applications, the underlying architecture can be applied to other applications. As a result, VPL may appeal to a wide audience of users including students, enthusiasts/hobbyists, as well as possibly web developers and professional programmers.

You will also need Microsoft Internet Explorer or another conventional web browser.

Getting Started

Open the Microsoft Visual Programming Language development environment and create a new project by selecting New from the File menu.

Step 1: Add and Configure New Activities

Now drag a Generic Contact Sensors service from the Services toolbox. The activity block appears with the name GenericContactSensors.

Figure 1

Figure 1 - Start by adding a GenericContactSensors activity block.

Add a Data activity by dragging one from the Basic Activities toolbox into your diagram, to the right of the sensor service activity. Select string from the dropdown list and enter Ouch! in its text box.

Step 2: Connect Activities

Connect the ContactSensor's notification output, dragging from the round Notification connection on the ContactSensor activity, to the Data activity.

If you dragged the connection from the correct connection point, you should see the Connection dialog box. Choose Update and Create in the Connections dialog and click OK.

Figure 2

Figure 2 - The Connections Dialog Box

This sends the Update message from the ContactSensor to the Create action of the Data activity. While the Data activity does not use the data coming from ContactSensor, it uses the message to trigger the creation of the data ("Ouch!") you entered.

Your diagram should now look like the following illustration.

Figure 3

Figure 3 - Connected Sensor and Data Activities

Step 3: Add and Configure a Simple Dialog Box

Now drag a Simple Dialog service into your Dataflow window and place to the right of the Data block. Connect the two activities. In the Connections dialog which opens, select DataValue and AlertDialog then click OK.

In the Data Connections dialog box, select value as the value to be sent to the target Message. This means that the text "Ouch!" is sent as the message text of the alert form of the simple dialog.

Figure 4

Figure 4 - The Data Connections Dialog Box

Your diagram should now look like the following illustration.

Figure 5

Figure 5 - Connected Activities and Simple Dialog

Step 4: Designate Your Sensor

The ContactSensor activity represents a generic service that can be applied to a contact (touch) sensor for different robots. Before you run your application, you need to tell VPL which sensor you want to use.

Right-click on the ContactSensor activity block to open its context pop-up menu. Select the Set Configuration command. In the dialog box that appears, under Set Configuration, select Use a manifest. If no manifest shows up in the list, select Import Manifest and chose the appropriate manifest for the sensor you are using, then click OK. You can also select one of the simulation manifests. The manifest should now be selected in the dropdown list.

Step 5: Run Your Application

Run your application by selecting the Run command from the Run menu or by pressing F5.

 

Robotics Tutorial 2 - Coordinating Services

This tutorial builds on the previous tutorial and shows you how use the input from a simple sensor and use it to control a motor service.

Robotics Tutorial 2 (VPL) - Coordinating Services

 

2008-1-16

This tutorial builds on Robotics Tutorial 1 (VPL) - Accessing a Serviceby using a sensor to turn a motor on and off. Like the previous tutorial, it requires sensor and motor services for a robot compatible with Microsoft Robotics Studio. Also as in previous tutorial, you need to setup your robot hardware appropriately before running this tutorial.

This tutorial is provided in the Microsoft Visual Programming Language (VPL) language. You can find the project files for this tutorial at the following location under the Microsoft Robotics Studio installation folder:

Sample location
 SamplesRoboticsTutorialsTutorial2mvpl

This tutorial teaches you how to:

Prerequisites

Hardware

You need a robot with microcontroller and a contact sensor. Contact sensors are typically simple mechanical switches that send a signal when physical contact is made. The sensor can also be distance detection devices (like sonars or infrared sensors) that provide a simple binary signal when a particular threshold is detected. Connect the sensor to your robot's microcontroller following the normal conventions for the hardware you are using.

To determine if support is included in Microsoft Robotics Studio for your robot and to setup your hardware, see Setting Up Your Hardware Overview. You may be able to apply this tutorial for other robots that provide similar services (or create your own services by performing the Service Tutorials included in Microsoft Robotics Studio). Setting up Your Hardware may also provide you with any recommended guidelines for setting up your PC to communicate with your robot.

Software

This tutorial is designed for use with Microsoft Visual Programming Language.

Microsoft Visual Programming Language (VPL) is an application development environment designed on a graphical dataflow-based programming model rather than control flow typically found in conventional programming. Rather than series of imperative commands sequentially executed, a dataflow program is more like a series of workers on an assembly line who do their assigned task as the materials arrive. As a result, VPL is well suited to programming a variety of concurrent or distributed processing scenarios.

VPL is targeted for beginning programmers with a basic understanding of concepts like variables and logic. However, VPL is not limited to novices. The compositional nature of the programming language may appeal to more advanced programmers for rapid prototyping or code development. In addition, while its toolbox is tailored developing robot applications, the underlying architecture can be applied to other applications. As a result, VPL may appeal to a wide audience of users including students, enthusiasts/hobbyists, as well as possibly web developers and professional programmers.

You will also need Microsoft Internet Explorer or another conventional web browser.

Getting Started

While you could modify and extend the previous tutorial application, this tutorial starts you from the beginning.

To begin, open the Microsoft Visual Programming Language development environment and create a new project by selecting New from the File menu.

Step 1: Add, Configure, and Connect New Activities

Insert a Generic Contact Sensor Array service and a Calculate activity into your Dataflow window. Connect the two using the round event connection on the Generic Contact Sensor Array (the actual activity block displays its name, ContactSensor). In the Connections dialog box, select Update and Calculate as your connections. In the Calculate text box enter Pressed. A list containing the parameters that the ContactSensor output includes in its Update event opens.

Figure 1

Step 2: Add and Initialize a Variable

Now add a Variable activity. Use its dropdown list to open the Variables dialog box and define a variable called MotorOn of type bool. Set the Variable activity to this MotorOn variable. You will use this variable to store the state of the robot motor. Connect the output of the Calculate activity block to the Variable input. Set the connections as CalculatedResult to Set Value.

Figure 2

To initialize the MotorOn variable, insert another Variable activity block and also set it to MotorOn. Then insert a Data activity and connect to this second Variable activity (from Data to Set Value). Select the boolData type and enter false in the text box. You don't need to connect these two activities to the rest of your dataflow in the diagram.

Figure 3

Step 3: Add and Configure an If Activity

Now insert an If activity into your diagram. Place it to the right of the first Variable activity you inserted and connect the output of the Variable block to its input. This sends the current state of the variable to determine what to do next.

Figure 4

Next, insert four more Data activities. In the first, select string and enter Motor On. In the second, select double and enter 1.0. In the third, select string and enter Motor Off. In the fourth, select double and enter 0.0.

Connect the first two the top (true) output of the If block and connect the other two to the Else (false) output of the If activity.

Figure 5

Step 4: Add and Configure a Simple Dialog Box and Generic Motor

Insert two Simple Dialog services and connect one to the MotorOn Data block and the other to the MotorOff Data block.

Figure 6

Now finish the diagram by inserting a Generic Motor service and connecting it to the 1.0 Data block.

Add another Generic Motor (or copy the one you put into the diagram). You will be asked whether to use the existing instance to create a new one. Select the Use Existing option and click OK.

Figure 7

Like the Generic Contact Sensor Array service, this is a generic service that can be applied to different robots. You need to set the manifest for each of these services, which you can do by displaying its context pop-up menu (right-clicking on it), then selecting the Set configuration command. In the dialog box that opens, select Use a manifest, click the Import Manifest... button, and select the manifest that applies to robot contact sensor and the robot motor you are using.

Note:

You only need to set the manifest for one of the Motor activities since they are both references to the same Motor.

When your diagram is complete it should look like the following.

Figure 8

Step 5: Run Your Application

Run your application by selecting the Run command from the Run menu or by pressing F5.

Robotics Tutorial 3 – Using Abstract Reusable Services

This tutorial describes of a generic drive and contact service that you apply across a variety of hardware platform and includes a simple "wanderer" service.

Robotics Tutorial 3 (VPL) - Creating Reusable Orchestration Services

 

2008-1-16

Microsoft Robotics Studio provides a re-usable design for writing services. This design allows you to write a service once to a common hardware specification and then use that service across a variety of hardware robotics platforms.

This tutorial teaches you how to create a custom activity that partners with abstract, base definitions of hardware services. Then, based on a configuration file (a manifest), that service binds at runtime to a specific implementation of these hardware services. The tutorial implements a very basic wandering behavior.

If a bumper is pressed, your robot backs up for a short distance, turns randomly for a brief amount of time, and then goes straight at a random velocity.

This tutorial can also be used in a Simulation without requiring any robotics hardware.

This very primitive behavior will result in the wheeled robot bumping and turning into things. For a more intelligent (and more advanced orchestration service) please review Robotics Tutorial 5 (C#) - Using Advanced Servicesand the Explorer Service.

This tutorial is provided in the Microsoft Visual Programming Language (VPL) language. You can find the project files for this tutorial at the following location under the Microsoft Robotics Studio installation folder:

Sample location
 SamplesRoboticsTutorialsTutorial3mvpl

This tutorial teaches you how to:

Prerequisites

Hardware

You need a robot with microcontroller and a contact sensor. The sensor can also be distance detection devices (like sonars or infrared sensors) that provide a simple binary signal when a particular threshold is detected. Configure your contact sensors so that one is at the front and the other is at the rear.

This tutorial also requires two motors in a two-wheeled differential/skid drive configuration.

Connect the sensors and motors to your robotic platform following the normal conventions for the hardware you are using.

To determine if support is included in Microsoft Robotics Studio for your robot and to setup your hardware, see Setting Up Your Hardware Overview. You may be able to apply this tutorial for other robots that provide similar services (or create your own services by performing the Service Tutorials included in Microsoft Robotics Studio). Setting up Your Hardware may also provide you with any recommended guidelines for setting up your PC to communicate with your robot.

Software

This tutorial is designed for use with Microsoft Visual Programming Language.

Microsoft Visual Programming Language (VPL) is an application development environment designed on a graphical dataflow-based programming model rather than control flow typically found in conventional programming. Rather than series of imperative commands sequentially executed, a dataflow program is more like a series of workers on an assembly line who do their assigned task as the materials arrive. As a result, VPL is well suited to programming a variety of concurrent or distributed processing scenarios.

VPL is targeted for beginning programmers with a basic understanding of concepts like variables and logic. However, VPL is not limited to novices. The compositional nature of the programming language may appeal to more advanced programmers for rapid prototyping or code development. In addition, while its toolbox is tailored developing robot applications, the underlying architecture can be applied to other applications. As a result, VPL may appeal to a wide audience of users including students, enthusiasts/hobbyists, as well as possibly web developers and professional programmers.

You will also need Microsoft Internet Explorer or another conventional web browser.

Getting Started

Begin by opening the Microsoft Visual Programming Language development environment and creating a new project by selecting New from the File menu.

Step 1: Create a Custom Activity using Generic Services

Microsoft Robotics Studio comes with a large number of services that you can use to build your programs. Sometimes, however, they don't have exactly the commands that you are looking for. For this tutorial you need a drive activity that has commands for backup, turn randomly, and drive straight with a random speed. Unfortunately, there is no such activity. You can build one yourself by using the Generic Differential Drive. (also see VPL Tutorial 3 - Create Your Own Activity)

Create a new activity by dragging an Activity into your diagram. You should always give your activities meaningful names. Select the new block and go to the Properties window to change its name to RandomDrive.

Figure 1

Figure 1 - New activity

Open the new activity to see its implementation by double-clicking on its block or selecting Open from the context menu. This opens a new page displaying the diagrams contained within the activity. It has one diagram for each action. You can choose the displayed action with the dropdown box at the top of the page.

Figure 2

Figure 2 - New activity page

A new activity initially has two actions. The Start action runs once immediately after the activity starts. You don't need it in this tutorial and can simply ignore it. The second action, named Action, can be used as a command from other diagrams in the same way you can use operations of a service in the previous tutorials. An activity can have more than these two actions. To add new actions to the activity, use the Actions and Notifications command in the Edit menu or press the button next to the action selector dropdown on top of the page.

In the Actions and Notifications dialog, add two more actions by clicking the + button in the Actions list twice. Select each action and change their names in the Name input field to Backup , Turn, and Drive.

Figure 3

Figure 3 - Actions and Notifications dialog

When you implement these actions, you have to know in which direction the robot is currently going so that you can reverse it. The direction can be sent as an input value to the action. For each action, add a new input value. Change the input value's name to Polarity and its type to double. (You will later use -1.0 to indicate reverse and 1.0 to indicate forward.) Click OK when you are done.

Figure 4

Figure 4 - Actions dialog with input

This tutorial explains in detail how to implement the Turn activity, the most complex of the three. Drive and Backup are simplified versions of Turn.

On the action selector dropdown, select the Turn action. A screen opens with connectors on the left and right side. The connectors represent the input (left) to the action and the action's output (right).

Figure 5

Figure 5 - Empty action

The turn speed should be random, so you need to come up with a random value. The easiest way to do that is by using the Math Functions. Add a MathFunction block to your diagram and connect the actions input to the MathFunctions block. On the connections dialog, choose Random from the To list. Random doesn't take any input values so there is nothing to set up for Data Connections. Random delivers values between 0.0 and 1.0. While 1.0 is also the maximum value to set the motor speed on the generic drive, in the interest of public safety, you should consider scaling it down a bit. You also want to make sure that the value isn't too close to zero since you wouldn't turn at all.

Connect the output of the MathFunctions block to a new Calculate and choose Random - Success from the From in the Connections Dialog.

Figure 6

Figure 6 - Create a random number

The resulting random value will be between 0.25 and 0.75. Use this value to calculate the motor power to set on the differential drive. In order to take the current direction in which the robot is traveling into account, you need to extract the Polarity value from the input using a Calculate and combine it with the random value using a Join.

Figure 7

Figure 7 - Joining Random and Polarity

In order to make the robot turn, the wheels have to rotate in different directions. Use two Calculate blocks to calculate the value for the left and the right wheel and combine the values using a Join, calling the values Left and Right.

Figure 8

Figure 8 - Calculating left and right speeds

Add a new Generic Differential Drive to your Turn action and connect it to the Join. Select the SetDrivePower command from the To list. In the Data Connections dialog. Select Left for LeftWheelPower and Right for RightWheelPower.

Figure 9

Figure 9 - Unconnected timer

Now you've got your robot turning. You want to make sure that it can actually turn for some time so that it really changes direction. A simple way of achieving this is by waiting for a brief period of time before doing something else. Add a new Timer service to the Turn action. Add a Data block, setting int as its type and connect it to the Timer. Select Wait in the Connections Dialog's To list. In the Data Connections dialog, set the value to Interval . Interval is the amount of time to wait in milliseconds. Enter a value that is appropriate for the speed of your robot in the Data block.

Figure 10

Figure 10 - Completed handler

Connect the output of the drive's SetDrivePower operation to the Data block and choose SetDrivePower - Success from the From list. Connect the Timer to the Result output of the Turn action. The Turn action has no output values. However, you can still send a result message indicating "I'm done" by connecting a message to the Timer, which makes sure that this message is not sent before you're done.

You can build Drive and Backup based on Turn. When you add the GenericDifferentialDrive to the Drive and Turn, make sure to select the same drive and do not create a new one when you are asked. All GenericDifferentialDrive blocks in all actions must have identical names. Alternatively, you can just copy the GenericDifferentialDrive block from the Turn action. By using the generic drive, you can use your RandomDrive with many different platforms and even simulation without having to change it.

Figure 11

Figure 11 - Activity dialog

The Backup action is similar to Turn except it uses fixed values instead of random and uses the same power for both wheels.

Figure 12

Figure 12 - Backup

The Drive uses the same random value for both wheels and doesn't wait. This allows a change in direction immediately after starting to go forward again.

Figure 13

Figure 13 - Drive

Step 2: Orchestrate the Custom Activity

The RandomDrive activity can now Backup, Turn randomly, and Drive forward with a random speed. Use this activity to build the wanderer program.

Go back to the main diagram of your project.

Add a Generic Contact Sensor (i.e. a bumper) service to the diagram. By using the generic drive, you can use your wander diagram with many different platforms. Whenever the bumper is pressed, the following actions occur:

  • Backup
  • Turn
  • Drive

Wandering is now simply a matter of chaining up the RandomDrive correctly.

First, add a new If and connect it to the contact sensors notifications (drag its round connector to the If). Select Update from the From list.

In the If condition, type Pressed. You now need to know what the current direction of the robot is and change it. Add a new variable block and define a variable called Polarity of type double. Connect the If's condition to the variable and select GetValue from the Connections dialog.

Figure 14

Figure 14 - Add the Polarity variable

Now you have the current direction and can use it to Backup. Connect the Variable block to the RandomDrive block. Select the Backup action in the To of the connection dialog. In the Data Connections dialog select, Polarity for the Polarity input value.

Figure 15

Figure 15 - Connect Polarity to RandomDrive

After Backup has completed, you can Turn. Because you also need the new Polarity value, you have to combine (add a Join) the result of Backup with the result of the calculate that calculates the new direction (by inverting the old one). Make a copy of RandomDrive and connect the Join block to it. In the Connections dialog, select Turn from the To list. In the Data Connections dialog, select Polarity for the Polarity input value. Repeat these steps to add the Drive command after the Turn command.

Figure 16

Figure 16 - Turn

Finally, you need to remember the new direction in the variable so that you can use it the next time the bumper is pressed. Add a new Variable block, select Polarity, and connect the Calculate to it. Select SetVariable in the Connections dialog. Use a new Data block and another Variable block to initialize the variable with 1.0 (forward).

When you're finished, your diagram should look like the following.

Figure 17

Figure 17 - Completed wander diagram

Step 3: Define a Manifest for Your Hardware

Before you run your program, you need to set the manifests for the ContactSensor and the DriveDifferentialTwoWheel services. Open the context pop-up menus for each of these services and select the Manifest command. In the dialog box which opens, select the manifest for your robot. If you don't have a robot that's supported you can try the simulated mobile robot manifest.

Step 4: Run Your Application

Run your application by selecting the Run command from the Run menu or by pressing F5.

Robotics Tutorial 4 – Drive-By-Wire

This tutorial covers how to build a simple application to use a conventional Windows user interface to control a motor drive service.

Robotics Tutorial 4 (VPL) - Drive-By-Wire

 

2008-1-16

Microsoft Robotics Studio provides a re-usable design for writing services. This design allows you to write a service once to a common hardware specification and then use that service across a variety of hardware robotic platforms.

This tutorial teaches you how to author a service that partners with abstract, base definitions of hardware services. Based on a configuration file (a manifest), your service binds at runtime to a specific implementation of these services. The tutorial displays a Windows user interface (Winform) that allows basic user control of a robot's movement.

This tutorial is provided in the Microsoft Visual Programming Language (VPL) language. You can find the project files for this tutorial at the following location under the Microsoft Robotics Studio installation folder:

Sample location
 SamplesRoboticsTutorialsTutorial4mvpl

This tutorial can also be used in a Simulation without requiring any robotic hardware.

This tutorial teaches you how to:

Prerequisites

Hardware

You need a robot with microcontroller and a contact sensor. The sensor can also be distance detection devices (like sonars or infrared sensors) that provide a simple binary signal when a particular threshold is detected. Configure your contact sensors so that one is at the front and the other is at the rear.

This tutorial also requires two motors in a two-wheeled differential/skid drive configuration.

Connect the sensors and motors to your robotic platform following the normal conventions for the hardware you are using.

To determine if support is included in Microsoft Robotics Studio for your robot and to setup your hardware, see Setting Up Your Hardware Overview. You may be able to apply this tutorial for other robots that provide similar services (or create your own services by performing the Service Tutorials included in Microsoft Robotics Studio). Setting up Your Hardware may also provide you with any recommended guidelines for setting up your PC to communicate with your robot.

Software

This tutorial is designed for use with Microsoft Visual Programming Language.

Microsoft Visual Programming Language (VPL) is an application development environment designed on a graphical dataflow-based programming model rather than control flow typically found in conventional programming. Rather than series of imperative commands sequentially executed, a dataflow program is more like a series of workers on an assembly line who do their assigned task as the materials arrive. As a result, VPL is well suited to programming a variety of concurrent or distributed processing scenarios.

VPL is targeted for beginning programmers with a basic understanding of concepts like variables and logic. However, VPL is not limited to novices. The compositional nature of the programming language may appeal to more advanced programmers for rapid prototyping or code development. In addition, while its toolbox is tailored developing robot applications, the underlying architecture can be applied to other applications. As a result, VPL may appeal to a wide audience of users including students, enthusiasts/hobbyists, as well as possibly web developers and professional programmers.

You will also need Microsoft Internet Explorer or another conventional web browser.

Getting Started

To begin, open the Microsoft Visual Programming Language development environment and create a new project by selecting New from the File menu.

Now drag a Direction Dialog from the Services toolbox into your diagram. The Direction Dialog provides a simple window with five buttons to control the robot: a left button, right button, Forwards button, backward button, and a stop button.

The Direction Dialog is designed to let you press a button on the dialog to trigger an event which passes the name of the button as a string. By connecting to this event, you can use an If activity block to control the motors of the robot.

Step 1: Define the Operations

Add a new Switch activity and a new Calculate to your diagram. The Switch compares its input message to the the values in its entries and sends the message to output of the first entry (from top to bottom) that matches the message.

Connect the Calculate block to the ButtonPressed notification of the DirectionDialog block and type Name in the text box to get the name of the button that was pressed.

In the Switch block, enter "Stop" (include the quotes). Click the Plus ( + ) button in the lower left of the activity block to display another condition. Enter, "Forwards". Click the Plus button three more times and enter "Backwards", "Left", and "Right" in the text boxes.

Figure 1

Figure 1 - Add the actions in the switch block.

Insert seven Data activities. Connect:

  • One to the "Stop" output and entering 0.0.
  • One to the "Forwards" output and enter 0.8.
  • One to the "Backwards" and enter -0.8.
  • Two to the "Left" output, entering 0.6 and -0.6.
  • Two to the "Right" output, entering 0.6 and -0.6

Insert two Join activities. Label the local variables in the Join text boxes as Left and Right. For each Join, connect the two Left Data blocks to one of Join activities and connect to the two Right Data blocks to the other.

Figure 2

Figure 2 - For each action specify the motor power values.

The Join activities take the two data value inputs and sends them together.

Now connect the output of each Join and each of the other Data blocks to a Generic Differential Drive service.

Your diagram is now complete and should look like the following.

Figure 3

Figure 3 - Merge the values to set drive power.

Step 2: Use Alternative Dataflow Diagrams

As a variation of this diagram, instead of using the Stop button, you can use the ButtonReleased event of the DirectionDialog service so that the robot goes when you press the buttons and stops when you release them.

Step 3: Run Your Application

Run your application by selecting the Run command from the Run menu or by pressing F5.



https://m.sciencenet.cn/blog-294785-266984.html

上一篇:Microsoft Robotics Studio
下一篇:卡尔曼滤波器Matlab工具箱

0

发表评论 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-6-2 14:21

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部