Can't toggle Ping from Enabled=false to Enabled=true
Navigates to RoboticsConnection.com Home RoboticsConnection.com HomePage
RoboticsConnection User Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



Can't toggle Ping from Enabled=false to... Expand / Collapse
Author
Message
Posted Thursday, April 17, 2008 8:15 AM
Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum 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
Post #358
Posted Thursday, April 17, 2008 8:39 AM


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: Tuesday, September 02, 2008 9:05 AM
Posts: 270, Visits: 400
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

Post #359
Posted Thursday, April 17, 2008 10:38 AM
Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum 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

Post #360
Posted Thursday, April 17, 2008 1:04 PM


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: Tuesday, September 02, 2008 9:05 AM
Posts: 270, Visits: 400
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

Post #361
Posted Tuesday, April 22, 2008 7:25 AM
Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum 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
Post #397
Posted Tuesday, April 22, 2008 7:35 AM


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: Tuesday, September 02, 2008 9:05 AM
Posts: 270, Visits: 400
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

Post #398
Posted Wednesday, April 23, 2008 8:42 AM


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: Tuesday, September 02, 2008 9:05 AM
Posts: 270, Visits: 400
Patrick,

I don't have this published yet, but here is the new Serializer .NET Library v1.2.4.0 build.  You get to be the guinea pig!

http://www.roboticsconnection.com/multimedia/libraries/Installer_12.msi

Let me know if this works for you!

Best Regards!

Jason Summerour
President,
Summerour Robotics Corporation
Microsoft MVP
www.roboticsconnection.com

Post #421
Posted Wednesday, April 23, 2008 3:00 PM
Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum 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

Post #431