View Single Post
Old February 10th, 2011, 04:55 PM
GeorgeMo GeorgeMo is offline
Registered User
Join Date: Feb 2010
Location: Austin, TX
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Getting Corobot-type (Ch. 6 example) Config.xml Changed


I'm posting this here instead of the MS Robotics forums, because my project was based on the ProMRDS Chapter 6 example project Corobot and drawing from the Chapter 3 ServiceA->ServiceB SetInterval() ProMRDS example. I'll apologize in advance for the long post, but I've been reading, recoding and pulling my hair out for weeks now trying to figure out why this doesn't work.

I created a "master" project in MS Visual Studio 2008 that is based on ProMRDS's Corobot project (called SimTest). It opens the simulation engine and populates it with the very simple two-box, four-wheeled robot like in the example. I created a second project based on ProMRDS's SimulatedQuadDifferentialDrive project that creates the entity (called SimEntity).

I then created a WinForm GUI for my own custom move command buttons, because that's the interface that I need to emulate in MRDS (called SimPanel). I need to pass the movement command from my GUI's button presses and make the robot move in the simulation.

I added the "Command" parameter, based on the ServiceA->ServiceB example (which my projects worked great), to the SimEntity (Corobot-style) project and was able to push the SimPanel GUI buttons and change the state in SimTest and save it into SimTest's config.xml file - no problem.

I then tried passing the Command parameter from SimTest to the SimEntity (SimulatedQuadDifferentialDrive-style) project.

Command string passed: SimPanel->SimTest->SimEntity

It compiled ok, no run-time DSSP errors shown in the console and it seemed to run through the functions (if stepped into each line), but it never actually changed the Command parameter in the SimEntity.Config.xml file/state (it does change it in the SimTest.Config.xml ok).

Stepping through I noticed that it went through the SimTest.Proxy functions and it would stop in the SimTest::SetCommandHandler(SetCommand request) if I put a breakpoint there (wouldn't see it if just stepping through). Stepping through the SimEntity.Proxy functions, it looked exactly identical, but if I put a breakpoint in SimEntity::SetCommandHandler(SetCommand request) it never gets there. It's just not calling SimEntity's SetCommandHandler() at all.

I thought maybe it was a problem with my partner lists and SimTest doing both input and output of Command, so I eliminated SimTest and just did

Command string passed: SimPanel->SimEntity

with the same exact code that worked with SimPanel->SimTest. Same exact bad results as with SimPanel->SimTest->SimEntity, so I figure it's got to be a specific difference between SimTest and SimEntity.

Comparing SimTest and SimEntity, the only significant difference I can see is that SimEntity (and the ProMRDS examples I based it on) has a different State function in it's Types file/class:

public class SimEntityState : pxdrive.DriveDifferentialTwoWheelState {
//...<the stuff in the SimulatedQuadDifferentialDrive project>...
    public string _command;
    public string Command
        get { return _command; }
        set { _command = value; }
Also I had these in the SimEntityTypes class:

/// <summary>
    /// Set Command state Operation
    /// </summary>
    public class SetCommand : Update<SetCommandRequest, PortSet<DefaultUpdateResponseType, Fault>>
        public SetCommand()

    /// <summary>
    /// Set Command Request
    /// </summary>
    public class SetCommandRequest
        [DataMember, DataMemberConstructor]
        public string Command;
Does the pxdrive inheritance prevent me from updating the Command parameter that I added? I just can't find any other difference or reason why it doesn't work. No errors or exceptions - it looks like it's stepping through but never actually calls SetCommandHandler() and update the config file or state.