Partager via


Robotics Studio R2

As part of a project I’m doing for a Seattle startup, I’m playing with Microsoft Robotics Developer Studio (RDS).  I downloaded the 2008 release and generated a simple program to use a desktop joystick (basically a UI element displayed on the screen) to control an iRobot Create.  That worked fine – it was cool to direct the robot around.  But of course, what I really want is to have my code take the place of the joystick and control the robot.

I used a feature of VPL (the Visual Programming Language RDS uses to prototype these things) to generate the whole sheebang as a “service” so I could look at the code being generated to hook the joystick up to the iRobot and then shim in my own code in its place.  The problem is that when I did this, I got this error from VS:

The type or namespace name 'Robotics' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)  

pointing at this line generated by the RDS code:

using drive = Microsoft.Robotics.Services.Drive.Proxy;

Sure enough, trying to add a reference to Microsoft.Robotics. anything fails since that namespace doesn’t exist on my machine.

Hmm…

I guessed that I was missing an install of something, perhaps the “CCR and DSS toolkit” – but talking to someone on the Robotics dev team at MS, I verified that I had the same assemblies as he did. 

I then realized I was using Visual Studio 2010 Release Candidate – could that be the problem?

Sure enough, rebuilding this under Visual Studio 2008 fixed the problem. So for some reason, VS 2008 is able to find the Microsoft.Robotics assemblies – but VS 2010 is not.  A friend on the Robotics dev team confirms that there are a few tweaks needed to make the toolkit work with Visual Studio 2010.

That then took me on to the next problem –getting this to run.  When I run it in VS 2008, I get an error:

The thread 0x670 has exited with code 0 (0x0).
*** Initialization failure: Could not start HTTP Listener.
The two most common causes for this are:
1) You already have another program listening on the specified port
2) You dont have permissions to listen to http requests. Use the httpreserve command line utility to run using a non-administrator account.
Exception message: Access is denied

 

Trying to use the httpreserve tool (which is installed as part of RDS), I get an error that the port can’t be reserved.  But if I run VS 2008 as an administrator (Start / Visual Studio 2008 / Microsoft Visual Studio 2008 (right click / Run as Administrator)) and then run the compiled RDS service – it works.  So there definitely is a problem with the non-admin user accessing the http port 50000 (for some reason, I don’t have this problem on my second machine which also has RDS installed).  I figured there is some permission group I need to be part of to enable this – but which one?  I wish the Microsoft RDS tools didn’t “dumb down” their explanation of what was happening here and instead told me what precisely was failing.

I decided to just move this to another machine where DSS is working and where I had VS 2008 installed, so copied the files over there. I ran into a couple of more problems before I got this working:

The final two problems:

* In the Post Build step that is generated (to run DSSProxy), a “%” sign was translated at some point into the URL-encoded equivalent, %25, which caused the ReferencePaths to not be generated correctly and caused the cryptic DssProxy error: “Not a DSS Assembly”

* After fixing that, I still got the error and what I finally noticed is that I have both Robotics 2008 and Robotics 2008 R2 installed on my machine.  I am building this under the R2 release, but for some reason the assembly references are to the 2008 release – i.e. they point to

Reference Assemblies/Microsoft/Robotics/v2.0

instead of

Reference Assemblies/Microsoft/Robotics/v2.1.

This also confuses DSS Proxy. Deleting those references in VS and adding the correct ones from the V2.1 directory (references for Microsoft.Ccr.Core, Microsoft.Dss.Base, and Microsoft.Dss.Runtime fixed the problem and I am now running!

Comments