-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #272 from MissouriMRDT/topic/post-competition-cleanup
Cleanup and fix compile warning.
- Loading branch information
Showing
10 changed files
with
105 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,13 +126,17 @@ geoops::UTMCoordinate NavigationBoard::GetUTMData() | |
LOG_WARNING(logging::g_qSharedLogger, "Current GPS data is out of date! GPS timestamp is {} seconds old!", nGPSDataAge); | ||
// Set toggle. | ||
bAlreadyPrintedWarning = true; | ||
// Set Out of Date. | ||
m_bNavBoardOutOfDate = true; | ||
} | ||
else if (nGPSDataAge < constants::NAVBOARD_MAX_GPS_DATA_AGE && bAlreadyPrintedWarning) | ||
{ | ||
// Submit logger message. | ||
LOG_WARNING(logging::g_qSharedLogger, "GPS data recovered!"); | ||
// Reset toggle. | ||
bAlreadyPrintedWarning = false; | ||
// Reset Out of Date. | ||
m_bNavBoardOutOfDate = false; | ||
} | ||
|
||
// Convert the currently stored GPS coord to UTM and return. | ||
|
@@ -163,13 +167,17 @@ double NavigationBoard::GetHeading() | |
LOG_WARNING(logging::g_qSharedLogger, "Current Compass data is out of date! Compass timestamp is {} seconds old!", nCompassDataAge); | ||
// Set toggle. | ||
bAlreadyPrintedWarning = true; | ||
// Set Out of Date. | ||
m_bNavBoardOutOfDate = true; | ||
} | ||
else if (nCompassDataAge < constants::NAVBOARD_MAX_COMPASS_DATA_AGE && bAlreadyPrintedWarning) | ||
{ | ||
// Submit logger message. | ||
LOG_WARNING(logging::g_qSharedLogger, "Compass data recovered!"); | ||
// Reset toggle. | ||
bAlreadyPrintedWarning = false; | ||
// Reset Out of Date. | ||
m_bNavBoardOutOfDate = false; | ||
} | ||
|
||
// Return current Compass data. | ||
|
@@ -200,13 +208,17 @@ double NavigationBoard::GetHeadingAccuracy() | |
LOG_WARNING(logging::g_qSharedLogger, "Current Compass data is out of date! Compass timestamp is {} seconds old!", nCompassDataAge); | ||
// Set toggle. | ||
bAlreadyPrintedWarning = true; | ||
// Set Out of Date. | ||
m_bNavBoardOutOfDate = true; | ||
} | ||
else if (nCompassDataAge < constants::NAVBOARD_MAX_COMPASS_DATA_AGE && bAlreadyPrintedWarning) | ||
{ | ||
// Submit logger message. | ||
LOG_WARNING(logging::g_qSharedLogger, "Compass data recovered!"); | ||
// Reset toggle. | ||
bAlreadyPrintedWarning = false; | ||
// Reset Out of Date. | ||
m_bNavBoardOutOfDate = false; | ||
} | ||
|
||
// Return current Compass data. | ||
|
@@ -238,13 +250,17 @@ double NavigationBoard::GetVelocity() | |
LOG_WARNING(logging::g_qSharedLogger, "Current Velocity data is out of date! GPS timestamp is {} seconds old!", nGPSDataAge); | ||
// Set toggle. | ||
bAlreadyPrintedWarning = true; | ||
// Set Out of Date. | ||
m_bNavBoardOutOfDate = true; | ||
} | ||
else if (nGPSDataAge < constants::NAVBOARD_MAX_GPS_DATA_AGE && bAlreadyPrintedWarning) | ||
{ | ||
// Submit logger message. | ||
LOG_WARNING(logging::g_qSharedLogger, "GPS data recovered!"); | ||
// Reset toggle. | ||
bAlreadyPrintedWarning = false; | ||
// Reset Out of Date. | ||
m_bNavBoardOutOfDate = false; | ||
} | ||
|
||
// Return current velocity. | ||
|
@@ -276,13 +292,17 @@ double NavigationBoard::GetAngularVelocity() | |
LOG_WARNING(logging::g_qSharedLogger, "Current Angular Velocity data is out of date! Compass timestamp is {} seconds old!", nCompassDataAge); | ||
// Set toggle. | ||
bAlreadyPrintedWarning = true; | ||
// Set Out of Date. | ||
m_bNavBoardOutOfDate = true; | ||
} | ||
else if (nCompassDataAge < constants::NAVBOARD_MAX_COMPASS_DATA_AGE && bAlreadyPrintedWarning) | ||
{ | ||
// Submit logger message. | ||
LOG_WARNING(logging::g_qSharedLogger, "Compass data recovered!"); | ||
// Reset toggle. | ||
bAlreadyPrintedWarning = false; | ||
// Reset Out of Date. | ||
m_bNavBoardOutOfDate = false; | ||
} | ||
|
||
// Return angular velocity. | ||
|
@@ -328,10 +348,11 @@ std::chrono::system_clock::duration NavigationBoard::GetCompassLastUpdateTime() | |
} | ||
|
||
/****************************************************************************** | ||
* @brief | ||
* @brief Checks if any of the navboard data is out of date. Expired data depends | ||
* on constants::NAVBOARD_MAX_COMPASS_DATA_AGE. | ||
* | ||
* @return true - | ||
* @return false - | ||
* @return true - The data is out of date. | ||
* @return false - The data is new. | ||
* | ||
* @author Eli Byrd ([email protected]) | ||
* @date 2024-05-24 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.