Compare commits

..

4 Commits

Author SHA1 Message Date
2d7356b9ed Merge pull request 'Nah' (#891) from i-hate-it-here into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #891
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2024-04-11 14:04:51 +02:00
675dda8e9e bump version
Some checks are pending
EIVE/eive-obsw/pipeline/head Build queued...
2024-04-11 14:00:30 +02:00
5bb1bd8946 changelog
Some checks are pending
EIVE/eive-obsw/pipeline/head Build started...
2024-04-11 13:58:57 +02:00
eff9116aec ???
Some checks are pending
EIVE/eive-obsw/pipeline/head Build started...
2024-04-11 13:57:40 +02:00
8 changed files with 15 additions and 54 deletions

View File

@ -16,6 +16,10 @@ will consitute of a breaking change warranting a new major release:
# [unreleased]
# [v7.8.1] 2024-04-11
- Reverted fix for wrong order in quaternion multiplication for computation of the error quaternion.
# [v7.8.0] 2024-04-10
## Changed

View File

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

View File

@ -48,7 +48,6 @@
#define OBSW_SWITCH_TO_NORMAL_MODE_AFTER_STARTUP 1
#define OBSW_PRINT_MISSED_DEADLINES 1
#define OBSW_MPSOC_JTAG_BOOT 0
#define OBSW_SYRLINKS_SIMULATED 1
#define OBSW_ADD_TEST_CODE 0
#define OBSW_ADD_TEST_TASK 0

View File

@ -6,10 +6,10 @@
#include <linux/payload/mpsocRetvals.h>
#include <mission/payload/plocSpBase.h>
#include "OBSWConfig.h"
#include "eive/definitions.h"
#include "fsfw/returnvalues/returnvalue.h"
#include "fsfw/globalfunctions/CRC.h"
#include "fsfw/serialize/SerializeAdapter.h"
#include "fsfw/serialize/SerializeIF.h"
namespace mpsoc {
@ -838,47 +838,20 @@ class TcSimplexSendFile : public TcBase {
: TcBase(params, apid::TC_SIMPLEX_SEND_FILE, sequenceCount) {}
ReturnValue_t setPayload(const uint8_t* commandData, size_t commandDataLen) {
if (commandDataLen < MIN_DATA_LENGTH) {
return INVALID_LENGTH;
}
if (commandDataLen > MAX_DATA_LENGTH) {
return INVALID_LENGTH;
}
const uint8_t** dataPtr = &commandData;
ReturnValue_t result = SerializeAdapter::deSerialize(&chunkParameter, dataPtr, &commandDataLen,
SerializeIF::Endianness::NETWORK);
if (result != returnvalue::OK) {
return result;
}
/// No chunks makes no sense, and DIV str can not be longer than whats representable with 3
/// decimal digits.
if (chunkParameter == 0 or chunkParameter > 999) {
return INVALID_PARAMETER;
}
std::string fileName(reinterpret_cast<const char*>(*dataPtr));
std::string fileName(reinterpret_cast<const char*>(commandData));
if (fileName.size() + sizeof(NULL_TERMINATOR) > MAX_FILENAME_SIZE) {
return FILENAME_TOO_LONG;
}
size_t currentCopyIdx = 0;
size_t payloadLen = fileName.length() + sizeof(NULL_TERMINATOR) + CRC_SIZE;
if (chunkParameter > 1) {
char divStr[16]{};
sprintf(divStr, "DIV%03u", chunkParameter);
std::memcpy(payloadStart, divStr, DIV_STR_LEN);
payloadLen += DIV_STR_LEN;
currentCopyIdx += DIV_STR_LEN;
}
std::memcpy(payloadStart + currentCopyIdx, *dataPtr, fileName.length());
spParams.setFullPayloadLen(payloadLen);
spParams.setFullPayloadLen(commandDataLen + CRC_SIZE);
std::memcpy(payloadStart, commandData, commandDataLen);
return returnvalue::OK;
}
private:
uint32_t chunkParameter = 0;
static constexpr size_t MAX_DATA_LENGTH = 256;
static constexpr size_t MIN_DATA_LENGTH = 4;
static constexpr size_t DIV_STR_LEN = 6;
static const size_t MAX_DATA_LENGTH = 256;
};
/**

View File

@ -303,9 +303,9 @@ void Guidance::comparePtg(double currentQuat[4], double currentSatRotRate[3], do
// First calculate error quaternion between current and target orientation without reference
// quaternion
double errorQuatWoRef[4] = {0, 0, 0, 0};
QuaternionOperations::multiply(targetQuat, currentQuat, errorQuatWoRef);
QuaternionOperations::multiply(currentQuat, targetQuat, errorQuatWoRef);
// Then add rotation from reference quaternion
QuaternionOperations::multiply(errorQuatWoRef, refQuat, errorQuat);
QuaternionOperations::multiply(refQuat, errorQuatWoRef, errorQuat);
// Keep scalar part of quaternion positive
if (errorQuat[3] < 0) {
VectorOperations<double>::mulScalar(errorQuat, -1, errorQuat, 4);

2
tmtc

Submodule tmtc updated: 37eafb722b...a8d0143b1e

View File

@ -6,6 +6,5 @@ target_sources(${UNITTEST_NAME} PRIVATE
testEnvironment.cpp
testGenericFilesystem.cpp
hdlcEncodingRw.cpp
mpsocTests.cpp
printChar.cpp
)
)

View File

@ -1,14 +0,0 @@
#include <catch2/catch_test_macros.hpp>
TEST_CASE("MPSoC helper tests", "[payload]") {
char divStr[16]{};
uint32_t divParam = 0;
SECTION("Simple Test") {
divParam = 3;
CHECK(divParam < 999);
sprintf(divStr, "DIV%03u", divParam);
REQUIRE(strcmp(divStr, "DIV003") == 0);
}
}