-
Notifications
You must be signed in to change notification settings - Fork 1
/
tracker.h
77 lines (61 loc) · 2.02 KB
/
tracker.h
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
/********************************************************************************
* File Name : tracker.h
* Title :
* Programmer: Motki Kimura
* Belonging :
* Date : 2014.8.3
* Language : C++
*********************************************************************************
* class to calculate the position & velocity of the spacecraft in geo coordinate
*
********************************************************************************/
#ifndef TRACKER_H_
#define TRACKER_H_
#include "tracker.h"
#include "tf.h"
#include "spacecraft.h"
#include "eigen-eigen-6b38706d90a9/eigen/Core"
using namespace Eigen;
#include <cmath>
#include <iostream>
#include <iomanip>
class SpacecraftTracker : public SpacecraftCalculator {
public:
typedef struct {
char scId[64];
struct OrbitInfo {
char id[64];
double epochMjd;
double positionEci[3];
double velocityEci[3];
} orbitInfo;
struct Param {
double ballisticCoeff;
} param;
} SCDRec;
typedef struct {
char name[65];
std::string info;
std::string param;
} SerializedSCDRec;
SpacecraftTracker (void);
SpacecraftTracker (SCDRec const& scd);
SpacecraftTracker (SerializedSCDRec const& scd);
virtual ~SpacecraftTracker (void);
int setSpacecraftInfo (SCDRec const& scd);
int setSpacecraftInfo (SerializedSCDRec const& scd);
void getSpacecraftInfo (SCDRec* scd) const;
void getSpacecraftInfo (SerializedSCDRec* scd) const;
virtual int setTargetTime (double unixtime);
void getTargetTime (double *unixtime) const;
void test (double unixtime_s, double unixtime_e, double outputDt);
private:
SCDRec scd_;
double unixtime_;
void updateSpacecraftState (void);
void calcIntegrationPeriod (double* period) const;
static bool convert(SerializedSCDRec const& in, SCDRec* out);
static bool convert(SCDRec const& in, SerializedSCDRec* out);
static bool toDouble(char const* start, char end, double* value);
};
#endif