Skip to content

Commit e779a10

Browse files
committed
Merge remote-tracking branch 'mlyle/mpl-actmodel' into glowtape-delaycomp
2 parents d8c8628 + 05e119a commit e779a10

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

flight/Modules/Actuator/actuator.c

+22-4
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ static MixerSettingsMixer1TypeOptions types_mixer[MAX_MIX_ACTUATORS];
9696
*/
9797

9898
static float motor_mixer[MAX_MIX_ACTUATORS * MIXERSETTINGS_MIXER1VECTOR_NUMELEM];
99+
static float motor_mixer_inv[MAX_MIX_ACTUATORS * MIXERSETTINGS_MIXER1VECTOR_NUMELEM];
99100

100101
/* These are various settings objects used throughout the actuator code */
101102
static ActuatorSettingsData actuatorSettings;
@@ -372,6 +373,12 @@ static void compute_mixer()
372373
#endif
373374
}
374375

376+
static bool compute_inverse_mixer()
377+
{
378+
return matrix_pseudoinv(motor_mixer, motor_mixer_inv,
379+
MAX_MIX_ACTUATORS, MIXERSETTINGS_MIXER1VECTOR_NUMELEM);
380+
}
381+
375382
static void fill_desired_vector(
376383
ActuatorDesiredData *desired,
377384
float val1, float val2,
@@ -738,20 +745,31 @@ static void actuator_task(void* parameters)
738745
actuator_settings_update();
739746
}
740747

748+
PIOS_WDG_UpdateFlag(PIOS_WDG_ACTUATOR);
749+
750+
UAVObjEvent ev;
751+
741752
if (mixer_settings_updated) {
742753
mixer_settings_updated = false;
743754
SystemSettingsAirframeTypeGet(&airframe_type);
744755

745756
compute_mixer();
757+
<<<<<<< HEAD
758+
=======
759+
760+
/* If we can't calculate a proper inverse mixer,
761+
* set failsafe.
762+
*/
763+
if (compute_inverse_mixer()) {
764+
set_failsafe();
765+
continue;
766+
}
767+
>>>>>>> mlyle/mpl-actmodel
746768

747769
MixerSettingsThrottleCurve2Get(curve2);
748770
MixerSettingsCurve2SourceGet(&curve2_src);
749771
}
750772

751-
PIOS_WDG_UpdateFlag(PIOS_WDG_ACTUATOR);
752-
753-
UAVObjEvent ev;
754-
755773
// Wait until the ActuatorDesired object is updated
756774
if (!PIOS_Queue_Receive(queue, &ev, FAILSAFE_TIMEOUT_MS)) {
757775
// If we hit a timeout, set the actuator failsafe and

flight/targets/sprf3e/fw/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ OPTMODULES += VtolPathFollower
5050
OPTMODULES += FixedWingPathFollower
5151
#OPTMODULES += UAVOMavlinkBridge
5252
OPTMODULES += UAVOMSPBridge
53-
OPTMODULES += UAVOLighttelemetryBridge
53+
#OPTMODULES += UAVOLighttelemetryBridge
5454
OPTMODULES += Battery
5555
OPTMODULES += ComUsbBridge
5656
OPTMODULES += Airspeed
57-
OPTMODULES += UAVOHoTTBridge
57+
#OPTMODULES += UAVOHoTTBridge
5858
OPTMODULES += UAVOFrSKYSensorHubBridge
5959
OPTMODULES += UAVOFrSKYSPortBridge
6060
OPTMODULES += Logging

0 commit comments

Comments
 (0)