Wrox Programmer Forums
BOOK: Professional Microsoft Robotics Studio ISBN: 978-0-470-14107-6
This is the forum to discuss the Wrox book Professional Microsoft Robotics Developer Studio by Kyle Johns, Trevor Taylor; ISBN: 9780470141076
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Microsoft Robotics Studio ISBN: 978-0-470-14107-6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old July 9th, 2011, 09:02 AM
Registered User
Join Date: Jul 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help needed subscribing to simulated compass


I'm working on a project that involves using machine learning on the Lego Mindstorm NXT robot. Basically, I need to use the simulator in order to obtain the learning data by "letting the robot loose" through a few hundred episodes.

For the time being the robot can receive inputs solely from a color sensor. This works fine both in and out of the simulator. Now, I want to add a compass sensor to the robot. I'm having problems doing that. On the robot side (not simulation) of the code, I have the following:

using compassVirtual = Microsoft.Robotics.Services.Simulation.Sensors.Compass.Proxy;
Then I try to create the partnership with the compass, but it does not have CompassSensorOperations, like the physical compass available, so I used:

            Contract = compassVirtual.Contract.Identifier,
            CreationPolicy = PartnerCreationPolicy.UseExisting,
            Optional = false)]
        compassVirtual.CombinedOperationsPort _compassSensorPort = new compassVirtual.CombinedOperationsPort();
        compassVirtual.CombinedOperationsPort _compassSensorNotify = new compassVirtual.CombinedOperationsPort();
Apparently this is wrong as I can't subscribe to the service. Also, if i ignore the subscription, and just run the code it just connects to the color sensor as it used to, and then it just waits.

Note that I added references to SimulatedCompass.Y2008.M11 and SimulatedCompass.Y2008.M11.Proxy.

Basically what I want to do, is to subscribe to the compass to use in the simulator and get frequently readings from it.

Can I please get some help with this?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 4 compass stanlick BOOK: Professional Android 2 Application Development 0 March 18th, 2011 03:23 PM
Chapter 4 Compass Cmdr BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2 0 July 11th, 2010 07:05 PM
Function Minimisation using Simulated Annealing Al starxxx Apache Tomcat 1 February 24th, 2008 08:04 AM
file uploader with simulated progressbar kunchala_rakesh Ajax 1 September 13th, 2007 10:11 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.