lwgps library integrated #23

Merged
meierj merged 10 commits from mueller/lwgps-integrated into develop 2021-03-04 18:24:01 +01:00
167 changed files with 406 additions and 148 deletions

5
.gitmodules vendored
View File

@ -1,5 +1,5 @@
[submodule "etl"] [submodule "etl"]
path = etl path = thirdparty/etl
url = https://github.com/ETLCPP/etl.git url = https://github.com/ETLCPP/etl.git
[submodule "arduino"] [submodule "arduino"]
path = arduino path = arduino
@ -10,3 +10,6 @@
[submodule "tmtc"] [submodule "tmtc"]
path = tmtc path = tmtc
url = https://egit.irs.uni-stuttgart.de/eive/eive_tmtc.git url = https://egit.irs.uni-stuttgart.de/eive/eive_tmtc.git
[submodule "thirdparty/lwgps"]
path = thirdparty/lwgps
url = https://github.com/rmspacefish/lwgps.git

View File

@ -15,6 +15,7 @@ cmake_minimum_required(VERSION 3.13)
set(CMAKE_SCRIPT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") set(CMAKE_SCRIPT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
option(ADD_ETL_LIB "Add ETL library" ON)
if(NOT OS_FSFW) if(NOT OS_FSFW)
set(OS_FSFW host CACHE STRING "OS for the FSFW.") set(OS_FSFW host CACHE STRING "OS for the FSFW.")
endif() endif()
@ -37,14 +38,21 @@ set(CMAKE_CXX_STANDARD_REQUIRED True)
# Set names and variables # Set names and variables
set(TARGET_NAME ${CMAKE_PROJECT_NAME}) set(TARGET_NAME ${CMAKE_PROJECT_NAME})
set(LIB_FSFW_NAME fsfw) set(LIB_FSFW_NAME fsfw)
set(LIB_ETL_NAME etl)
set(LIB_CSP_NAME libcsp) set(LIB_CSP_NAME libcsp)
set(LIB_LWGPS_NAME lwgps)
set(THIRD_PARTY_FOLDER thirdparty)
# Set path names # Set path names
set(FSFW_PATH fsfw) set(FSFW_PATH fsfw)
set(MISSION_PATH mission) set(MISSION_PATH mission)
set(CSPLIB_PATH libcsp)
set(TEST_PATH test/testtasks) set(TEST_PATH test/testtasks)
set(LINUX_PATH linux) set(LINUX_PATH linux)
set(COMMON_PATH common)
set(CSP_LIB_PATH ${THIRD_PARTY_FOLDER}/libcsp)
set(ETL_LIB_PATH ${THIRD_PARTY_FOLDER}/etl)
set(LWGPS_LIB_PATH ${THIRD_PARTY_FOLDER}/lwgps)
set(FSFW_WARNING_SHADOW_LOCAL_GCC OFF) set(FSFW_WARNING_SHADOW_LOCAL_GCC OFF)
set(ADD_LINUX_FILES FALSE) set(ADD_LINUX_FILES FALSE)
@ -73,6 +81,8 @@ else()
# Required by FSFW library # Required by FSFW library
set(FSFW_CONFIG_PATH "${BSP_PATH}/fsfwconfig") set(FSFW_CONFIG_PATH "${BSP_PATH}/fsfwconfig")
endif() endif()
# Set for lwgps library
set(LWGPS_CONFIG_PATH "${COMMON_PATH}/config")
################################################################################ ################################################################################
# Executable and Sources # Executable and Sources
@ -87,17 +97,23 @@ if(ROOT_CONFIG_FOLDER)
endif() endif()
if(ADD_CSP_LIB) if(ADD_CSP_LIB)
add_subdirectory(${CSPLIB_PATH}) add_subdirectory(${CSP_LIB_PATH})
endif()
if(ADD_ETL_LIB)
add_subdirectory(${ETL_LIB_PATH})
endif() endif()
if(ADD_LINUX_FILES) if(ADD_LINUX_FILES)
add_subdirectory(${LINUX_PATH}) add_subdirectory(${LINUX_PATH})
endif() endif()
add_subdirectory(${LWGPS_LIB_PATH})
add_subdirectory(${BSP_PATH}) add_subdirectory(${BSP_PATH})
add_subdirectory(${FSFW_PATH}) add_subdirectory(${FSFW_PATH})
add_subdirectory(${MISSION_PATH}) add_subdirectory(${MISSION_PATH})
add_subdirectory(${TEST_PATH}) add_subdirectory(${TEST_PATH})
add_subdirectory(${COMMON_PATH})
################################################################################ ################################################################################
# Post-Sources preparation # Post-Sources preparation
@ -109,8 +125,15 @@ set_property(CACHE OS_FSFW PROPERTY STRINGS host linux)
target_link_libraries(${TARGET_NAME} PRIVATE target_link_libraries(${TARGET_NAME} PRIVATE
${LIB_FSFW_NAME} ${LIB_FSFW_NAME}
${LIB_OS_NAME} ${LIB_OS_NAME}
${LIB_LWGPS_NAME}
) )
if(ADD_ETL_LIB)
target_link_libraries(${TARGET_NAME} PRIVATE
${LIB_ETL_NAME}
)
endif()
if(ADD_CSP_LIB) if(ADD_CSP_LIB)
target_link_libraries(${TARGET_NAME} PRIVATE target_link_libraries(${TARGET_NAME} PRIVATE
${LIB_CSP_NAME} ${LIB_CSP_NAME}

View File

@ -208,7 +208,16 @@ or
ssh eive@192.168.199.227 ssh eive@192.168.199.227
``` ```
To access the console of the Q7S run the following: If the static IP address of the Q7S has already been set,
you can access it with ssh
```sh
ssh root@192.168.133.10
```
If this has not been done yet, you can access the serial
console of the Q7S like this to set it
```sh ```sh
picocom -b 115200 /dev/ttyUSB0 picocom -b 115200 /dev/ttyUSB0
``` ```

View File

@ -15,7 +15,6 @@
#include <iostream> #include <iostream>
// This is configured for linux without \cr
#ifdef LINUX #ifdef LINUX
ServiceInterfaceStream sif::debug("DEBUG"); ServiceInterfaceStream sif::debug("DEBUG");
ServiceInterfaceStream sif::info("INFO"); ServiceInterfaceStream sif::info("INFO");
@ -42,116 +41,119 @@ void initmission::initMission() {
} }
void initmission::initTasks() { void initmission::initTasks() {
TaskFactory* factory = TaskFactory::instance();
if(factory == nullptr) {
/* Should never happen ! */
return;
}
#if OBSW_PRINT_MISSED_DEADLINES == 1
void (*missedDeadlineFunc) (void) = TaskFactory::printMissedDeadline;
#else
void (*missedDeadlineFunc) (void) = nullptr;
#endif
/* TMTC Distribution */ /* TMTC Distribution */
PeriodicTaskIF* TmTcDistributor = TaskFactory::instance()-> PeriodicTaskIF* tmTcDistributor = factory->createPeriodicTask(
createPeriodicTask("DIST", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, "DIST", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc);
0.100, nullptr); ReturnValue_t result = tmTcDistributor->addComponent(
ReturnValue_t result = TmTcDistributor->addComponent(
objects::CCSDS_PACKET_DISTRIBUTOR); objects::CCSDS_PACKET_DISTRIBUTOR);
if(result != HasReturnvaluesIF::RETURN_OK){ if(result != HasReturnvaluesIF::RETURN_OK){
sif::error << "Object add component failed" << std::endl; sif::error << "Object add component failed" << std::endl;
} }
result = TmTcDistributor->addComponent(objects::PUS_PACKET_DISTRIBUTOR); result = tmTcDistributor->addComponent(objects::PUS_PACKET_DISTRIBUTOR);
if(result != HasReturnvaluesIF::RETURN_OK){ if(result != HasReturnvaluesIF::RETURN_OK){
sif::error << "Object add component failed" << std::endl; sif::error << "Object add component failed" << std::endl;
} }
result = TmTcDistributor->addComponent(objects::TM_FUNNEL); result = tmTcDistributor->addComponent(objects::TM_FUNNEL);
if(result != HasReturnvaluesIF::RETURN_OK) { if(result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "Object add component failed" << std::endl; sif::error << "Object add component failed" << std::endl;
} }
/* UDP bridge */ /* UDP bridge */
PeriodicTaskIF* UdpBridgeTask = TaskFactory::instance()->createPeriodicTask( PeriodicTaskIF* udpBridgeTask = factory->createPeriodicTask(
"UDP_UNIX_BRIDGE", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, "UDP_UNIX_BRIDGE", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc);
0.2, nullptr); result = udpBridgeTask->addComponent(objects::UDP_BRIDGE);
result = UdpBridgeTask->addComponent(objects::UDP_BRIDGE);
if(result != HasReturnvaluesIF::RETURN_OK) { if(result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "Add component UDP Unix Bridge failed" << std::endl; sif::error << "Add component UDP Unix Bridge failed" << std::endl;
} }
PeriodicTaskIF* UdpPollingTask = TaskFactory::instance()-> PeriodicTaskIF* udpPollingTask = factory->createPeriodicTask(
createPeriodicTask("UDP_POLLING", 80, "UDP_POLLING", 80, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc);
PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, nullptr); result = udpPollingTask->addComponent(objects::UDP_POLLING_TASK);
result = UdpPollingTask->addComponent(objects::UDP_POLLING_TASK);
if(result != HasReturnvaluesIF::RETURN_OK) { if(result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "Add component UDP Polling failed" << std::endl; sif::error << "Add component UDP Polling failed" << std::endl;
} }
/* PUS Services */ /* PUS Services */
PeriodicTaskIF* PusVerification = TaskFactory::instance()-> PeriodicTaskIF* pusVerification = factory->createPeriodicTask(
createPeriodicTask("PUS_VERIF_1", 40, "PUS_VERIF", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, missedDeadlineFunc);
PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, nullptr); result = pusVerification->addComponent(objects::PUS_SERVICE_1_VERIFICATION);
result = PusVerification->addComponent(objects::PUS_SERVICE_1_VERIFICATION);
if(result != HasReturnvaluesIF::RETURN_OK){ if(result != HasReturnvaluesIF::RETURN_OK){
sif::error << "Object add component failed" << std::endl; sif::error << "Object add component failed" << std::endl;
} }
PeriodicTaskIF* PusEvents = TaskFactory::instance()-> PeriodicTaskIF* pusEvents = factory->createPeriodicTask(
createPeriodicTask("PUS_VERIF_1", 60, "PUS_EVENTS", 60, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, missedDeadlineFunc);
PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, nullptr); result = pusVerification->addComponent(objects::PUS_SERVICE_5_EVENT_REPORTING);
result = PusVerification->addComponent(objects::PUS_SERVICE_5_EVENT_REPORTING);
if(result != HasReturnvaluesIF::RETURN_OK){ if(result != HasReturnvaluesIF::RETURN_OK){
sif::error << "Object add component failed" << std::endl; initmission::printAddObjectError("PUS5", objects::PUS_SERVICE_5_EVENT_REPORTING);
} }
PeriodicTaskIF* PusHighPrio = TaskFactory::instance()-> PeriodicTaskIF* pusHighPrio = factory->createPeriodicTask(
createPeriodicTask("PUS_HIGH_PRIO", 50, "PUS_HIGH_PRIO", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, missedDeadlineFunc);
PeriodicTaskIF::MINIMUM_STACK_SIZE, result = pusHighPrio->addComponent(objects::PUS_SERVICE_2_DEVICE_ACCESS);
0.200, nullptr);
result = PusHighPrio->addComponent(objects::PUS_SERVICE_2_DEVICE_ACCESS);
if(result != HasReturnvaluesIF::RETURN_OK) { if(result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "Object add component failed" << std::endl; initmission::printAddObjectError("PUS2", objects::PUS_SERVICE_2_DEVICE_ACCESS);
} }
result = PusHighPrio->addComponent(objects::PUS_SERVICE_9_TIME_MGMT); result = pusHighPrio->addComponent(objects::PUS_SERVICE_9_TIME_MGMT);
if(result != HasReturnvaluesIF::RETURN_OK) { if(result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "Object add component failed" << std::endl; initmission::printAddObjectError("PUS9", objects::PUS_SERVICE_9_TIME_MGMT);
} }
PeriodicTaskIF* PusMedPrio = TaskFactory::instance()-> PeriodicTaskIF* pusMedPrio = factory->createPeriodicTask(
createPeriodicTask("PUS_HIGH_PRIO", 40, "PUS_MED_PRIO", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, missedDeadlineFunc);
PeriodicTaskIF::MINIMUM_STACK_SIZE, result = pusMedPrio->addComponent(objects::PUS_SERVICE_8_FUNCTION_MGMT);
0.8, nullptr);
result = PusMedPrio->addComponent(objects::PUS_SERVICE_8_FUNCTION_MGMT);
if(result != HasReturnvaluesIF::RETURN_OK) { if(result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "Object add component failed" << std::endl; initmission::printAddObjectError("PUS8", objects::PUS_SERVICE_8_FUNCTION_MGMT);
} }
result = PusMedPrio->addComponent(objects::PUS_SERVICE_200_MODE_MGMT); result = pusMedPrio->addComponent(objects::PUS_SERVICE_200_MODE_MGMT);
if(result != HasReturnvaluesIF::RETURN_OK) { if(result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "Object add component failed" << std::endl; initmission::printAddObjectError("PUS200", objects::PUS_SERVICE_200_MODE_MGMT);
}
result = pusMedPrio->addComponent(objects::PUS_SERVICE_20_PARAMETERS);
if(result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("PUS20", objects::PUS_SERVICE_20_PARAMETERS);
} }
PeriodicTaskIF* PusLowPrio = TaskFactory::instance()-> PeriodicTaskIF* pusLowPrio = factory->createPeriodicTask(
createPeriodicTask("PUSB", 30, PeriodicTaskIF::MINIMUM_STACK_SIZE, "PUS_LOW_PRIO", 30, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.6, missedDeadlineFunc);
1.6, nullptr); result = pusLowPrio->addComponent(objects::PUS_SERVICE_17_TEST);
result = PusLowPrio->addComponent(objects::PUS_SERVICE_17_TEST);
if(result != HasReturnvaluesIF::RETURN_OK) { if(result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "Object add component failed" << std::endl; initmission::printAddObjectError("PUS17", objects::PUS_SERVICE_17_TEST);
} }
PeriodicTaskIF* testTask = factory->createPeriodicTask(
"TEST_TASK", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc);
#if OBSW_ADD_TEST_CODE == 1 #if OBSW_ADD_TEST_CODE == 1
FixedTimeslotTaskIF* TestTimeslotTask = TaskFactory::instance()-> result = testTask->addComponent(objects::TEST_TASK);
createFixedTimeslotTask("PST_TEST_TASK", 10,
PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, nullptr);
result = pst::pollingSequenceTestFunction(TestTimeslotTask);
if(result != HasReturnvaluesIF::RETURN_OK) { if(result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "InitMission::createTasks: Test PST initialization " initmission::printAddObjectError("TEST_TASK", objects::TEST_TASK);
<< "failed!" << std::endl;
} }
#endif #endif /* OBSW_ADD_TEST_CODE == 1 */
//Main thread sleep
sif::info << "Starting tasks.." << std::endl; sif::info << "Starting tasks.." << std::endl;
TmTcDistributor->startTask(); tmTcDistributor->startTask();
UdpBridgeTask->startTask(); udpBridgeTask->startTask();
UdpPollingTask->startTask(); udpPollingTask->startTask();
pusVerification->startTask();
pusEvents->startTask();
pusHighPrio->startTask();
pusMedPrio->startTask();
pusLowPrio->startTask();
PusVerification->startTask();
PusEvents->startTask();
PusHighPrio->startTask();
PusMedPrio->startTask();
PusLowPrio->startTask();
#if OBSW_ADD_TEST_CODE == 1 #if OBSW_ADD_TEST_CODE == 1
TestTimeslotTask->startTask(); testTask->startTask();
#endif #endif /* OBSW_ADD_TEST_CODE == 1 */
sif::info << "Tasks started.." << std::endl; sif::info << "Tasks started.." << std::endl;
} }

View File

@ -6,7 +6,9 @@
#ifndef CONFIG_OBSWCONFIG_H_ #ifndef CONFIG_OBSWCONFIG_H_
#define CONFIG_OBSWCONFIG_H_ #define CONFIG_OBSWCONFIG_H_
#define OBSW_ADD_TEST_CODE 0 #include "commonConfig.h"
#define OBSW_ADD_TEST_CODE 1
/* These defines should be disabled for mission code but are useful for /* These defines should be disabled for mission code but are useful for
debugging. */ debugging. */

View File

@ -0,0 +1,35 @@
#ifndef FSFWCONFIG_DEVICES_GPIOIDS_H_
#define FSFWCONFIG_DEVICES_GPIOIDS_H_
#include <linux/gpio/GpioIF.h>
namespace gpioIds {
enum gpioId_t {
HEATER_0,
HEATER_1,
HEATER_2,
HEATER_3,
HEATER_4,
HEATER_5,
HEATER_6,
HEATER_7,
DEPLSA1,
DEPLSA2,
MGM_0_LIS3_CS,
MGM_1_RM3100_CS,
GYRO_0_ADIS_CS,
GYRO_1_L3G_CS,
GYRO_2_L3G_CS,
MGM_2_LIS3_CS,
MGM_3_RM3100_CS,
TEST_ID_0,
TEST_ID_1
};
}
#endif /* FSFWCONFIG_DEVICES_GPIOIDS_H_ */

View File

@ -0,0 +1,58 @@
#ifndef FSFWCONFIG_DEVICES_POWERSWITCHERLIST_H_
#define FSFWCONFIG_DEVICES_POWERSWITCHERLIST_H_
#include <OBSWConfig.h>
namespace pcduSwitches {
/* Switches are uint8_t datatype and go from 0 to 255 */
enum switcherList {
Q7S,
PAYLOAD_PCDU_CH1,
RW,
TCS_BOARD_8V_HEATER_IN,
SUS_REDUNDANT,
DEPLOYMENT_MECHANISM,
PAYLOAD_PCDU_CH6,
ACS_BOARD_SIDE_B,
PAYLOAD_CAMERA,
TCS_BOARD_3V3,
SYRLINKS,
STAR_TRACKER,
MGT,
SUS_NOMINAL,
SOLAR_CELL_EXP,
PLOC,
ACS_BORAD_SIDE_A,
NUMBER_OF_SWITCHES
};
static const uint8_t ON = 1;
static const uint8_t OFF = 0;
/* Output states after reboot of the PDUs */
static const uint8_t INIT_STATE_Q7S = ON;
static const uint8_t INIT_STATE_PAYLOAD_PCDU_CH1 = OFF;
static const uint8_t INIT_STATE_RW = OFF;
#if TE0720 == 1
/* Because the TE0720 is not connected to the PCDU, this switch is always on */
static const uint8_t INIT_STATE_TCS_BOARD_8V_HEATER_IN = ON;
#else
static const uint8_t INIT_STATE_TCS_BOARD_8V_HEATER_IN = OFF;
#endif
static const uint8_t INIT_STATE_SUS_REDUNDANT = OFF;
static const uint8_t INIT_STATE_DEPLOYMENT_MECHANISM = OFF;
static const uint8_t INIT_STATE_PAYLOAD_PCDU_CH6 = OFF;
static const uint8_t INIT_STATE_ACS_BOARD_SIDE_B = OFF;
static const uint8_t INIT_STATE_PAYLOAD_CAMERA = OFF;
static const uint8_t INIT_STATE_TCS_BOARD_3V3 = OFF;
static const uint8_t INIT_STATE_SYRLINKS = OFF;
static const uint8_t INIT_STATE_STAR_TRACKER = OFF;
static const uint8_t INIT_STATE_MGT = OFF;
static const uint8_t INIT_STATE_SUS_NOMINAL = OFF;
static const uint8_t INIT_STATE_SOLAR_CELL_EXP = OFF;
static const uint8_t INIT_STATE_PLOC = OFF;
static const uint8_t INIT_STATE_ACS_BOARD_SIDE_A = OFF;
}
#endif /* FSFWCONFIG_DEVICES_POWERSWITCHERLIST_H_ */

View File

@ -27,6 +27,21 @@ namespace objects {
DUMMY_INTERFACE = 0xCAFECAFE, DUMMY_INTERFACE = 0xCAFECAFE,
DUMMY_HANDLER = 0x4400AFFE, DUMMY_HANDLER = 0x4400AFFE,
/* 0x44 ('D') for device handlers */
P60DOCK_HANDLER = 0x44000001,
PDU1_HANDLER = 0x44000002,
PDU2_HANDLER = 0x44000003,
ACU_HANDLER = 0x44000004,
TMP1075_HANDLER_1 = 0x44000005,
TMP1075_HANDLER_2 = 0x44000006,
MGM_0_LIS3_HANDLER = 0x4400007,
MGM_1_RM3100_HANDLER = 0x44000008,
MGM_2_LIS3_HANDLER = 0x44000009,
MGM_3_RM3100_HANDLER = 0x44000010,
GYRO_0_ADIS_HANDLER = 0x44000011,
GYRO_1_L3G_HANDLER = 0x44000012,
GYRO_2_L3G_HANDLER = 0x44000013,
/* 0x49 ('I') for Communication Interfaces **/ /* 0x49 ('I') for Communication Interfaces **/
ARDUINO_COM_IF = 0x49000001 ARDUINO_COM_IF = 0x49000001
}; };

View File

@ -7,6 +7,7 @@
#include <devices/powerSwitcherList.h> #include <devices/powerSwitcherList.h>
#include <bsp_q7s/devices/HeaterHandler.h> #include <bsp_q7s/devices/HeaterHandler.h>
#include <bsp_q7s/devices/SolarArrayDeploymentHandler.h>
#include <mission/core/GenericFactory.h> #include <mission/core/GenericFactory.h>
#include <mission/devices/PDU1Handler.h> #include <mission/devices/PDU1Handler.h>
@ -15,7 +16,6 @@
#include <mission/devices/PCDUHandler.h> #include <mission/devices/PCDUHandler.h>
#include <mission/devices/P60DockHandler.h> #include <mission/devices/P60DockHandler.h>
#include <mission/devices/Tmp1075Handler.h> #include <mission/devices/Tmp1075Handler.h>
#include <mission/devices/SolarArrayDeploymentHandler.h>
#include <mission/devices/devicedefinitions/GomSpacePackets.h> #include <mission/devices/devicedefinitions/GomSpacePackets.h>
#include <mission/devices/devicedefinitions/GomspaceDefinitions.h> #include <mission/devices/devicedefinitions/GomspaceDefinitions.h>
#include <mission/utility/TmFunnel.h> #include <mission/utility/TmFunnel.h>

View File

@ -1,3 +1,4 @@
target_sources(${TARGET_NAME} PRIVATE target_sources(${TARGET_NAME} PRIVATE
HeaterHandler.cpp HeaterHandler.cpp
SolarArrayDeploymentHandler.cpp
) )

View File

@ -1,7 +1,8 @@
#include "SolarArrayDeploymentHandler.h"
#include <devices/powerSwitcherList.h> #include <devices/powerSwitcherList.h>
#include <devices/gpioIds.h> #include <devices/gpioIds.h>
#include <mission/devices/SolarArrayDeploymentHandler.h>
#include <linux/gpio/GpioCookie.h> #include <linux/gpio/GpioCookie.h>
#include <fsfw/ipc/QueueFactory.h> #include <fsfw/ipc/QueueFactory.h>

View File

@ -15,6 +15,7 @@ if [ "${counter}" -ge 5 ];then
fi fi
build_generator="" build_generator=""
build_dir="Debug-Host"
os_fsfw="host" os_fsfw="host"
if [ "${OS}" = "Windows_NT" ]; then if [ "${OS}" = "Windows_NT" ]; then
build_generator="MinGW Makefiles" build_generator="MinGW Makefiles"
@ -23,4 +24,4 @@ else
build_generator="Unix Makefiles" build_generator="Unix Makefiles"
fi fi
python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -l"${build_dir}"

View File

@ -16,6 +16,7 @@ fi
build_generator="" build_generator=""
os_fsfw="host" os_fsfw="host"
build_dir="Debug-Release"
if [ "${OS}" = "Windows_NT" ]; then if [ "${OS}" = "Windows_NT" ]; then
build_generator="MinGW Makefiles" build_generator="MinGW Makefiles"
# Could be other OS but this works for now. # Could be other OS but this works for now.
@ -23,4 +24,4 @@ else
build_generator="Unix Makefiles" build_generator="Unix Makefiles"
fi fi
python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "release" python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "release" -l"${build_dir}"

1
common/CMakeLists.txt Normal file
View File

@ -0,0 +1 @@
add_subdirectory(config)

View File

@ -0,0 +1,3 @@
target_include_directories(${TARGET_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
)

View File

@ -0,0 +1,7 @@
#ifndef COMMON_CONFIG_COMMONCONFIG_H_
#define COMMON_CONFIG_COMMONCONFIG_H_
#define OBSW_ADD_LWGPS_TEST 0
#endif /* COMMON_CONFIG_COMMONCONFIG_H_ */

View File

@ -0,0 +1,44 @@
/**
* \file lwgps_opts_template.h
* \brief LwGPS configuration file
*/
/*
* Copyright (c) 2020 Tilen MAJERLE
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
* AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* This file is part of LwGPS - Lightweight GPS NMEA parser library.
*
* Author: Tilen MAJERLE <tilen@majerle.eu>
* Version: v2.1.0
*/
#ifndef LWGPS_HDR_OPTS_H
#define LWGPS_HDR_OPTS_H
/* Rename this file to "lwgps_opts.h" for your application */
/*
* Open "include/lwgps/lwgps_opt.h" and
* copy & replace here settings you want to change values
*/
#endif /* LWGPS_HDR_OPTS_H */

View File

@ -9,6 +9,7 @@
#ifdef RASPBERRY_PI #ifdef RASPBERRY_PI
#include <rpi_config.h> #include <rpi_config.h>
#endif #endif
#include "commonConfig.h"
#include "OBSWVersion.h" #include "OBSWVersion.h"
/* These defines should be disabled for mission code but are useful for /* These defines should be disabled for mission code but are useful for

View File

@ -4,7 +4,7 @@
<listAttribute key="org.eclipse.cdt.dsf.gdb.AUTO_SOLIB_LIST"/> <listAttribute key="org.eclipse.cdt.dsf.gdb.AUTO_SOLIB_LIST"/>
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="gdb"/> <stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="gdb"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_ON_FORK" value="false"/> <booleanAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_ON_FORK" value="false"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.EXTERNAL_CONSOLE" value="false"/> <booleanAttribute key="org.eclipse.cdt.dsf.gdb.EXTERNAL_CONSOLE" value="true"/>
<stringAttribute key="org.eclipse.cdt.dsf.gdb.GDB_INIT" value=".gdbinit"/> <stringAttribute key="org.eclipse.cdt.dsf.gdb.GDB_INIT" value=".gdbinit"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.NON_STOP" value="false"/> <booleanAttribute key="org.eclipse.cdt.dsf.gdb.NON_STOP" value="false"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.REVERSE" value="false"/> <booleanAttribute key="org.eclipse.cdt.dsf.gdb.REVERSE" value="false"/>
@ -18,7 +18,7 @@
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_START_MODE" value="run"/> <stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_START_MODE" value="run"/>
<booleanAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN" value="true"/> <booleanAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN" value="true"/>
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN_SYMBOL" value="main"/> <stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN_SYMBOL" value="main"/>
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="Debug/eive_obsw"/> <stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="Debug-Host/eive_obsw.exe"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="eive_obsw"/> <stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="eive_obsw"/>
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="false"/> <booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="false"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443"/> <stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443"/>

View File

@ -10,7 +10,6 @@ target_sources(${TARGET_NAME} PUBLIC
PDU1Handler.cpp PDU1Handler.cpp
PDU2Handler.cpp PDU2Handler.cpp
ACUHandler.cpp ACUHandler.cpp
SolarArrayDeploymentHandler.cpp
) )

View File

@ -1,9 +1,12 @@
#include "PCDUHandler.h" #include "PCDUHandler.h"
#include <fsfwconfig/objects/systemObjectList.h> #include <OBSWConfig.h>
#include <objects/systemObjectList.h>
#include <mission/devices/devicedefinitions/GomSpacePackets.h> #include <mission/devices/devicedefinitions/GomSpacePackets.h>
#include <fsfw/ipc/QueueFactory.h> #include <fsfw/ipc/QueueFactory.h>
#include <fsfw/housekeeping/HousekeepingSnapshot.h> #include <fsfw/housekeeping/HousekeepingSnapshot.h>
#include <fsfwconfig/OBSWConfig.h>
PCDUHandler::PCDUHandler(object_id_t setObjectId, size_t cmdQueueSize) : PCDUHandler::PCDUHandler(object_id_t setObjectId, size_t cmdQueueSize) :
SystemObject(setObjectId), poolManager(this, nullptr), pdu2HkTableDataset(this), pdu1HkTableDataset( SystemObject(setObjectId), poolManager(this, nullptr), pdu2HkTableDataset(this), pdu1HkTableDataset(

View File

@ -1,6 +1,7 @@
#ifndef MISSION_DEVICES_PCDUHANDLER_H_ #ifndef MISSION_DEVICES_PCDUHANDLER_H_
#define MISSION_DEVICES_PCDUHANDLER_H_ #define MISSION_DEVICES_PCDUHANDLER_H_
#include <devices/powerSwitcherList.h>
#include <mission/devices/devicedefinitions/GomspaceDefinitions.h> #include <mission/devices/devicedefinitions/GomspaceDefinitions.h>
#include <mission/devices/GomspaceDeviceHandler.h> #include <mission/devices/GomspaceDeviceHandler.h>
#include <fsfw/timemanager/CCSDSTime.h> #include <fsfw/timemanager/CCSDSTime.h>
@ -9,7 +10,7 @@
#include <fsfw/objectmanager/SystemObject.h> #include <fsfw/objectmanager/SystemObject.h>
#include <fsfw/tasks/ExecutableObjectIF.h> #include <fsfw/tasks/ExecutableObjectIF.h>
#include <fsfw/objectmanager/SystemObject.h> #include <fsfw/objectmanager/SystemObject.h>
#include <fsfwconfig/devices/powerSwitcherList.h>
/** /**
* @brief The PCDUHandler provides a compact interface to handle all devices related to the * @brief The PCDUHandler provides a compact interface to handle all devices related to the

View File

@ -1,6 +1,6 @@
#include "PDU1Handler.h" #include "PDU1Handler.h"
#include <mission/devices/devicedefinitions/GomSpacePackets.h> #include <mission/devices/devicedefinitions/GomSpacePackets.h>
#include <fsfwconfig/OBSWConfig.h> #include <OBSWConfig.h>
PDU1Handler::PDU1Handler(object_id_t objectId, object_id_t comIF, CookieIF * comCookie) : PDU1Handler::PDU1Handler(object_id_t objectId, object_id_t comIF, CookieIF * comCookie) :
GomspaceDeviceHandler(objectId, comIF, comCookie, PDU::MAX_CONFIGTABLE_ADDRESS, GomspaceDeviceHandler(objectId, comIF, comCookie, PDU::MAX_CONFIGTABLE_ADDRESS,

View File

@ -1,6 +1,6 @@
#include "PDU2Handler.h" #include "PDU2Handler.h"
#include <mission/devices/devicedefinitions/GomSpacePackets.h> #include <mission/devices/devicedefinitions/GomSpacePackets.h>
#include <fsfwconfig/OBSWConfig.h> #include <OBSWConfig.h>
PDU2Handler::PDU2Handler(object_id_t objectId, object_id_t comIF, CookieIF * comCookie) : PDU2Handler::PDU2Handler(object_id_t objectId, object_id_t comIF, CookieIF * comCookie) :
GomspaceDeviceHandler(objectId, comIF, comCookie, PDU::MAX_CONFIGTABLE_ADDRESS, GomspaceDeviceHandler(objectId, comIF, comCookie, PDU::MAX_CONFIGTABLE_ADDRESS,

View File

@ -1,6 +1,6 @@
#include <mission/devices/Tmp1075Handler.h> #include <mission/devices/Tmp1075Handler.h>
#include <mission/devices/devicedefinitions/Tmp1075Definitions.h> #include <mission/devices/devicedefinitions/Tmp1075Definitions.h>
#include <fsfwconfig/OBSWConfig.h> #include <OBSWConfig.h>
Tmp1075Handler::Tmp1075Handler(object_id_t objectId, object_id_t comIF, Tmp1075Handler::Tmp1075Handler(object_id_t objectId, object_id_t comIF,
CookieIF * comCookie) : CookieIF * comCookie) :

View File

@ -1,4 +1,6 @@
#include <test/testtasks/TestTask.h> #include "TestTask.h"
#include <OBSWConfig.h>
#include <fsfw/objectmanager/frameworkObjects.h> #include <fsfw/objectmanager/frameworkObjects.h>
#include <fsfw/serviceinterface/ServiceInterfaceStream.h> #include <fsfw/serviceinterface/ServiceInterfaceStream.h>
#include <fsfw/objectmanager/ObjectManagerIF.h> #include <fsfw/objectmanager/ObjectManagerIF.h>
@ -41,8 +43,33 @@ ReturnValue_t TestTask::performOperation(uint8_t operationCode) {
return result; return result;
} }
#include <etl/vector.h>
#include <lwgps/lwgps.h>
/**
* @brief Dummy data from GPS receiver. Will be replaced witgh hyperion data later.
*/
const char
gps_rx_data[] = ""
"$GPRMC,183729,A,3907.356,N,12102.482,W,000.0,360.0,080301,015.5,E*6F\r\n"
"$GPRMB,A,,,,,,,,,,,,V*71\r\n"
"$GPGGA,183730,3907.356,N,12102.482,W,1,05,1.6,646.4,M,-24.1,M,,*75\r\n"
"$GPGSA,A,3,02,,,07,,09,24,26,,,,,1.6,1.6,1.0*3D\r\n"
"$GPGSV,2,1,08,02,43,088,38,04,42,145,00,05,11,291,00,07,60,043,35*71\r\n"
"$GPGSV,2,2,08,08,02,145,00,09,46,303,47,24,16,178,32,26,18,231,43*77\r\n"
"$PGRME,22.0,M,52.9,M,51.0,M*14\r\n"
"$GPGLL,3907.360,N,12102.481,W,183730,A*33\r\n"
"$PGRMZ,2062,f,3*2D\r\n"
"$PGRMM,WGS84*06\r\n"
"$GPBOD,,T,,M,,*47\r\n"
"$GPRTE,1,1,c,0*07\r\n"
"$GPRMC,183731,A,3907.482,N,12102.436,W,000.0,360.0,080301,015.5,E*67\r\n"
"$GPRMB,A,,,,,,,,,,,,V*71\r\n";
ReturnValue_t TestTask::performOneShotAction() { ReturnValue_t TestTask::performOneShotAction() {
/* Everything here will only be performed once. */ #if OBSW_ADD_TEST_CODE == 1
performLwgpsTest();
#endif
return HasReturnvaluesIF::RETURN_OK; return HasReturnvaluesIF::RETURN_OK;
} }
@ -63,3 +90,21 @@ ReturnValue_t TestTask::performActionB() {
/* Add periodically executed code here */ /* Add periodically executed code here */
return result; return result;
} }
void TestTask::performLwgpsTest() {
/* Everything here will only be performed once. */
etl::vector<uint8_t, 30> testVec;
lwgps_t gpsStruct;
sif::info << "Size of GPS struct: " << sizeof(gpsStruct) << std::endl;
lwgps_init(&gpsStruct);
/* Process all input data */
lwgps_process(&gpsStruct, gps_rx_data, strlen(gps_rx_data));
/* Print messages */
printf("Valid status: %d\r\n", gpsStruct.is_valid);
printf("Latitude: %f degrees\r\n", gpsStruct.latitude);
printf("Longitude: %f degrees\r\n", gpsStruct.longitude);
printf("Altitude: %f meters\r\n", gpsStruct.altitude);
}

View File

@ -50,6 +50,8 @@ private:
// Let's keep it simple for now. // Let's keep it simple for now.
bool oneShotAction = true; bool oneShotAction = true;
StorageManagerIF* IPCStore; StorageManagerIF* IPCStore;
void performLwgpsTest();
}; };

View File

Some files were not shown because too many files have changed in this diff Show More