diff --git a/src/boards/Parafoil/Configs/WingConfig.h b/src/boards/Parafoil/Configs/WingConfig.h index c97771451a3223693159029bf2826f04f26bdfdc..979fb742af2e47df5fcd4a47b99bfab4f39f6b3c 100644 --- a/src/boards/Parafoil/Configs/WingConfig.h +++ b/src/boards/Parafoil/Configs/WingConfig.h @@ -56,8 +56,8 @@ constexpr float DEFAULT_TARGET_LON = 9.1544219; #endif constexpr int WING_STRAIGHT_FLIGHT_TIMEOUT = 15 * 1000; // [ms] -constexpr int PARAFOIL_COMMAND_PERIOD = 5 * 1000; // [ms] -constexpr int PARAFOIL_WING_INCREMENT = 10; // [°] +constexpr int PARAFOIL_COMMAND_PERIOD = 6 * 1000; // [ms] +constexpr int PARAFOIL_WING_DECREMENT = 30; // [°] constexpr int WING_UPDATE_PERIOD = 1000; // [ms] diff --git a/src/boards/Parafoil/StateMachines/WingController/WingController.cpp b/src/boards/Parafoil/StateMachines/WingController/WingController.cpp index d7ca32b11c2f062a308cbe831c88efb461d34d76..95f6a9854ebe620e23f8f97d7fbd305f7fdedb80 100644 --- a/src/boards/Parafoil/StateMachines/WingController/WingController.cpp +++ b/src/boards/Parafoil/StateMachines/WingController/WingController.cpp @@ -179,14 +179,15 @@ State WingController::state_calibration(const Boardcore::Event& event) case DPL_NC_OPEN: { reset(); - calibrationTimeoutEventId = EventBroker::getInstance().postDelayed( - DPL_WES_CAL_DONE, TOPIC_DPL, WES_CALIBRATION_TIMEOUT); - modules.get<WindEstimation>() - ->startWindEstimationSchemeCalibration(); + // calibrationTimeoutEventId = + // EventBroker::getInstance().postDelayed( + // DPL_WES_CAL_DONE, TOPIC_DPL, WES_CALIBRATION_TIMEOUT); + // modules.get<WindEstimation>() + // ->startWindEstimationSchemeCalibration(); - modules.get<Actuators>()->startTwirl(); + // modules.get<Actuators>()->startTwirl(); - return HANDLED; + return transition(&WingController::state_controlled_descent); } case DPL_WES_CAL_DONE: { @@ -351,10 +352,10 @@ bool WingController::addAlgorithms() // Algorithm 4 (Progressive rotation) algorithm = new WingAlgorithm(PARAFOIL_LEFT_SERVO, PARAFOIL_RIGHT_SERVO); - step.timestamp = 0; - for (int i = 0; i < 80; i += PARAFOIL_WING_INCREMENT) + step.timestamp = 5000 * 1000; // us + + for (int i = 150; i >= 0; i -= PARAFOIL_WING_DECREMENT) { - step.timestamp += PARAFOIL_COMMAND_PERIOD * 1000; // us step.servo1Angle = i; step.servo2Angle = 0; algorithm->addStep(step); @@ -362,7 +363,10 @@ bool WingController::addAlgorithms() step.servo1Angle = 0; step.servo2Angle = i; algorithm->addStep(step); + step.timestamp += PARAFOIL_COMMAND_PERIOD * 1000; // us } + result &= algorithm->init(); + algorithms.push_back(algorithm); selectAlgorithm(SELECTED_ALGORITHM); diff --git a/src/scripts/logdecoder/logdecoder b/src/scripts/logdecoder/logdecoder new file mode 100755 index 0000000000000000000000000000000000000000..498256d8bfff6e32e9b88e95a33befce3873cfc1 Binary files /dev/null and b/src/scripts/logdecoder/logdecoder differ diff --git a/src/scripts/logdecoder/logdecoder.cpp b/src/scripts/logdecoder/logdecoder.cpp index ac43ed5464639997968f8c8f8c6023b38e1e2552..68a380e6d7eaf001615f812f1632d8d6d9f744e7 100644 --- a/src/scripts/logdecoder/logdecoder.cpp +++ b/src/scripts/logdecoder/logdecoder.cpp @@ -20,13 +20,13 @@ * THE SOFTWARE. */ +#include <Parafoil/Configs/WingConfig.h> #include <Parafoil/StateMachines/FlightModeManager/FlightModeManagerData.h> #include <Parafoil/StateMachines/NASController/NASControllerData.h> #include <Parafoil/StateMachines/WingController/WingControllerData.h> -#include <Parafoil/Configs/WingConfig.h> -#include <Parafoil/Wing/WingTargetPositionData.h> -#include <Parafoil/Wing/WingAlgorithmData.h> #include <Parafoil/WindEstimationScheme/WindEstimationData.h> +#include <Parafoil/Wing/WingAlgorithmData.h> +#include <Parafoil/Wing/WingTargetPositionData.h> #include <logger/Deserializer.h> #include <logger/LogTypes.h> #include <radio/Xbee/APIFramesLog.h> @@ -75,7 +75,6 @@ void registerTypes(Deserializer& ds) ds.registerType<WingTargetPositionData>(); ds.registerType<WingAlgorithmData>(); ds.registerType<WindLogging>(); - } void showUsage(const string& cmdName)