Skip to content
This repository was archived by the owner on Jun 28, 2025. It is now read-only.

Commit 58ebab6

Browse files
committed
add setupTM
1 parent 56825cc commit 58ebab6

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

SystemManager/Inc/SystemManager.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ class SystemManager {
2323
/* Other managers*/
2424
TelemetryManager *telemetryManager;
2525

26+
TelemetryManager* setupTM();
27+
2628
/* Class Functions */
2729
void startSystemManager();
2830

SystemManager/Src/SystemManager.cpp

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,17 @@ SystemManager::SystemManager()
4747
// BUT I FEEL LIKE SM PM WOULD KNOW WHERE. MAYBE IN THE HPP FILE? IDK HOW YOU ARE PLANNING ON
4848
// GATHERING THE DATA. I JUST PUT THEM HERE FOR NOW
4949

50-
// Struct containing the state of the drone
50+
51+
this->telemetryManager = setupTM();
52+
this->telemetryManager->init();
53+
54+
// IDK WHERE SM PLANS TO DO THIS, BUT telemetryManager.update() NEEDS TO BE CALLED AT A SEMI
55+
// REGULAR INTERVAL AS IT DEALS WITH MESSAGE DECODING AND LOW PRIORITY DATA TRANSMISSION
56+
}
57+
58+
TelemetryManager* SystemManager::setupTM() {
59+
60+
// Struct containing the state of the drone
5161
TMStateData stateData;
5262

5363
// values to be assigned to stateData
@@ -106,10 +116,8 @@ SystemManager::SystemManager()
106116
// the buffer that stores the bytes received from the ground station.
107117
MavlinkTranslator MT;
108118

109-
this->telemetryManager = new TelemetryManager(stateData, mavState, mavMode, GSC, MT);
110-
this->telemetryManager->init();
111-
// IDK WHERE SM PLANS TO DO THIS, BUT telemetryManager.update() NEEDS TO BE CALLED AT A SEMI
112-
// REGULAR INTERVAL AS IT DEALS WITH MESSAGE DECODING AND LOW PRIORITY DATA TRANSMISSION
119+
120+
return new TelemetryManager(stateData, mavState, mavMode, GSC, MT);
113121
}
114122

115123
// wrapper functions are needed as FreeRTOS xTaskCreate function does not accept functions that have

0 commit comments

Comments
 (0)