42 #if PERIODIC_TELEMETRY
44 #include "generated/settings.h"
46 #if defined RADIO_CALIB && defined RADIO_CONTROL_SETTINGS
48 static void send_rc_settings(
struct transport_tx *trans,
struct link_device *
dev)
58 static void send_mode(
struct transport_tx *trans,
struct link_device *
dev)
60 pprz_msg_send_PPRZ_MODE(trans, dev, AC_ID,
66 pprz_msg_send_ESTIMATOR(trans, dev, AC_ID,
70 static void send_bat(
struct transport_tx *trans,
struct link_device *
dev)
75 if (fabs(
energy) >= INT16_MAX) {
78 pprz_msg_send_BAT(trans, dev, AC_ID,
87 if (fabs(
energy) >= INT16_MAX) {
90 float vsup = ((float)
vsupply) / 10.0f;
91 float curs = ((float)
current) / 1000.0f;
92 float power = vsup * curs;
93 pprz_msg_send_ENERGY(trans, dev, AC_ID, &vsup, &curs, &e, &power);
104 pprz_msg_send_DESIRED(trans, dev, AC_ID,
107 &v_ctl_auto_airspeed_setpoint);
110 static void send_airspeed(
struct transport_tx *trans __attribute__((unused)),
111 struct link_device *
dev __attribute__((unused)))
115 pprz_msg_send_AIRSPEED(trans,
dev, AC_ID,
120 pprz_msg_send_AIRSPEED(trans,
dev, AC_ID, &airspeed, &zero, &zero, &zero);
139 #if PERIODIC_TELEMETRY
147 #if defined RADIO_CALIB && defined RADIO_CONTROL_SETTINGS
uint8_t mcu1_status
Second MCU status (FBW part)
static void send_airspeed(struct transport_tx *trans, struct link_device *dev)
void autopilot_firmware_init(void)
Init function.
float v_ctl_altitude_setpoint
in meters above MSL
Variable setting though the radio control.
Periodic telemetry system header (includes downlink utility and generated code).
int32_t current
Supply current in milliAmpere.
float h_ctl_course_setpoint
float v_ctl_auto_groundspeed_setpoint
in meters per second
float v_ctl_climb_setpoint
uint16_t flight_time
flight time in seconds
static float stateGetAirspeed_f(void)
Get airspeed (float).
struct pprz_autopilot autopilot
Global autopilot structure.
float v_ctl_auto_airspeed_setpoint
in meters per second
Fixed wing horizontal control.
float energy
Energy consumption (mAh) This is the ap copy of the measurement from fbw FIXME use electrical module ...
uint16_t vsupply
Supply voltage in deciVolt.
static void send_desired(struct transport_tx *trans, struct link_device *dev)
Fixedwing specific autopilot interface and initialization.
float h_ctl_pitch_loop_setpoint
#define DefaultPeriodic
Set default periodic telemetry.
static void send_estimator(struct transport_tx *trans, struct link_device *dev)
void autopilot_send_mode(void)
Report autopilot mode on default downlink channel.
static const struct usb_device_descriptor dev
static void send_bat(struct transport_tx *trans, struct link_device *dev)
static struct UtmCoor_f * stateGetPositionUtm_f(void)
Get position in UTM coordinates (float).
API to get/set the generic vehicle states.
float h_ctl_roll_setpoint
static struct EnuCoor_f * stateGetSpeedEnu_f(void)
Get ground speed in local ENU coordinates (float).
static void send_energy(struct transport_tx *trans, struct link_device *dev)
static void send_mode(struct transport_tx *trans, struct link_device *dev)
bool kill_throttle
allow autopilot to use throttle
Fixedwing Navigation library.
pprz_t v_ctl_throttle_slewed
uint8_t mode
current autopilot mode
float v_ctl_auto_airspeed_controlled
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.