FrSkyRC / ETHOS-Feedback-Community

Feedback & suggestions are welcomed here for ETHOS by FrSky
188 stars 85 forks source link

CRSF: GPS Heading, Speed, Alt, Sats malfunction #2403

Closed r1000ru closed 1 year ago

r1000ru commented 1 year ago

Hello. On Tandem X20, Ethos 1.4.6, CRSF(Elrs), next sensor is malfunction:

bsongis-frsky commented 1 year ago

Ethos has 2 kind of limits:

It seems you have mixed those 2 kind of limits in your request, here are my remarks:

r1000ru commented 1 year ago

@bsongis-frsky

  1. UBLOX protocol return struct, then ground_speed in sm/s and heading value scale to deg/1e-5. For sample take speed 12m/s and course 90 degrees. In ublox struct it will be 12100 = 1200 (sm/h) and 90/1e-5 = 90/ 0.00001 = 90 100 000 = 9 000 000
  2. When parsing , INAV makes transformations:
    gpsSol.groundSpeed = _buffer.velned.speed_2d;    // cm/s
    gpsSol.groundCourse = (uint16_t) (_buffer.velned.heading_2d / 10000);     // Heading 2D deg * 100000 rescaled to deg * 10
  3. Then INAV make CRSF GPS frame use next scales:
    • speed cm/m to km/h 10 = speed(sm/h) 3600(s in h) / 100000 (sm in km) 10 = speed 36 / 100;
    • heading deg 10 to deg 100 = heading * 10;
      #define DECIDEGREES_TO_CENTIDEGREES(angle) ((angle) * 10)
      crsfSerialize16(dst, (gpsSol.groundSpeed * 36 + 50) / 100); // gpsSol.groundSpeed is in cm/s
      crsfSerialize16(dst, DECIDEGREES_TO_CENTIDEGREES(gpsSol.groundCourse)); // gpsSol.groundCourse is 0.1 degrees, need 0.01 deg

      These transformations correspond to a document that TBS forbids publishing, called crsf rev07.pdf crsf_gps

bsongis-frsky commented 1 year ago

Thanks for the reference to the documentation.

Changes made for 1.4.7: 1) GPS Speed: 2 decimals, max = 650.00km/h 2) GPS Heading: 2 decimals, max = 360.00° 3) GPS Alt: max = 65000m 4) GPS Sats: max = 255 satellites

bsongis-frsky commented 1 year ago

I have found this exact document in my computer, it is a little bit old. I wonder if it has changed since, as OpenTX uses a different precision (so EdgeTX the same) and it seems there is no issue with the GPS fields.