44 const int update_rate_hz = 10;
87 uint8_t remaining = battery_status.
remaining * 100;
99 int32_t latitude = vehicle_gps_position.
lat;
100 int32_t longitude = vehicle_gps_position.
lon;
101 uint16_t groundspeed = vehicle_gps_position.
vel_d_m_s / 3.6f * 10.f;
103 uint16_t altitude = vehicle_gps_position.
alt + 1000;
107 gps_heading, altitude, num_satellites);
136 case vehicle_status_s::NAVIGATION_STATE_MANUAL:
137 flight_mode =
"Manual";
140 case vehicle_status_s::NAVIGATION_STATE_ALTCTL:
141 flight_mode =
"Altitude";
144 case vehicle_status_s::NAVIGATION_STATE_POSCTL:
145 flight_mode =
"Position";
148 case vehicle_status_s::NAVIGATION_STATE_AUTO_RTL:
149 flight_mode =
"Return";
152 case vehicle_status_s::NAVIGATION_STATE_AUTO_MISSION:
153 flight_mode =
"Mission";
156 case vehicle_status_s::NAVIGATION_STATE_AUTO_LOITER:
157 case vehicle_status_s::NAVIGATION_STATE_AUTO_RCRECOVER:
158 case vehicle_status_s::NAVIGATION_STATE_AUTO_RTGS:
159 case vehicle_status_s::NAVIGATION_STATE_DESCEND:
160 case vehicle_status_s::NAVIGATION_STATE_AUTO_TAKEOFF:
161 case vehicle_status_s::NAVIGATION_STATE_AUTO_LAND:
162 case vehicle_status_s::NAVIGATION_STATE_AUTO_FOLLOW_TARGET:
163 case vehicle_status_s::NAVIGATION_STATE_AUTO_PRECLAND:
164 flight_mode =
"Auto";
167 case vehicle_status_s::NAVIGATION_STATE_AUTO_LANDENGFAIL:
168 case vehicle_status_s::NAVIGATION_STATE_AUTO_LANDGPSFAIL:
169 flight_mode =
"Failure";
172 case vehicle_status_s::NAVIGATION_STATE_ACRO:
173 flight_mode =
"Acro";
176 case vehicle_status_s::NAVIGATION_STATE_TERMINATION:
177 flight_mode =
"Terminate";
180 case vehicle_status_s::NAVIGATION_STATE_OFFBOARD:
181 flight_mode =
"Offboard";
184 case vehicle_status_s::NAVIGATION_STATE_STAB:
185 flight_mode =
"Stabilized";
188 case vehicle_status_s::NAVIGATION_STATE_RATTITUDE:
189 flight_mode =
"Rattitude";
bool crsf_send_telemetry_gps(int uart_fd, int32_t latitude, int32_t longitude, uint16_t groundspeed, uint16_t gps_heading, uint16_t altitude, uint8_t num_satellites)
Send telemetry GPS information.
uORB::Subscription _vehicle_attitude_sub
bool crsf_send_telemetry_battery(int uart_fd, uint16_t voltage, uint16_t current, int fuel, uint8_t remaining)
Send telemetry battery information.
bool crsf_send_telemetry_attitude(int uart_fd, int16_t pitch, int16_t roll, int16_t yaw)
Send telemetry Attitude information.
constexpr T degrees(T radians)
uORB::Subscription _vehicle_gps_position_sub
bool update(const hrt_abstime &now)
Send telemetry data.
uORB::Subscription _battery_status_sub
__BEGIN_DECLS typedef uint64_t hrt_abstime
Absolute time, in microsecond units.
static constexpr int num_data_types
number of different telemetry data types
Quaternion< float > Quatf
CRSFTelemetry(int uart_fd)
bool update(void *dst)
Update the struct.
RC protocol definition for CSRF (TBS Crossfire).
uORB::Subscription _vehicle_status_sub
bool crsf_send_telemetry_flight_mode(int uart_fd, const char *flight_mode)
Send telemetry Flight Mode information.