1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

Merged in f5soh/librepilot/LP-563_Reduce_telemetry (pull request #480)

LP-563 Reduce telemetry bandwidth

Approved-by: Lalanne Laurent <f5soh@free.fr>
Approved-by: Philippe Renon <philippe_renon@yahoo.fr>
Approved-by: Alessio Morale <alessiomorale@gmail.com>
This commit is contained in:
Lalanne Laurent 2018-01-24 20:04:26 +00:00 committed by Philippe Renon
commit dc012a1503
28 changed files with 51 additions and 27 deletions

View File

@ -49,6 +49,8 @@
#include "accessorydesired.h"
#include "attitudestate.h"
#include "mixersettings.h"
#include "actuatorcommand.h"
#include "camerastabsettings.h"
#include "cameradesired.h"
#include "hwsettings.h"
@ -61,6 +63,8 @@
// Private types
// Private variables
static bool gimbalOutputEnabled = false;
static struct CameraStab_data {
portTickType lastSysTime;
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);
#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
@ -150,6 +160,20 @@ static void attitudeUpdated(UAVObjEvent *ev)
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;
CameraStabSettingsData cameraStab;

View File

@ -10,7 +10,7 @@
<field name="TrueAirspeed" units="m/s" type="float" elements="1" defaultvalue="-1"/>
<access gcs="readwrite" flight="readwrite"/>
<telemetrygcs acked="false" updatemode="manual" period="0"/>
<telemetryflight acked="false" updatemode="periodic" period="1000"/>
<telemetryflight acked="false" updatemode="throttled" period="1000"/>
<logging updatemode="manual" period="0"/>
</object>
</xml>

View File

@ -5,7 +5,7 @@
<field name="TrueAirspeed" units="m/s" type="float" elements="1"/>
<access gcs="readwrite" flight="readwrite"/>
<telemetrygcs acked="false" updatemode="manual" period="0"/>
<telemetryflight acked="false" updatemode="periodic" period="1000"/>
<telemetryflight acked="false" updatemode="throttled" period="1000"/>
<logging updatemode="manual" period="0"/>
</object>
</xml>

View File

@ -6,7 +6,7 @@
<field name="ThrustDemand" units="" type="float" elements="1"/>
<access gcs="readwrite" flight="readwrite"/>
<telemetrygcs acked="false" updatemode="manual" period="0"/>
<telemetryflight acked="false" updatemode="periodic" period="1000"/>
<telemetryflight acked="false" updatemode="throttled" period="1000"/>
<logging updatemode="manual" period="0"/>
</object>
</xml>

View File

@ -7,7 +7,7 @@
<field name="Status" units="" type="enum" elements="1" options="None,Ok" defaultvalue="None"/>
<access gcs="readwrite" flight="readwrite"/>
<telemetrygcs acked="false" updatemode="manual" period="0"/>
<telemetryflight acked="false" updatemode="periodic" period="10000"/>
<telemetryflight acked="false" updatemode="throttled" period="10000"/>
<logging updatemode="manual" period="0"/>
</object>
</xml>

View File

@ -6,7 +6,7 @@
<field name="Pressure" units="Pa" type="float" elements="1"/>
<access gcs="readwrite" flight="readwrite"/>
<telemetrygcs acked="false" updatemode="manual" period="0"/>
<telemetryflight acked="false" updatemode="periodic" period="1000"/>
<telemetryflight acked="false" updatemode="throttled" period="1000"/>
<logging updatemode="manual" period="0"/>
</object>
</xml>

View File

@ -7,7 +7,7 @@
<field name="Trigger" units="" type="float" elements="1"/>
<access gcs="readwrite" flight="readwrite"/>
<telemetrygcs acked="false" updatemode="manual" period="0"/>
<telemetryflight acked="false" updatemode="periodic" period="1000"/>
<telemetryflight acked="false" updatemode="throttled" period="1000"/>
<logging updatemode="manual" period="0"/>
</object>
</xml>

View File

@ -7,7 +7,7 @@
<field name="FreeSlots" units="" type="uint16" elements="1" description="The number of free log slots available"/>
<access gcs="readwrite" flight="readwrite"/>
<telemetrygcs acked="false" updatemode="manual" period="0"/>
<telemetryflight acked="false" updatemode="periodic" period="1000"/>
<telemetryflight acked="false" updatemode="throttled" period="1000"/>
<logging updatemode="manual" period="0"/>
</object>
</xml>

View File

@ -20,7 +20,7 @@
</field>
<access gcs="readwrite" flight="readwrite"/>
<telemetrygcs acked="false" updatemode="manual" period="0"/>
<telemetryflight acked="false" updatemode="periodic" period="10000"/>
<telemetryflight acked="false" updatemode="throttled" period="10000"/>
<logging updatemode="manual" period="0"/>
</object>
</xml>

View File

@ -7,7 +7,7 @@
<field name="Errors" units="" type="uint8" elementnames="Wind,Stallspeed,Lowspeed,Highspeed,Overspeed,Lowpower,Highpower,Rollcontrol,Pitchcontrol,AirspeedSensor" />
<access gcs="readwrite" flight="readwrite"/>
<telemetrygcs acked="false" updatemode="manual" period="0"/>
<telemetryflight acked="false" updatemode="periodic" period="500"/>
<telemetryflight acked="false" updatemode="throttled" period="500"/>
<logging updatemode="manual" period="0"/>
</object>
</xml>

View File

@ -8,7 +8,7 @@
<field name="Debug" units="" type="float" elements="2" defaultvalue="0.0"/>
<access gcs="readwrite" flight="readwrite"/>
<telemetrygcs acked="false" updatemode="manual" period="0"/>
<telemetryflight acked="false" updatemode="periodic" period="2000"/>
<telemetryflight acked="false" updatemode="throttled" period="2000"/>
<logging updatemode="manual" period="0"/>
</object>
</xml>

View File

@ -17,7 +17,7 @@
<field name="BaudRate" units="" type="enum" elements="1" options="2400,4800,9600,19200,38400,57600,115200,230400,Unknown" defaultvalue="Unknown" />
<access gcs="readwrite" flight="readwrite"/>
<telemetrygcs acked="false" updatemode="manual" period="0"/>
<telemetryflight acked="false" updatemode="periodic" period="1000"/>
<telemetryflight acked="false" updatemode="throttled" period="1000"/>
<logging updatemode="manual" period="0"/>
</object>
</xml>

View File

@ -8,7 +8,7 @@
<field name="SNR" units="" type="int8" elements="24"/>
<access gcs="readwrite" flight="readwrite"/>
<telemetrygcs acked="false" updatemode="manual" period="0"/>
<telemetryflight acked="false" updatemode="periodic" period="10000"/>
<telemetryflight acked="false" updatemode="throttled" period="10000"/>
<logging updatemode="manual" period="0"/>
</object>
</xml>

View File

@ -10,7 +10,7 @@
<field name="Millisecond" units="ms" type="int16" elements="1"/>
<access gcs="readwrite" flight="readwrite"/>
<telemetrygcs acked="false" updatemode="manual" period="0"/>
<telemetryflight acked="false" updatemode="periodic" period="10000"/>
<telemetryflight acked="false" updatemode="throttled" period="10000"/>
<logging updatemode="manual" period="0"/>
</object>
</xml>

View File

@ -6,7 +6,7 @@
<field name="Down" units="m/s" type="float" elements="1"/>
<access gcs="readwrite" flight="readwrite"/>
<telemetrygcs acked="false" updatemode="manual" period="0"/>
<telemetryflight acked="false" updatemode="periodic" period="1000"/>
<telemetryflight acked="false" updatemode="throttled" period="1000"/>
<logging updatemode="manual" period="0"/>
</object>
</xml>

View File

@ -7,7 +7,7 @@
<field name="temperature" units="deg C" type="float" elements="1"/>
<access gcs="readwrite" flight="readwrite"/>
<telemetrygcs acked="false" updatemode="manual" period="0"/>
<telemetryflight acked="false" updatemode="periodic" period="10000"/>
<telemetryflight acked="false" updatemode="throttled" period="10000"/>
<logging updatemode="manual" period="0"/>
</object>
</xml>

View File

@ -7,7 +7,7 @@
<field name="Source" units="" type="enum" elements="1" options="Invalid,OnBoard,Aux" defaultvalue="Invalid"/>
<access gcs="readwrite" flight="readwrite"/>
<telemetrygcs acked="false" updatemode="manual" period="0"/>
<telemetryflight acked="false" updatemode="periodic" period="1000"/>
<telemetryflight acked="false" updatemode="throttled" period="1000"/>
<logging updatemode="manual" period="0"/>
</object>
</xml>

View File

@ -6,7 +6,7 @@
<field name="LinkQuality" units="%" type="uint8" elements="1" defaultvalue="0"/>
<access gcs="readonly" flight="readwrite"/>
<telemetrygcs acked="false" updatemode="manual" period="0"/>
<telemetryflight acked="false" updatemode="periodic" period="1000"/>
<telemetryflight acked="false" updatemode="throttled" period="1000"/>
<logging updatemode="manual" period="0"/>
</object>
</xml>

View File

@ -21,7 +21,7 @@
<access gcs="readwrite" flight="readwrite"/>
<telemetrygcs acked="false" updatemode="manual" period="0"/>
<telemetryflight acked="false" updatemode="periodic" period="1000"/>
<telemetryflight acked="false" updatemode="throttled" period="1000"/>
<logging updatemode="manual" period="0"/>
</object>
</xml>

View File

@ -16,7 +16,7 @@
<field name="path_time" units="s" type="float" elements="1"/>
<access gcs="readwrite" flight="readwrite"/>
<telemetrygcs acked="false" updatemode="manual" period="0"/>
<telemetryflight acked="false" updatemode="periodic" period="1000"/>
<telemetryflight acked="false" updatemode="throttled" period="1000"/>
<logging updatemode="manual" period="0"/>
</object>
</xml>

View File

@ -15,7 +15,7 @@
FixedAttitude,SetAccessory,DisarmAlarm,Land,Brake,Velocity,AutoTakeoff" default="GoToEndpoint" />
<access gcs="readwrite" flight="readwrite"/>
<telemetrygcs acked="false" updatemode="manual" period="0"/>
<telemetryflight acked="false" updatemode="periodic" period="1000"/>
<telemetryflight acked="false" updatemode="throttled" period="1000"/>
<logging updatemode="manual" period="0"/>
</object>
</xml>

View File

@ -12,7 +12,7 @@
<field name="D" units="m" type="float" elements="1"/>
<access gcs="readwrite" flight="readwrite"/>
<telemetrygcs acked="false" updatemode="manual" period="0"/>
<telemetryflight acked="false" updatemode="periodic" period="1000"/>
<telemetryflight acked="false" updatemode="throttled" period="1000"/>
<logging updatemode="manual" period="0"/>
</object>
</xml>

View File

@ -6,7 +6,7 @@
<field name="Down" units="m" type="float" elements="1"/>
<access gcs="readwrite" flight="readwrite"/>
<telemetrygcs acked="false" updatemode="manual" period="0"/>
<telemetryflight acked="false" updatemode="periodic" period="1000"/>
<telemetryflight acked="false" updatemode="throttled" period="1000"/>
<logging updatemode="manual" period="0"/>
</object>
</xml>

View File

@ -6,7 +6,7 @@
<field name="Down" units="m" type="float" elements="1"/>
<access gcs="readwrite" flight="readwrite"/>
<telemetrygcs acked="false" updatemode="manual" period="0"/>
<telemetryflight acked="false" updatemode="periodic" period="1000"/>
<telemetryflight acked="false" updatemode="throttled" period="1000"/>
<logging updatemode="manual" period="0"/>
</object>
</xml>

View File

@ -14,7 +14,7 @@
<field name="Complete" units="bool" type="enum" elements="1" options="False,True" defaultvalue="False" description="Automatically set True for a good complete tune or False for incomplete or bad"/>
<access gcs="readonly" flight="readwrite"/>
<telemetrygcs acked="false" updatemode="manual" period="0"/>
<telemetryflight acked="false" updatemode="periodic" period="1000"/>
<telemetryflight acked="false" updatemode="throttled" period="1000"/>
<logging updatemode="manual" period="0"/>
</object>
</xml>

View File

@ -6,7 +6,7 @@
<field name="Down" units="m/s" type="float" elements="1"/>
<access gcs="readwrite" flight="readwrite"/>
<telemetrygcs acked="false" updatemode="manual" period="0"/>
<telemetryflight acked="false" updatemode="periodic" period="1000"/>
<telemetryflight acked="false" updatemode="throttled" period="1000"/>
<logging updatemode="manual" period="0"/>
</object>
</xml>

View File

@ -6,7 +6,7 @@
<field name="Down" units="m/s" type="float" elements="1"/>
<access gcs="readwrite" flight="readwrite"/>
<telemetrygcs acked="false" updatemode="manual" period="0"/>
<telemetryflight acked="false" updatemode="periodic" period="1000"/>
<telemetryflight acked="false" updatemode="throttled" period="1000"/>
<logging updatemode="manual" period="0"/>
</object>
</xml>

View File

@ -9,7 +9,7 @@
<access gcs="readwrite" flight="readwrite"/>
<telemetrygcs acked="false" updatemode="manual" period="0"/>
<telemetryflight acked="false" updatemode="periodic" period="1000"/>
<telemetryflight acked="false" updatemode="throttled" period="1000"/>
<logging updatemode="manual" period="0"/>
</object>
</xml>