Merging the Simple Dashboard with the BasicStamp2
I am trying to merge the Basic Stamp Service, with Xinput, SimpleDashboard, BoBot Generic Drive, and the BoBot generic motor services.
So far, I have created a new solution that contains BasicSTamp2, BSServices, Simple Dashboard, and XInmputGamepad. The solution builds successfully and I can open the Control Panel on port localhost:50000.
I can incorporate each of the services manually through the Control Panel and everything works - I can drive the BoeBot using the dashboard and/or the Xbox controller.
Now, I want to automate activating BoBot Generic Drive, BoBot Generic Motor and bring up (and log into) the dashboard. I added the references, and the using statments within BasicSTamp2. I added SimpleDashboard and XinputGamepad to my solution.
I still haven't been able to automate the inclusion of a single additional service within my application.
As you can see, I am new to programming and certainly new to MSRS. I am open to suggestions on what I should do next (besides listening or working through the tutorials again - which I am going to do anyway)
jeff
Hi Jeff.
There are a couple of concepts in MSRS which may be different from you've seen before.
In particular, when you write a service which uses functionality from another service, you don't instantiate the other service directly. Instead, you create a partnership with the service using [Partner] attribute, and you only add a reference to the proxy of the other services. The Robotics Tutorials [1] would be a great place to see examples of service partnership.
The second concept which might be new to you is the service manifest. This manifest keeps track of starting and initializing not only your service, but all of the dependent services you plan to use. The manifest editor [2] is a tool which allows you to customize your manifests.
Hopefully, this helps you to get started.
[1] Robotics Tutorials: http://msdn2.microsoft.com/library/bb466258.aspx
[2] Manifest Editor: http://msdn2.microsoft.com/en-us/library/bb643213.aspx
Sooo.....
Two ways to approach this ..... (please confirm - I will test tonight):
1. Create a new manifest in the DSS Manifest Editor - add the original manifest (BoeBotBASICStamp2) and then import manifests from Boe-Bot Generic Drive, Boe-Bot Generic Motor, Simple Dashboard and save the combined manifests as a single new manifest. Then change the Command line arguments to reference the newly created manifest. Will that drive the partnerships between the various services?
and/or 2. Manually add the Partnerships in BasicSTamp2.cs for each of the individual services and then append each manifest reference to the Command Line Arguments.
I can see how this setup can be very powerful. I am still trying to wrap my mind around the specifics. Does this make sense ?
I really appreciate that you and the rest of the group are being so helpful.
jeff
Yes - both of these approaches will work.
However, the most direct approach would be to create a new manifest from scratch.
The Manifest Editor will show all available services, so you just need to drag one of each of the services on to your Manifest workspace, then you will see a list of partners under each service. Simple drag and drop the corresponding service into the partner slot and it will bind the two services together. You can also set up initial configuration for the services which need it.
When you are done, save the new manifest and change your command line arguments to start just this one manifest.
Dave
Bingo !
Got it and I figured out why the drives didn't work initially. Here we go:
The original Command Line Argument read
-port:50000 -tcpport:50001 -c:"http://schemas.microsoft.com/robotics/2007/06/basicstamp2.html"
I replaced it with:
/p:50000 /t:50001 -m:"samples\config\Parallax.BoeBot.Drive.manifest.xml"
As a result, the drive service started working.
I then added the dashboard service to the Command Line Argument. The Command Line then read:
/p:50000 /t:50001 -m:"samples\config\Parallax.BoeBot.Drive.manifest.xml" -m:"Samples\Config\SimpleDashboard.manifest.xml"
I added references to the Simple Dashboard within the BasicStamp2 and BSServices projects. I added the Simple Dashboard project. and it worked.
The next step is to modify the Simple Dashboard to include my other controls.
Thanks Much!
jeff
Hi Jeff,
I'm glad you got it working.
Are you referencing the Simple Dashboard directly from BasicStamp2 or BSServices? Unless you added a partnership and are posting messages to the Dashboard directly, you shouldn't have to add references in these projects to the Dashboard,
Dave