kopia lustrzana https://github.com/mikaelnousiainen/RS41ng
Fix incorrect cast for atmospheric pressure. Fix Horus not supporting negative altitudes. Attempt to filter out invalid GPS data by improving fix detection.
rodzic
8c13702598
commit
8ec3f8817a
|
@ -29,7 +29,7 @@ size_t horus_packet_v1_create(uint8_t *payload, size_t length, telemetry_data *d
|
|||
horus_packet.Seconds = gps_data->seconds;
|
||||
horus_packet.Latitude = float_lat;
|
||||
horus_packet.Longitude = float_lon;
|
||||
horus_packet.Altitude = (uint16_t)(gps_data->altitude_mm / 1000);
|
||||
horus_packet.Altitude = (uint16_t)((gps_data->altitude_mm > 0 ? gps_data->altitude_mm : 0) / 1000);
|
||||
horus_packet.Speed = (uint8_t)((float) gps_data->ground_speed_cm_per_second * 0.036);
|
||||
|
||||
// Temporary pDOP info, to determine suitable pDOP limits.
|
||||
|
|
|
@ -29,7 +29,7 @@ size_t horus_packet_v2_create(uint8_t *payload, size_t length, telemetry_data *d
|
|||
horus_packet.Seconds = gps_data->seconds;
|
||||
horus_packet.Latitude = float_lat;
|
||||
horus_packet.Longitude = float_lon;
|
||||
horus_packet.Altitude = (uint16_t)(gps_data->altitude_mm / 1000);
|
||||
horus_packet.Altitude = (uint16_t)((gps_data->altitude_mm > 0 ? gps_data->altitude_mm : 0) / 1000);
|
||||
horus_packet.Speed = (uint8_t)((float) gps_data->ground_speed_cm_per_second * 0.036);
|
||||
|
||||
horus_packet.BattVoltage = volts_scaled;
|
||||
|
@ -62,7 +62,7 @@ size_t horus_packet_v2_create(uint8_t *payload, size_t length, telemetry_data *d
|
|||
custom_data_pointer += sizeof(ext_humidity_percentage);
|
||||
|
||||
// Unit: mbar * 10
|
||||
uint16_t ext_pressure_mbar = (uint8_t) (data->pressure_mbar_100 / 10.0f);
|
||||
uint16_t ext_pressure_mbar = (uint16_t) (data->pressure_mbar_100 / 10.0f);
|
||||
memcpy(custom_data_pointer, &ext_pressure_mbar, sizeof(ext_pressure_mbar));
|
||||
// custom_data_pointer += sizeof(ext_pressure_mbar);
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ void telemetry_collect(telemetry_data *data)
|
|||
|
||||
// Zero out position data if we don't have a valid GPS fix.
|
||||
// This is done to avoid transmitting invalid position information.
|
||||
if (!(data->gps.fix_ok) || data->gps.fix == 0) {
|
||||
if (!data->gps.fix_ok) {
|
||||
data->gps.latitude_degrees_1000000 = 0;
|
||||
data->gps.longitude_degrees_1000000 = 0;
|
||||
data->gps.altitude_mm = 0;
|
||||
|
|
Ładowanie…
Reference in New Issue