Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/parafoil-test-dev' into main-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
NidasioAlberto committed Mar 5, 2022
2 parents b35efd3 + df26b03 commit d2358ce
Show file tree
Hide file tree
Showing 69 changed files with 3,734 additions and 1,797 deletions.
3 changes: 1 addition & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[submodule "skyward-boardcore"]
path = skyward-boardcore
url = ../skyward-boardcore.git
branch = testing
url = ../skyward-boardcore
2 changes: 2 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
"${workspaceFolder}/skyward-boardcore/libs/mavlink_skyward_lib",
"${workspaceFolder}/skyward-boardcore/libs/fmt/include",
"${workspaceFolder}/skyward-boardcore/libs/eigen",
"${workspaceFolder}/skyward-boardcore/libs/tscpp",
"${workspaceFolder}/skyward-boardcore/libs/mavlink_skyward_lib",
"${workspaceFolder}/skyward-boardcore/libs",
"${workspaceFolder}/skyward-boardcore/src/shared",
"${workspaceFolder}/skyward-boardcore/src/tests",
Expand Down
19 changes: 18 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ include(skyward-boardcore/cmake/sbs.cmake)
# Project #
#-----------------------------------------------------------------------------#

project(SkywardOnBoardSoftware)
project(SkywardParafoilTest)

#-----------------------------------------------------------------------------#
# Main Computer #
Expand All @@ -41,3 +41,20 @@ target_include_directories(catch-tests-main PRIVATE ${OBSW_INCLUDE_DIRS})
target_compile_definitions(catch-tests-main PRIVATE USE_MOCK_PERIPHERALS)
sbs_target(catch-tests-main stm32f429zi_skyward_death_stack_x)
sbs_catch_test(catch-tests-main)

#-----------------------------------------------------------------------------#
# Parafoil Computer #
#-----------------------------------------------------------------------------#

add_executable(parafoil-entry
src/entrypoints/Parafoil/parafoil-entry.cpp
${PARAFOIL_COMPUTER}
)
target_include_directories(parafoil-entry PRIVATE ${OBSW_INCLUDE_DIRS})
sbs_target(parafoil-entry stm32f429zi_stm32f4discovery)

add_executable(parafoil-test-bme280 src/tests/Parafoil/parafoil-test-bme280.cpp)
sbs_target(parafoil-test-bme280 stm32f429zi_stm32f4discovery)

add_executable(parafoil-test-ublox-uart src/tests/Parafoil/parafoil-test-ublox-uart.cpp)
sbs_target(parafoil-test-ublox-uart stm32f429zi_stm32f4discovery)
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Pyxis On-Board Software [![pipeline status](https://git.skywarder.eu/scs/pyxis/obsw/badges/master/pipeline.svg)](https://git.skywarder.eu/scs/pyxis/obsw/commits/master)
# Parafoil test On-Board Software [![pipeline status](https://git.skywarder.eu/scs/pyxis/obsw/badges/master/pipeline.svg)](https://git.skywarder.eu/scs/pyxis/obsw/commits/master)

*On Board software for Pyxis*
*On Board software for Parafoil tests*

To clone, use `git clone --recurse-submodules [email protected]:scs/pyxis/obsw.git`.

Expand Down
10 changes: 10 additions & 0 deletions cmake/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,13 @@ set(MAIN_COMPUTER
src/boards/Main/Actuators/Actuators.cpp
src/boards/Main/Deployment/DeploymentController.cpp
)

set(PARAFOIL_COMPUTER
src/boards/Parafoil/Main/Sensors.cpp
src/boards/Parafoil/Main/Radio.cpp
src/boards/Parafoil/TelemetriesTelecommands/TMRepository.cpp
src/boards/Parafoil/Wing/WingServo.cpp
src/boards/Parafoil/Wing/WingAlgorithm.cpp
src/boards/Parafoil/Wing/WingController.cpp
src/boards/Parafoil/FlightModeManager/FMMController.cpp
)
Binary file added data/ParafoilTestDev/UMLMavlink.dia
Binary file not shown.
Binary file added data/ParafoilTestDev/UMLWingControlDiagram.dia
Binary file not shown.
Binary file added data/ParafoilTestDev/UMLWingControlDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion skyward-boardcore
2 changes: 2 additions & 0 deletions src Lynx/boards/DeathStack/ApogeeDetectionAlgorithm/ADAData.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

#include <ostream>

#include <ostream>

namespace DeathStackBoard
{

Expand Down
2 changes: 1 addition & 1 deletion src Lynx/boards/DeathStack/Main/Radio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ using namespace std::placeholders;
using namespace Boardcore;

// Xbee ATTN interrupt
void __attribute__((used)) EXTI10_IRQHandlerImpl()
void __attribute__((used)) EXTI4_15_IRQHandlerImpl()
{
using namespace DeathStackBoard;

Expand Down
2 changes: 2 additions & 0 deletions src Lynx/boards/DeathStack/configs/NASConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

#include "Eigen/Dense"

#include "Eigen/Dense"

namespace DeathStackBoard
{

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ enum Events : uint8_t
EV_TC_STOP_SENSOR_TM,
EV_TC_TEST_ABK,
EV_TC_TEST_MODE,
EV_TC_EXIT_TEST_MODE,
EV_TEST_ABK,
EV_TEST_TIMEOUT,
EV_TIMEOUT_END_MISSION,
Expand Down Expand Up @@ -164,6 +165,7 @@ const std::vector<uint8_t> EVENT_LIST{
EV_TC_STOP_SENSOR_TM,
EV_TC_TEST_ABK,
EV_TC_TEST_MODE,
EV_TC_EXIT_TEST_MODE,
EV_TEST_ABK,
EV_TEST_TIMEOUT,
EV_TIMEOUT_END_MISSION,
Expand Down
File renamed without changes.
4 changes: 0 additions & 4 deletions src Lynx/entrypoints/deserializer/logdecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@
#include <stdexcept>
#include <string>

// TODO: add here include files of serialized classes

#include "LogTypes.h"

using namespace std;
using namespace tscpp;

Expand Down
32 changes: 17 additions & 15 deletions src Lynx/hardware_in_the_loop/HIL_sensors/HILSensorsData.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ struct HILAccelData : public AccelerometerData

void print(std::ostream& os) const
{
os << accel_timestamp << "," << accel_x << "," << accel_y << ","
<< accel_z << "\n";
os << accelerationTimestamp << "," << accelerationX << ","
<< accelerationY << "," << accelerationZ << "\n";
}
};

Expand All @@ -53,8 +53,8 @@ struct HILGyroscopeData : public GyroscopeData

void print(std::ostream& os) const
{
os << gyro_timestamp << "," << gyro_x << "," << gyro_y << "," << gyro_z
<< "\n";
os << angularVelocityTimestamp << "," << angularVelocityX << ","
<< angularVelocityY << "," << angularVelocityZ << "\n";
}
};

Expand All @@ -71,8 +71,8 @@ struct HILMagnetometerData : public MagnetometerData

void print(std::ostream& os) const
{
os << mag_timestamp << "," << mag_x << "," << mag_y << "," << mag_z
<< "\n";
os << magneticFieldTimestamp << "," << magneticFieldX << ","
<< magneticFieldY << "," << magneticFieldZ << "\n";
}
};

Expand All @@ -88,10 +88,12 @@ struct HILImuData : public HILAccelData,

void print(std::ostream& os) const
{
os << accel_timestamp << "," << accel_x << "," << accel_y << ","
<< accel_z << "," << gyro_timestamp << "," << gyro_x << "," << gyro_y
<< "," << gyro_z << "," << mag_timestamp << "," << mag_x << ","
<< mag_y << "," << mag_z << "\n";
os << accelerationTimestamp << "," << accelerationX << ","
<< accelerationY << "," << accelerationZ << ","
<< angularVelocityTimestamp << "," << angularVelocityX << ","
<< angularVelocityY << "," << angularVelocityZ << ","
<< magneticFieldTimestamp << "," << magneticFieldX << ","
<< magneticFieldY << "," << magneticFieldZ << "\n";
}
};

Expand All @@ -114,10 +116,10 @@ struct HILGpsData : public GPSData

void print(std::ostream& os) const
{
os << gps_timestamp << "," << longitude << "," << latitude << ","
<< height << "," << velocity_north << "," << velocity_east << ","
<< velocity_down << "," << speed << "," << track << ","
<< (int)num_satellites << "," << (int)fix << "\n";
os << gpsTimestamp << "," << longitude << "," << latitude << ","
<< height << "," << velocityNorth << "," << velocityEast << ","
<< velocityDown << "," << speed << "," << track << ","
<< (int)satellites << "," << (int)fix << "\n";
}
};

Expand All @@ -131,6 +133,6 @@ struct HILBaroData : public PressureData

void print(std::ostream& os) const
{
os << press_timestamp << "," << press << "\n";
os << pressureTimestamp << "," << pressure << "\n";
}
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Copyright (c) 2021 Skyward Experimental Rocketry
* Author: Luca Erbetta
* Authors: Luca Conterio
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand All @@ -19,34 +19,20 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

#pragma once

//#include <TelemetriesTelecommands/Mavlink.h>
#include <drivers/Xbee/Xbee.h>

namespace PayloadBoard
{

class Radio
namespace ParafoilTestDev
{
public:
// TMTCController* tmtc_manager;
// TmRepository* tm_repo;
Boardcore::Xbee::Xbee* xbee;
// MavDriver* mav_driver;

Radio(Boardcore::SPIBusInterface& xbee_bus_);
~Radio();

bool start();

void logStatus();

private:
void onXbeeFrameReceived(Boardcore::Xbee::APIFrame& frame);
/* Mavlink Driver queue settings */
static constexpr unsigned int MAV_OUT_QUEUE_LEN = 10;
static constexpr unsigned int MAV_PKT_SIZE = 255;
static constexpr size_t MAV_OUT_BUFFER_MAX_AGE = 200;

Boardcore::SPIBusInterface& xbee_bus;
};
//These two values are taken as is
static const unsigned int TMTC_MAV_SYSID = 171;
static const unsigned int TMTC_MAV_COMPID = 96;

} // namespace PayloadBoard
/* Min guaranteed sleep time after each packet sent (milliseconds) */
static const uint16_t SLEEP_AFTER_SEND = 0;
}
39 changes: 39 additions & 0 deletions src/boards/Parafoil/Configs/RadioConfig.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/* Copyright (c) 2022 Skyward Experimental Rocketry
* Author: Matteo Pignataro
*
* 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.
*/

#pragma once

#include <stdint.h>

namespace ParafoilTestDev
{

// TODO update with the correct values
static const uint32_t HR_GROUND_UPDATE_PERIOD = 62; // Milliseconds
static const uint32_t HR_FLIGHT_UPDATE_PERIOD = 10;
static const uint32_t LR_UPDATE_PERIOD = 100; // Milliseconds

// TODO define the correct ids for task scheduler
static const uint8_t RADIO_HR_ID = 200;
static const uint8_t RADIO_LR_ID = 201;

} // namespace ParafoilTestDev
64 changes: 64 additions & 0 deletions src/boards/Parafoil/Configs/SensorsConfig.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/* Copyright (c) 2022 Skyward Experimental Rocketry
* Author: Matteo Pignataro
*
* 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 class specifies the sensors constants that the sensor manager
* needs to know about every device. For example the sample time is
* essential to understand how much time a sensor should wait before
* another sample.
*/

#pragma once

#include <sensors/UbloxGPS/UbloxGPS.h>
#include <sensors/MPU9250/MPU9250.h>
#include <sensors/BME280/BME280.h>

using namespace Boardcore;

namespace ParafoilTestDev
{
//SPI pinouts
static miosix::GpioPin SCK(GPIOA_BASE, 5);
static miosix::GpioPin MISO(GPIOB_BASE, 4);
static miosix::GpioPin MOSI(GPIOA_BASE, 7);

//GPS settings
//static miosix::GpioPin GPS_CS(GPIOG_BASE, 3);
static miosix::GpioPin GPS_TX(GPIOA_BASE, 2);
static miosix::GpioPin GPS_RX(GPIOA_BASE, 3);
static constexpr unsigned int GPS_SAMPLE_RATE = 25;
static constexpr unsigned int GPS_SAMPLE_PERIOD = 1000 / GPS_SAMPLE_RATE;


//IMU MPU9250 settings
static miosix::GpioPin IMU_CS(GPIOB_BASE, 2);
static const MPU9250::MPU9250GyroFSR IMU_GYRO_SCALE = MPU9250::GYRO_FSR_500DPS;
static const MPU9250::MPU9250AccelFSR IMU_ACCEL_SCALE = MPU9250::ACCEL_FSR_16G;
static constexpr unsigned short IMU_SAMPLE_RATE = 500;
static constexpr unsigned int IMU_SAMPLE_PERIOD = 1000 / IMU_SAMPLE_RATE;

//Barometer BME280 settings
static miosix::GpioPin PRESS_CS(GPIOC_BASE, 11);
static const BME280::StandbyTime PRESS_SAMPLE_RATE = BME280::STB_TIME_0_5;
static constexpr unsigned int PRESS_SAMPLE_PERIOD = 20;
}
Loading

0 comments on commit d2358ce

Please sign in to comment.