more ACS cleaning
Some checks are pending
EIVE/eive-obsw/pipeline/head Build started...
EIVE/eive-obsw/pipeline/pr-develop Build queued...

- STR code is now in mission folder, but still only conpiled for Q7S
  code because wire library is proprietary
This commit is contained in:
Robin Müller 2023-03-26 16:05:01 +02:00
parent e9901f3c85
commit 079da3b0e4
No known key found for this signature in database
GPG Key ID: FC76078F520434A5
30 changed files with 74 additions and 73 deletions

View File

@ -407,7 +407,6 @@ add_subdirectory(thirdparty)
if(EIVE_ADD_LINUX_FILES)
if(TGT_BSP MATCHES "arm/q7s")
add_subdirectory(${LIB_GOMSPACE_PATH})
add_subdirectory(${LIB_ARCSEC_PATH})
endif()
add_subdirectory(${LINUX_PATH})
endif()

View File

@ -2,13 +2,16 @@
#include <fsfw/subsystem/Subsystem.h>
#include <linux/acs/AcsBoardPolling.h>
#include <linux/acs/GpsHyperionLinuxController.h>
#include <linux/acs/ImtqPollingTask.h>
#include <linux/acs/RwPollingTask.h>
#include <linux/acs/startracker/StrComHandler.h>
#include <linux/acs/StrComHandler.h>
#include <linux/com/SyrlinksComHandler.h>
#include <mission/acs/GyrL3gCustomHandler.h>
#include <mission/acs/MgmLis3CustomHandler.h>
#include <mission/acs/MgmRm3100CustomHandler.h>
#include <mission/acs/str/StarTrackerHandler.h>
#include <mission/acs/str/strHelpers.h>
#include <mission/system/acs/ImtqAssembly.h>
#include <mission/system/fdir/StrFdir.h>
#include <mission/system/objects/CamSwitcher.h>
@ -33,16 +36,13 @@
#include "eive/definitions.h"
#include "fsfw/ipc/QueueFactory.h"
#include "linux/ObjectFactory.h"
#include "linux/acs/startracker/StarTrackerHandler.h"
#include "linux/boardtest/I2cTestClass.h"
#include "linux/boardtest/SpiTestClass.h"
#include "linux/boardtest/UartTestClass.h"
#include "linux/callbacks/gpioCallbacks.h"
#include "linux/csp/CspComIF.h"
#include "linux/devices/GpsHyperionLinuxController.h"
#include "linux/devices/ScexUartReader.h"
#include "linux/devices/devicedefinitions/PlocMPSoCDefinitions.h"
#include "linux/devices/devicedefinitions/StarTrackerDefinitions.h"
#include "linux/devices/ploc/PlocMPSoCHandler.h"
#include "linux/devices/ploc/PlocMPSoCHelper.h"
#include "linux/devices/ploc/PlocMemoryDumper.h"

View File

@ -1,6 +1,6 @@
#include "StarTrackerDummy.h"
#include <linux/devices/devicedefinitions/StarTrackerDefinitions.h>
#include <mission/acs/str/strHelpers.h>
StarTrackerDummy::StarTrackerDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie)
: DeviceHandlerBase(objectId, comif, comCookie) {}

View File

@ -1,7 +1,7 @@
target_sources(${OBSW_NAME} PUBLIC AcsBoardPolling.cpp ImtqPollingTask.cpp
RwPollingTask.cpp SusPolling.cpp)
target_sources(
${OBSW_NAME} PUBLIC AcsBoardPolling.cpp ImtqPollingTask.cpp RwPollingTask.cpp
SusPolling.cpp StrComHandler.cpp)
# Dependency on proprietary library
if(TGT_BSP MATCHES "arm/q7s")
add_subdirectory(startracker)
if(EIVE_BUILD_GPSD_GPS_HANDLER)
target_sources(${OBSW_NAME} PRIVATE GpsHyperionLinuxController.cpp)
endif()

View File

@ -4,6 +4,7 @@
#include <fsfw/filesystem/HasFileSystemIF.h>
#include <fsfw/tasks/TaskFactory.h>
#include <fsfw/timemanager/Stopwatch.h>
#include <mission/acs/str/strHelpers.h>
#include <unistd.h>
#include <filesystem>
@ -12,8 +13,6 @@
#include "OBSWConfig.h"
#include "eive/definitions.h"
#include "fsfw/timemanager/Countdown.h"
#include "helpers.h"
#include "linux/devices/devicedefinitions/StarTrackerDefinitions.h"
#include "mission/utility/Filenaming.h"
#include "mission/utility/ProgressPrinter.h"
#include "mission/utility/Timestamp.h"
@ -554,12 +553,12 @@ ReturnValue_t StrComHandler::sendAndRead(size_t size, uint32_t failParameter) {
}
ReturnValue_t StrComHandler::checkActionReply(size_t replySize) {
uint8_t type = str::getReplyFrameType(replyPtr);
uint8_t type = startracker::getReplyFrameType(replyPtr);
if (type != TMTC_ACTIONREPLY) {
sif::warning << "StrHelper::checkActionReply: Received reply with invalid type ID" << std::endl;
return INVALID_TYPE_ID;
}
uint8_t status = str::getStatusField(replyPtr);
uint8_t status = startracker::getStatusField(replyPtr);
if (status != ArcsecDatalinkLayer::STATUS_OK) {
sif::warning << "StrHelper::checkActionReply: Status failure: "
<< static_cast<unsigned int>(status) << std::endl;

View File

@ -1,9 +1,10 @@
#ifndef BSP_Q7S_DEVICES_STRHELPER_H_
#define BSP_Q7S_DEVICES_STRHELPER_H_
#include <mission/acs/str/ArcsecDatalinkLayer.h>
#include <string>
#include "ArcsecDatalinkLayer.h"
#include "OBSWConfig.h"
#ifdef XIPHOS_Q7S

View File

@ -1,7 +0,0 @@
#include "helpers.h"
uint8_t str::getReplyFrameType(const uint8_t* rawFrame) { return rawFrame[0]; }
uint8_t str::getId(const uint8_t* rawFrame) { return rawFrame[1]; }
uint8_t str::getStatusField(const uint8_t* rawFrame) { return rawFrame[2]; }

View File

@ -1,17 +0,0 @@
#ifndef LINUX_DEVICES_STARTRACKER_HELPERS_H_
#define LINUX_DEVICES_STARTRACKER_HELPERS_H_
#include "arcsec/common/genericstructs.h"
namespace str {
/**
* @brief Returns the frame type field of a decoded frame.
*/
uint8_t getReplyFrameType(const uint8_t* rawFrame);
uint8_t getId(const uint8_t* rawFrame);
uint8_t getStatusField(const uint8_t* rawFrame);
} // namespace str
#endif /* LINUX_DEVICES_STARTRACKER_HELPERS_H_ */

View File

@ -1,7 +1,3 @@
if(EIVE_BUILD_GPSD_GPS_HANDLER)
target_sources(${OBSW_NAME} PRIVATE GpsHyperionLinuxController.cpp)
endif()
target_sources(${OBSW_NAME} PRIVATE Max31865RtdPolling.cpp ScexUartReader.cpp
ScexDleParser.cpp ScexHelper.cpp)

View File

@ -11,3 +11,8 @@ target_sources(
imtqHelpers.cpp
rwHelpers.cpp
defs.cpp)
# Dependency on proprietary library
if(TGT_BSP MATCHES "arm/q7s")
add_subdirectory(str)
endif()

View File

@ -8,6 +8,9 @@
class ImtqHandler;
// C garbage which can be included from gps.h
#undef STATUS_SET
namespace imtq {
enum class RequestType : uint8_t { MEASURE_NO_ACTUATION, ACTUATE, DO_NOTHING };

View File

@ -1,4 +1,4 @@
#include "ArcsecDatalinkLayer.h"
#include <mission/acs/str/ArcsecDatalinkLayer.h>
ArcsecDatalinkLayer::ArcsecDatalinkLayer() : decodeRingBuf(BUFFER_LENGTHS, true) { slipInit(); }

View File

@ -3,11 +3,11 @@
#include <fsfw/container/SimpleRingBuffer.h>
#include <fsfw/devicehandlers/CookieIF.h>
#include <mission/acs/str/strHelpers.h>
#include "arcsec/common/misc.h"
#include "eive/resultClassIds.h"
#include "fsfw/returnvalues/returnvalue.h"
#include "linux/devices/devicedefinitions/StarTrackerDefinitions.h"
/**
* @brief Helper class to handle the datalinklayer of replies from the star tracker of arcsec.

View File

@ -1,4 +1,5 @@
#include "ArcsecJsonParamBase.h"
#include <mission/acs/str/ArcsecJsonParamBase.h>
#include <mission/acs/str/arcsecJsonKeys.h>
#include "arcsecJsonKeys.h"

View File

@ -1,6 +1,8 @@
#ifndef BSP_Q7S_DEVICES_STARTRACKER_ARCSECJSONPARAMBASE_H_
#define BSP_Q7S_DEVICES_STARTRACKER_ARCSECJSONPARAMBASE_H_
#include <mission/acs/str/strHelpers.h>
#include <filesystem>
#include <fstream>
#include <nlohmann/json.hpp>
@ -9,7 +11,6 @@
#include "arcsec/common/genericstructs.h"
#include "eive/resultClassIds.h"
#include "fsfw/returnvalues/returnvalue.h"
#include "linux/devices/devicedefinitions/StarTrackerDefinitions.h"
using json = nlohmann::json;

View File

@ -1,4 +1,4 @@
target_sources(
${OBSW_NAME}
PRIVATE StarTrackerHandler.cpp strJsonCommands.cpp ArcsecDatalinkLayer.cpp
ArcsecJsonParamBase.cpp StrComHandler.cpp helpers.cpp)
ArcsecJsonParamBase.cpp strHelpers.cpp)

View File

@ -1,10 +1,11 @@
#include "StarTrackerHandler.h"
#include <arcsec/client/generated/actionreq.h>
#include <arcsec/client/generated/parameter.h>
#include <arcsec/client/generated/telemetry.h>
#include <fsfw/ipc/QueueFactory.h>
#include <fsfw/timemanager/Stopwatch.h>
#include <mission/acs/str/StarTrackerHandler.h>
#include <mission/acs/str/strHelpers.h>
#include <mission/acs/str/strJsonCommands.h>
#include <atomic>
#include <fstream>
@ -12,8 +13,6 @@
#include "OBSWConfig.h"
#include "arcsec/common/misc.h"
#include "helpers.h"
#include "strJsonCommands.h"
std::atomic_bool JCFG_DONE(false);
@ -831,26 +830,26 @@ ReturnValue_t StarTrackerHandler::scanForReply(const uint8_t* start, size_t rema
return returnvalue::FAILED;
}
switch (str::getReplyFrameType(start)) {
switch (startracker::getReplyFrameType(start)) {
case TMTC_ACTIONREPLY: {
*foundLen = remainingSize - bytesLeft;
result = scanForActionReply(str::getId(start), foundId);
result = scanForActionReply(startracker::getId(start), foundId);
break;
}
case TMTC_SETPARAMREPLY: {
*foundLen = remainingSize - bytesLeft;
result = scanForSetParameterReply(str::getId(start), foundId);
result = scanForSetParameterReply(startracker::getId(start), foundId);
break;
}
case TMTC_PARAMREPLY: {
*foundLen = remainingSize - bytesLeft;
result = scanForGetParameterReply(str::getId(start), foundId);
result = scanForGetParameterReply(startracker::getId(start), foundId);
break;
}
case TMTC_TELEMETRYREPLYA:
case TMTC_TELEMETRYREPLY: {
*foundLen = remainingSize - bytesLeft;
result = scanForTmReply(str::getId(start), foundId);
result = scanForTmReply(startracker::getId(start), foundId);
break;
}
default: {
@ -1818,7 +1817,7 @@ ReturnValue_t StarTrackerHandler::prepareRequestDebugCameraParams() {
}
ReturnValue_t StarTrackerHandler::handleSetParamReply(const uint8_t* rawFrame) {
uint8_t status = str::getStatusField(rawFrame);
uint8_t status = startracker::getStatusField(rawFrame);
if (status != startracker::STATUS_OK) {
sif::warning << "StarTrackerHandler::handleSetParamReply: Failed to execute parameter set "
" command with parameter ID"
@ -1835,7 +1834,7 @@ ReturnValue_t StarTrackerHandler::handleSetParamReply(const uint8_t* rawFrame) {
}
ReturnValue_t StarTrackerHandler::handleActionReply(const uint8_t* rawFrame) {
uint8_t status = str::getStatusField(rawFrame);
uint8_t status = startracker::getStatusField(rawFrame);
if (status != startracker::STATUS_OK) {
sif::warning << "StarTrackerHandler::handleActionReply: Failed to execute action "
<< "command with action ID "
@ -1903,7 +1902,7 @@ ReturnValue_t StarTrackerHandler::handleParamRequest(const uint8_t* rawFrame,
ReturnValue_t StarTrackerHandler::handlePingReply(const uint8_t* rawFrame) {
ReturnValue_t result = returnvalue::OK;
uint32_t pingId = 0;
uint8_t status = str::getStatusField(rawFrame);
uint8_t status = startracker::getStatusField(rawFrame);
const uint8_t* buffer = rawFrame + ACTION_DATA_OFFSET;
size_t size = sizeof(pingId);
SerializeAdapter::deSerialize(&pingId, &buffer, &size, SerializeIF::Endianness::LITTLE);
@ -1956,7 +1955,7 @@ ReturnValue_t StarTrackerHandler::checkProgram() {
ReturnValue_t StarTrackerHandler::handleTm(const uint8_t* rawFrame, LocalPoolDataSetBase& dataset,
size_t size) {
ReturnValue_t result = returnvalue::OK;
uint8_t status = str::getStatusField(rawFrame);
uint8_t status = startracker::getStatusField(rawFrame);
if (status != startracker::STATUS_OK) {
sif::warning << "StarTrackerHandler::handleTm: Reply error: "
<< static_cast<unsigned int>(status) << std::endl;
@ -1987,7 +1986,7 @@ ReturnValue_t StarTrackerHandler::handleTm(const uint8_t* rawFrame, LocalPoolDat
ReturnValue_t StarTrackerHandler::handleActionReplySet(const uint8_t* rawFrame,
LocalPoolDataSetBase& dataset, size_t size) {
ReturnValue_t result = returnvalue::OK;
uint8_t status = str::getStatusField(rawFrame);
uint8_t status = startracker::getStatusField(rawFrame);
if (status != startracker::STATUS_OK) {
sif::warning << "StarTrackerHandler::handleActionReplySet: Reply error: "
<< static_cast<unsigned int>(status) << std::endl;

View File

@ -2,19 +2,19 @@
#define MISSION_DEVICES_STARTRACKERHANDLER_H_
#include <fsfw/datapool/PoolReadGuard.h>
#include <linux/acs/StrComHandler.h>
#include <mission/acs/str/ArcsecJsonParamBase.h>
#include <mission/acs/str/strHelpers.h>
#include <mission/acs/str/strJsonCommands.h>
#include <thread>
#include "ArcsecJsonParamBase.h"
#include "OBSWConfig.h"
#include "StrComHandler.h"
#include "arcsec/common/SLIP.h"
#include "devices/powerSwitcherList.h"
#include "fsfw/devicehandlers/DeviceHandlerBase.h"
#include "fsfw/src/fsfw/serialize/SerializeAdapter.h"
#include "fsfw/timemanager/Countdown.h"
#include "linux/devices/devicedefinitions/StarTrackerDefinitions.h"
#include "strJsonCommands.h"
/**
* @brief This is the device handler for the star tracker from arcsec.

View File

@ -0,0 +1,7 @@
#include <mission/acs/str/strHelpers.h>
uint8_t startracker::getReplyFrameType(const uint8_t* rawFrame) { return rawFrame[0]; }
uint8_t startracker::getId(const uint8_t* rawFrame) { return rawFrame[1]; }
uint8_t startracker::getStatusField(const uint8_t* rawFrame) { return rawFrame[2]; }

View File

@ -11,6 +11,13 @@
namespace startracker {
/**
* @brief Returns the frame type field of a decoded frame.
*/
uint8_t getReplyFrameType(const uint8_t* rawFrame);
uint8_t getId(const uint8_t* rawFrame);
uint8_t getStatusField(const uint8_t* rawFrame);
/** This is the address of the star tracker */
static const uint8_t ADDRESS = 33;

View File

@ -1,4 +1,5 @@
#include "strJsonCommands.h"
#include <mission/acs/str/arcsecJsonKeys.h>
#include <mission/acs/str/strJsonCommands.h>
#include "arcsecJsonKeys.h"

View File

@ -7,9 +7,10 @@
* @author J. Meier
*/
#include <mission/acs/str/ArcsecJsonParamBase.h>
#include <string>
#include "ArcsecJsonParamBase.h"
#include "fsfw/serviceinterface/ServiceInterface.h"
/**

View File

@ -5,10 +5,10 @@
#include <fsfw/thermal/ThermalComponentIF.h>
#include <fsfw_hal/devicehandlers/devicedefinitions/gyroL3gHelpers.h>
#include <fsfw_hal/devicehandlers/devicedefinitions/mgmLis3Helpers.h>
#include <linux/devices/devicedefinitions/StarTrackerDefinitions.h>
#include <mission/acs/gyroAdisHelpers.h>
#include <mission/acs/imtqHelpers.h>
#include <mission/acs/rwHelpers.h>
#include <mission/acs/str/strHelpers.h>
#include <mission/com/syrlinksDefs.h>
#include <mission/devices/devicedefinitions/BpxBatteryDefinitions.h>
#include <mission/devices/devicedefinitions/GomspaceDefinitions.h>

View File

@ -7,10 +7,10 @@
#include <fsfw/timemanager/Countdown.h>
#include <fsfw_hal/devicehandlers/devicedefinitions/gyroL3gHelpers.h>
#include <fsfw_hal/devicehandlers/devicedefinitions/mgmLis3Helpers.h>
#include <linux/devices/devicedefinitions/StarTrackerDefinitions.h>
#include <mission/acs/gyroAdisHelpers.h>
#include <mission/acs/imtqHelpers.h>
#include <mission/acs/rwHelpers.h>
#include <mission/acs/str/strHelpers.h>
#include <mission/com/syrlinksDefs.h>
#include <mission/controller/controllerdefinitions/ThermalControllerDefinitions.h>
#include <mission/devices/devicedefinitions/BpxBatteryDefinitions.h>

View File

@ -4,10 +4,10 @@
#include <fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h>
#include <fsfw_hal/devicehandlers/MgmRM3100Handler.h>
#include <fsfw_hal/devicehandlers/devicedefinitions/gyroL3gHelpers.h>
#include <linux/devices/devicedefinitions/StarTrackerDefinitions.h>
#include <mission/acs/gyroAdisHelpers.h>
#include <mission/acs/imtqHelpers.h>
#include <mission/acs/rwHelpers.h>
#include <mission/acs/str/strHelpers.h>
#include <mission/devices/devicedefinitions/GPSDefinitions.h>
#include <mission/devices/devicedefinitions/susMax1227Helpers.h>

View File

@ -2,4 +2,9 @@ if(EIVE_ADD_LINUX_FILES)
add_subdirectory(tas)
endif()
# Dependency on proprietary library
if(TGT_BSP MATCHES "arm/q7s")
add_subdirectory(arcsec_star_tracker)
endif()
add_subdirectory(rapidcsv)

@ -1 +1 @@
Subproject commit cbb3b24dc1993b727735fd63576088401ba351ec
Subproject commit 2823952e0902726e6e35dd7c159761f76bf7e505