Microsoft Robotics Studio

by Paul Foster

To start designing and programming robots you don’t need anything more than a Windows PC. Even if your goal is to enter one of the most advanced research challenges in the world - as the Princeton Autonomous Vehicle Engineering or PAVE (https://pave.princeton.edu/main/ ) team, from Princeton University, did in 2007. The American Defence Advanced Research Projects Agency (DARPA) ran its third Grand Challenge – The Urban Challenge last year. Teams wishing to take part would have to build and program an autonomous ground vehicle (ie a robot car) to drive safely according to traffic law, around an urban course complete with other traffic, parked cars and a variety of junctions. Just where do you start with such a project and what programming tools could you use? Well, for the Princeton University team there was only one choice of software tools - Microsoft Robotics Studio.

Microsoft Robotics Studio makes it easier for hobbyist, academic and commercial developers to create robotic applications for a variety of hardware platforms. Free for non-commercial use, Microsoft Robotics Studio can be downloaded from https://microsoft.com/robotics. In this article let’s explore Microsoft Robotics Studio 1.5 and see what we can build with it.

Microsoft Robotics Studio (MSRS) provides a lightweight services-oriented runtime called the Concurrency and Co-ordination Runtime (CCR). The CCR is one part of the key to simplifying the development of robot applications. A robot is basically a number of actuators and sensors all working together to achieve a task. The great difficulty in writing a robot application is to ensure appropriate priority is given to all of these elements. You can’t concentrate on making your motors turn and ignore your sensors. If you do, you drive into something or someone! Likewise, if you concentrate on your sensors, some of which can provide enormous amounts of data per second, you starve the rest of your application of processing power and nothing gets done. The CCR makes it simple to write programs to handle asynchronous input from multiple robotics sensors and output to motors and actuators. In practice, you can write each sensor or robot ‘service’ as an individual program. These programs can then be orchestrated by another program with the CCR ensuring each gets appropriate processing time as required.

The second part of the key is the Decentralised Software Services (DSS) application model. This is the approach taken to implement each service. Coupled with the DSS protocol it makes it simple to access, and to respond to a robot’s state, using a Web browser or a Windows based application. In summary, using this modular service approach enables a composable model of application development. Build high-level functions using simple components, providing for resusability of code modules as well as better reliability and replaceability. For instance a lower-level sensor service could be integrated into a navigation service.

An exciting aspect of the DSS model and the CCR is that they enable services to be distributed across many computing systems. Your robot doesn’t have to have everything running on it. This means a simplistic microprocessor robot can be wirelessly driven by a Windows-based MSRS application, and can take advantage of Windows OS features – such as voice recognition, or speech synthesis etc etc. If also means further system integration can be easily achieved – think about the fun of integrating your robot with your Windows Media Centre PC! The PAVE team used five personal computers in their robot car, running 25 services across them to poll sensors and control motors with a top level orchestration using these services to drive the car on its mission.

As fun as it would be to build a robot car, you don’t have to have expensive hardware to get going with MSRS. In fact, thanks to the included Simulation Environment you don’t need any hardware beyond your humble Windows PC. The MSRS Simulation Environment uses Microsoft’s XNA game development framework to provide a 3D world in which to test your robot functionality. The simulation engine uses Ageia’s PhysX Technology to provide real world physics in your simulation.

After installing MSRS you will find a range of simulations have been installed and are accessible from the Start menu. These include simulations for the Lego MindStorms NXT based tribot, the iRobot Create, the KUKA LBR3 robot arm and the Pioneer 3DX research robot. You can also download additional simulations from the Microsoft Robotics site. These include a fun robot Sumo simulation and a robot football simulation that is compliant with the RoboCup Soccer rules. Both these additional simulations are designed to get you started, allowing you to develop your ‘players’ game strategy without having to build the entire solution from the ground up. Or you can just run them as they are for a bit of fun.

It is however, easy to build your own simulation. You don’t need to be a serious code monkey to build with MSRS. The Visual Programming Language(VPL) proves a simple ‘pointy-clicky draggy-droppy’ way to orchestrate modular services and when you start up you’ll be overwhelmed with the number of services provided out of the box. From GPS, Web cam and speech to Xbox controller and other specialised actuator hardware services are all provided ‘in the box’ –with source code to help you develop them further (if you are a real code monkey!).

But back in VPL. Type Xinput into the services search box. This should find the Xinput Controller service module. Drag this onto the diagram. Now clear the services search box and type Generic into it. This will return a number of generic service modules. Look for the Generic Differential Drive module and drag that onto the diagram too. Now all we have to do is define the connection between the two modules. Do this by dragging the orange connection pin (circle not the square) on the right side of the Xinput Controller across and onto the Generic Differential Drive module, where you can drop it. This will cause the Connections dialog to open. This dialog lists the actions that are available from each module and enables you to select the two you wish to join up. Select the ‘TriggersChanged’ and the SetDrivePower then press ok. Now we need to finish the connection by defining the data that will flow in the connection. A new Data Connections dialog opens showing the target properties that will be set in the Generic Differential Drive module and allowing us to choose the values we wish to use from the Xinput Controller module. Using the drop downs select Right for the LeftWheelPower and Left for the RightWheelPower. I know they are reversed but this makes the robot move correctly.

Cweb browser. The Control Panel lists all the MSRS services installed and allows you to create instances of them. The Service Directory shows you what is already running on your machine, and the other options provide tools for debugging and tracing execution.

The great thing with MSRS is that it enables the building of robot solutions quickly. There are a wide range of additional services provided for free on the web from different partners and developers. These include services for inexpensive robot components such as those on sale at https://www.robot-electronics.co.uk.

You may not be building a robot car just yet, but you can start building your own ‘Gonk’ droid or even an early ‘Astromec’ droid experimenting with sonar, laser range finders and vision all within the simulation environment of MSRS. Just to help you get going I have a couple of fun competitions at https://ILoveRobots.Wotudo.net my blog site. If you are already building a robot submit a photo and some details of what your robot can do in the Robot Idol competition (then get all your friends to vote for it!). If you are just starting out, tell us about your dream robot in the Robot Blueprint competition. Winners of both competitions will receive hundreds of pounds of credit to spend at named robot material retailers in the UK. See the competition terms and conditions for details. Above all, have fun building robots!