This project demonstrates the use of Motion Capture (MoCAP) data for predicting the trajectory of a ball using a Kalman Filter followed by Non-Linear Optimization (NLopt) for refinement. The aim is to accurately predict the ball’s path by filtering out noise and optimizing the trajectory model.
This project focuses on predicting the trajectory of a moving object, specifically a ball, while accounting for wind effects. The model leverages a Kalman Filter to estimate the ball’s position and velocity, correcting for noise to improve accuracy over time. Additionally, NLopt optimization is used to dynamically adjust model parameters under variable wind conditions, ensuring the model adapts effectively to external forces like wind.
- Kalman Filter: Real-time state estimation of the ball's position and velocity, smoothing noise in measurements.
- NLopt Optimization: Optimizes parameters to enhance trajectory prediction accuracy under the influence of wind.
- Real-Time Updates: Integrates real-time measurements to refine predictions continuously.
- Python 3.x
- Jupyter Notebook
To set up the environment, install the following Python libraries:
pip install numpy scipy nlopt matplotlib filterpy
- Setup Environment: Install the necessary libraries as listed above.
- Run the Notebook: Open and run
ball_tracking.ipynb
in Jupyter Notebook to execute the prediction model. - Adjust Input Parameters: Customize initial conditions for wind speed and measurement noise within the notebook to simulate different scenarios.
- Kalman Filter Implementation: Predicts the ball's position and velocity, refining estimates as new data comes in.
- NLopt Optimization: Adjusts parameters based on real-time feedback to account for wind dynamics.
- Visualization: Plots the predicted trajectory alongside actual measurements to demonstrate the model’s accuracy.
The model demonstrates enhanced accuracy in trajectory prediction under windy conditions. The Kalman Filter smoothens noise in measurements, while NLopt optimization dynamically adjusts to changing wind conditions for robust predictions.
- Extend the model to handle varying wind directions.
- Incorporate additional environmental factors affecting trajectory.