-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmisc.h
More file actions
executable file
·80 lines (61 loc) · 1.59 KB
/
Copy pathmisc.h
File metadata and controls
executable file
·80 lines (61 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
//
// Created by Arkadiy on 11/03/2016.
//
#ifndef MEERKAT2_MISC_H
#define MEERKAT2_MISC_H
#include <string>
#include <fstream>
#include <vector>
#include <cmath>
#include <Eigen/Dense>
using namespace std;
typedef float corrected_frame_dt;
typedef float out_float_number;
typedef float reciprocal_fractional_t;
typedef Eigen::Matrix<reciprocal_fractional_t,3,3> matrix_3x3;
const float PI_F=3.14159265358979f;
typedef float vec6[6];
typedef Eigen::Matrix<reciprocal_fractional_t,3,1> vec3;
template<typename T>
inline T square(T a){
return a*a;
}
class FileNotFound : std::exception {
public:
FileNotFound(string filename): filename(filename) {}
~FileNotFound() throw() {}
string filename;
};
class ParserError : std::exception {
public:
ParserError(string description): description(description) {}
~ParserError() throw() {}
string description;
};
class MaskError : std::exception {
public:
MaskError(string description): description(description) {}
~MaskError() throw() {}
string description;
};
class ValueOutsideRange : std::exception {
public:
ValueOutsideRange() {}
~ValueOutsideRange() throw() {}
};
bool file_exists(const string& filename);
string format_template(string, size_t);
class Microstep {
public:
double inc;
double start;
double end;
size_t number;
Microstep(size_t no_microsteps, size_t increment_step=1) :
inc(1.*increment_step/no_microsteps),
start((-double(increment_step)+inc)*0.5),
end(0.5*increment_step),
number(no_microsteps)
{}
};
#endif //MEERKAT2_MISC_H