mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-20 10:54:14 +01:00
LP-563 CameraDesired is updated continuouslly, check gimbal outputs.
This commit is contained in:
parent
37353469b8
commit
43c4718798
@ -49,6 +49,8 @@
|
|||||||
|
|
||||||
#include "accessorydesired.h"
|
#include "accessorydesired.h"
|
||||||
#include "attitudestate.h"
|
#include "attitudestate.h"
|
||||||
|
#include "mixersettings.h"
|
||||||
|
#include "actuatorcommand.h"
|
||||||
#include "camerastabsettings.h"
|
#include "camerastabsettings.h"
|
||||||
#include "cameradesired.h"
|
#include "cameradesired.h"
|
||||||
#include "hwsettings.h"
|
#include "hwsettings.h"
|
||||||
@ -61,6 +63,8 @@
|
|||||||
// Private types
|
// Private types
|
||||||
|
|
||||||
// Private variables
|
// Private variables
|
||||||
|
static bool gimbalOutputEnabled = false;
|
||||||
|
|
||||||
static struct CameraStab_data {
|
static struct CameraStab_data {
|
||||||
portTickType lastSysTime;
|
portTickType lastSysTime;
|
||||||
float inputs[CAMERASTABSETTINGS_INPUT_NUMELEM];
|
float inputs[CAMERASTABSETTINGS_INPUT_NUMELEM];
|
||||||
@ -83,6 +87,12 @@ static void attitudeUpdated(UAVObjEvent *ev);
|
|||||||
static void applyFeedForward(uint8_t index, float dT, float *attitude, CameraStabSettingsData *cameraStab);
|
static void applyFeedForward(uint8_t index, float dT, float *attitude, CameraStabSettingsData *cameraStab);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// this structure is equivalent to the UAVObjects for one mixer.
|
||||||
|
typedef struct {
|
||||||
|
uint8_t type;
|
||||||
|
int8_t matrix[5];
|
||||||
|
} __attribute__((packed)) Mixer_t;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialise the module, called on startup
|
* Initialise the module, called on startup
|
||||||
@ -148,6 +158,20 @@ static void attitudeUpdated(UAVObjEvent *ev)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!gimbalOutputEnabled) {
|
||||||
|
MixerSettingsData mixerSettings;
|
||||||
|
MixerSettingsGet(&mixerSettings);
|
||||||
|
Mixer_t *mixers = (Mixer_t *)&mixerSettings.Mixer1Type;
|
||||||
|
for (int ct = 0; ct < ACTUATORCOMMAND_CHANNEL_NUMELEM; ct++) {
|
||||||
|
uint8_t mixer_type = mixers[ct].type;
|
||||||
|
if ((mixer_type >= MIXERSETTINGS_MIXER1TYPE_CAMERAROLLORSERVO1) &&
|
||||||
|
(mixer_type <= MIXERSETTINGS_MIXER1TYPE_CAMERAYAW)) {
|
||||||
|
gimbalOutputEnabled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
AccessoryDesiredData accessory;
|
AccessoryDesiredData accessory;
|
||||||
|
|
||||||
CameraStabSettingsData cameraStab;
|
CameraStabSettingsData cameraStab;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user