arlier this year, Microsoft released a Community Technical Preview (CTP) of its robot-programming SDK, called "Microsoft Robotics Studio
," the result of work done by one of the groups emerging from Microsoft Research. Robotics Studio provides a high-level generic interface for programming a wide range of robots using a distributed model. The utility of this approach is apparent by the fact that both hobbyists controlling robotic kits or toy robots and serious roboticists controlling large and complicated robots can use the same SDK. This article presents an overview of Robotics Studio, and then shows you how to use the SDK to program the iRobot Roomba vacuum robot.
Microsoft Robotics Studio
The small group that created Robotics Studio hopes to simplify robot programming for all sorts of people by offering an easy way to manipulate a robot of any size. The best part is that the runtime supports distributed processing and does not require any particular robotic OS, meaning that you can program robots running on different platforms, using different chip architectures. You can also manipulate complex robots, which sometimes have more than one processor type.
Robotics Studio is made up of three main areas of software. They are as follows:
- RuntimeThis is the central core that allows you to run robots from toys to industrial size models.
- Concurrency Library (CCR)This simplifies managing concurrent processes, which is necessary because robots have several things going on at once.
- Decentralized System Services (DSS)This is a services-based architecture that lets you write and coordinate distributed applications.
|What You Need
|Microsoft Robotics SDK (September 2006 CTP release) and an iRobot Roomba Vacuuming Robot (any of the current models). Robotics Studio works with a number of other robots as well.
All these areas are used to build Web-based applications that are lightweight and flexible since they utilize Web services to distribute processing. The application itself resides on a Web server; the robot communicates with the application using a wireless or wired interface. Obviously, the wireless alternative is preferable because that allows the robot to move with the greatest amount of freedom.
Programming robots involves the monitoring and manipulation of multiple processes (or services, as they are referred to in Robotics Studio) that often occur at the same time. For instance, a robot can be moving, (one process) and at the same time one of the robot's sensors can be collecting information about the environment. These two processes need to occur concurrently. The Robotics SDK utilizes the Concurrency Library (CCR) to support this need for concurrent processing, .
Services are core objects in Robotics Studio. Each service lets you communicate between processesand each process performs a specific function (such as moving a robots head or retrieving data from a sensor). Your application comprises a set of services that talk to each other at the same time.
The services send messages to each other through ports. The services know how to communicate with each other because they each have a contract. The contract contains all the information about how messages should be formatted and what the service supports. You specify all this in an XML schema definition file (.xsd
file). The third core area, a Decentralized System Services (DSS) node, coordinates all this activity. DSS is one of the key software areas that makes up Robotics Studio.
Robotics Studio Features
Unusually for a new product, the Microsoft Research group did well by including several tutorials that step you though how to get your robot up and running. The tutorials are available in multiple languages and cover everything from accessing and coordinating services to using abstract reusable services. Abstract reusable services are great because you can use the same code to run different robots (even if they reside on different platforms). The Robotics SDK installation includes tutorials that demonstrate how you might need to accomplish certain tasks. Tutorial #3 shows how to create reusable orchestration services.
For example, you could create an HTML page that allowed you to enter information, such as text that you want your robot to speak. You could then use code similar to the following that allowed the robot to speak the text entered.
var sayRequest = IEDSSNode.CreateObject(
sayRequest.SpeechText = textMessage;
This example calls the SayText
function, using the text passed in as the textMessage
as a parameter. The function uses the IEDSSNode object, which is the Internet Explorer DSS host object.
You can also control your robot using Microsoft Instant Messenger (IM). This is great for quickly and remotely controlling your robot. Using IM and a handheld device, you could build a simple remote control for your robot. Robotics Studio provides a tutorial that walks you through how to do this.
|Figure 1. iRobot Roomba: iRobot's product line includes several different robots. Here's the Roomba Red Vacuuming Robot.|
Using the Microsoft Speech SDK 5.1, you can add text-to speech capabilities to a speech-compatible robot, letting your robot communicate with the outside world verbally. For example, you can easily make the Roomba robot (see Figure 1
) say "Ouch" when certain sensors are triggered or announce when it has gotten stuck.
For novice programmers or people new to the world of robotics programming, Robotics Studio features a tool called the Visual Programming Language (VPL). This utility allows you to build a dataflow for your application visually by dragging objects onto a worksheet. Included with each tutorial is a VPL file that allows you to quickly see how the tutorial works.
Finally, for those people who want to experiment with robotic control before a robot is actually built (or those who don't have a robot available), Robotics Studio provides a simulation environment, and includes tutorials that step you through its use. You can effectively build a robot and control the movements virtually. This is great for robotics classes that need to teach about robotics and do not want to waste the entire time just building the robot.