Segway RMP readme
Ben Axelrod
December 2007
=======================

Overview
========
These are services for the Segway RMP 200 robot base for use in Microsoft Robotics Studio.  The code
provided is for MSRS version 1.0, but can be easily upgraded to later versions (see below).  
Communication to robot base is through USB.

There are 3 Visual studio projects: 
 * SegwayNativeWrapper wraps the Segway USB dll in managed .NET code
 * SegwayBase is a MSRS service that interfaces with SegwayNativeWrapper
 * SegwayServices are a number of MSRS services that implement generic contracts for sensors and
   motors.
    - SegwayDrive service that implements the generic differential drive contract.  (Also has a nice
      XSLT).
    - ForeAft/Yaw encoder service.  Uses my own encoder contract.  
    - Left/Right encoder service.  Uses my own encoder contract.  
    - SegwayBattery service that will 'say' the battery voltage when you do a get on it.  (It will
      also warn when battery is low.)


Install + Run
========
 1. Run "RMPInstall.msi" as supplied with the Segway RMP 200
 2. Compile services 
 3. Modify the path to your services in the command line arguments in the Debug properties of the 
    projects if you want to run the services with F5.


Upgrade
========
 1. Copy the code into the MSRS 1.5 directory tree.  
 2. Open a MSRS 1.5 console and run the dssprojectmigration tool on those directories.  
     a. More info on that tool here: http://msdn2.microsoft.com/en-us/library/bb483018.aspx
 3. You may have to manually change the post build step for the native wrapper. 
 4. You may have to change the order of the Subscribe and ReliableSubscribe messages in the
    SegwayEncoderForeAftYawOperations and SegwayEncoderLeftRightOperations definitions.


Troubleshooting
========
Problem: 
When I run the services, I see this message: 
*** SegwayBase Initialization Failed [http://mycomputer:50000/segwaybase]

Solution: 
Check to make sure the robot is plugged in to the computer with USB.


Problem: 
The robot is unresponsive to my commands.  And I see Unknown Segway USB Message
repeatidly on the console.

Solution: 
I suspect you are seeing a strange bug that I never found the cause of.  The solution
seems to be keeping the USB plugged in and the computer ready to go when you turn on the RMP.  
Then *quickly* start the services. 


FAQ
========
Q. Why dont you provide version 1.5 services?
A. Because I dont have access to the robot any more and am not comfortable releasing code on my
site without thorough testing.  


License
========
You are free to use this code for educational and personal use, but any commercial use requires my
explicit permission.  It is licensed under the Creative Commons Attribution-Noncommercial-Share 
Alike license.  See for more info: http://creativecommons.org/licenses/by-nc-sa/3.0/us/

