Spacecraft Control Framework 1.0
Spacecraft Control Library
sc_formation.h
Go to the documentation of this file.
1/* fflib/formation.h. Generated by configure. */
2/*
3 * formation.h
4 *
5 * Programmer(s): Joe Mueller, David Wilson, Lavanya Swetharanyan, Stephanie Thomas
6 *
7 * Copyright 2005, Princeton Satellite Systems. All rights reserved.
8 *
9 *
10 *
11 *
12 * NOTES
13 * =====
14 * 1. I placed a "*sctlib" comment next to the functions that I think should go in sctlib. The group of 3-4
15 * functions at the bottom of this header should definitely go in sctlib.
16 *
17 * 2. We should probably create a new structure "assignment_params" that includes {N, M, P, Pu, Q, phi, u, f}.
18 * The first 7 params are returned from SetupAssignmentProblem, and the last one is the cost matrix that
19 * gets filled during the distributed assignment process, created with InitializeCostMatrix.
20 *
21 * 3. The "NewtRaph" function is called by 3 other functions (FFEccXExt, ""YExt, ""ZExt). If its too hard to
22 * implement as a seperate function, we can just perform the newton-raphson method seperately in each one.
23 *
24 * 4. In the prototype, both julian date (JD) and seconds since 1970 (SS1970) units are used. In this library,
25 * we will use MET (a double in seconds) as the absolute time for referencing all time-tags. By using MET,
26 * we can consistently use seconds to represent all times (orbit periods, timesteps, timetags, etc).
27 * MET will be computed in the MANTA system by first creating a global ma_time_record called MST (mission
28 * start time), and then subtracting it from the current time.
29 *
30 * side-note: The ThrusterAlignment function requires the Julian Date because it needs to compute the
31 * location of the sun and moon with respect to the Earth.
32 *
33 * 5. There are many cases in which I've used "int", but we may want to use "unsigned short" to use less
34 * memory. For example, spacecraft ID numbers, which will always be postive and less than 10,000.
35 *
36 *
37 *
38 */
79#ifndef __FORMATION__
80#define __FORMATION__
81
82#include <stdlib.h>
83#include <math.h>
84#include "sc_constants.h"
85#include "sc_coord.h"
86#include "sc_environs.h"
87#include "sc_ephemeris.h"
88#include "sc_gravity.h"
89#include "sc_math.h"
90#include "sc_orbit.h"
91#ifdef AS_OS_WINDOWS
92#include "matrixlib.h"
93#else
94#include <MatrixLib/MatrixLib.h>
95#endif
96
97
98extern "C++"
99{
100
101// Define the size of the J2 perturbation
102#ifdef FF_NO_J2
106#define FF_J2 0.0
107#else
111#define FF_J2 0.001082
112#endif
113
114#if 0
115#pragma mark Error Codes
116#endif
118typedef enum {
124
125#if 0
126#pragma mark Formation Types
127#endif
129typedef enum {
140 FF_TETRA = 11,
142
146#define FF_TOL 1e-8
147
151#define FF_MAX_ITER 100
152
156#define FF_MAX_BURNS 10
157
161#define FF_MAX_MEMBERS 8
162
163/* Linux OS */
164/* #undef SC_OS_LINUX */
165
169#define SC_OS_MACOSX
170
174#define SC_OS_UNIX
175
176#if 0
177#pragma mark Data Structures
178#endif
179
181typedef struct alf_orb_data_s {
182 double sma;
183 double inc;
184 double raan;
185 double true_lat;
186 double q1;
187 double q2;
188 double epoch;
190
192typedef struct team_s {
193 int teamID;
195 ml_int_array memID;
196 int refID;
198 int level;
200
202typedef struct state_s {
206 ml_matrix xH;
207 double tM;
208 double mass;
210
212typedef struct geom_s {
213 double y0;
214 double aE;
215 double beta;
216 double zInc;
217 double zLan;
219
221typedef struct ecc_geom_s {
222 double y0;
223 double xMax;
224 double nu_xMax;
225 double zMax;
226 double nu_zMax;
228
230typedef struct ecc_geom_xy_s {
231 double y0;
232 double x;
233 double y;
234 double nu_xy;
235 double zMax;
236 double nu_zMax;
238
240typedef struct window_s {
241 double startTime;
242 double nOrbMin;
243 double nOrbMax;
247
249typedef struct plan_param_s {
250 double fNom;
251 double horizon;
252 double dTMin;
253 double maxDeltaV;
256 double eTol;
258
260typedef struct constraints_s {
261 bool variable;
263 ml_int_array restrictID;
265 ml_matrix phase;
267
269typedef struct team_goals_s {
270 int nU;
271 int teamID;
274 double dPhi;
276
278typedef struct ecc_team_goals_s {
279 int nU;
280 int teamID;
283 double dPhi;
285
287typedef struct cost_s {
288 int nU;
289 int memID;
290 ml_int_array targetIndex;
291 ml_int_array costLength;
292 ml_matrix cost;
294
296typedef struct burn_s {
297 double t;
298 double dT;
299 double dV;
300 double uX;
301 double uY;
302 double uZ;
303 int iD;
305
307typedef struct maneuver_s {
308 bool achieve;
309 int nBurns;
311 double t0;
312 double tF;
313 int iD;
315
317typedef struct dv_command_s {
318 int kTank;
319 double pulsewidth;
320 double timeTag;
321 int iD;
323
325typedef struct orientation_s {
326 ml_matrix qHB;
327 double timeTag;
328 double dT;
329 int iD;
331
333typedef struct assign_s {
334 int N;
335 int M;
336 int P;
337 int Pu;
338 int Q;
339 ml_matrix phi;
340 ml_int_array u;
342
344typedef struct coll_mon_data_s {
346 ml_matrix init_bounds;
347 double sigma;
348 double Pmin;
349 double lenSC;
350 ml_matrix Ssc;
351 ml_matrix S0;
352 int nPts;
354
355#if 0
356#pragma mark Control Law
357#endif
362maneuver_s IterativeImpulsiveManeuver(state_t state, geom_t goals_circ, window_t window, plan_param_t param, bool &foundSoln);
363
365maneuver_s IterativeImpulsiveManeuver(state_t state, ecc_geom_t goals_ecc, window_t window, plan_param_t param, bool &foundSoln);
366
368maneuver_s ImpulsiveLPManeuver(state_t state, geom_t goals_circ, window_t window, plan_param_t param, double &maxDV);
369
371maneuver_s ImpulsiveLPManeuver(state_t state, ecc_geom_t goals_ecc, window_t window, plan_param_t param, double &maxDV);
372
374maneuver_s ImpulsiveManeuver(state_t state, geom_t goals, window_t window, plan_param_t param, double &maxDV);
375
377bool OptimalInPlaneDeltaV( double nOrbMin, double nOrbMax, double a, double th0, double th1, double delta_a, double delta_th0, double delta_q1, double
378delta_q2, double &dV1, double &dV2, double &dV3, unsigned short &M, unsigned short &N );
379
381burn_t *InPlane( alf_orb_data_t meas_elem, alf_orb_data_t delta_elem, double accNom, double dTMin, double nOrbMin, double nOrbMax, double horizon,
382double &t0, double &tF, unsigned short &nBurns );
383
385burn_t OutOfPlane( alf_orb_data_t meas_elem, alf_orb_data_t delta_elem, double accNom, double dTMin, unsigned short &nBurns, double &th1 );
387
388#if 0
389#pragma mark Guidance Law
390#endif
394geom_t AutoFormGeometry( state_t state, geom_t memberGoals[], int num, double minSepDist, double maxSepDist );
395
397ecc_geom_t AutoFormGeometry( state_t state, ecc_geom_t memberGoals[], int num, double minSepDist, double maxSepDist );
398
400double NearestOffset( double y0, double width, ml_matrix extrema, double minSepDistance, double maxSepDistance );
401
403ml_matrix InitializeCostMatrix( team_goals_t teamGoals, int nRelatives );
404
406ml_matrix InitializeCostMatrix( ecc_team_goals_t teamGoals, int nRelatives );
407
409int PopulateCostMatrix( ml_matrix& f, cost_t costEstimate, team_goals_t teamGoals, ml_int_array relativeIDs );
410
412int PopulateCostMatrix( ml_matrix& f, cost_t costEstimate, ecc_team_goals_t teamGoals, ml_int_array relativeIDs );
413
415void CostMatrixRows( team_goals_t teamGoals, int index, int& a, int& b );
416
418void CostMatrixRows( ecc_team_goals_t teamGoals, int index, int& a, int& b );
419
421cost_s EstimateCost( alf_orb_data_t el0, alf_orb_data_t dEl, team_goals_t teamGoals, int memID, window_t window, double weight);
422
424cost_s FFEccEstimateCost( orb_data_t el0, const ml_matrix& xH0, ecc_team_goals_t teamGoals, int memID, window_t window, double weight, int nSPO);
425
427team_goals_s GenerateTeamGoals( alf_orb_data_t el0, int fType, double fSize, unsigned short nRels, int teamID, double angRes );
428
430ecc_team_goals_s FFEccGenerateTeamGoals( orb_data_t el0, int fType, double fSize, unsigned short nRels, int teamID, double nu, const ml_matrix& eul);
431
433ecc_geom_xy_s *FFEccTetrahedronGeometry( double nu, double d, const ml_matrix& eul );
434
436geom_s PCGoals( double R, double alpha0, double sgn, double y0 );
437
439void SortTeamGoals( team_goals_t& teamGoals );
440
442void SortTeamGoals( ecc_team_goals_t& teamGoals );
443
445assign_s SetupAssignmentProblem( team_goals_t teamGoals, double orbFrac = 1);
446
448assign_s SetupAssignmentProblem( ecc_team_goals_t teamGoals, double orbFrac = 1);
449
451int RestrictIDSet( ml_int_array& relIDs, constraints_t constraints[], int numC );
452
454int VerifyAssignmentParams( assign_t a, const ml_matrix& f );
455
457int PrivilegedAssignment( assign_t assign, const ml_matrix& f, int method, ml_int_array& optOrder, ml_matrix& optPhi, double& optCost );
458
460int OptimalAssignment( assign_t assign, ml_matrix f, ml_int_array& optOrder, ml_matrix& optPhi, double& optCost );
461
463bool EquallyPhased( const ml_matrix& phi, ml_int_array u, int Pu );
464
466ml_int_array FindMinSet( ml_matrix& mat, double& minSum );
467
469void permute(ml_int_array arr, int start, int num, const ml_matrix& mat, double& cost, ml_int_array& best);
471
472
473#if 0
474#pragma mark Linear Programming
475#endif
478
480void LPCircular(const ml_matrix& x0, const ml_matrix& xF, double n, double duration, double dT, unsigned short constraintType, double maxConstraint, ml_matrix& aC, ml_matrix& t, bool& exitFlag);
481
483void LPEccentric(double e, double n, const ml_matrix& x0, const ml_matrix& xF, double nu0, double nuF, int nS, ml_matrix cW, unsigned short constraintType, double maxConstraint, ml_matrix& aC, ml_matrix& t, bool& exitFlag);
484
486void LPCircularTimeWeight( orb_data_t el0, const ml_matrix& xH0, geom_t goals, window_t window, int nSPO, ml_matrix& xHF, double& nOrbMvr );
487
489void LPEccentricTimeWeight( orb_data_t el0, const ml_matrix& xH0, ecc_geom_t goals, window_t window, int nSPO, ml_matrix& xHF, double& nOrbMvr );
490
492void GVEErrorDynamics( orb_data_t el0, ml_matrix& A, ml_matrix &B );
493
495void LPEccentricGVE(orb_data_t el0, const ml_matrix& x0, const ml_matrix& xF, double MF, int nS, ml_matrix cW, unsigned short constraintType, double maxConstraint, ml_matrix& aC, ml_matrix& t, bool& exitFlag);
497
498#if 0
499#pragma mark Eccentric Geometry
500#endif
504void FFEccLinOrb( double n, double nu, double e, ml_matrix& a, ml_matrix& b, double dT );
505
507ml_matrix FFEccLinOrb( const ml_matrix& x, const ml_matrix& acc, double n, double nu, double e );
508
510ml_matrix FFEccProp( const ml_matrix& D, const ml_matrix& nu, double e, double dH );
511
513ml_matrix FFEccProp( const ml_matrix& D, double nu, double e, double dH );
514
516double FFEccDH( double nu0, double e );
517
519void FFEccGoals( double e, ecc_geom_t goals, ml_matrix& D, ml_matrix& xH );
520
522void FFEccGoals( double e, ecc_geom_xy_t goals, ml_matrix& D, ml_matrix& xH );
523
525void FFEccIntConst( const ml_matrix& xH0, double nu0, double e, ml_matrix& D, double& dH, ml_matrix& R );
526
528ml_matrix FFEccRMat( double nu, double e, double dH );
529
531ml_matrix FFEccRMat( double nu, double e );
532
534void FFEccXExt( double e, const ml_matrix& D, double dH, double epsilon, int nMax, ml_matrix& x, ml_matrix& nu );
535
537void FFEccYExt( double e, const ml_matrix& D, double dH, double epsilon, int nMax, ml_matrix& y, ml_matrix& nu );
538
540void FFEccZExt( double e, const ml_matrix& D, double dH, double epsilon, int nMax, ml_matrix& z, ml_matrix& nu );
541
543void NuDot( double n, double e, double nu, double& nuDot, double& nuDotDot );
544
546double FFEccDX( double nu, double e, const ml_matrix& D, double dH );
547
549double FFEccDY( double nu, double e, const ml_matrix& D, double dH );
550
552double FFEccDZ( double nu, double e, const ml_matrix& D, double dH );
553
555double FFEccDDX( double nu, double e, const ml_matrix& D, double dH );
556
558double FFEccDDY( double nu, double e, const ml_matrix& D, double dH );
559
561double FFEccDDZ( double nu, double e, const ml_matrix& D, double dH );
563
564#if 0
565#pragma mark Coordinate Frames
566#endif
571
574
576alf_orb_data_t El2Alfriend( orb_data_t el, double true_anom );
577
580
583
586
589
591double CirclePhase( double beta );
592
594double EllipsePhase( double alpha );
595
598
601
604
607
609ml_matrix DeltaElem2Hills( alf_orb_data_t elA, alf_orb_data_t dEl );
610
612alf_orb_data_s Hills2DeltaElem( alf_orb_data_t el0, const ml_matrix& xH );
613
615geom_s Hills2Goals( alf_orb_data_t el0, const ml_matrix& xH );
616
618ml_matrix Goals2Hills( alf_orb_data_t el0, geom_t goals );
619
621orb_data_s FFEccHills2DeltaElem( orb_data_t el0, const ml_matrix& xH );
622
624alf_orb_data_s FFEccHills2DeltaElem( alf_orb_data_t el0, const ml_matrix& xH );
625
628
631
633ml_matrix FFEccGoals2Hills( double e, double nu, ecc_geom_t g, double n );
634
636ml_matrix FFEccGoals2Hills( double e, double nu, ecc_geom_xy_t g, double n );
637
639ml_matrix FFEccGoals2Hills( double e, double nu, ecc_geom_t g );
640
642ecc_geom_t FFEccHills2Goals( double e, double nu, ml_matrix xH, double n );
643
645ecc_geom_t FFEccHills2Goals( double e, double nu, const ml_matrix& xH );
646
648void Nu2TimeDomain( ml_matrix& x, double n, double e, double nu );
649
651void Time2NuDomain( ml_matrix& x, double n, double e, double nu );
652
654ecc_geom_t GeometryCirc2Ecc( double w, geom_t gCirc );
655
657geom_t GeometryEcc2Circ( double w, ecc_geom_t gEcc );
658
660geom_t RotateState( geom_t goals, double phi );
661
663double MeanAnom2TrueLat( double e, double w, double M );
664
666void GetHillsMats( const ml_matrix& r0, const ml_matrix& v0, ml_matrix& A, ml_matrix& Adot );
667
669void AbsRelECI2Hills( ml_matrix r0, ml_matrix v0, ml_matrix dr, ml_matrix dv, ml_matrix& rH, ml_matrix& vH );
670
672alf_orb_data_t Osc2Mean( alf_orb_data_t el, double J2 );
673
675alf_orb_data_t *ECI2MeanElements( const ml_matrix& xRefECI, const ml_matrix& xRelECI, double J2, alf_orb_data_t& elRefMean );
676
678bool AlignThruster( const ml_matrix& aH, const ml_matrix& bTh, ml_matrix& qHB );
679
681bool AlignThruster( const ml_matrix& aH, const ml_matrix& bTh, const ml_matrix& bST, const ml_matrix& r, const ml_matrix& v, double jD, double sep, ml_matrix& qHB );
682
684ml_matrix Hills2Frenet( const ml_matrix &xH, const double &e, const double &nu, const double &n );
686
687#if 0
688#pragma mark Propagation
689#endif
693ml_matrix HillsEqns( const ml_matrix& xH0, double n, double t );
694
696ml_matrix FFEccHillsEqns( ml_matrix xH0, double nu0, const ml_matrix& nu, double e, double n );
697
699ml_matrix FFEccHillsEqns( const ml_matrix& xH0, double nu0, const ml_matrix& nu, double e );
700
702ml_matrix DiscreteHills( const ml_matrix& x0, double n, const ml_matrix& aC, double dT );
703
705ml_matrix FFEccDiscreteHills( double e, double n, const ml_matrix& x0, double nu0, const ml_matrix& aC, const ml_matrix& t );
707#if 0
708#pragma mark Collision Monitoring
709#endif
713double CollProbSet( double sigma, const ml_matrix& S, const ml_matrix& xc, const ml_matrix& Ssc, int n);
714
716ml_matrix MonitoringAlg( ml_matrix& y, ml_matrix& t,ml_matrix& M, ml_matrix& nu, ml_matrix& accel, ml_matrix& aDiff, coll_mon_data_t d );
717
719ml_matrix CollisionSurvey( ml_matrix& y, double t0, maneuver_t mvr1, maneuver_t mvr2[], int n_points, coll_mon_data_s d );
720
722ml_matrix DeltaElem2HillsMat( const ml_matrix& elA );
723
725ml_matrix DeltaEl2AlfriendMat( orb_data_t el );
726
728double distant_pt_ell( const ml_matrix& S, const ml_matrix& U, const ml_matrix& xc, const ml_matrix& x0, ml_matrix& x );
729
731double Laguerre( const ml_matrix& a, double x_guess );
732
734ml_matrix GenerateTimeVector(orb_data_t d,const double tF, const int nPts, ml_matrix& M,ml_matrix& nu);
735
737ml_matrix ManeuverStruct2AccelVector( maneuver_t mvr, const ml_matrix& tProp );
739
740#if 0
741#pragma mark Utility
742#endif
746bool TeamLevels( team_t teams[], int num, ml_int_array& levels );
747
749int IsRelative( int iD, team_t teams[], int num );
750
752bool FindUpperTeams( int kBot, team_t teams[], int num, ml_int_array& kUpper);
753
755double TimeUntilTheta( double a, double w, double e, double theta0, double& theta1 );
756
758void AccelVector2ManeuverStruct( const ml_matrix& aC, ml_matrix t, double tRef, double nomAccel, double minSepTime, maneuver_t& mvr, ml_matrix& dV );
759
761void ManeuverStruct2AccelVector( maneuver_t mvr, double dT, ml_matrix& aC, ml_matrix& t );
762
764ml_matrix NOrbVector( window_t window );
765
767ml_matrix TargetTrueAnom( double e, double nu0, ml_matrix nOrb );
768
770ml_matrix Tetrahedron( double d, const ml_matrix& eul );
771
773double vsum( const ml_matrix& a );
774
776typedef double (*nr_function)(double x, double e, const ml_matrix& D, double dH);
777
779double newton_raphson(nr_function f,nr_function df,double x,double epsilon,int& n_max,double e,const ml_matrix &D,const double &dH);
780
782char *matout( ml_matrix mat );
784
785}
786#endif
Definition: sc_geometry.h:22
Physical and mathematical constants.
Coordinate transformation functions.
Environmental functions.
Time and data conversions and planetary movement, position, and eclipse computations.
void CostMatrixRows(team_goals_t teamGoals, int index, int &a, int &b)
Compute the starting and ending rows in the cost matrix that correspond to a give target state index.
Definition: sc_formation.cc:1523
char * matout(ml_matrix mat)
Output a matrix to a string with higher precision than built-in "to_string" function.
Definition: sc_formation.cc:7097
alf_orb_data_t El2Alfriend(orb_data_t el)
Convert a standard orbital element set into the Alfriend orbital element set *sctlib.
Definition: sc_formation.cc:4476
void LPEccentricTimeWeight(orb_data_t el0, const ml_matrix &xH0, ecc_geom_t goals, window_t window, int nSPO, ml_matrix &xHF, double &nOrbMvr)
Determine the target state on the desired trajectory that gives the minimum time-weighted cost....
Definition: sc_formation.cc:3352
#define FF_MAX_BURNS
Defines the maximum number of impulsive burns that can be included in a maneuver data structure.
Definition: sc_formation.h:156
struct plan_param_s plan_param_t
Planning parameters data structure.
bool OptimalInPlaneDeltaV(double nOrbMin, double nOrbMax, double a, double th0, double th1, double delta_a, double delta_th0, double delta_q1, double delta_q2, double &dV1, double &dV2, double &dV3, unsigned short &M, unsigned short &N)
Computes the in-plane delta-v sequence for the given time window that achieves the desired element di...
Definition: sc_formation.cc:843
ml_matrix HillsEqns(const ml_matrix &xH0, double n, double t)
Closed form solution of relative orbital motion using Hills equations.
Definition: sc_formation.cc:5685
struct dv_command_s dv_command_t
Delta-V command data structure.
double FFEccDDX(double nu, double e, const ml_matrix &D, double dH)
Compute the second derivative of x with respect to true anomaly.
Definition: sc_formation.cc:4373
double CollProbSet(double sigma, const ml_matrix &S, const ml_matrix &xc, const ml_matrix &Ssc, int n)
Collision probability for relative frame (single ellipsoid to point at origin) using ellipsoid shells...
Definition: sc_formation.cc:6241
int VerifyAssignmentParams(assign_t a, const ml_matrix &f)
Check for inconsistencies in the assignment parameters.
Definition: sc_formation.cc:2605
double FFEccDY(double nu, double e, const ml_matrix &D, double dH)
Compute the first derivative of y with respect to true anomaly.
Definition: sc_formation.cc:4340
#define FF_MAX_MEMBERS
Defines the maximum number of satellite members that can be on a given team.
Definition: sc_formation.h:161
double EllipsePhase(double alpha)
Compute the desired phase on an ellipse from the desired phase on the circle. The circle is superscri...
Definition: sc_formation.cc:4615
bool AlignThruster(const ml_matrix &aH, const ml_matrix &bTh, ml_matrix &qHB)
Computes desired Hills-to-body quaternion for a thruster firing. Rotation about thruster-axis is igno...
Definition: sc_formation.cc:5527
geom_s Hills2Goals(alf_orb_data_t el0, const ml_matrix &xH)
Computes the geometric goals from the Hills frame state and reference elements.
Definition: sc_formation.cc:4895
void GVEErrorDynamics(orb_data_t el0, ml_matrix &A, ml_matrix &B)
Compute continuous-time dynamics for Gauss' variational equations.
Definition: sc_formation.cc:3421
maneuver_s IterativeImpulsiveManeuver(state_t state, geom_t goals_circ, window_t window, plan_param_t param, bool &foundSoln)
Computes the delta-v's required to implement a formation flying maneuver for a single spacecraft.
Definition: sc_formation.cc:30
struct ecc_geom_s ecc_geom_t
Eccentric geometry data structure.
void Nu2TimeDomain(ml_matrix &x, double n, double e, double nu)
Convert a relative orbit state from the nu-domain to the time-domain.
Definition: sc_formation.cc:5203
struct burn_s burn_t
Burn data structure.
bool EquallyPhased(const ml_matrix &phi, ml_int_array u, int Pu)
Determine if the phase angles are equally phased.
Definition: sc_formation.cc:2861
double TimeUntilTheta(double a, double w, double e, double theta0, double &theta1)
Computes the time in seconds until the new latitude is reached from the original latitude.
Definition: sc_formation.cc:6797
ml_matrix CollisionSurvey(ml_matrix &y, double t0, maneuver_t mvr1, maneuver_t mvr2[], int n_points, coll_mon_data_s d)
Collision survey implementation which changes maneuvers to acceleration vectors and calls monitoring ...
Definition: sc_formation.cc:5848
struct state_s state_t
State data structure.
alf_orb_data_t OrbElemDiff(alf_orb_data_t el0, alf_orb_data_t el)
Computes the differences between Alfriend orbital element vectors.
Definition: sc_formation.cc:4638
ml_matrix FFEccProp(const ml_matrix &D, const ml_matrix &nu, double e, double dH)
Compute Hills frame state at specified true anomaly given integration constants and eccentricity.
Definition: sc_formation.cc:3700
alf_orb_data_t Osc2Mean(alf_orb_data_t el, double J2)
Transforms osculating orbital elements to mean orbital elements.
Definition: sc_formation.cc:5381
int PrivilegedAssignment(assign_t assign, const ml_matrix &f, int method, ml_int_array &optOrder, ml_matrix &optPhi, double &optCost)
Assign N targets to N satellites one at a time, so that the satellite with the largest minimum cost i...
Definition: sc_formation.cc:2634
void SortTeamGoals(team_goals_t &teamGoals)
Sort the team goals with fixed states listed before variable states.
Definition: sc_formation.cc:2416
struct maneuver_s maneuver_t
Maneuver data structure.
alf_orb_data_s add_elements(alf_orb_data_t el1, alf_orb_data_t el2)
Add two sets of orbital elements *sctlib.
Definition: sc_formation.cc:4520
ml_matrix FFEccGoals2Hills(double e, double nu, ecc_geom_t g, double n)
Compute Hills frame state (in time-domain) given geometric goals and orbit data.
Definition: sc_formation.cc:5035
ml_matrix DeltaElem2Hills(alf_orb_data_t elA, alf_orb_data_t dEl)
Computes the Hills frame state from the element differences and reference elements.
Definition: sc_formation.cc:4703
void LPEccentric(double e, double n, const ml_matrix &x0, const ml_matrix &xF, double nu0, double nuF, int nS, ml_matrix cW, unsigned short constraintType, double maxConstraint, ml_matrix &aC, ml_matrix &t, bool &exitFlag)
Computes the thrust trajectory to go from an initial state to a final state in Hills frame....
Definition: sc_formation.cc:3119
double FFEccDH(double nu0, double e)
Compute integration constant dH for homogeneous solution to LTV differential equations of relative or...
Definition: sc_formation.cc:3739
void LPEccentricGVE(orb_data_t el0, const ml_matrix &x0, const ml_matrix &xF, double MF, int nS, ml_matrix cW, unsigned short constraintType, double maxConstraint, ml_matrix &aC, ml_matrix &t, bool &exitFlag)
Computes the thrust trajectory to go from an initial state to a final state in Hills frame....
Definition: sc_formation.cc:3473
int IsRelative(int iD, team_t teams[], int num)
Determine whether the given satellite ID is a relative of any team.
Definition: sc_formation.cc:6739
struct alf_orb_data_s alf_orb_data_t
Alfriend orbital elements data structure.
ml_matrix ManeuverStruct2AccelVector(maneuver_t mvr, const ml_matrix &tProp)
Compute a 3xN acceleration vector from a maneuver data structure.
Definition: sc_formation.cc:6609
double FFEccDDY(double nu, double e, const ml_matrix &D, double dH)
Compute the second derivative of y with respect to true anomaly.
Definition: sc_formation.cc:4401
void FFEccLinOrb(double n, double nu, double e, ml_matrix &a, ml_matrix &b, double dT)
Compute the continuous A,B matrices for linearized relative motion in an eccentric reference orbit,...
Definition: sc_formation.cc:3623
struct orientation_s orientation_t
Orientation data structure.
struct coll_mon_data_s coll_mon_data_t
Collision monitor data.
alf_orb_data_s Hills2DeltaElem(alf_orb_data_t el0, const ml_matrix &xH)
Computes the element differences from the Hills frame state and reference elements.
Definition: sc_formation.cc:4781
void NuDot(double n, double e, double nu, double &nuDot, double &nuDotDot)
Compute the time-derivative of the true anomaly. *sctlib.
Definition: sc_formation.cc:4307
ml_matrix MonitoringAlg(ml_matrix &y, ml_matrix &t, ml_matrix &M, ml_matrix &nu, ml_matrix &accel, ml_matrix &aDiff, coll_mon_data_t d)
Collision monitoring algorithm implementation used for both modes, monitoring and surveying.
Definition: sc_formation.cc:5955
struct cost_s cost_t
Cost estimate data structure.
void FFEccXExt(double e, const ml_matrix &D, double dH, double epsilon, int nMax, ml_matrix &x, ml_matrix &nu)
Compute extreme x-values and associated true anomalies for given relative motion.
Definition: sc_formation.cc:4146
bool FindUpperTeams(int kBot, team_t teams[], int num, ml_int_array &kUpper)
Find teams above this one in the hierarchy.
Definition: sc_formation.cc:6762
geom_t GeometryEcc2Circ(double w, ecc_geom_t gEcc)
Convert an eccentric geometry structure to a circular geometry structure.
Definition: sc_formation.cc:5257
double distant_pt_ell(const ml_matrix &S, const ml_matrix &U, const ml_matrix &xc, const ml_matrix &x0, ml_matrix &x)
Compute minimum distance from a distance point to an ellipsoid's surface.
Definition: sc_formation.cc:6366
ecc_team_goals_s FFEccGenerateTeamGoals(orb_data_t el0, int fType, double fSize, unsigned short nRels, int teamID, double nu, const ml_matrix &eul)
Generate a set of team goals given the formation type, size, location and orientation.
Definition: sc_formation.cc:2241
double NearestOffset(double y0, double width, ml_matrix extrema, double minSepDistance, double maxSepDistance)
Determine the nearest along-track offset for a trajectory that is safe such that the minimum and maxi...
Definition: sc_formation.cc:1222
struct ecc_team_goals_s ecc_team_goals_t
Eccentric team goals data structure.
maneuver_s ImpulsiveManeuver(state_t state, geom_t goals, window_t window, plan_param_t param, double &maxDV)
Plans an impulsive burn sequence (using closed-form equations) to achieve the specified trajectory wi...
Definition: sc_formation.cc:634
int OptimalAssignment(assign_t assign, ml_matrix f, ml_int_array &optOrder, ml_matrix &optPhi, double &optCost)
Assign N targets to N satellites so that the weighted sum of costs to reach all targets is minimized.
Definition: sc_formation.cc:2776
assign_s SetupAssignmentProblem(team_goals_t teamGoals, double orbFrac=1)
Set up the assignment problem given the team goals by computing the number of fixed,...
Definition: sc_formation.cc:2492
void permute(ml_int_array arr, int start, int num, const ml_matrix &mat, double &cost, ml_int_array &best)
Permute the supplied array, called recursively by FindMinSet.
Definition: sc_formation.cc:2939
void FFEccIntConst(const ml_matrix &xH0, double nu0, double e, ml_matrix &D, double &dH, ml_matrix &R)
Compute integration constants for homogeneous solution to LTV differential equations of relative orbi...
Definition: sc_formation.cc:3990
double vsum(const ml_matrix &a)
Compute the sum of all elements in a row or column vector.
Definition: sc_formation.cc:7055
void LPCircular(const ml_matrix &x0, const ml_matrix &xF, double n, double duration, double dT, unsigned short constraintType, double maxConstraint, ml_matrix &aC, ml_matrix &t, bool &exitFlag)
Computes the thrust trajectory to go from an initial state to a final state in Hills frame....
Definition: sc_formation.cc:2989
double newton_raphson(nr_function f, nr_function df, double x, double epsilon, int &n_max, double e, const ml_matrix &D, const double &dH)
Newton-Raphson (optimized for FFEccXExt and similar)
Definition: sc_formation.cc:7077
ml_matrix NOrbVector(window_t window)
Compute a vector of maneuver durations (in orbits) from time window data.
Definition: sc_formation.cc:6991
ml_matrix FFEccDeltaElem2Hills(alf_orb_data_t el0, alf_orb_data_t dEl)
Convert element differences to Hills frame coordinates in an eccentric orbit.
Definition: sc_formation.cc:4999
alf_orb_data_t Goals2DeltaElem(alf_orb_data_t el0, geom_t goals)
Computes the desired element differences, given the geometric goals and the measured orbital elements...
Definition: sc_formation.cc:4676
cost_s EstimateCost(alf_orb_data_t el0, alf_orb_data_t dEl, team_goals_t teamGoals, int memID, window_t window, double weight)
Estimate the (weighted) cost to achieve all specified unique target states.
Definition: sc_formation.cc:1584
ff_formation_types
Formation type enumerations.
Definition: sc_formation.h:129
@ FF_IPLF
Equally spaced in-plane leader-follower.
Definition: sc_formation.h:130
@ FF_OOPLF_RGT
Equally spaced out-of-plane leader-follower with right ascen.
Definition: sc_formation.h:131
@ FF_CIPE_REF_CENTER
Equqlly phased centered in-plane ellipse, reference at center of ellipse.
Definition: sc_formation.h:132
@ FF_CIPE_REF_ON
Equqlly phased centered in-plane ellipse, reference on ellipse.
Definition: sc_formation.h:133
@ FF_DUAL_PROJ_CIRC_REF_ON
Equally phased dual-plane projected circle, reference on circle.
Definition: sc_formation.h:139
@ FF_NEG_PROJ_CIRC_REF_ON
Equqlly phased negative-plane projected circle, reference on circle.
Definition: sc_formation.h:137
@ FF_NEG_PROJ_CIRC_REF_CENTER
Equqlly phased negative-plane projected circle, reference at center of circle.
Definition: sc_formation.h:136
@ FF_TETRA
Repeating tetrahedron geometry at a specified true anomaly, any orientation.
Definition: sc_formation.h:140
@ FF_POS_PROJ_CIRC_REF_CENTER
Equqlly phased positive-plane projected circle, reference at center of circle.
Definition: sc_formation.h:134
@ FF_DUAL_PROJ_CIRC_REF_CENTER
Equally phased dual-plane projected circle, reference at center of circle.
Definition: sc_formation.h:138
@ FF_POS_PROJ_CIRC_REF_ON
Equqlly phased positive-plane projected circle, reference on circle.
Definition: sc_formation.h:135
ml_matrix Goals2Hills(alf_orb_data_t el0, geom_t goals)
Computes the Hills frame state from the geometric goals and reference elements.
Definition: sc_formation.cc:4925
ml_matrix Hills2Frenet(const ml_matrix &xH, const double &e, const double &nu, const double &n)
Transforms from the Hills frame to the Frenet frame.
Definition: sc_formation.cc:5648
struct team_s team_t
Team data structure.
void GetHillsMats(const ml_matrix &r0, const ml_matrix &v0, ml_matrix &A, ml_matrix &Adot)
Computes the A and Adot matrices used for transformation to Hills frame.
Definition: sc_formation.cc:5315
ecc_geom_t FFEccHills2Goals(double e, double nu, ml_matrix xH, double n)
Compute geometric goals given Hills frame state (in time-domain) and orbit data.
Definition: sc_formation.cc:5088
alf_orb_data_s sub_elements(alf_orb_data_t el1, alf_orb_data_t el2)
Subtract one element set from another.
Definition: sc_formation.cc:4558
bool TeamLevels(team_t teams[], int num, ml_int_array &levels)
Assign a hierarchical level to each team in the array.
Definition: sc_formation.cc:6695
team_goals_s GenerateTeamGoals(alf_orb_data_t el0, int fType, double fSize, unsigned short nRels, int teamID, double angRes)
Generate a set of team goals given the formation type and size.
Definition: sc_formation.cc:1831
double(* nr_function)(double x, double e, const ml_matrix &D, double dH)
Newton-Raphson function.
Definition: sc_formation.h:776
cost_s FFEccEstimateCost(orb_data_t el0, const ml_matrix &xH0, ecc_team_goals_t teamGoals, int memID, window_t window, double weight, int nSPO)
Estimate the (weighted) cost to achieve all specified unique target states.
Definition: sc_formation.cc:1731
int PopulateCostMatrix(ml_matrix &f, cost_t costEstimate, team_goals_t teamGoals, ml_int_array relativeIDs)
Fill in a single column of the cost matrix.
Definition: sc_formation.cc:1366
void LPCircularTimeWeight(orb_data_t el0, const ml_matrix &xH0, geom_t goals, window_t window, int nSPO, ml_matrix &xHF, double &nOrbMvr)
Determine the target state on the desired trajectory that gives the minimum time-weighted cost....
Definition: sc_formation.cc:3269
ecc_geom_xy_s * FFEccTetrahedronGeometry(double nu, double d, const ml_matrix &eul)
Compute the geometric goals for a formation that achieves a tetrahedron shape at a given true anomaly...
Definition: sc_formation.cc:2377
void AbsRelECI2Hills(ml_matrix r0, ml_matrix v0, ml_matrix dr, ml_matrix dv, ml_matrix &rH, ml_matrix &vH)
Compute the relative position and velocity in Hills frame given an absolute ECI position & velocity a...
Definition: sc_formation.cc:5338
#define FF_MAX_ITER
Defines the default value for maximum number of iterations.
Definition: sc_formation.h:151
ml_matrix DeltaEl2AlfriendMat(orb_data_t el)
Compute transformation matrix from standard differential elements to Alfriend differential elements.
Definition: sc_formation.cc:6123
orb_data_t Alfriend2El(alf_orb_data_t elA)
Convert an Alfriend orbital element set into the standard orbital element set *sctlib.
Definition: sc_formation.cc:4455
burn_t * InPlane(alf_orb_data_t meas_elem, alf_orb_data_t delta_elem, double accNom, double dTMin, double nOrbMin, double nOrbMax, double horizon, double &t0, double &tF, unsigned short &nBurns)
Computes the in-plane burn sequence for the given time window that achieves the desired element diffe...
Definition: sc_formation.cc:924
geom_s PCGoals(double R, double alpha0, double sgn, double y0)
Generate the geometric goals for a projected circular formation.
Definition: sc_formation.cc:2401
ml_matrix Tetrahedron(double d, const ml_matrix &eul)
Compute the 4 points of a regular tetrahedron, the surface area and volume.
Definition: sc_formation.cc:7030
struct window_s window_t
Time window data structure.
struct ecc_geom_xy_s ecc_geom_xy_t
Eccentric geometry data structure (xy)
maneuver_s ImpulsiveLPManeuver(state_t state, geom_t goals_circ, window_t window, plan_param_t param, double &maxDV)
Plans an impulsive burn sequence (using simplex) to achieve the specified trajectory within the given...
Definition: sc_formation.cc:298
double FFEccDX(double nu, double e, const ml_matrix &D, double dH)
Compute the first derivative of x with respect to true anomaly.
Definition: sc_formation.cc:4323
void AccelVector2ManeuverStruct(const ml_matrix &aC, ml_matrix t, double tRef, double nomAccel, double minSepTime, maneuver_t &mvr, ml_matrix &dV)
Build a maneuver structure from acceleration and time vectors.
Definition: sc_formation.cc:6820
int RestrictIDSet(ml_int_array &relIDs, constraints_t constraints[], int numC)
Restrict the set of relative IDs to respect the specified assignment constraints.
Definition: sc_formation.cc:2563
ml_int_array FindMinSet(ml_matrix &mat, double &minSum)
Find the order in which to arrange the columns so that the matrix diagonal sum is minimized.
Definition: sc_formation.cc:2889
void Time2NuDomain(ml_matrix &x, double n, double e, double nu)
Convert a relative orbit state from the time-domain to the nu-domain.
Definition: sc_formation.cc:5221
ml_matrix FFEccHillsEqns(ml_matrix xH0, double nu0, const ml_matrix &nu, double e, double n)
Compute Hills frame state (in time-domain) at future true anomaly(s). For eccentric or circular orbit...
Definition: sc_formation.cc:5712
geom_t RotateState(geom_t goals, double phi)
Rotate a geometric goal set to the circular phase angle phi.
Definition: sc_formation.cc:5278
struct team_goals_s team_goals_t
Team goals data structure.
double Laguerre(const ml_matrix &a, double x_guess)
Laguerre root finding algorithm adapted to real roots.
Definition: sc_formation.cc:6524
ecc_geom_t GeometryCirc2Ecc(double w, geom_t gCirc)
Convert a circular geometry structure to an eccentric geometry structure.
Definition: sc_formation.cc:5237
ff_error_codes
Error codes for invalid matrix operations.
Definition: sc_formation.h:118
@ FF_NO_ERROR
No error reported.
Definition: sc_formation.h:119
@ FF_NO_SOLN
No solution was found.
Definition: sc_formation.h:120
@ FF_BAD_VALUE
Occurs when a supplied value is physically impossible (ie, SMA < 0).
Definition: sc_formation.h:122
void FFEccGoals(double e, ecc_geom_t goals, ml_matrix &D, ml_matrix &xH)
Compute integration constants and initial state from the geometric goals.
Definition: sc_formation.cc:3761
ml_matrix DeltaElem2HillsMat(const ml_matrix &elA)
Compute transformation matrix from delta elements to Hills.
Definition: sc_formation.cc:6166
struct assign_s assign_t
Assignment data structure.
ml_matrix DiscreteHills(const ml_matrix &x0, double n, const ml_matrix &aC, double dT)
Compute the force relative trajectory from the initial state and time-history of applied acceleration...
Definition: sc_formation.cc:5763
ml_matrix FFEccDiscreteHills(double e, double n, const ml_matrix &x0, double nu0, const ml_matrix &aC, const ml_matrix &t)
Compute the force relative trajectory from the initial state and time-history of applied acceleration...
Definition: sc_formation.cc:5798
double CirclePhase(double beta)
Compute the desired phase on a circle from the desired phase on the ellipse. The circle is superscrib...
Definition: sc_formation.cc:4595
ecc_geom_t FFEccDeltaElem2Goals(alf_orb_data_t el0, alf_orb_data_t dEl)
Convert element differences to eccentric geometric goals.
Definition: sc_formation.cc:5017
geom_t DeltaElem2Goals(alf_orb_data_t el0, alf_orb_data_t dEl)
Computes the geoemtric goals, given the desired element differences and the measured orbital elements...
Definition: sc_formation.cc:4689
double MeanAnom2TrueLat(double e, double w, double M)
Convert mean anomlay to true latitude.
Definition: sc_formation.cc:5299
alf_orb_data_t * ECI2MeanElements(const ml_matrix &xRefECI, const ml_matrix &xRelECI, double J2, alf_orb_data_t &elRefMean)
Computes mean orbital elements and mean orbital element differences from reference and relative ECI p...
Definition: sc_formation.cc:5485
double FFEccDZ(double nu, double e, const ml_matrix &D, double dH)
Compute the first derivative of z with respect to true anomaly.
Definition: sc_formation.cc:4356
ml_matrix GenerateTimeVector(orb_data_t d, const double tF, const int nPts, ml_matrix &M, ml_matrix &nu)
Generate a time vector evenly spaced over true anomaly.
Definition: sc_formation.cc:6469
void FFEccYExt(double e, const ml_matrix &D, double dH, double epsilon, int nMax, ml_matrix &y, ml_matrix &nu)
Compute extreme y-values and associated true anomalies for given relative motion.
Definition: sc_formation.cc:4200
orb_data_s FFEccHills2DeltaElem(orb_data_t el0, const ml_matrix &xH)
Computes the orbital element differences from the Hills frame state and the reference orbital element...
Definition: sc_formation.cc:4964
ml_matrix FFEccRMat(double nu, double e, double dH)
Compute the state-transition matrix, R, given the eccentricity and true anomaly so that xH = R*D,...
Definition: sc_formation.cc:4005
double FFEccDDZ(double nu, double e, const ml_matrix &D, double dH)
Compute the second derivative of z with respect to true anomaly.
Definition: sc_formation.cc:4429
struct geom_s geom_t
Geometry data structure.
struct constraints_s constraints_t
Constraints data structure.
burn_t OutOfPlane(alf_orb_data_t meas_elem, alf_orb_data_t delta_elem, double accNom, double dTMin, unsigned short &nBurns, double &th1)
Compute the out-of-plane burn sequence for the given time window that achieves the desired element di...
Definition: sc_formation.cc:1038
geom_t AutoFormGeometry(state_t state, geom_t memberGoals[], int num, double minSepDist, double maxSepDist)
Definition: sc_formation.cc:1133
void FFEccZExt(double e, const ml_matrix &D, double dH, double epsilon, int nMax, ml_matrix &z, ml_matrix &nu)
Compute extreme z-values and associated true anomalies for given relative motion.
Definition: sc_formation.cc:4255
ml_matrix InitializeCostMatrix(team_goals_t teamGoals, int nRelatives)
Given the team goals, initialize the cost matrix "f" with the right size.
Definition: sc_formation.cc:1306
ml_matrix TargetTrueAnom(double e, double nu0, ml_matrix nOrb)
Compute the future true anomaly (unwrapped) at the specified number of orbits after the initial true ...
Definition: sc_formation.cc:7011
Spherical harmonic gravity model type and functions.
Math utility functions.
Orbit mechanics functions and types, including Keplerian, spherical and cartesian elements.
Alfriend orbital elements data structure.
Definition: sc_formation.h:181
double inc
Inclination [rad].
Definition: sc_formation.h:183
double sma
Semi-major axis [km].
Definition: sc_formation.h:182
double true_lat
True latitude [rad].
Definition: sc_formation.h:185
double q1
ecc*cos(perigee).
Definition: sc_formation.h:186
double epoch
Epoch [Julian Days from J2000].
Definition: sc_formation.h:188
double raan
Right ascension of the ascending node [rad].
Definition: sc_formation.h:184
double q2
ecc*sin(perigee).
Definition: sc_formation.h:187
Assignment data structure.
Definition: sc_formation.h:333
int M
Number of fixed states.
Definition: sc_formation.h:335
int Pu
Number of unique variable states.
Definition: sc_formation.h:337
ml_matrix phi
Array of desired phase offsets for variable states.
Definition: sc_formation.h:339
int P
Number of variable states.
Definition: sc_formation.h:336
int N
Total number of states.
Definition: sc_formation.h:334
int Q
Number of points over which variable states are discretized.
Definition: sc_formation.h:338
ml_int_array u
Array of indices matching phase offsets with unique variable states.
Definition: sc_formation.h:340
Burn data structure.
Definition: sc_formation.h:296
double uY
Unit y-direction in Hills frame.
Definition: sc_formation.h:301
double dT
Burn duration [sec].
Definition: sc_formation.h:298
int iD
Spacecraft ID.
Definition: sc_formation.h:303
double uZ
Unit z-direction in Hills frame.
Definition: sc_formation.h:302
double dV
Delta-v magnitude [km/s].
Definition: sc_formation.h:299
double uX
Unit x-direction in Hills frame.
Definition: sc_formation.h:300
double t
Burn start time [MET].
Definition: sc_formation.h:297
Collision monitor data.
Definition: sc_formation.h:344
double lenSC
Spacecraft maximum dimension [m].
Definition: sc_formation.h:349
orb_data_t el_ref
Reference orbital data.
Definition: sc_formation.h:345
int nPts
Number of points for collision set probabilty.
Definition: sc_formation.h:352
ml_matrix init_bounds
Measurement error, 1x6 matrix [km, km/s].
Definition: sc_formation.h:346
double sigma
Sigma of measurement error.
Definition: sc_formation.h:347
ml_matrix Ssc
Spacecraft hard-body sphere [km2].
Definition: sc_formation.h:350
double Pmin
Probability corresponding to sigma.
Definition: sc_formation.h:348
ml_matrix S0
Initial ellipsoid, 6x6 matrix [km2].
Definition: sc_formation.h:351
Constraints data structure.
Definition: sc_formation.h:260
ml_matrix phase
Phase offset of each duplicate state [rad].
Definition: sc_formation.h:265
ml_int_array restrictID
Array of member IDs to restrict assignments to .
Definition: sc_formation.h:263
int nDuplicates
Number of duplicate states.
Definition: sc_formation.h:264
bool variable
Flag indicating whether the associated geomtric goals are fixed (false) or variable (true).
Definition: sc_formation.h:261
int nRestrict
Number of members to restrict assignments to.
Definition: sc_formation.h:262
Cost estimate data structure.
Definition: sc_formation.h:287
ml_int_array costLength
Length of the cost vector for each unique target state.
Definition: sc_formation.h:291
ml_int_array targetIndex
Array of indices corresponding to unique target states.
Definition: sc_formation.h:290
int nU
Number of unique target states that costs were computed for.
Definition: sc_formation.h:288
ml_matrix cost
Cost vectors for all unique target states.
Definition: sc_formation.h:292
int memID
Spacecraft ID.
Definition: sc_formation.h:289
Delta-V command data structure.
Definition: sc_formation.h:317
double pulsewidth
Burn duration [sec].
Definition: sc_formation.h:319
double timeTag
time at which to send the command [MET]
Definition: sc_formation.h:320
int kTank
Index of tank to use.
Definition: sc_formation.h:318
int iD
Maneuver command ID.
Definition: sc_formation.h:321
Eccentric geometry data structure.
Definition: sc_formation.h:221
double xMax
Maximum radial separation [km].
Definition: sc_formation.h:223
double nu_xMax
True anomaly where maximum radial separation occurs [rad].
Definition: sc_formation.h:224
double y0
Along-track offset of center of relative motion [km].
Definition: sc_formation.h:222
double nu_zMax
True anomaly where maximum cross-track separation occurs [rad].
Definition: sc_formation.h:226
double zMax
Maximum cross-track separation [km].
Definition: sc_formation.h:225
Eccentric geometry data structure (xy)
Definition: sc_formation.h:230
double y0
Along-track offset of center of relative motion [km].
Definition: sc_formation.h:231
double x
Radial position at nu_xy [km].
Definition: sc_formation.h:232
double nu_xy
True anomaly where maximum radial separation occurs [rad].
Definition: sc_formation.h:234
double nu_zMax
True anomaly where maximum cross-track separation occurs [rad].
Definition: sc_formation.h:236
double zMax
Maximum cross-track separation [km].
Definition: sc_formation.h:235
double y
Along-track position at nu_xy [km].
Definition: sc_formation.h:233
Eccentric team goals data structure.
Definition: sc_formation.h:278
constraints_t constraints[FF_MAX_MEMBERS]
Array of assignment constraints.
Definition: sc_formation.h:282
double dPhi
Angular resolution [rad].
Definition: sc_formation.h:283
int nU
Number of unique states.
Definition: sc_formation.h:279
int teamID
Team ID.
Definition: sc_formation.h:280
Geometry data structure.
Definition: sc_formation.h:212
double zLan
Maximum cross-track amplitude due to right ascension difference [km].
Definition: sc_formation.h:217
double y0
Along-track offset of center of relative motion [km].
Definition: sc_formation.h:213
double beta
Phase angle on relative ellipse at equator crossing, measured from -x axis to +y axis [rad].
Definition: sc_formation.h:215
double zInc
Maximum cross-track amplitude due to inclination difference [km].
Definition: sc_formation.h:216
double aE
Semi-major axis of relative ellipse [km].
Definition: sc_formation.h:214
Maneuver data structure.
Definition: sc_formation.h:307
bool achieve
Flag indicating whether to achieve the maneuver or not.
Definition: sc_formation.h:308
burn_t burnData[FF_MAX_BURNS]
Array of burn data structures.
Definition: sc_formation.h:310
double t0
Maneuver start time [MET].
Definition: sc_formation.h:311
int iD
Maneuver command ID.
Definition: sc_formation.h:313
double tF
Maneuver completion time [MET].
Definition: sc_formation.h:312
int nBurns
Number of burns.
Definition: sc_formation.h:309
Structure for storing orbit data.
Definition: sc_orbit.h:33
Orientation data structure.
Definition: sc_formation.h:325
ml_matrix qHB
Desired Hills-to-body quaternion to align the thruster properly.
Definition: sc_formation.h:326
double dT
Duration to remain at target orientation [sec].
Definition: sc_formation.h:328
int iD
Maneuver command ID.
Definition: sc_formation.h:329
double timeTag
time at which to send the command [MET]
Definition: sc_formation.h:327
Planning parameters data structure.
Definition: sc_formation.h:249
int nSPOCoarse
Number of samples per orbit to use in coarse LP planning.
Definition: sc_formation.h:254
double horizon
Minimum time required between planning and first burn [sec].
Definition: sc_formation.h:251
double fNom
Nominal thrust capability [kN].
Definition: sc_formation.h:250
double dTMin
Minimum achievable burn time [sec].
Definition: sc_formation.h:252
double maxDeltaV
Maximum achievable delta-v for a single burn [km/s].
Definition: sc_formation.h:253
int nSPOFine
Number of samples per orbit to use in fine LP planning.
Definition: sc_formation.h:255
double eTol
Eccentricity tolerance.
Definition: sc_formation.h:256
State data structure.
Definition: sc_formation.h:202
alf_orb_data_t dEl
Alfriend orbital element differences.
Definition: sc_formation.h:205
double mass
Mass.
Definition: sc_formation.h:208
ml_matrix xH
Relative position and velocity in Hills frame.
Definition: sc_formation.h:206
double tM
Measurement time [MET].
Definition: sc_formation.h:207
alf_orb_data_t elA
Alfriend orbital elements.
Definition: sc_formation.h:204
orb_data_t el
Standard orbital elements.
Definition: sc_formation.h:203
Team goals data structure.
Definition: sc_formation.h:269
int teamID
Team ID.
Definition: sc_formation.h:271
int nU
Number of unique states.
Definition: sc_formation.h:270
constraints_t constraints[FF_MAX_MEMBERS]
Array of assignment constraints.
Definition: sc_formation.h:273
double dPhi
Angular resolution [rad].
Definition: sc_formation.h:274
Team data structure.
Definition: sc_formation.h:192
ml_int_array memID
Team member IDs.
Definition: sc_formation.h:195
int nMembers
Number of team members.
Definition: sc_formation.h:194
int level
Level of team in hierarchy.
Definition: sc_formation.h:198
int teamID
Team ID.
Definition: sc_formation.h:193
int captainID
Captain ID.
Definition: sc_formation.h:197
int refID
Reference ID.
Definition: sc_formation.h:196
Time window data structure.
Definition: sc_formation.h:240
double startTime
Earliest allowable start time [MET].
Definition: sc_formation.h:241
double nOrbMax
Maximum number of orbits that the maneuver may last.
Definition: sc_formation.h:243
double nOrbMin
Minimum number of orbits that the maneuver may last.
Definition: sc_formation.h:242
int nManeuvers
Total number of maneuvers to plan, between min and max durations.
Definition: sc_formation.h:244
double timeWeightExp
Exponent for weighting the cost with maneuver time.
Definition: sc_formation.h:245