zs6buj / AntTracker

Antenna Tracker for tracking a moving model aircraft or drone with a small high-gain UHF or SHF antenna
GNU General Public License v3.0
155 stars 42 forks source link

compile error and missing smartport telemetry sensors #42

Closed shro70 closed 1 year ago

shro70 commented 2 years ago

Hello.

When i try to set #define Heading_Source 3 // 3=Trackerbox_Compass i get a compile error "'uint_16' was not declared in this scope " at line 92 in compass : fHeading = (float)wrap360((uint_16)val);"

The other issue is i only get a few telemetry sensors . I use Inav + radiomatster TX16s +R9M ACCST in Fport with an inverted HC05 pluged in the back of the R9M. Connection is ok , the esp32 receive telemetry but only GPS, Heading,arming and RSSI. This setup work great on another tracker (U360gts) but I need a 180°/180° tracker so your project look promising.

Capture

Can you help me ?

zs6buj commented 2 years ago

Hello, yes I fixed the typo and uploaded v2.19.5b

The tracker only every needs the location of the craft and its altitude, so I don't bother decoding most of the other message types.

shro70 commented 2 years ago

Thanks for the quick answer and fix. Which altitude sensor is used ? Baro or gps alt because I only get 0m .

zs6buj commented 2 years ago

0x820 for alritude. You are showing alt = 233 above?

shro70 commented 2 years ago

Ah you're right. That's my gps alt but the screen only show 0. Same wit sat's number .

zs6buj commented 2 years ago

Ah, OK. I'll check that when I get home.

zs6buj commented 2 years ago

Ok, I'm looking at the code. I determine altitude above ground/field/home by saving absolute altitude (above mean sea level) when "home" is set. Home can be set when motors are armed if this option is set

#if defined SET_HOME_AT_ARM_TIME

or by button push. From you log I can see that home has not yet been established.

image

So altitude above field will be 0.

As for rssi. number of sats, climb and ground speed, I've added some code for iNav hud display, but might need a little more work. I need iNav sensor numbers for speed and climb.

shro70 commented 2 years ago

Ok I understand now. Thanks again for the quick answer.

Maybe I can help you with the inav sensor numbers. It's the sensor number in the radio telemetry page/ edit sensor tab ?

zs6buj commented 2 years ago

I don't have any iNav kit here unfortunately, so I need links to documents that list the sensors. I have some docs, but they seem out of date.

zs6buj commented 2 years ago

I found this

#define GPS_SPEED_FIRST_ID        0x0830
#define GPS_SPEED_LAST_ID         0x083f
shro70 commented 2 years ago

https://github.com/iNavFlight/inav/blob/master/src/main/telemetry/smartport.c

FSSP_DATAID_SPEED = 0x0830 , FSSP_DATAID_VFAS = 0x0210 , FSSP_DATAID_CURRENT = 0x0200 , FSSP_DATAID_RPM = 0x050F , FSSP_DATAID_ALTITUDE = 0x0100 , FSSP_DATAID_FUEL = 0x0600 , FSSP_DATAID_ADC1 = 0xF102 , FSSP_DATAID_ADC2 = 0xF103 , FSSP_DATAID_LATLONG = 0x0800 , FSSP_DATAID_CAP_USED = 0x0600 , FSSP_DATAID_VARIO = 0x0110 , FSSP_DATAID_CELLS = 0x0300 , FSSP_DATAID_CELLS_LAST = 0x030F , FSSP_DATAID_HEADING = 0x0840 , FSSP_DATAID_FPV = 0x0450 , FSSP_DATAID_PITCH = 0x0430 , FSSP_DATAID_ROLL = 0x0440 , FSSP_DATAID_ACCX = 0x0700 , FSSP_DATAID_ACCY = 0x0710 , FSSP_DATAID_ACCZ = 0x0720 , FSSP_DATAID_T1 = 0x0400 , FSSP_DATAID_T2 = 0x0410 , FSSP_DATAID_HOME_DIST = 0x0420 , FSSP_DATAID_GPS_ALT = 0x0820 , FSSP_DATAID_ASPD = 0x0A00 , FSSP_DATAID_A3 = 0x0900 , FSSP_DATAID_A4 = 0x0910 , FSSP_DATAID_AZIMUTH = 0x0460,

zs6buj commented 2 years ago

Thanks, I need to do a bit more coding. You could try v 2.19.06 in the meantime. I suggest you use

define SET_HOME_AT_ARM_TIME

shro70 commented 2 years ago

I tested the 2.19.06 and it solved my issues. I see you added sat number too .

I think I noticed a minor bug :

Define servo slowdown seem to only affect azimuth not elevation.

zs6buj commented 2 years ago
"I think I noticed a minor bug :
#Define servo slowdown seem to only affect azimuth not elevation."

Could you double check. It looks ok here.

zs6buj commented 2 years ago

v2.19.07 added speed, pitch and roll. Does iNav have a climb (rate of) message?

shro70 commented 2 years ago

Nice. Vertical speed is FSSP_DATAID_VARIO = 0x0110

zs6buj commented 2 years ago

Done. v2.19.07b

I've assumed unit = m *10, so /10 to get m/s

shro70 commented 2 years ago
"I think I noticed a minor bug :
#Define servo slowdown seem to only affect azimuth not elevation."

Could you double check. It looks ok here.

I tested my servo with the #test servo and only azimuth is slowed down. I tried 5 10 15 and elevation servo still move at full speed while azimut is effectively slowed down. I only did a bench test no real flying

zs6buj commented 1 year ago

@shro70: Sorry, I've been away for a while. If you still need help with this please reopen the issue.