A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
LeoOrbitalOffsetTestCase Class Reference

Test that a non-zero orbital offset correctly rotates the satellite along its orbital plane via the Rodrigues rotation in RotatePlane(). More...

Inheritance diagram for LeoOrbitalOffsetTestCase:
Collaboration diagram for LeoOrbitalOffsetTestCase:

Public Member Functions

 LeoOrbitalOffsetTestCase ()
Public Member Functions inherited from ns3::TestCase
 TestCase (const TestCase &)=delete
 Caller graph was not generated because of its size.
virtual ~TestCase ()
 Destructor.
std::string GetName () const
TestCaseoperator= (const TestCase &)=delete

Private Member Functions

void DoRun () override
 Implementation to actually run this TestCase.

Additional Inherited Members

Public Types inherited from ns3::TestCase
enum class  Duration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 }
 How long the test takes to execute. More...
Protected Member Functions inherited from ns3::TestCase
 TestCase (std::string name)
 Constructor.
void AddTestCase (TestCase *testCase, Duration duration=Duration::QUICK)
 Add an individual child TestCase to this test suite.
TestCaseGetParent () const
 Get the parent of this TestCase.
bool IsStatusFailure () const
 Check if any tests failed.
bool IsStatusSuccess () const
 Check if all tests passed.
void SetDataDir (std::string directory)
 Set the data directory where reference trace files can be found.
void ReportTestFailure (std::string cond, std::string actual, std::string limit, std::string message, std::string file, int32_t line)
 Log the failure of this TestCase.
bool MustAssertOnFailure () const
 Check if this run should assert on failure.
bool MustContinueOnFailure () const
 Check if this run should continue on failure.
std::string CreateDataDirFilename (std::string filename)
 Construct the full path to a file in the data directory.
std::string CreateTempDirFilename (std::string filename)
 Construct the full path to a file in a temporary directory.

Detailed Description

Test that a non-zero orbital offset correctly rotates the satellite along its orbital plane via the Rodrigues rotation in RotatePlane().

An offset of 0 places the satellite at the ascending node; a non-zero offset rotates it around the orbital plane normal. The first three test cases all use offset = 0 degrees, meaning RotatePlane() acts as an identity and is not exercised. This test uses offset = 90 degrees to verify the Rodrigues rotation.

RotatePlane() implements the Rodrigues rotation formula (see https://en.wikipedia.org/wiki/Rodrigues%27_rotation_formula ): v' = (n . v) * n + cos(a) * ((n x v) x n) + sin(a) * (n x v)

With altitude = 1000 km, inclination = 45 degrees, longitude = 0 degrees, and orbital offset = 90 degrees, the Rodrigues rotation yields:

The orbital plane normal is n = (-sqrt(2)/2, 0, sqrt(2)/2). The ascending-node position is x = r * (sqrt(2)/2, 0, sqrt(2)/2). Since n . x = 0, the formula simplifies: result = cos(90 deg) * ((n x x) x n) + sin(90 deg) * (n x x) = 0 + (0, r, 0) = (0, r, 0)

Expected ECEF position: (0, r, 0) where r = (R_earth + 1000 km) in meters.

Definition at line 289 of file leo-mobility-test-suite.cc.

Constructor & Destructor Documentation

◆ LeoOrbitalOffsetTestCase()

LeoOrbitalOffsetTestCase::LeoOrbitalOffsetTestCase ( )

Definition at line 298 of file leo-mobility-test-suite.cc.

References ns3::TestCase::TestCase().

Here is the call graph for this function:

Member Function Documentation

◆ DoRun()

void LeoOrbitalOffsetTestCase::DoRun ( )
overrideprivatevirtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implements ns3::TestCase.

Definition at line 304 of file leo-mobility-test-suite.cc.

References ns3::CreateObject(), ns3::Simulator::Destroy(), NS_TEST_ASSERT_MSG_EQ_TOL, ORBIT_RADIUS_M, ns3::Seconds(), and ns3::TOLERANCE.

Here is the call graph for this function:

The documentation for this class was generated from the following file: