Skip to content

Commit

Permalink
fix: Fix regex for international designator in TLE construct method (#77
Browse files Browse the repository at this point in the history
)

fix: Fix regex for international designator in TLE construct method:

Co-authored-by: Vishwa Shah <vishwa@loftorbital.com>
  • Loading branch information
vishwa2710 and vishwaLoft authored Nov 10, 2022
1 parent ed9375b commit 3045486
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ TLE TLE::Construct (
throw ostk::core::error::runtime::Wrong("International designator", anInternationalDesignator) ;
}

if (!std::regex_match(anInternationalDesignator, std::regex("^\\d{2}\\d{3}\\w{1,2}$")))
if (!std::regex_match(anInternationalDesignator, std::regex("^\\d{2}\\d{3}\\w{1,3}$")))
{
throw ostk::core::error::runtime::Wrong("International designator", anInternationalDesignator) ;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2413,6 +2413,33 @@ TEST (OpenSpaceToolkit_Astrodynamics_Trajectory_Orbit_Models_SGP4_TLE, Construct

}

{

const TLE tle = TLE::Construct
(
satelliteNumber,
classification,
"22001YAM",
epoch,
meanMotionFirstTimeDerivativeDividedByTwo,
meanMotionSecondTimeDerivativeDividedBySix,
bStarDragTerm,
ephemerisType,
elementSetNumber,
inclination,
raan,
eccentricity,
aop,
meanAnomaly,
meanMotion,
99999
) ;

EXPECT_EQ("1 25544U 22001YAM 08264.51782528 -.00002182 00000-0 -11606-4 0 2922", tle.getFirstLine()) ;
EXPECT_EQ("2 25544 51.6416 247.4627 0006703 130.5360 325.0288 15.72125391999990", tle.getSecondLine()) ;

}

}

}
Expand Down

0 comments on commit 3045486

Please sign in to comment.