An Introduction to Programming Robots with Microsoft Robotics Studio

An Introduction to Programming Robots with Microsoft Robotics Studio

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:

  • Runtime?This 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 processes?and 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.

Robotics Studio includes several nice features that give you all sorts of ways to control your robot. One of the nicest features is the ability to control or monitor robots using Internet Explorer (IE). Using the tutorial provided with Robotics Studio and a few lines of JavaScript, you can monitor the sensors from your robot. This allows you to create a control panel that can be monitored remotely.

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.

function sayTextToSpeech(textMessage)      {   IEDSSNode.ThisService().InsertStateItem(         "RunScript","sayMessageImpl(""+textMessage+"");")      var sayRequest = IEDSSNode.CreateObject(        "Microsoft.Robotics.Technologies.Speech.TextToSpeech." +         "Proxy.SpeechMsg",speechConnect);      sayRequest.SpeechText = textMessage;      IEDSSNode.SendMessage(        speechConnect,"Microsoft.Robotics.Technologies.Speech." +         "TextToSpeech.Proxy.SayText",sayRequest,function(){});   } 

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.

Available Robots
At this time, the SDK provides tutorials that support nine different robots?and I’m sure that number will increase with every new release. Table 1 lists the robots supported by the latest release.

Table 1: Robots currently supported by Microsoft Robotics Studio.

Robot Typical Price Description
iRobot Roomba $149.99 and up Several different models are available. The best part about this robot is that it also provides a practical service and vacuums your floors.
LEGO Mindstorms RCX $119.99 Programmable LEGO brick that you can use to transform a LEGO model into a robot.
LEGO Mindstorms NXT $249.95 LEGO?s latest robot kit, featuring Bluetooth capabilities and several redesigned sensors.
Parallax Boe-Bot BASIC Stamp Robot $198.77 (for a limited time) A wheeled robot that features a Bluetooth module. This is a great robot for students and hobbyists.
Lynxmotion Lynx 6 Robotic Arm $388.75 This robotic arm features motion in the base, shoulder, elbow and wrist and also has a functional gripper.
fischertechnik $199.00 and up This flexible construction kit allows you to design and build your own robot.
Kondo KHR-1 $1499.00 and up For the serious robot lover, this fighting Japanese robot is popular in the robot wars.
MobileRobots Pioneer P3 DX Contact Sales for quote This general purpose wheeled robot includes a laser, arm, bumpers, and vision.

No matter which robot you choose, you’ll need a way to communicate with it. For a limited time, Parallax is offering a discount on a bundle that allows you to program their Boe-Bot BASIC stamp robot using Bluetooth. Parallax is a true innovator in the field of robotics, striving to make robotics accessible to a wide range of people. The Boe-Bot is a great robot for people wanting to enter robotics competitions, which are rapidly gaining popularity across the United States.

The Boe-Bot kit does require you to assemble the robot, but should only take a couple of hours to do so. You can also expand the Boe-Bot to speech (using a speech board) and/or a wireless camera controlled from a connected computer. The Boe-Bot is a great robot for hobbyists or students wanting to learn more about how robots work.

I chose to test Robotics Studio using the iRobot Roomba, a programmable robotic vacuum cleaner.

iRobot’s Roomba Vacuuming Robot
Founded in 1990 by a group from the Massachusetts Institute of Technology, iRobot’s flagship product is the popular Roomba vacuum. Over two million units have been sold and the company makes constant improvements to the product. The company offers several different models that do everything from simple cleaning to allowing for scheduled operations and remote control.

The Roomba Red vacuuming robot (see Figure 1) is the least expensive of iRobot’s vacuuming robots. This one lets you clean both hardwood and carpeted floors. Using one of the interfaces available at http://www.roombadevtools.com, you can control your Roomba programmatically.

In 2005, the company added a Serial Command Interface (SCI) to all models that allows owners to program their Roombas. The SCI gave hobbyists who may not be interested in actually building a robot a way to enter the world of robotics.

Programming your Roomba with Robotics Studio
Robotics Studio offers several tutorials that get you up and running with your robot. You can use the Robotics tutorial #4 to work with the Roomba. A manifest file is included which specifically allows you to control your Roomba. The XML-based manifest file, seen below, contains the information needed by Robotics Studio to work with a specific type of hardware.

                                            http://schemas.microsoft.com/robotics/2006/08/roomba.html                                                                        http://localhost/mountpoint/Samples/Config/                  iRobot.Roomba.Config.xml
?
Figure 2. DataFlow Tab: Here's a screenshot of the dataflow tab for the robotics tutorial #4, as shown in the Microsoft Visual Programming Language utility.
dssp:StateService
http://schemas.microsoft.com/robotics/ 2006/09/roombadrive.html

The tutorial project is available in CSharp, VB.NET, and Jscript versions. The Robotics Studio installs the tutorial in the samples subdirectory. In addition to the different language versions, the tutorial includes a Microsoft Visual Programming Language (MVPL) file, which lets you see the way data flows through your application (see Figure 2). You can use this tool to convert the dataflow into actual code.

The tutorial project itself initializes the DSS node using the manifest files located in the config folder for the project. It also brings up a small form (see Figure 3) that lets you control the direction in which your robot moves.

?
Figure 3. Simple Robot Motion Control: Here’s the control form available with the robotics tutorial #4. You can use this form to control the motion of your Roomba vacuum.

You need to make a change to the configuration file, iRobot.Roomba.Drive.manifest.xml, before executing the tutorial. You will need to add a element and set the value to the COM port to which the Roomba interface is connected. If you are using a wireless connection, then this will be the RooTooth (see the sidebar “Roomba Development Tools“).

Is this Artificial Intelligence?
If you are thinking that Microsoft has solved problems associated with Artificial Intelligence (AI), you are partly right. They have created a software tool that makes it easier to control robots, which is often associated with AI. But, most scientists would define AI as the ability for a machine to think for itself. Robotics Studio may be used as a basis for adding higher level abstractions that represent intelligence, but in itself, it is only a tool for controlling the robot.

What makes Robotics Studio so special is that it opens up more opportunities for people to access the world of robotics. According to Tandy Towler, program manager for the Robotics Studio group, “Robots are about to be unshackled from forced labor. Expect them everywhere”. So, now is a great opportunity for you as a developer to get involved with the world of robotics. I encourage everyone to download Robotics Studio and take a look. Even if you do not want to invest in a robot, you can still experiment with the service tutorials that require no hardware. You can also play with the Simulation Tool which allows you to simulate what your robot will do before you actually build it. And most importantly, it’s a lot of fun.

devx-admin

devx-admin

Share the Post:
Software Development

Top Software Development Companies

Looking for the best in software development? Our list of Top Software Development Companies is your gateway to finding the right tech partner. Dive in

India Web Development

Top Web Development Companies in India

In the digital race, the right web development partner is your winning edge. Dive into our curated list of top web development companies in India,

USA Web Development

Top Web Development Companies in USA

Looking for the best web development companies in the USA? We’ve got you covered! Check out our top 10 picks to find the right partner

Clean Energy Adoption

Inside Michigan’s Clean Energy Revolution

Democratic state legislators in Michigan continue to discuss and debate clean energy legislation in the hopes of establishing a comprehensive clean energy strategy for the

Chips Act Revolution

European Chips Act: What is it?

In response to the intensifying worldwide technology competition, Europe has unveiled the long-awaited European Chips Act. This daring legislative proposal aims to fortify Europe’s semiconductor

Revolutionized Low-Code

You Should Use Low-Code Platforms for Apps

As the demand for rapid software development increases, low-code platforms have emerged as a popular choice among developers for their ability to build applications with

Software Development

Top Software Development Companies

Looking for the best in software development? Our list of Top Software Development Companies is your gateway to finding the right tech partner. Dive in and explore the leaders in

India Web Development

Top Web Development Companies in India

In the digital race, the right web development partner is your winning edge. Dive into our curated list of top web development companies in India, and kickstart your journey to

USA Web Development

Top Web Development Companies in USA

Looking for the best web development companies in the USA? We’ve got you covered! Check out our top 10 picks to find the right partner for your online project. Your

Clean Energy Adoption

Inside Michigan’s Clean Energy Revolution

Democratic state legislators in Michigan continue to discuss and debate clean energy legislation in the hopes of establishing a comprehensive clean energy strategy for the state. A Senate committee meeting

Chips Act Revolution

European Chips Act: What is it?

In response to the intensifying worldwide technology competition, Europe has unveiled the long-awaited European Chips Act. This daring legislative proposal aims to fortify Europe’s semiconductor supply chain and enhance its

Revolutionized Low-Code

You Should Use Low-Code Platforms for Apps

As the demand for rapid software development increases, low-code platforms have emerged as a popular choice among developers for their ability to build applications with minimal coding. These platforms not

Cybersecurity Strategy

Five Powerful Strategies to Bolster Your Cybersecurity

In today’s increasingly digital landscape, businesses of all sizes must prioritize cyber security measures to defend against potential dangers. Cyber security professionals suggest five simple technological strategies to help companies

Global Layoffs

Tech Layoffs Are Getting Worse Globally

Since the start of 2023, the global technology sector has experienced a significant rise in layoffs, with over 236,000 workers being let go by 1,019 tech firms, as per data

Huawei Electric Dazzle

Huawei Dazzles with Electric Vehicles and Wireless Earbuds

During a prominent unveiling event, Huawei, the Chinese telecommunications powerhouse, kept quiet about its enigmatic new 5G phone and alleged cutting-edge chip development. Instead, Huawei astounded the audience by presenting

Cybersecurity Banking Revolution

Digital Banking Needs Cybersecurity

The banking, financial, and insurance (BFSI) sectors are pioneers in digital transformation, using web applications and application programming interfaces (APIs) to provide seamless services to customers around the world. Rising

FinTech Leadership

Terry Clune’s Fintech Empire

Over the past 30 years, Terry Clune has built a remarkable business empire, with CluneTech at the helm. The CEO and Founder has successfully created eight fintech firms, attracting renowned

The Role Of AI Within A Web Design Agency?

In the digital age, the role of Artificial Intelligence (AI) in web design is rapidly evolving, transitioning from a futuristic concept to practical tools used in design, coding, content writing

Generative AI Revolution

Is Generative AI the Next Internet?

The increasing demand for Generative AI models has led to a surge in its adoption across diverse sectors, with healthcare, automotive, and financial services being among the top beneficiaries. These

Microsoft Laptop

The New Surface Laptop Studio 2 Is Nuts

The Surface Laptop Studio 2 is a dynamic and robust all-in-one laptop designed for creators and professionals alike. It features a 14.4″ touchscreen and a cutting-edge design that is over

5G Innovations

GPU-Accelerated 5G in Japan

NTT DOCOMO, a global telecommunications giant, is set to break new ground in the industry as it prepares to launch a GPU-accelerated 5G network in Japan. This innovative approach will

AI Ethics

AI Journalism: Balancing Integrity and Innovation

An op-ed, produced using Microsoft’s Bing Chat AI software, recently appeared in the St. Louis Post-Dispatch, discussing the potential concerns surrounding the employment of artificial intelligence (AI) in journalism. These

Savings Extravaganza

Big Deal Days Extravaganza

The highly awaited Big Deal Days event for October 2023 is nearly here, scheduled for the 10th and 11th. Similar to the previous year, this autumn sale has already created

Cisco Splunk Deal

Cisco Splunk Deal Sparks Tech Acquisition Frenzy

Cisco’s recent massive purchase of Splunk, an AI-powered cybersecurity firm, for $28 billion signals a potential boost in tech deals after a year of subdued mergers and acquisitions in the

Iran Drone Expansion

Iran’s Jet-Propelled Drone Reshapes Power Balance

Iran has recently unveiled a jet-propelled variant of its Shahed series drone, marking a significant advancement in the nation’s drone technology. The new drone is poised to reshape the regional

Solar Geoengineering

Did the Overshoot Commission Shoot Down Geoengineering?

The Overshoot Commission has recently released a comprehensive report that discusses the controversial topic of Solar Geoengineering, also known as Solar Radiation Modification (SRM). The Commission’s primary objective is to

Remote Learning

Revolutionizing Remote Learning for Success

School districts are preparing to reveal a substantial technological upgrade designed to significantly improve remote learning experiences for both educators and students amid the ongoing pandemic. This major investment, which

Revolutionary SABERS Transforming

SABERS Batteries Transforming Industries

Scientists John Connell and Yi Lin from NASA’s Solid-state Architecture Batteries for Enhanced Rechargeability and Safety (SABERS) project are working on experimental solid-state battery packs that could dramatically change the

Build a Website

How Much Does It Cost to Build a Website?

Are you wondering how much it costs to build a website? The approximated cost is based on several factors, including which add-ons and platforms you choose. For example, a self-hosted

Battery Investments

Battery Startups Attract Billion-Dollar Investments

In recent times, battery startups have experienced a significant boost in investments, with three businesses obtaining over $1 billion in funding within the last month. French company Verkor amassed $2.1