ArduPilot / ardupilot

ArduPlane, ArduCopter, ArduRover, ArduSub source
http://ardupilot.org/
GNU General Public License v3.0
10.68k stars 17.15k forks source link

Include Graupner HOTT telemetry support into code tree #631

Closed msk7-ripe closed 10 years ago

msk7-ripe commented 10 years ago

Some time ago Adam Majerczyk wrote HOTT support for AP 2.7 (https://code.google.com/p/hott-for-ardupilot/). It worked for me in 2.9.1 and (with minor changes) now works in 3.0.1 though I never updated project tree. Now I'm trying to implement HOTT in current AC version. There are some problems cause timer driven proc is needed to fulfill tight HOTT timings and in newer versions timer ticks slower. Graupner RC is popular and valuable, so I suggest including HOTT support into main APM tree. If sources working with 3.0.1 are needed, contact me.

rmackay9 commented 10 years ago

Is this similar (or a replacement) of MAVLink? If "yes" what are the advantages over MAVLink?

msk7-ripe commented 10 years ago

It's not replacement of MAVLink, it's protocol for Graupner RC to see telemetry data on Graupner RC display. gpsprofile It can display lot of data including GPS data, batteries state etc.

msk7-ripe commented 10 years ago

I've made it working with 3.1-rc5. Now code uses user hooks, but I'd like to add it to basic functionality. Code and video showing it works if here: http://t13.mediamax.pro/HOTT/ If code will be added to tree I'll convert c source to APM library class.

rmackay9 commented 10 years ago

Well, i think that's pretty neat. I'd like to talk about it with Tridge first but I would lean towards including it if at all possible although it might be behind a #define because the number of users could be limited. I think there are probably more commonly used telemetry systems (like frsky) that we should also support. I'll talk about it with tridge on the tuesday dev call.

rmackay9 commented 10 years ago

Having it as a library would make it much easier to integrate, thanks!

msk7-ripe commented 10 years ago

So, if possible, let's include it first as is to let more users test it and give their ideas. Surely it should be included under #define, but I think I'll remove calls from user_code and put into ArduCopter.pde. Also I've just addded some functionality and updated file on site.

msk7-ripe commented 10 years ago

As to other telemetry systems, I don't have frsky RC, I have Futaba. I saw some info on reverse-engineering futaba protocol. Also it has less functionality than HOTT and I don't have any compatible sensor to check. May be later I'll try to implement it.

rmackay9 commented 10 years ago

We talked about this on the dev call and we will be happy to include the change if you can turn it into a library and submit it as a pull request. A couple of comments on the implementation:

  1. it would probably be better to run the updates from the scheduler_tasks list instead of the 1khz scheduler which is mostly used for sensors. https://github.com/diydrones/ardupilot/blob/master/ArduCopter/ArduCopter.pde#L858
  2. it would be best to use the in16_t format for the variables because the size of an int is different on the Pixhawk/PX4 (I think).
  3. Tridge and I think it would probably be best if it used the 2ndary telemetry port on the APM2 instead of the main one although we can discuss. I guess if you're not using a 3dr radio it might be easier to just use the main telemetry port.
msk7-ripe commented 10 years ago

@rmackay9 on your comments:

  1. I know timer works for sensors. As I found in newer version it ticks 500 Hz. I tried do fulfill your advice when porting to 3.0.1 and 3.1 before I suggested including this code into tree. Unfortunately HOTT won't work with scheduler 100Hz loop which is too slow and has unstable period. HOTT requires rather fast response: it sends "sensor request" and if there was no response within certain time, "sensor" is concerned "dead". The slower portion of code which updates sensor data does work now from scheduler loop. Maybe it's possible to drive fast portion of HOTT code with serial interrupt, but I'm not enough familiar with AVR to decide now whether it's right.
  2. Definitely you are right with int16_t. Is Pixhawk/PX4 open hardware? Where may I get info about it's architecture, serial ports etc to support HOTT?
  3. Do you mean using serial telemetry port where 3dr radio is connected? As for me I use both serial radio and HOTT, though I'd like to separate ports. I guess the thing is port I use has to be soldered by user. Maybe in future we could add a parameter like "RC_TELEMETRY_PORT"
rmackay9 commented 10 years ago

msk7-ripe,

Yes, the pixhawk is also open source and it runs arducopter. It's due to launch in a few weeks from 3dr: http://copter.ardupilot.com/wiki/common-pixhawk-overview/ http://store.3drobotics.com/products/3dr-pixhawk

I guess if the fast part of the loop is very quick it might be ok. I guess we will just need to check performance. We have the perfmon lib, the scheduler also can display information on overruns and slipped tasks.

The additional parameter sounds like a good idea.

msk7-ripe commented 10 years ago

As HOTT code uses much non-library variables, functions etc. I decided not to convert it into library because library should be autonomous and HOTT code is not. After I test it with AP3.1-rc6 I'll make a patch.

uwerod commented 10 years ago

Where can I get the hott Code. I use the telemetrie with ac3.0.1 and in the Version 3.1 I have a Problem with the scheduler.

AndKe commented 10 years ago

@msk7-ripe What does it actually mean ? That you'll make a patch, not a library. what is the difference to the end user ?

I was very happy to see HoTT support being added to the project. HoTT is very, very useful. Here's a newer code source, with support for current versions and some improvements, +recently added flight modes. https://github.com/uwerod/ardupilot_with_Hott

@uwerod : is the 2 month old comment about sceduler still an issue ?

tgghtp commented 10 years ago

Well, great work!

What is the actual state: will it become part of apm 3.2 ?

I got it running with 3.2. The only problem: The mavlink parameter LED_mode disappears apparently when 3.2 is built with hott-code. Any Ideas?

msk7-ripe commented 10 years ago

@tgghtp : You may get patch from http://t13.mediamax.pro/HOTT/ Also I changed GPS calculations from float to integer saving precious processing time. I'll be glad if anyone is ready to run tests and give me response and advises, please contact me by e-mail.

msk7-ripe commented 10 years ago

@AndKe : Patch or library s no difference to end-user

AndKe commented 10 years ago

nice, thanks - I did not review the patch yet, did you add support for pixhawk ? (i ran into problems when trying to enable/disable send/recieve in my attempt to do so)

msk7-ripe commented 10 years ago

@AndKe : Unfortunately I don't have pixhawk. I think I can add pixhawk support, but someone has to provide testing.

AndKe commented 10 years ago

I can test, for faster testing, if you provided a hexa arducopter build- I am pretty sure I could give it a go this weekend. if not, its not impossible that I find time anyway. :) (make px4-v2-hexa)

Viper256 commented 10 years ago

@msk7-ripe: I did patched the various files using your patch file, however I got a bunch of compiler errors like:

Hott.pde: In function 'void _hott_send_msg(int8_t*, int)': Hott.pde:649:23: error: expected ';' before numeric constant Hott.pde: In function 'void _hott_update_gam_msg()': Hott.pde:700:30: error: expected ')' before numeric constant Hott.pde:703:26: error: expected ';' before numeric constant Hott.pde:704:34: error: expected ';' before 'climb_rate' Hott.pde:705:51: error: '120' cannot be used as a function

I am using APM2.5 hardware and arduino IDE. Any help would be appreciated.

Regards,

Michel.

msk7-ripe commented 10 years ago

@Viper256 : Sorry, I don't have these errors. Try downloading hott.pde here http://t13.mediamax.pro/HOTT

Viper256 commented 10 years ago

Hi,

Thanks for the response. Well I was not so lucky. I’ll describe what I did:

  1. I took the patch file. The patch file consists of code which has to be inserted in a number specifiek file. Question: which version of the Arducopter code did you use 3.1.2?? (https://github.com/diydrones/ardupilot) So I inserted these pieces of code in the specifiek file and I did add the Hott.pde file in the directory. Question: do I need to use the makefile command or is this automatically taken care of by the Arduino IDE?
  2. When It works is the new ‘information screen’ automatically discplayed on the Graupner transmitter? Or do I have to select a specifik menu?

Your respnse will be appreciated.

Regards,

Michel.

Van: msk7-ripe [mailto:notifications@github.com] Verzonden: woensdag 2 april 2014 07:56 Aan: diydrones/ardupilot CC: Viper256 Onderwerp: Re: [ardupilot] Include Graupner HOTT telemetry support into code tree (#631)

@Viper256 https://github.com/Viper256 : Sorry, I don't have these errors. Try downloading hott.pde here http://t13.mediamax.pro/HOTT

— Reply to this email directly or view it on GitHub https://github.com/diydrones/ardupilot/issues/631#issuecomment-39291275 . https://github.com/notifications/beacon/7099906__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcxMjAzNzM1OCwiZGF0YSI6eyJpZCI6MTg5NzYyNTJ9fQ==--6fb02ce57bca0ce75b5806c9c075696898fd5d48.gif

msk7-ripe commented 10 years ago

@Viper256 Hi Michel, This patch is for 3.1.2 version. You have to copy patch file to ArduCopter directory, then use patch utility supplied with GCC/Arduino "patch < (put patch file namr here)". The utility will make required edits in files and make Hott.pde file. After this remove patch file from directory and tune source as usual (frame type, options etc) and compile source. Then flash hex into APM.

This code emulates standard Graupner sensors: GPS, EAM, GAM and VARIO sensors. When everything is OK you should be able seeing sensor data as described in Graupner manual.

For this system to work you also need connecting APM serial port to Graupner telemetry port using special-made cable. See http://t13.mediamax.pro/HOTT/APM-HOTT-connection.html

This patch allows information on battery voltage, consumed capacity, flight modes, GPS data, speed, altitude, bearing, current WP number in AUTO mode etc to be shown on Graupner RC screen.

Small video showing RC display is here http://t13.mediamax.pro/HOTT/HOTT-working-ap3.1-rc5.3gp

Viper256 commented 10 years ago

Hi,

The patch utility was new to me. I did patch the various files manually and eventually it compiled without errors however i did not (yet) see the promised screen on the graupner rc yet. Do i have to select a specific screen on the rc or make another ajustment?

Groet/regards, Michel (www.Peters-Web.nl)

Op 3 apr. 2014 om 15:17 heeft msk7-ripe notifications@github.com het volgende geschreven:

@Viper256 Hi Michel, This patch is for 3.1.2 version. You have to copy patch file to ArduCopter directory, then use patch utility supplied with GCC/Arduino "patch < (put patch file namr here)". The utility will make required edits in files and make Hott.pde file. After this remove patch file from directory and tune source as usual (frame type, options etc) and compile source. Then flash hex into APM.

This code emulates standard Graupner sensors: GPS, EAM, GAM and VARIO sensors. When everything is OK you should be able seeing sensor data as described in Graupner manual.

For this system to work you also need connecting APM serial port to Graupner telemetry port using special-made cable. See http://t13.mediamax.pro/HOTT/APM-HOTT-connection.html

This patch allows information on battery voltage, consumed capacity, flight modes, GPS data, speed, altitude, bearing, current WP number in AUTO mode etc to be shown on Graupner RC screen.

Small video showing RC display is here http://t13.mediamax.pro/HOTT/HOTT-working-ap3.1-rc5.3gp

— Reply to this email directly or view it on GitHub.

AndKe commented 10 years ago

@Viper256 While we all appreciate what the devs do here, this is not a step-by-step support place, try right down arrow, or RTFM. :)

msk7-ripe commented 10 years ago

@rmackay9 Hi Randy, finally i've made HoTT patch for AC3.1.2. It supports only APM board now. I improved efficiency replacing float operations with ints and added some more functionality. I'll continue my work to add linux support and then convert this code into library. What do you think about adding this code into next release? Regards, M.

NullVoxPopuli commented 10 years ago

will this support encryption or authentication? as quads get more popular, I worry about people hijacking them mid flight via mavlink. (I too the telemetry module off my vtail for this reason). :-\

AndKe commented 10 years ago

@NullVoxPopuli The way we use HoTT today, is mostly to transmit data down to the "TX's display, and maybe forward it to a BT device from there. While HoTT can be used to upload data, it's simple data only, like some input for tuning etc, there is NO code that would receieve mavlink code thru the HoTT channel. Hott also works on only 19200bps, and have more latency due to the way packets are requested and sent. So there's no risk of hijacking by using HoTT -datalink. - simply because there's no "input" from the teemetry code into autopilot.

Reddi82 commented 10 years ago

I still wait for HoTT support, too. ;)

j-lang commented 8 years ago

What is the current state of this geat extension? Is there a plan for integration into APM and Pixhawk firmware? I had a prior version on apm 2.8 running and it is so useful - as long your Hott receiver works you have info about the current state of the copter - especially without additional hardware. My 3dr radio looses connection over 200m - 300m and have mount the smartphone to the RX, whats not recommended by all RC equipment producers. :+1:

AndKe commented 8 years ago

due to the lack of RX/TX control in pixhawk (disable RX while transmitting) I am using an external device, http://madhacker.org/mavlink-to-hott-adapter/
Still - I would love to see Pixhawk capable of this.