Compare commits

...

28 Commits

Author SHA1 Message Date
158927ce5c Merge pull request 'Fix inverted X-Axis for PTG Target' (#875) from fix-tgt-ptg into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #875
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2024-03-06 13:33:07 +01:00
e97105820a version bump
Some checks are pending
EIVE/eive-obsw/pipeline/pr-main Build started...
2024-03-06 13:31:39 +01:00
88102b26a6 changelog
Some checks are pending
EIVE/eive-obsw/pipeline/pr-main Build started...
2024-03-06 13:30:22 +01:00
7e689c9f55 well ...
Some checks are pending
EIVE/eive-obsw/pipeline/head Build started...
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-03-06 13:07:55 +01:00
97ada32f33 Merge pull request 'Prep v7.1.1' (#874) from prep-v7.1.1 into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #874
2024-03-06 11:37:05 +01:00
244c364f60 bumped version
Some checks are pending
EIVE/eive-obsw/pipeline/head Build queued...
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-03-06 11:16:02 +01:00
c0c3576131 changelog 2024-03-06 11:15:40 +01:00
c2a4578b81 Merge pull request 'Fix NaN for Limiting Rotation Rates' (#872) from limit-rot-rate-fix into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #872
2024-03-06 11:13:01 +01:00
781feffc90 bumped submodules
Some checks are pending
EIVE/eive-obsw/pipeline/pr-main Build started...
2024-03-06 11:10:35 +01:00
7efd48c695 make robin happy 2024-03-06 11:09:23 +01:00
d0765fdcce Merge branch 'main' into limit-rot-rate-fix
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-03-06 10:18:15 +01:00
be0bae58ac Merge pull request 'Fix Dimension Error in MEKF' (#873) from fix-mekf-dim into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #873
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2024-03-06 10:17:10 +01:00
616803c6a8 changelog
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-03-06 09:47:47 +01:00
3501763cf0 fsfw
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-03-06 09:47:06 +01:00
efaf48beff we should actually use this 2024-03-06 09:46:51 +01:00
e052470cf4 changelog
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-03-06 09:08:31 +01:00
2364f7d5d9 fix of the century
Some checks are pending
EIVE/eive-obsw/pipeline/head Build started...
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-03-05 17:35:06 +01:00
c52818a5ce changelog
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-03-05 15:49:11 +01:00
fb8a92ecb5 bumped fsfw
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-03-05 14:30:13 +01:00
39032249b2 -
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-03-05 14:10:32 +01:00
aa4bfa8d88 we might want an OK 2024-03-05 14:09:40 +01:00
c2d8ef9fe4 should be enough
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-03-05 13:48:09 +01:00
440d989490 whoops
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-03-05 13:08:29 +01:00
85ed8420fd act cmd
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-03-05 11:51:02 +01:00
2a2a173ebd prep for leap seconds
Some checks failed
EIVE/eive-obsw/pipeline/pr-main There was a failure building this commit
2024-03-05 09:06:48 +01:00
cda2a9df33 use existing function
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-03-04 11:57:10 +01:00
6da37c0fa4 changelog
Some checks are pending
EIVE/eive-obsw/pipeline/head Build started...
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-03-01 15:29:14 +01:00
141f82d0a9 prevent ctrl values from becoming NaN
Some checks are pending
EIVE/eive-obsw/pipeline/head Build started...
2024-03-01 15:27:13 +01:00
14 changed files with 133 additions and 10 deletions

View File

@ -16,6 +16,30 @@ will consitute of a breaking change warranting a new major release:
# [unreleased]
# [v7.7.2] 2024-03-06
## Fixed
- Camera and E-band antenna now point towards the target instead of away from the target for the
pointing target mode.
# [v7.7.1] 2024-03-06
- Bumped `eive-tmtc` to v6.1.1
- Bumped `eive-fsfw`
## Added
- The `CoreController` now sets the leap seconds on initalization. They are stored in a persistent
file. If the file does yet not exist, it will be created. The leap seconds can be updated using an
action command. This will also update the file.
## Fixed
- Fixed wrong dimension of a matrix within the `MEKF`, which would lead to a seg fault, if the
star tracker was available.
- Fixed case in which control values within the `AcsController` could become NaN.
# [v7.7.0] 2024-02-29
- Bumped `eive-tmtc` to v6.1.0

View File

@ -11,7 +11,7 @@ cmake_minimum_required(VERSION 3.13)
set(OBSW_VERSION_MAJOR 7)
set(OBSW_VERSION_MINOR 7)
set(OBSW_VERSION_REVISION 0)
set(OBSW_VERSION_REVISION 2)
# set(CMAKE_VERBOSE TRUE)

View File

@ -480,6 +480,16 @@ ReturnValue_t CoreController::executeAction(ActionId_t actionId, MessageQueueId_
successRecipient = commandedBy;
return returnvalue::OK;
}
case (UPDATE_LEAP_SECONDS): {
if (size != sizeof(uint16_t)) {
return HasActionsIF::INVALID_PARAMETERS;
}
ReturnValue_t result = actionUpdateLeapSeconds(data);
if (result != returnvalue::OK) {
return result;
}
return HasActionsIF::EXECUTION_FINISHED;
}
default: {
return HasActionsIF::INVALID_ACTION_ID;
}
@ -1411,6 +1421,9 @@ void CoreController::performMountedSdCardOperations() {
if (not timeFileInitDone) {
initClockFromTimeFile();
}
if (not leapSecondsInitDone) {
initLeapSeconds();
}
performRebootWatchdogHandling(false);
performRebootCountersHandling(false);
}
@ -2066,6 +2079,71 @@ ReturnValue_t CoreController::backupTimeFileHandler() {
return returnvalue::OK;
}
void CoreController::initLeapSeconds() {
ReturnValue_t result = initLeapSecondsFromFile();
if (result != returnvalue::OK) {
Clock::setLeapSeconds(config::LEAP_SECONDS);
writeLeapSecondsToFile(config::LEAP_SECONDS);
}
leapSecondsInitDone = true;
}
ReturnValue_t CoreController::initLeapSecondsFromFile() {
std::string fileName = currMntPrefix + LEAP_SECONDS_FILE;
std::error_code e;
if (sdcMan->isSdCardUsable(std::nullopt) and std::filesystem::exists(fileName, e)) {
std::ifstream leapSecondsFile(fileName);
std::string nextWord;
std::getline(leapSecondsFile, nextWord);
std::istringstream iss(nextWord);
iss >> nextWord;
if (iss.bad() or nextWord != "LEAP") {
return returnvalue::FAILED;
}
iss >> nextWord;
if (iss.bad() or nextWord != "SECONDS:") {
return returnvalue::FAILED;
}
iss >> nextWord;
uint16_t leapSeconds = 0;
leapSeconds = std::stoi(nextWord.c_str());
if (iss.bad()) {
return returnvalue::FAILED;
}
Clock::setLeapSeconds(leapSeconds);
return returnvalue::OK;
}
sif::error
<< "CoreController::leapSecondsFileHandler: Initalization of leap seconds from file failed"
<< std::endl;
return returnvalue::FAILED;
};
ReturnValue_t CoreController::writeLeapSecondsToFile(const uint16_t leapSeconds) {
std::string fileName = currMntPrefix + LEAP_SECONDS_FILE;
if (not sdcMan->isSdCardUsable(std::nullopt)) {
return returnvalue::FAILED;
}
std::ofstream leapSecondsFile(fileName.c_str(), std::ofstream::out | std::ofstream::trunc);
if (not leapSecondsFile.good()) {
sif::error << "CoreController::leapSecondsFileHandler: Error opening leap seconds file: "
<< strerror(errno) << std::endl;
return returnvalue::FAILED;
}
leapSecondsFile << "LEAP SECONDS: " << leapSeconds << std::endl;
return returnvalue::OK;
};
ReturnValue_t CoreController::actionUpdateLeapSeconds(const uint8_t *data) {
uint16_t leapSeconds = data[1] | (data[0] << 8);
ReturnValue_t result = writeLeapSecondsToFile(leapSeconds);
if (result != returnvalue::OK) {
return result;
}
Clock::setLeapSeconds(leapSeconds);
return returnvalue::OK;
}
ReturnValue_t CoreController::initClockFromTimeFile() {
using namespace GpsHyperion;
using namespace std;

View File

@ -150,6 +150,8 @@ class CoreController : public ExtendedControllerBase, public ReceivesParameterMe
std::string(core::LEGACY_REBOOT_WATCHDOG_FILE_NAME);
const std::string REBOOT_WATCHDOG_FILE =
"/" + std::string(core::CONF_FOLDER) + "/" + std::string(core::REBOOT_WATCHDOG_FILE_NAME);
const std::string LEAP_SECONDS_FILE =
"/" + std::string(core::CONF_FOLDER) + "/" + std::string(core::LEAP_SECONDS_FILE_NAME);
const std::string BACKUP_TIME_FILE =
"/" + std::string(core::CONF_FOLDER) + "/" + std::string(core::TIME_FILE_NAME);
const std::string REBOOT_COUNTERS_FILE =
@ -296,6 +298,7 @@ class CoreController : public ExtendedControllerBase, public ReceivesParameterMe
std::string currMntPrefix;
bool timeFileInitDone = false;
bool leapSecondsInitDone = false;
bool performOneShotSdCardOpsSwitch = false;
uint8_t shortSdCardCdCounter = 0;
#if OBSW_THREAD_TRACING == 1
@ -335,7 +338,11 @@ class CoreController : public ExtendedControllerBase, public ReceivesParameterMe
void performMountedSdCardOperations();
ReturnValue_t initVersionFile();
void initLeapSeconds();
ReturnValue_t initLeapSecondsFromFile();
ReturnValue_t initClockFromTimeFile();
ReturnValue_t actionUpdateLeapSeconds(const uint8_t* data);
ReturnValue_t writeLeapSecondsToFile(const uint16_t leapSeconds);
ReturnValue_t performSdCardCheck();
ReturnValue_t backupTimeFileHandler();
ReturnValue_t initBootCopyFile();

View File

@ -20,6 +20,9 @@ static constexpr char OBSW_VERSION_FILE_PATH[] = "/usr/share/eive-obsw/obsw_vers
// ISO8601 timestamp.
static constexpr char FILE_DATE_FORMAT[] = "%FT%H%M%SZ";
// Leap Seconds as of 2024-03-04
static constexpr uint16_t LEAP_SECONDS = 37;
static constexpr uint16_t EIVE_PUS_APID = 0x65;
static constexpr uint16_t EIVE_CFDP_APID = 0x66;
static constexpr uint16_t EIVE_LOCAL_CFDP_ENTITY_ID = EIVE_CFDP_APID;

2
fsfw

Submodule fsfw updated: 516357d855...47b21caf5f

View File

@ -59,6 +59,7 @@ void Guidance::targetQuatPtgTarget(timeval timeAbsolute, const double timeDelta,
// this aligns with the camera, E- and S-band antennas
double xAxisIX[3] = {0, 0, 0};
VectorOperations<double>::normalize(targetDirI, xAxisIX, 3);
VectorOperations<double>::mulScalar(xAxisIX, -1, xAxisIX, 3);
// transform velocity into inertial frame
double velSatI[3] = {0, 0, 0};
@ -273,7 +274,11 @@ void Guidance::limitReferenceRotation(const double xAxisIX[3], double quatIX[4])
QuaternionOperations::multiply(quatIXtilde, quatXI, quatXXtilde);
double phiResidual = 0, phiResidualVec[3] = {0, 0, 0};
phiResidual = std::sqrt((phiMax * phiMax) - (phiX * phiX));
if ((phiX * phiX) > (phiMax * phiMax)) {
phiResidual = 0;
} else {
phiResidual = std::sqrt((phiMax * phiMax) - (phiX * phiX));
}
std::memcpy(phiResidualVec, quatXXtilde, sizeof(phiResidualVec));
VectorOperations<double>::normalize(phiResidualVec, phiResidualVec, 3);

View File

@ -69,7 +69,8 @@ void Igrf13Model::magFieldComp(const double longitude, const double gcLatitude,
magFieldModel[1] *= -1;
magFieldModel[2] *= (-1 / sin(theta));
double JD2000 = TimeSystems::convertUnixToJD2000(timeOfMagMeasurement);
double JD2000 = 0;
Clock::convertTimevalToJD2000(timeOfMagMeasurement, &JD2000);
double UT1 = JD2000 / 36525.;
double gst =
@ -93,7 +94,8 @@ void Igrf13Model::magFieldComp(const double longitude, const double gcLatitude,
void Igrf13Model::updateCoeffGH(timeval timeOfMagMeasurement) {
double JD2000Igrf = (2458850.0 - 2451545); // Begin of IGRF-13 (2020-01-01,00:00:00) in JD2000
double JD2000 = TimeSystems::convertUnixToJD2000(timeOfMagMeasurement);
double JD2000 = 0;
Clock::convertTimevalToJD2000(timeOfMagMeasurement, &JD2000);
double days = ceil(JD2000 - JD2000Igrf);
for (int i = 0; i <= igrfOrder; i++) {
for (int j = 0; j <= (igrfOrder - 1); j++) {

View File

@ -16,11 +16,11 @@
#ifndef IGRF13MODEL_H_
#define IGRF13MODEL_H_
#include <fsfw/src/fsfw/globalfunctions/TimeSystems.h>
#include <fsfw/src/fsfw/globalfunctions/constants.h>
#include <fsfw/src/fsfw/globalfunctions/math/MatrixOperations.h>
#include <fsfw/src/fsfw/globalfunctions/math/QuaternionOperations.h>
#include <fsfw/src/fsfw/globalfunctions/math/VectorOperations.h>
#include <fsfw/src/fsfw/timemanager/Clock.h>
#include <cmath>

View File

@ -342,7 +342,7 @@ ReturnValue_t MultiplicativeKalmanFilter::kfGain(
double *measSensMatrix, double *measCovMatrix, double *kalmanGain,
acsctrl::AttitudeEstimationData *attitudeEstimationData) {
// Kalman Gain: K = P * H' / (H * P * H' + R)
double kalmanGainDen[6][matrixDimensionFactor] = {{0}},
double kalmanGainDen[matrixDimensionFactor][matrixDimensionFactor] = {{0}},
invKalmanGainDen[matrixDimensionFactor][matrixDimensionFactor] = {{0}},
residualCov[6][matrixDimensionFactor] = {{0}},
measSensMatrixTransposed[6][matrixDimensionFactor] = {{0}};

View File

@ -180,7 +180,8 @@ void SensorProcessing::processSus(
const AcsParameters::SunModelParameters *sunModelParameters,
acsctrl::SusDataProcessed *susDataProcessed) {
/* -------- Sun Model Direction (IJK frame) ------- */
double JD2000 = TimeSystems::convertUnixToJD2000(timeAbsolute);
double JD2000 = 0;
Clock::convertTimevalToJD2000(timeAbsolute, &JD2000);
// Julean Centuries
double sunIjkModel[3] = {0.0, 0.0, 0.0};

View File

@ -4,13 +4,13 @@
#include <common/config/eive/resultClassIds.h>
#include <fsfw/coordinates/CoordinateTransformations.h>
#include <fsfw/datapool/PoolReadGuard.h>
#include <fsfw/globalfunctions/TimeSystems.h>
#include <fsfw/globalfunctions/constants.h>
#include <fsfw/globalfunctions/math/MatrixOperations.h>
#include <fsfw/globalfunctions/math/QuaternionOperations.h>
#include <fsfw/globalfunctions/math/VectorOperations.h>
#include <fsfw/globalfunctions/timevalOperations.h>
#include <fsfw/returnvalues/returnvalue.h>
#include <fsfw/timemanager/Clock.h>
#include <mission/acs/defs.h>
#include <mission/controller/acs/AcsParameters.h>
#include <mission/controller/acs/Igrf13Model.h>

View File

@ -55,6 +55,7 @@ static constexpr char VERSION_FILE_NAME[] = "version.txt";
static constexpr char LEGACY_REBOOT_WATCHDOG_FILE_NAME[] = "reboot.txt";
static constexpr char REBOOT_WATCHDOG_FILE_NAME[] = "reboot_watchdog.txt";
static constexpr char REBOOT_COUNTER_FILE_NAME[] = "reboot_counters.txt";
static constexpr char LEAP_SECONDS_FILE_NAME[] = "leapseconds.txt";
static constexpr char TIME_FILE_NAME[] = "time_backup.txt";
static constexpr uint32_t SYS_ROM_BASE_ADDR = 0x80000000;
@ -93,6 +94,8 @@ static constexpr ActionId_t MV_HELPER = 53;
static constexpr ActionId_t RM_HELPER = 54;
static constexpr ActionId_t MKDIR_HELPER = 55;
static constexpr ActionId_t UPDATE_LEAP_SECONDS = 60;
static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::CORE;
static constexpr Event ALLOC_FAILURE = event::makeEvent(SUBSYSTEM_ID, 0, severity::MEDIUM);

2
tmtc

Submodule tmtc updated: 73a4260f33...c843356c8a