I checked my sensor, which is a Hokuyo range finder, URG-04LX-UG01, it has a 100ms scanning time, so might not be so bad with the values of Read(), but still wonders me why it time to time takes more than 100ms to process Read().
My Kalman filter has a time step of 300ms, so there is plenty of headroom, but my problem is how to ensure 300ms between the calculation of the next position and the laser scan since it might be problematic due to the scanning time of the laser, but is there anyway how to do this nicely?
If there is no new information available to the proxies, Read will block until new data is available (or until it times out), as is specified in its function documentation . ReadIfWaiting will return immediately if there is no new information available, otherwise it will proceed to call Read(). Read() takes a little bit of time to complete, which may vary slightly depending on how many interfaces it needs to update.
The variation you’re seeing in Read() just depends on when you call it vs. when new information is available. The variation you’re seeing in ReadIfWaiting is probably due to it returning instantly in the same instances during which the call to Read() would block. There is a function called Peek() which will let you know if data is available for the Read() function.
How quickly do your sensors publish updated information? Running a Kalman filter faster than your sensors are able to publish data is pointless, you want to have at least some new information at the end of each time step. Usually people run them synchronously with a sensor reading or slower. These long Read() delays might indicate that you are trying to run your filter at a frequency much faster than you’re getting new sensor readings.
After my mail yesterday I have tried to dig through the code and also looked into the fixed timestep, dt, since a Kalman filter needs a fixed timestep for its prediction step.
But I have noticed that the command "robot.Read()" has a very long and very uncertain delay which is found to be between 70 to 115 ms.
- How can it be that the "Read()" command takes such a huge amount of time.
- Is it possible to use a different approach that is more stable? "ReadIfWaiting" is also producing some very unstable results in its process time.
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
Playerstage-users mailing list