C++ and Arduino project using OpenCV
git clone https://github.com/ColinHarker/Trajectory_Intercept_System.git
This project files requires the installation of OpenCV:
Following are some links to help install OpenCV on mac, windows and linux:
OpenCV - Mac | Windows | Ubuntu
cd <Trajectory_Intercept_System_Directory>
cmake .
make
./Trajectory_Intercept_System
Include the following header
#include "Linker.hpp"In the 'constants.hpp' file this is where you specify;
-
How many frames of data will be calculated
constexpr int kNumCalcFrames = ;
-
At what point does the frame calculation start
constexpr int kStartFrame = ;
-
How many frames in the future do you want to predict
constexpr int kNumPredictedFrames = ;
-
If you are sending data out of a port, you include the port name
constexpr char kPortName[] = "";
- Create two arrays, for "X" and "Y" coordinates in all frames up until a given point.
int frame_data_x[constants::kNumCalcFrames];
int frame_data_y[constants::kNumCalcFrames];- Send data to the calculate trajectory function asynchronously, the predicted point needs to be calculated as fast as possible.
auto future_x = std::async(calculateTrajectory, frame_data_x);
auto future_y = std::async(calculateTrajectory, frame_data_y);This project was created to make a nerf gun turret be able to track and fire a dart to intercept an object flying through the air