I'm working on a robotics project that has a sensor that ultimately returns a Vector3 direction that points to another object that is moving. The sensor readings*** can be assumed to be a standard gaussian distribution of mildly noisy data that is centered on the correct reading, with occasional missing readings (the sensor will occasionally say it doesn't know the direction).
I'm looking for known techniques that that can do a few things in real-time***:
*** The sensor outputs a reading every 33ms. The faster the three values (current direction, derivative of the direction and 2nd derivative of the direction) can be computed, the better, so fast and "pretty close to correct" is far superior to slow and perfect. The algorithm' calculations will be running on a dedicated core of a modern SBC, while other cores are working on their own dedicated calculations. Since the memory bus is shared between all the cores, keeping the working set of data small is beneficial.
I'm looking for known techniques that that can do a few things in real-time***:
- De-noise the sensor output. The other object is moving smoothly, so the Vector3 direction should move smoothly as well. I'd like to find a smart way to smooth the "current direction" of the most recent sensor reading (30 sensor reading/sec) to be more reliable than basing my calculations off of a non-smooth noisy raw direction that the sensor puts out.
- Determine the angular velocity of the change in direction of the sensor reading (IOW, the derivative of the sensor reading), which would require the smoothed current direction and a smoothed point half a second in the past. The past point obviously can be smoothed more reliably than the since it has both past and future datapoints to smooth against.
- Determine the angular acceleration of the change in direction of the sensor reading (IOW the 2nd derivative of the sensor reading), which I assume would require an additional smoothed reading from a second ago so I can difference the two angular velocities. Or maybe there is a better mathematical way to get the angular acceleration?
*** The sensor outputs a reading every 33ms. The faster the three values (current direction, derivative of the direction and 2nd derivative of the direction) can be computed, the better, so fast and "pretty close to correct" is far superior to slow and perfect. The algorithm' calculations will be running on a dedicated core of a modern SBC, while other cores are working on their own dedicated calculations. Since the memory bus is shared between all the cores, keeping the working set of data small is beneficial.