This code provides a method to estimate a 3D trajectory based on Inertial Measurement Unit (IMU) data. The IMU data includes angular velocity (from a gyroscope) and linear acceleration (from an accelerometer).
- Kalman Filter: A basic Kalman filter is used to fuse the angular velocity and acceleration data. This helps in reducing noise and getting a smoother estimate of the IMU data.
- Sensor Fusion: The fused angular velocity and acceleration data are integrated over time to estimate the relative position or trajectory of the IMU sensor in 3D space.
- Visualization: The estimated 3D trajectory is visualized using matplotlib.
- Load the IMU data from a JSON file. The expected keys in the JSON file are 'angularvelocity', 'acceleration', and 'sampletime'.
- The Kalman filter is applied to both the angular velocity and acceleration data to get the fused estimates.
- The fused data is then integrated to get the estimated 3D trajectory.
- Finally, the 3D trajectory is visualized.
- The IMU and camera coordinate systems are aligned.
- The angular velocity is provided in radians/second.
- The acceleration data is in meters/second^2.
- The sample duration (time between samples) is consistent across all samples.
This is a basic demonstration of trajectory estimation using IMU data. In real-world scenarios, the accuracy of the estimated trajectory can be affected by various factors, including sensor noise, drift, biases, and external disturbances. More advanced methods, such as Extended Kalman Filters, Particle Filters, or other sensor fusion techniques, may be required for high-precision applications.