Last active
August 29, 2015 14:23
detection.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//=================================== | |
// include guard (safety measure) | |
#ifndef DETECTION_H // if not defined | |
#define DETECTION_H // define | |
//=================================== | |
// forward declared dependencies | |
//=================================== | |
// included dependencies | |
#include <iostream> | |
#include <emc/io.h> // embedded motion control package | |
#include <emc/rate.h> | |
#include <ctime> | |
#include <string> | |
#include <unistd.h> | |
#include <stdlib.h> | |
#include <cmath> // math operation such as sqrt(),cos() | |
#include <math.h> // more math | |
#include <fstream> | |
#include "picomath.h" | |
#include "opencvf.h" // contains all the opencv dependencies | |
#include "eigen3/Eigen/Dense" | |
//=================================== | |
// the actual class | |
class Detection { | |
private: | |
//general | |
Point curloc; // current position of the robit (x,y,theta) [m] and [rad]. | |
Point origin; // origin of the coordinate system (x,y,theta) [m] and [rad]. | |
// mprocessing | |
std::vector<Point> corners; | |
bool plot; | |
// sitrec | |
Situation sit; | |
Situation sit_prev; | |
int tol_filter; | |
int filter; | |
// slam | |
// computational entities | |
// measurement processing | |
void mprocessing(emc::IO &io, emc::LaserData scan, emc::OdometryData odom); | |
// situation recognition | |
void sitrec(emc::IO &io, emc::LaserData scan, emc::OdometryData odom); | |
// slam | |
void slam(emc::IO &io, emc::LaserData scan, emc::OdometryData odom); | |
// subcomputational entities | |
// slam | |
void prediction(emc::OdometryData odom); | |
void save_marker(emc::OdometryData odom, Point x); | |
int check_marker(Point x, emc::LaserData y); | |
void update(emc::OdometryData odom, std::vector<Point> edges, emc::LaserData scan); | |
void MyEllipse( cv::Mat img, cv::Point point, cv::Scalar color ); | |
void MyCircle(cv::Mat img, cv::Point center, int radius, const cv::Scalar color); | |
void drawing(std::vector<Point> edges); | |
void drawPoint(int x, int y, int color); | |
void grid(); | |
cv::Point2f m2px(cv::Point2f, int, int); | |
cv::Point2f px2m(cv::Point2f, int, int); | |
public: | |
// coordinators/composers | |
void detection(emc::IO &io, emc::LaserData scan, emc::OdometryData odom); | |
// monitors | |
bool monitor(); | |
// configurators | |
void ResetOdomOrigin(Point current_location); | |
void ResetOdomOrigin(emc::OdometryData current_location); | |
// class entities | |
// constructors (sets default values or input values to the private variables when an object of class Detection is made for the first time) | |
Detection(); // default values | |
// getters (able to get values of the private variables of this class) | |
Point getCurrentLocation(); | |
std::vector<Point> getCorners(); | |
Situation getSituation(); | |
// setters (able to set values to the private variables of this class) | |
}; | |
#endif // CONVERT_H |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment