Skip to content

ColinHarker/Trajectory_Intercept_System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Trajectory_Intercept_System

C++ and Arduino project using OpenCV

Installation

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

Run

cd <Trajectory_Intercept_System_Directory>
cmake .
make
./Trajectory_Intercept_System

Quick Start

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[] = "";

Calculate Future Trajectory

  1. 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];
  1. 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);

About

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

About

C++ and Arduino project using OpenCV

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published