COSMOS core  1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
new_propagator.cpp File Reference
Include dependency graph for new_propagator.cpp:

Functions

int main (int argc, char *argv[])
 

Function Documentation

int main ( int  argc,
char *  argv[] 
)
35 {
36  double initialutc;
37  double dp = 60.;
38  double endp = 86400.;
39  int32_t iretn = 0;
40  gj_handle gjh;
41 // physicsstruc gphys;
42 // locstruc gloc;
43 // int32_t iretn;
44  vector<tlestruc>lines;
45 
46  Physics::State *state;
47 // Physics::GaussJacksonPositionPropagator *posprop;
48 // Physics::LVLHAttitudePropagator *attprop;
49 // Physics::ThermalPropagator *thermprop;
50 // Physics::ElectricalPropagator *elecprop;
51  locstruc loc;
52  physicsstruc phys;
53 
54  state = new Physics::State();
55 // posprop = new Physics::GaussJacksonPositionPropagator(&loc, &phys, 1., 6);
56 // attprop = new Physics::LVLHAttitudePropagator(&loc, &phys, 1.);
57 // thermprop = new Physics::ThermalPropagator(&loc, &phys, 1., 300.);
58 // elecprop = new Physics::ElectricalPropagator(&loc, &phys, 1., 40.);
59 
60  loc_clear(loc);
61  loc.utc = currentmjd();
62  switch (argc)
63  {
64  case 5:
65  endp = atof(argv[4]);
66  case 4:
67  dp = atof(argv[3]);
68  case 3:
69  loc.utc = atof(argv[2]);
70  case 2:
71  {
72  string fname = argv[1];
73  if (fname.find(".tle") != string::npos)
74  {
75  iretn = load_lines(fname, lines);
76  state->Init(Physics::Structure::Type::U6, Physics::Propagator::Type::PositionGaussJackson, Physics::Propagator::Type::AttitudeLVLH, Physics::Propagator::Type::Thermal, Physics::Propagator::Type::Electrical, &loc, &phys, dp/10., lines);
77  }
78  }
79  break;
80  case 8:
81  loc.utc = atof(argv[1]);
82  loc.pos.eci.s.col[0] = atof(argv[2]);
83  loc.pos.eci.s.col[1] = atof(argv[3]);
84  loc.pos.eci.s.col[2] = atof(argv[4]);
85  loc.pos.eci.v.col[0] = atof(argv[5]);
86  loc.pos.eci.v.col[1] = atof(argv[6]);
87  loc.pos.eci.v.col[2] = atof(argv[7]);
88  loc.pos.eci.utc = loc.utc;
89  ++loc.pos.eci.pass;
90  state->Init(Physics::Structure::Type::U6, Physics::Propagator::Type::PositionGaussJackson, Physics::Propagator::Type::AttitudeLVLH, Physics::Propagator::Type::Thermal, Physics::Propagator::Type::Electrical, &loc, &phys, dp/10., lines);
91  }
92 
93 // locstruc cloc = loc;
94  initialutc = loc.utc;
95  for (double second=0.; second<endp; ++second)
96  {
97  state->Increment(initialutc + second / 86400.);
98 // posprop->Propagate();
99 // attprop->Propagate();
100 // thermprop->Propagate();
101 // elecprop->Propagate();
102  if (second == dp*static_cast<int32_t>(second/(dp)))
103  {
104  printf("%s %10f %10f %10f %7f %7f %7f %.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f\n"
105  , mjd2iso8601(loc.utc).c_str(),DEGOF(loc.pos.geod.s.lat), DEGOF(loc.pos.geod.s.lon)
106  , loc.pos.geod.s.h, DEGOF(loc.pos.geod.v.lat), DEGOF(loc.pos.geod.v.lon), loc.pos.geod.v.h
107  , loc.pos.eci.s.col[0], loc.pos.eci.s.col[1], loc.pos.eci.s.col[2]
108  , loc.pos.eci.v.col[0], loc.pos.eci.v.col[1], loc.pos.eci.v.col[2]
109  , loc.pos.eci.a.col[0], loc.pos.eci.a.col[1], loc.pos.eci.a.col[2]
110  , phys.temp, phys.radiation);
111  fflush(stdout);
112  }
113  }
114  return iretn;
115 }
Gauss-Jackson integration handle.
Definition: physicsdef.h:98
float radiation
Definition: jsondef.h:3428
rvector a
Acceleration.
Definition: convertdef.h:167
double utc
UTC of Position.
Definition: convertdef.h:161
uint32_t pass
pass indicator: allows synchronization with other attitude and position values.
Definition: convertdef.h:170
int32_t Increment(double nextutc)
Definition: physicsclass.cpp:423
int iretn
Definition: rw_test.cpp:37
double utc
Master time for location, in Modified Julian Day.
Definition: convertdef.h:879
Physics Simulation Structure.
Definition: jsondef.h:3411
float temp
Definition: jsondef.h:3426
static double initialutc
Definition: physicslib.cpp:43
rvector s
Location.
Definition: convertdef.h:163
int32_t loc_clear(locstruc *loc)
Initialize locstruc.
Definition: convertlib.cpp:58
static char fname[100]
Definition: geomag.cpp:89
#define DEGOF(rad)
Degrees of a Radian value.
Definition: math/constants.h:33
double h
Height in meters.
Definition: vector.h:229
gj_handle gjh
Definition: agent_node.cpp:80
double lon
Longitude in radians.
Definition: vector.h:227
int32_t Init(Propagator *posprop, Propagator *attprop, Propagator *thermprop, Propagator *elecprop)
Definition: physicsclass.cpp:256
int32_t load_lines(string fname, vector< tlestruc > &lines)
Load TLE from file. TODO!!! Rename Function to loadTle and create new class for dealing with TLEs...
Definition: convertlib.cpp:3612
double currentmjd(double offset)
Current UTC in Modified Julian Days.
Definition: timelib.cpp:65
posstruc pos
posstruc for this time.
Definition: convertdef.h:881
gvector s
Position vector.
Definition: convertdef.h:263
double lat
Latitude in radians.
Definition: vector.h:225
double col[3]
Definition: vector.h:55
cartpos eci
Definition: convertdef.h:737
Definition: physicsclass.h:296
geoidpos geod
Definition: convertdef.h:741
string mjd2iso8601(double mjd)
Definition: timelib.cpp:1316
gvector v
Velocity vector.
Definition: convertdef.h:265
Definition: convertdef.h:876
rvector v
Velocity.
Definition: convertdef.h:165