Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
SIMZEDCam.cc File Reference

SIMZEDCam unit tests. More...

Include dependency graph for SIMZEDCam.cc:

Classes

class  SIMZEDCamTests
 Unit Test Class for the SIMZEDCam. More...

Functions

 TEST_F (SIMZEDCamTests, ConstructorDestructor)
 Test the functionality of the SIMZEDCam constructor and destructor.
 TEST_F (SIMZEDCamTests, DoesNotLeak)
 Check that SIMZEDCam doesn't leak any memory.
 TEST_F (SIMZEDCamTests, Leaks)
 This should fail when the –check_for_leaks command line flag is specified.
 TEST_F (SIMZEDCamTests, ResetPositionalTracking)
 Test the ResetPositionalTracking method.
 TEST_F (SIMZEDCamTests, RebootCamera)
 Test the RebootCamera method.
 TEST_F (SIMZEDCamTests, EnablePositionalTracking)
 Test the EnablePositionalTracking method.
 TEST_F (SIMZEDCamTests, DisablePositionalTracking)
 Test the DisablePositionalTracking method.

Detailed Description

SIMZEDCam unit tests.

Author
clayjay3 (clayt.nosp@m.onra.nosp@m.ycowe.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om)
Date
2025-01-05

Function Documentation

◆ TEST_F() [1/7]

TEST_F ( SIMZEDCamTests ,
ConstructorDestructor  )

Test the functionality of the SIMZEDCam constructor and destructor.

Author
clayjay3 (clayt.nosp@m.onra.nosp@m.ycowe.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om)
Date
2025-01-05
78{
79 // Create a SIMZEDCam object.
80 SIMZEDCam simZEDCam("ws://127.0.0.1:8080/ZEDFrontCam", 1280, 720, 30, 90.0, 60.0, false, 1, 12345);
81
82 // Check initial camera open status.
83 EXPECT_FALSE(simZEDCam.GetCameraIsOpen());
84
85 // Destructor will be called automatically when the object goes out of scope.
86}
This class implements and interfaces with the SIM cameras and data. It is designed in such a way that...
Definition SIMZEDCam.h:36
Here is the call graph for this function:

◆ TEST_F() [2/7]

TEST_F ( SIMZEDCamTests ,
DoesNotLeak  )

Check that SIMZEDCam doesn't leak any memory.

Author
clayjay3 (clayt.nosp@m.onra.nosp@m.ycowe.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om)
Date
2025-01-05
96{
97 // Create a new SIMZEDCam object.
98 SIMZEDCam* pSimZEDCam = new SIMZEDCam("ws://127.0.0.1:8080/ZEDFrontCam", 1280, 720, 30, 90.0, 60.0, false, 1, 12345);
99 // Delete object.
100 delete pSimZEDCam;
101 // Point to null.
102 pSimZEDCam = nullptr;
103}

◆ TEST_F() [3/7]

TEST_F ( SIMZEDCamTests ,
Leaks  )

This should fail when the –check_for_leaks command line flag is specified.

Author
clayjay3 (clayt.nosp@m.onra.nosp@m.ycowe.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om)
Date
2025-01-05
113{
114 // Create a new SIMZEDCam object.
115 SIMZEDCam* pSimZEDCam = new SIMZEDCam("ws://127.0.0.1:8080/ZEDFrontCam", 1280, 720, 30, 90.0, 60.0, false, 1, 12345);
116 EXPECT_TRUE(pSimZEDCam != nullptr);
117}

◆ TEST_F() [4/7]

TEST_F ( SIMZEDCamTests ,
ResetPositionalTracking  )

Test the ResetPositionalTracking method.

Author
clayjay3 (clayt.nosp@m.onra.nosp@m.ycowe.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om)
Date
2025-01-05
127{
128 // Create a SIMZEDCam object.
129 SIMZEDCam simZEDCam("ws://127.0.0.1:8080/ZEDFrontCam", 1280, 720, 30, 90.0, 60.0, false, 1, 12345);
130
131 // Call ResetPositionalTracking.
132 auto errorCode = simZEDCam.ResetPositionalTracking();
133
134 // Check that the error code is SUCCESS.
135 EXPECT_EQ(errorCode, sl::ERROR_CODE::SUCCESS);
136}
Here is the call graph for this function:

◆ TEST_F() [5/7]

TEST_F ( SIMZEDCamTests ,
RebootCamera  )

Test the RebootCamera method.

Author
clayjay3 (clayt.nosp@m.onra.nosp@m.ycowe.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om)
Date
2025-01-05
146{
147 // Create a SIMZEDCam object.
148 SIMZEDCam simZEDCam("ws://127.0.0.1:8080/ZEDFrontCam", 1280, 720, 30, 90.0, 60.0, false, 1, 12345);
149
150 // Call RebootCamera.
151 auto errorCode = simZEDCam.RebootCamera();
152
153 // Check that the error code is SUCCESS.
154 EXPECT_EQ(errorCode, sl::ERROR_CODE::SUCCESS);
155}
Here is the call graph for this function:

◆ TEST_F() [6/7]

TEST_F ( SIMZEDCamTests ,
EnablePositionalTracking  )

Test the EnablePositionalTracking method.

Author
clayjay3 (clayt.nosp@m.onra.nosp@m.ycowe.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om)
Date
2025-01-05
165{
166 // Create a SIMZEDCam object.
167 SIMZEDCam simZEDCam("ws://127.0.0.1:8080/ZEDFrontCam", 1280, 720, 30, 90.0, 60.0, false, 1, 12345);
168
169 // Call EnablePositionalTracking.
170 auto errorCode = simZEDCam.EnablePositionalTracking(1.0f);
171
172 // Check that the error code is SUCCESS.
173 EXPECT_EQ(errorCode, sl::ERROR_CODE::SUCCESS);
174}
Here is the call graph for this function:

◆ TEST_F() [7/7]

TEST_F ( SIMZEDCamTests ,
DisablePositionalTracking  )

Test the DisablePositionalTracking method.

Author
clayjay3 (clayt.nosp@m.onra.nosp@m.ycowe.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om)
Date
2025-01-05
184{
185 // Create a SIMZEDCam object.
186 SIMZEDCam simZEDCam("ws://127.0.0.1:8080/ZEDFrontCam", 1280, 720, 30, 90.0, 60.0, false, 1, 12345);
187
188 // Call DisablePositionalTracking.
189 simZEDCam.DisablePositionalTracking();
190
191 // Check that positional tracking is disabled.
192 // Assuming there is a method to check this, e.g., IsPositionalTrackingEnabled().
193 EXPECT_FALSE(simZEDCam.GetPositionalTrackingEnabled());
194}
Here is the call graph for this function: