Adding LTM telemetry support

Hi, I’ve been using AC/AP for many many years now since apm2.6 My gratitude and enormous respect to all the people who made software/hardware and made this project!

Recently I’ve come to need to use LTM protocol with Ardupilot firmware. Instead of begging and nagging and asking devs to port it, I’ve decided to give it a go myself. My particular application needs very low baud- 2400. LTMv1 has only 3 frames at 2400baud provide gps/alt info at 5Hz, attitude at 10Hz and sens info at 2Hz one way stream. If interested this is to be used with u360gts antenna tracking project with telemetry being streamed via audio channel of vTX through FSK modem at 2400baud. u360gts is able to emulate mavlink and provide unidirectional stream to a GCS of choice from LTM/Frsky and a few other protocols.

Attached are LTM.h and LTM.cpp which I did my best to format similar to Frsky and Devo files. Most of the code I’ve already completed taking clues from frsky and devo files, however due to not being sufficiently familiar with AP structure I have a few questions and would appreciate some input:

#1. Need help properly initializing serial port, namelly:

AP_SerialManager.h file doesn’t have
AP_SERIALMANAGER_DEVO_TELEM_BAUD,
AP_SERIALMANAGER_DEVO_BUFSIZE_RX and
AP_SERIALMANAGER_DEVO_BUFSIZE_TX
which are used in
AP_DEVO_Telem::init(const AP_SerialManager& serial_manager)
to initialize serial port.
On the other hand, Frsky related variables are present, yet it appears that both Frsky and Devo instances are initialized in the same way.

#2. Need help with obtaining MAV_TYPE value. (and some explanation of its value)
According to to comments in Frsky.h :
“mav_type; // frame type (see MAV_TYPE in Mavlink definition file common.h)”
I went through AP_Common.h but could not find MAV_TYPE.

#3. Need help getting RC RSSI

#4. Would appreciate if someone could go through the files attached and advised If I am doing incorrectly.

THANKS!

LTM.cpp (6.8 KB)
LTM.h (3.1 KB)

1 Like

Hello,
thanks for contributing !
I think it will be better to make PR directly on github, that way other can directy add modification to your code !
You will find most information on how to do it here : http://ardupilot.org/dev/docs/contributing.html

About #1.
Those define are in https://github.com/ArduPilot/ardupilot/blob/master/libraries/AP_Devo_Telem/AP_Devo_Telem.cpp#L23 . But I think it is better to put it with other in AP_SerialManager.h
About #2. The mav_type is the vehicle type : rover, copter, etc. It is set by vehicle code, so you won’t be able to access it from library. Look at how it is done for FRSKY :
https://github.com/ArduPilot/ardupilot/blob/73940df48ee961de3a846d4dfa36e842d0f2aba3/ArduCopter/system.cpp#L96

Got most of the questions figured out!
here are the updated files:
AP_LTM.cpp (7.4 KB)
AP_LTM.h (3.4 KB)
AP_SerialManager.h (7.0 KB)
system.cpp (20.9 KB)
config.h (22.8 KB)
Copter.h (32.8 KB)
AP_SerialManager.cpp (25.3 KB)

I can’t find where to put #include AP_LTM.cpp though.
thanks!