Telemetry
Messages
The set of periodic messages sent over the downlink channel by an aircraft to the ground station is configurable with the help of one XML file, located in the conf/telemetry directory. This file must follow the telemetry.dtd syntax. The default.xml is provided as an example and should be suitable for most users:
<!DOCTYPE telemetry SYSTEM "telemetry.dtd"> <telemetry> <process name="Ap"> <mode name="default"> <message name="ATTITUDE" period="0.5"/> <message name="PPRZ_MODE" period="5"/> ... </mode> <mode name="fast attitude"> <message name="ATTITUDE" period="0.1"/> </mode> </process> <process name="Fbw"> <mode name="default"> <message name="COMMANDS" period="1"/> ... </mode> <mode name="debug"> <message name="PPM" period="0.5"/> </mode> </process> </telemetry>
The description is divided into process and modes. There are currently only two processes in the autopilot, Ap and Fbw. Any number of modes is allowed per process, the default is the first of the sequence. A mode contains a list of messages with their period in seconds. In this example, the ATTITUDE message will be sent by the Ap process at 2Hz in the default mode and at 10Hz (the current maximum allowed frequency) in the fast attitude mode.
The mode can be chosen in the airframe file by setting the TELEMETRY_MODE_FBW constant:
<define name="TELEMETRY_MODE_FBW" value="1"/>
where the (default) first mode is numbered 0.
This mode can also be changed dynamically with a datalink setting or with a set stage in the flight plan.
Note that an (undocumented!) subset of the messages is required to be able to use ground station properly. So it is not advisable to completely remove messages for the Ap process listed in the default mode.
Settings
The settings attribute in the description of the aircraft in conf.xml allows the user to specify a list of variables for which values can be changed in-flight:
<aircraft name="Microjet" ... settings="settings/basic.xml" ... />
with the basic.xml file located in conf/settings/. A dl_setting element in this file associates buttons or sliders in the GCS interface to autopilot variables:
<!DOCTYPE settings SYSTEM "settings.dtd"> <settings> <dl_settings> <dl_settings NAME="flight params"> <dl_setting MAX="1000" MIN="-50" STEP="10" VAR="altitude_shift"/> </dl_settings> <dl_settings NAME="mode"> <dl_setting MAX="2" MIN="0" STEP="1" VAR="pprz_mode"> <strip_button name="AUTO2" value="2"/> </dl_setting> <dl_setting MAX="1" MIN="0" STEP="1" VAR="launch"> <strip_button name="Launch" value="1"/> </dl_setting> <dl_setting MAX="1" MIN="0" STEP="1" VAR="kill_throttle"/> </dl_settings> </dl_settings> </settings>
where dl_settings elements can be nested at any depth. A dl_setting element just specifies the name of the variable, the allowed range for the setting (min and max attributes) and the minimal step.
A notebook page will be associated in the GUI to each dl_settings element. A slider will be associated to each dl_setting entry except if the range is small (typically less than 3) and discrete (step=1): in the latter case, a set of radio buttons will be displayed.
The strip_button element adds a button to the GCS strip for commonly used tasks like "Launch" or "Circle". Multiple buttons can be used to assign different values to the same variable.
R/C Transmitter Data Uplink (Obsolete)
With the advent of small modems such as the popular Zigbee-based models, the value of the R/C transmitter based data-link is substantially reduced and the audio-based downlink has also been removed from current hardware designs. Nevertheless, this feature may still prove useful for extremely minimal hardware configurations. The tuning_rc.xml file is located in conf/settings.
<aircraft name="Microjet" ... settings="settings/tuning_rc.xml" ... />
A rc_settings element in this file associates switches and sliders of the RC to airborne variables:
<!DOCTYPE settings SYSTEM "settings.dtd"> <settings> <rc_settings> <rc_mode NAME="AUTO1"> <rc_setting VAR="ir_pitch_neutral" RANGE="2" RC="gain_1_up" TYPE="float"/> <rc_setting VAR="ir_roll_neutral" RANGE="-2" RC="gain_1_down" TYPE="float"/> </rc_mode> <rc_mode NAME="AUTO2"> <rc_setting VAR="course_pgain" RANGE="0.1" RC="gain_1_up" TYPE="float"/> <rc_setting VAR="pitch_of_roll" RANGE=".2" RC="gain_1_down" TYPE="float"/> </rc_mode> </rc_settings> </settings>
First, settings are sorted by mode (AUTO1 or AUTO2). Then a setting is composed of a variable name, a range (corresponding to the range of the RC slider) and a RC name. The RC name prefix can be gain_1 or gain_2, which corresponds to the GAIN1 and GAIN2 channels of your RC transmitter configuration. The RC name suffix can be up or down, which is related to the position of the CALIB switch on the RC transmitter.