Back to description
Welcome to the world of robotics software! If you are just entering the world of robotics, a warning is in order. Whether... more
Welcome to the world of robotics software! If you are just entering the world of robotics, a warning is in order. Whether you are a hobbyist, a student, or a professional, working with robots can be addictive and if you are not careful, it can crowd out other worthy pursuits such as career, social life, and personal hygiene. If you are willing to take that risk, keep reading.
This book is not going to tell you how to build your own robot to fetch beer from the refrigerator or pick up your roommate’s socks off the floor. Instead, you will learn how to use an innovative new software development kit (SDK) called Microsoft Robotics Developer Studio (MRDS) to build software for robots already on the market, as well as custom robots and robots yet to be built.
The best feature of MRDS is that it’s free for personal, academic, and development use. If you end up shipping an application that uses MRDS, there is a modest licensing fee.
If you have a LEGO NXT or an iRobot Create or one of several other robots, you can start controlling your robot with MRDS right away. If you have a robot that doesn’t yet have MRDS support, this book will show you how to write your own custom robotics services.
You don’t have a robot yet? Don’t worry about it. MRDS includes a sophisticated 3D simulation environment for virtual robots. You can be driving robots through a virtual environment just minutes after you download the free SDK, and the majority of the examples in the book are designed so that they will work with the simulator.
Don’t be deceived by the “price,” though. MRDS includes a sophisticated run-time environment that makes it easy to write powerful asynchronous and distributed applications. Several large corporations are using this environment in non-robotics applications to handle robust serving of web pages and financial transactions. In its short life, MRDS has already eaten up the road in the DARPA Urban Challenge and swam underwater in a robotic submarine.
If we’re ever going to get to the point where robots overthrow our way of life and threaten the very existence of humanity, we all need to get busy writing robotics software. It’s time to download Microsoft Robotics Developer Studio and become a part of the robotics revolution.
... less
Microsoft Robotics Developers Studio (MRDS) is built on two basic components: the Concurrency and Coordination Runtime... more
Microsoft Robotics Developers Studio (MRDS) is built on two basic components: the Concurrency and Coordination Runtime (CCR) and the Decentralized Software Services (DSS). This chapter covers many of the concepts of the CCR; the next chapter discusses DSS.
To quickly clarify the differences between the CCR and DSS: The CCR is a programming model for handling multi-threading and inter-task synchronization, whereas DSS is used for building applications based on a loosely coupled service model. Services can run anywhere on the network, so DSS provides a communications infrastructure that enables services to transparently run on different nodes using all of the same CCR constructs that they would use if they were running locally.
Although you can use the CCR on its own, completely outside MRDS, this is not how you use it for creating robotics applications. Consequently, there is some overlap with DSS in this chapter because it provides an environment that makes CCR easier to use. In fact, there was some discussion during the writing of this book regarding whether CCR or DSS should be covered first. You can take a peek at the next chapter and decide for yourself in which order you want to read them.
A large amount of documentation is supplied with MRDS and the authors do not intend to reproduce it all here. You should read the online CCR User Guide (http://msdn2.microsoft.com/en-us/library/bb905447.aspx), which is also in the documentation that comes with MRDS. In particular, you will find the MRDS Tutorials to be an invaluable source of information.
http://msdn2.microsoft.com/en-us/library/bb905447.aspx
The objective in this book is to give you a brief introduction to the important concepts and then get into coding as quickly as possible. Along the way, many new applications supplement the examples that are included in the MRDS distribution.
You will probably find that the MRDS environment is quite different from anything that you have programmed with in the past, which means that it can involve a steep learning curve. Luckily, Microsoft recognized this and built the Visual Programming Language (VPL) tool to hide many of the details about how MRDS services work. However, as a professional programmer, you need to understand what is happening “under the hood,” so the book begins with the basics, and VPL is covered later in the book.
The Decentralized System Services (DSS) are responsible for controlling the basic functions of robotics applications. As... more
The Decentralized System Services (DSS) are responsible for controlling the basic functions of robotics applications. As explained in the previous chapter, DSS is built on top of the CCR. There is a DSS base class from which all services are derived, and this draws heavily on the features of the CCR.
DSS is responsible for starting and stopping services and managing the flow of messages between services via service forwarder ports. In fact, DSS itself is composed of several services that load service configurations; manage security; maintain a directory of running services; control access to local files and embedded resources such as icons; and provide user interfaces through web pages that are accessible using a web browser,
DSS uses a protocol called, not surprisingly, DSS Protocol (DSSP). The specification for DSSP can be used for free under the Microsoft Open Software Promise. DSSP is based on the Representational State Transfer (REST) model, which should be a familiar model for anyone who has worked in web development.
In some ways, such as handling errors using faults, DSSP is similar to SOAP (Simple Object Access Protocol) which is used by web services. However, unlike web services, DSSP separates state from behavior and represents all access to a service as operations on the state. In contrast, the state of a web service is hidden. Making the state of a robot fully visible, especially sensor values, is essential to writing control behaviors for the robot. A key feature of both models is asynchronous event notifications, which are important in the dynamic environment of robotics.
In this chapter, you learn how to build services, including the fundamental concepts. Like the last chapter on the CCR, this one is full of new terminology and it may take you a little while to become completely familiar with DSS.
The Decentralized System Services (DSS) are responsible for controlling the basic operations of robotics applications. As... more
The Decentralized System Services (DSS) are responsible for controlling the basic operations of robotics applications. As explained in the previous chapter, DSS is built on top of the CCR. This chapter moves on to more advanced features of services, including subscriptions and user interfaces. It is very likely that you will need to use the material in this chapter at some stage.
This chapter develops a service, called TeleOperation, that can be used to drive a robot with a web camera attached so you can see where the robot is going. The code introduces you to using Windows Forms as well as Web Forms with MRDS services, and demonstrates how to display live video. Don’t worry if you don’t have a robot with a camera because the faithful simulator comes to the rescue and you can still work through the code.
You might want your user interface to look like the cockpit of a 747, but that is not the objective in this chapter. It covers the basics of using Windows Forms (WinForms) and how to format web pages using XSLT. You can add fancy stuff yourself later.
These concepts are used in the Dashboard service that is included with this chapter. However, the discussion in the text uses the TeleOperation service because it contains a small subset of the Dashboard functions.
The Visual Simulation Environment, a key part of Microsoft Robotics Developer Studio, uses 3D graphics to render a virtual... more
The Visual Simulation Environment, a key part of Microsoft Robotics Developer Studio, uses 3D graphics to render a virtual world and a physics engine to approximate interactions between objects within that world. At first glance, it looks something like a game engine. However, after a little bit of use, it quickly becomes apparent that it is much different; whereas many actions and events are scripted in a game environment, the things that happen in the simulator rely completely on the interactions and motions of objects in the environment.
This chapter explains how to use the Visual Simulation Environment along with all of the simulation objects and services provided in the SDK. Subsequent chapters explain in detail how you can add your own objects and environments to the simulator to explore your own robotic designs.
In this chapter, you’ll learn the following:
How the simulator can help you prototype new algorithms and robots
What hardware and software are required to run the simulator
How to use the basic simulator functions
How to use the Simulation Editor to place robots and other entities in a new environment
What built-in entities are provided with the SDK and how to use them
This chapter focuses on using the simulator functionality with the environments and entities provided as part of the SDK. The next chapters go into more detail about how you define your own environment and entities.
The previous chapter showed how to use the MRDS Visual Simulation Environment, including making simple edits to the environment... more
The previous chapter showed how to use the MRDS Visual Simulation Environment, including making simple edits to the environment using the Simulation Editor. The robot entities and environments provided with the MRDS SDK are great, but they only tap a small part of the simulator’s potential.
This chapter demonstrates how to add your own custom entities and services to the simulation environment. You will define a new four-wheel-drive robot with a camera and IR distance sensors, along with the services needed to drive the motors and read the sensor values. In the next chapter, you’ll use this robot in a simulation of the SRS Robo-Magellan contest.
By the time you complete these two chapters, you will know how to build an entire simulation scenario, complete with special environmental entities, a custom robot, services to interface with the entities, and a high-level orchestration service to control the behavior of the robot.
A simulation scenario is an environment and one or more robot models that is used to prototype a control algorithm. The extent... more
A simulation scenario is an environment and one or more robot models that is used to prototype a control algorithm. The extent to which the environment reflects real-world conditions and limitations depends on the desired results from the simulation. If it is important that the exact code you use in the simulator can run on a real robot, then the simulated world and services must carefully model every important aspect of the real world. If the simulator is to be used only to prototype or demonstrate an algorithm, then real-world fidelity is less important.
In this chapter, you’ll use the new Corobot robot entity from the last chapter in a simulation scenario that mimics the Seattle Robotics Society’s Robo-Magellan competition. A description of the competition and the rules can be found at www.robothon.org/robothon/robo-magellan.php. Before the competition begins, a referee places cones on the course and then provides GPS coordinates to the contestants for their location. Robots start at a predetermined place and navigate to each cone, avoiding obstacles along the way. The challenges that the robots face are navigating over outdoor terrain, avoiding obstacles, and dealing with GPS signal problems.
www.robothon.org/robothon/robo-magellan.php
In this simulation, you’ll mainly focus on navigation and obstacle avoidance. You haven’t built a GPS service yet so you’ll use the robot position reported by the SimulatedQuadDifferentialDrive to mimic this capability.
SimulatedQuadDifferentialDrive
In the last chapter, you used the Corobot manifest to test the Corobot entity and its associated services. For this scenario, you’ll define a new manifest that runs the Corobot services along with a referee service and the Robo-Magellan orchestration service.
This chapter explains how to create articulated entities such as robotic arms and jointed robots in the simulation environment... more
This chapter explains how to create articulated entities such as robotic arms and jointed robots in the simulation environment. Wheeled robots are fine for some applications, but sometimes you need a robot that can reach out and grab things.
The primary mechanism for defining articulated entities is the Joint object. This chapter begins by describing how to use a joint to join two entities and all of the options that are available. Then you will learn how to build a robotic arm with multiple joints.
Joint
The previous chapters in this part have covered what you need to know to make your own simulation scenarios, complete with... more
The previous chapters in this part have covered what you need to know to make your own simulation scenarios, complete with custom robots, simulation services, and orchestration services. Unfortunately, all this information is a little like being handed a toolbox and a pile of lumber and being told to build a house. It helps to have a few examples to work from. That’s what this chapter is all about.
Several examples are presented that demonstrate how to use the simulator in a variety of ways. You’ll see how to define a new Sumo Player service using the Simulated Sumo Competition package. You’ll see how to take articulated robotic arms to the next level by building a simulated walking hexapod. You’ll also see how to implement a soccer strategy with a team of Corobots in the Simulated Soccer Competition package. Finally, you’ll have an opportunity to build a complete simulation environment that can be explored by a simulated robot and built from a floor-plan image.
The Microsoft Visual Programming Language (VPL) is a new application development environment designed specifically to work... more
The Microsoft Visual Programming Language (VPL) is a new application development environment designed specifically to work with DSS Services. Programs are defined graphically in data flow diagrams rather than the typical sequence of commands and instructions found in other programming languages. VPL provides an easy way to quickly define how data flows between services. It is useful for beginning programmers because they can quickly specify their intent, but it is also well suited to help with prototyping and code generation for more experienced programmers. It is also useful for specifying robotic orchestration services within the context of the Microsoft Robotics Developer Studio SDK but it can be used outside of robotics as well.
This chapter covers what it means to work with a data flow language, how to specify a data flow diagram using the basic activities provided by VPL, and how to debug and run it. You won’t find any robots in this chapter but you will learn how to use VPL to control robots in Chapter 11.
The Microsoft Visual Programming Language (VPL) can be used to implement general-purpose programs that have nothing to do... more
The Microsoft Visual Programming Language (VPL) can be used to implement general-purpose programs that have nothing to do with robotics, but because it is part of the Microsoft Robotics Developer Studio SDK, this chapter focuses on robotic applications.
First, the relationship between VPL activities and DSS services is explained, and you’ll learn how to compile a diagram into a C# service implementation. Next you’ll learn how to associate an activity with a specific service. Simple examples are provided that demonstrate how to control actuators and read data from sensors.
More complicated examples are presented in Chapter 12.
The previous two chapters explained the basics of the Microsoft Visual Programming Language (VPL) and showed how VPL can... more
The previous two chapters explained the basics of the Microsoft Visual Programming Language (VPL) and showed how VPL can be used to read robot sensors and control robot actuators. Be sure that you are familiar with the material in Chapters 10 and 11 before reading this one. This chapter offers a few more examples that show how VPL can be used to solve a variety of problems. The examples use the Simulation Environment instead of actual robot hardware so that they are accessible to everyone. In most cases, they can be converted to run with actual hardware just by changing the manifest that is used.
Each example is independent of the others so feel free to dive in and devour a few or just take a bite from all of them.
Welcome to the hardware part of the book. So far in this book you have learned a lot about Microsoft Robotics Developer Studio... more
Welcome to the hardware part of the book. So far in this book you have learned a lot about Microsoft Robotics Developer Studio (MRDS), mostly using the simulator, a key feature of which is that you can use the same code to control a simulated robot as a real robot. Fortunately, this means that you already know how to drive a real robot provided that the low-level communication is taken care of for you.
This chapter provides an overview of the hardware chapters as well as some key concepts in robotics; it does not introduce new code. Subsequent chapters explain how to use a variety of real robots with MRDS. Several different types of robots are covered, including wheeled robots and a robotic arm. If you have experience with robots, you might want to skim quickly through this material. Conversely, if you have not used robots before, then you should find the chapter useful for gaining a basic understanding of the field.
Some material from previous parts of the book is discussed again in this part of the book. This is intended to make the individual parts independent of each other, although repetition is also good when you are learning new material.
Because this book is designed to introduce programmers to Microsoft Robotics Developer Studio, you should view it as a supplement to the online documentation, not a replacement. In particular, you should regularly visit the MRDS home page and check the discussion forum: http://forums.microsoft.com/MSDN/default.aspx?ForumGroupID=383&SiteID=1.
http://forums.microsoft.com/MSDN/default.aspx?ForumGroupID=383&SiteID=1
It is not assumed that you know much about robotics. There are countless textbooks on the subject of robotics and even entire degree programs with titles like “Robotics Engineering” and “Mechatronics.” If you want to learn more about robotics, you should spend some time looking at your favorite online bookstore or in your local bookstore. In addition, most robot manufacturers have active discussion forums, and you can learn a lot from the experiences of other people. You might also be able to find a robotics club in your local area.
Industrial robots are not covered in this book and it does not teach you how to build a robot starting from spare parts. It is definitely not suitable for designing and programming robots that might be used for handling hazardous materials or that operate in medical environments, especially if the application is life-critical. You should consider the robots in this book to be educational toys or research tools.
Remotely controlling a robot is one of the most common robotics scenarios. It is usually necessary because the robot is too... more
Remotely controlling a robot is one of the most common robotics scenarios. It is usually necessary because the robot is too small to carry an onboard PC, or the cost of an onboard PC would be prohibitive. For example, teaching robotics in a classroom requires a lot of robots, so they need to be relatively inexpensive.
This chapter covers how to connect real robots to Microsoft Robotics Developer Studio and make them perform simple tasks. Two different robots are used in the examples: the LEGO NXT Tribot and the Parallax Boe-Bot. There are differences between the examples due to different hardware capabilities, which has the benefit of demonstrating different tasks. Regardless of which type of robot you have, you should read the entire chapter.
Subsequent chapters explain how you can build your own mobile robot with an onboard PC so that it can operate autonomously.
The previous chapter discussed remotely controlling a wheeled robot. This chapter covers using a robotic arm, which is substantially... more
The previous chapter discussed remotely controlling a wheeled robot. This chapter covers using a robotic arm, which is substantially different. Although robotic arms can be attached to a mobile robot, they are usually fixed to the floor or a table and can therefore be directly connected to the PC that controls them with no need for wireless communication or an onboard PC.
There are many different types of articulated robots, and arms are only a small subset. For example, bipedal humanoid robots are articulated and so are robots that emulate snakes. However, the robot arms that build cars are probably one of the first and most successful applications of robotics in industry.
Relatively cheap hobby arms are available from several sources, such as Lynxmotion. This chapter shows you how to use a Lynx L6 arm to do some simple operations. The L6 is a small lightweight arm that is intended for hobbyists and education. The software on the book’s website (www.proMRDS.com or www.wrox.com) includes a Lynx6Arm service for controlling the arm, as well as some examples demonstrating how to use it. The original service software and several of the photos in this chapter are courtesy of Lynxmotion.
www.proMRDS.com
www.wrox.com
A Lynx arm is not suitable for industrial use. For that you need something like a heavy-duty arm from KUKA. You might be interested in trying out the KUKA Educational Framework for MRDS, available for download from www.kuka.com.
www
kuka
com
The KUKA framework contains several tutorials using a simulation of a KUKA LBR3 arm. However, the tutorials rapidly get into complex mathematics. The objective in this chapter is to provide an overview without going into the great depth of the KUKA tutorials.
Note
If you have not read Chapter 8, it would be a good idea to go back and do so now. It introduces a lot of key concepts for articulated arms and does so using a simulation so that you don’t have to worry about breaking anything if you make a mistake! This chapter assumes that you are familiar with the material in Chapter 8.
And now for something completely different . . .
So far you have seen robots controlled directly from your desktop PC. However... more
So far you have seen robots controlled directly from your desktop PC. However, it is much more fun to let them roam free. To do this you need to make them autonomous, i.e., give the robots onboard brains.
In writing a book like this it is hard to predict the skills of the audience. Some of you might have worked with MS-DOS in what now seems like a previous life, and others might be young enough to have grown up without having to deal with the horrors of command prompts, Autoexec.bat, Windows for Workgroups, and so on. Unfortunately, in some ways working with onboard computers is taking a step backwards from the comfortable environment of Windows XP or Vista that you have on your desktop PC to the bygone era of DOS.
Autoexec.bat
Some of this chapter, therefore, is about introducing you to what might be new concepts and ways of programming and debugging. The robotics content is not very high, but unless you understand how to work in these environments you will not be able to create autonomous robots.
Regardless of whether you want to build an autonomous robot or not, you might find parts of this chapter useful. For example, it discusses using the .NET Compact Framework (CF) on a personal digital assistant (PDA) to control a robot via Bluetooth.
You should read the entire chapter even if you are using Windows CE because some of the material in the section on PDAs is relevant to Windows CE as well.
As the final chapter in this book, there is a lot of material to draw on. Building services, debugging, and deploying services... more
As the final chapter in this book, there is a lot of material to draw on. Building services, debugging, and deploying services are all covered in previous chapters as well as Chapter 16, which discusses building services for Windows CE and Windows Mobile.
In this chapter, you’ll start with a blank slate and build services for a new robot. You’ll begin with a new Generic Brick contract, and then build services based on this for the Integrator and Hemisson robots. To simplify the process of testing, a test service is also available that can execute operations on any robot based on the Generic Brick contract.
The Integrator uses a PICAXE microcontroller that is similar to the BASIC Stamp in that it has an onboard BASIC interpreter. The “monitor program” that is necessary for the robot to communicate with a PC is developed in BASIC.
The Integrator robot was selected because of the popularity of small microcontrollers such as the PIC16F88, on which the PICAXE is based. Although the Integrator is not a widely known robot, the instructions in this chapter should assist you in programming your own robot based on a range of different robots that are available in kit form or preassembled.
The authors also provide services for the Hemisson robot from K-Team in the ProMRDS\Chapter17 folder. These are based on the Generic Brick contract as a second example, and show you how to approach the task when the robot already has its own firmware and the communications “protocol” is already defined. In this case, you do not have to write a monitor program.
ProMRDS\Chapter17
Purchase Before purchasing this product, please be sure you have met all software and system requirements, and that you understand any limits placed upon its use.
Return Policy Wrox Chapters on Demand are non-returnable and non-refundable.
Reader Software Wrox Chapters on Demand are offered as PDFs, and they must be viewed using the Adobe Reader. If you do not have the Reader installed, it can be downloaded for free at Adobe.com.
Test Download As Wrox Chapters on Demand purchases are non-returnable, it is advisable that you test your system and software configurations with a free sample download before you place an order.
Usage Rights for a Wrox Chapter on Demand File Any Wrox Chapter on Demand product you purchase from this site will come with certain restrictions that allow Wiley to protect the copyrights of its products. After you purchase and download this title, you:
If you have any questions about these restrictions, you may contact Customer Care at (877) 762-2974 (8 a.m. - 5 p.m. EST, Monday - Friday). If you have any issues related to Technical Support, please contact us at 800-762-2974 (United States only) or 317-572-3994 (International) 8 a.m. - 8 p.m. EST, Monday - Friday).
Related Books