|
|
|
Forum Member
      
Group: Forum Members
Last Login: Saturday, August 02, 2008 3:55 PM
Posts: 35,
Visits: 141
|
|
Hi Jason and Ringo,
I am simply trying to toggle one of my Ping sensors from Enabled=true to Enabled=false, then back to Enabled=true. My simplest test pseudo code is:
Ping.Enabled=false
sleep 2 seconds
Ping.Enabled=true
What I observe is that the first line successfully turns the Ping sensor off (LED stops flashing and I don't get updated distances), but the third line does not turn it back on. Am I missing something?
I am using the latest Serializer.NET library and firmware 1.5.1.
On a related note, do you happen to know the fastest meaningful update frequency one can use with the Ping sensors? Ditto for the GP2D12 sensors. In other words, what is the minimum round trip time for a manual update() and distance reading using these two sensors and the Serializer? (I imagine the Ping sensor will take longer than the IR sensor.)
Thanks!
patrick
|
|
|
|
|
Supreme Being
      
Group: Administrators
Last Login: Yesterday @ 8:31 AM
Posts: 270,
Visits: 396
|
|
| Patrick, I just looked at the Serializer .NET library src code, and I think I see the bug...I'll get it fixed this weekend. While you're waiting on me, instead of disabling it for two seconds, why don't you just set the UpdateFrequency property to 2 seconds, and sign up for the DistanceChanged event? Per the MaxSonar-EZ1, it looks like the fastest you can query one (if you're querying a bunch of them) is about every 50msec. This period is enough time to query one sonar, w/o affecting the readings of other surrounding sonars. http://www.maxbotix.com/MaxSonar-EZ1__FAQ.html Per the GP2D12, it looks like it's taking samples on a 39msec period. So, they're both about the same. http://www.roboticsconnection.com/multimedia/docs/Sharp_GP2D12_IR_Sensor_Specs.pdf Best Regards!
Jason Summerour President, Summerour Robotics Corporation Microsoft MVP www.roboticsconnection.com
|
|
|
|
|
Forum Member
      
Group: Forum Members
Last Login: Saturday, August 02, 2008 3:55 PM
Posts: 35,
Visits: 141
|
|
| Hi Jason, Many thanks for the reply--glad it wasn't just me. To clarify what I was trying to do: normally I just use PumpEvents within a 100ms timer to poll the Ping sensor. However, under some conditions, my robot needs to do a more precisely timed action so I wanted to use the manual Update method instead at that moment. So the idea is that I set Enabled=false, do the Update, read the Distance, do the action that depends on the precise timing, then go back to normal polling by setting Enabled=true. I might be able to get away with simply setting the polling timer interval to 50ms instead of 100ms. As a followup question: I assume it is not a good idea to leave Enabled=true *and* use a manual Update at random intervals? Thanks, patrick
|
|
|
|
|
Supreme Being
      
Group: Administrators
Last Login: Yesterday @ 8:31 AM
Posts: 270,
Visits: 396
|
|
Makes perfect sense to me... Yeah, I wouldn't leave the sensor enabled, and then invoke Update() on it. You basically won't know if the distance you get back was from your manual Update() call, or from the periodic querying being done within the QueryableComponent base class. They would race to get queued up, and you wouldn't know which order. Best Regards!
Jason Summerour President, Summerour Robotics Corporation Microsoft MVP www.roboticsconnection.com
|
|
|
|
|
Forum Member
      
Group: Forum Members
Last Login: Saturday, August 02, 2008 3:55 PM
Posts: 35,
Visits: 141
|
|
Hi Jason,
Were you able to get a chance to fix this bug? 
Thanks!
patrick
|
|
|
|
|
Supreme Being
      
Group: Administrators
Last Login: Yesterday @ 8:31 AM
Posts: 270,
Visits: 396
|
|
| I'll get it fixed later today...We've been having shopping cart issues (yet again), and I'm trying to get them resolved. Best Regards!
Jason Summerour President, Summerour Robotics Corporation Microsoft MVP www.roboticsconnection.com
|
|
|
|
|
Supreme Being
      
Group: Administrators
Last Login: Yesterday @ 8:31 AM
Posts: 270,
Visits: 396
|
|
|
|
|
|
Forum Member
      
Group: Forum Members
Last Login: Saturday, August 02, 2008 3:55 PM
Posts: 35,
Visits: 141
|
|
Awesome! Many thanks Jason. I'll give it a try today or tomorrow and let you know how it goes.
--patrick
|
|
|
| | |