Question about interfacing with LibrePilot
« on: November 30, 2016, 06:19:44 pm »
Hi All,

I have a question I can't seem to figure out on my own.

Let's say I have another process running on the same machine as LibrePilot. Is there a way I can send LibrePilot messages over UavLink from that other process? Or is the only interface via OPLink radio.   

I've spent some time looking over the docs.

Thanks.

Mateusz

  • *
  • 808
Re: Question about interfacing with LibrePilot
« Reply #1 on: November 30, 2016, 07:26:43 pm »
You have to go to Configuration->Hardware->HW Settings where you see board with different outputs.
There you can enable telemetry on USB, Main Port, Flexi Port in addition to OPlink, protocol is described here https://librepilot.atlassian.net/wiki/display/LPDOC/UavTalk

I wasn't sure about running LibrePilot. The LibrePilot has GCS and fight-side firmware under it's umbrella.
« Last Edit: November 30, 2016, 07:32:07 pm by Mateusz »

f5soh

  • *****
  • 4572
    • LibrePilot
Re: Question about interfacing with LibrePilot
« Reply #2 on: December 01, 2016, 07:03:46 pm »
Not sure what you are asking exactly.

Currently there is a simposix firmware that can be run locally as a process and you can connect to it via udp in GCS.
This run under Linux and can be used to autopilot/stabilize a aircraft under FlightGear flight simulator.

hwh

  • *
  • 1018
Re: Question about interfacing with LibrePilot
« Reply #3 on: December 01, 2016, 08:42:37 pm »
...Let's say I have another process running on the same machine as LibrePilot. Is there a way I can send LibrePilot messages over UavLink from that other process? Or is the only interface via OPLink radio. ...
LibrePilot refers to both the ground control software and the firmware on the flight controller.  Which do you want to send messages to?  It would help us to answer if you posted a little more on just what you want to do.

Re: Question about interfacing with LibrePilot
« Reply #4 on: January 04, 2017, 12:04:09 am »
Hi @hwh,

I'm referring to the ground control software. Basically, I would like to listen to a different protocol/interface, and then convert those messages to the UAVObjects and inject them to OpenPilot.

Re: Question about interfacing with LibrePilot
« Reply #5 on: January 04, 2017, 10:53:55 am »
You can talk to the FC with OpLink, USB, or serial.  GCS can act as intermediate to convert network packets into these.  GCS can read a joystick and send control commands too.  Serial can be connected to some RF modems to mimic a pair of OpLinks.

I would recommend that you modify the GCS to read from the other program and send to the FC, since it already knows how to do this and has some very helpful debugging stuff (look at the System tab to see the UAVOs in real time).

Re: Question about interfacing with LibrePilot
« Reply #6 on: January 05, 2017, 06:26:48 pm »
After spending some time in the LibrePilot code, I think my best bet will be to create a new *Connection plugin which receives the messages on the other protocol and then convert/translate them to a UAVObject which then the current widgets can use.

At this point I'm not familiar enough with the architecture to know if I can just push the UAVObject to the widgets or if I need to inject it into the UAVTalk bus (if that even makes sense). Back to the code!

Re: Question about interfacing with LibrePilot
« Reply #7 on: January 05, 2017, 06:28:48 pm »
Just so every knows what I'm doing:

I need to receive telemetry info using a protocol that LibrePilot does not support and I want to reuse the current widgets. Current widgets know UAVObjects, so that is why a translation from the new protocol message set to the UABObject message set.

f5soh

  • *****
  • 4572
    • LibrePilot
Re: Question about interfacing with LibrePilot
« Reply #8 on: January 05, 2017, 06:53:31 pm »
Whats your input protocol  ?

filnet

  • *****
  • 113
Re: Question about interfacing with LibrePilot
« Reply #9 on: January 05, 2017, 07:14:12 pm »
A new "Connection" type is not the best approach imho.

GCS can have only one active connection. If "your" connection is active then there will be no "real" connection from GCS to the UAV.

I suggest you take a look at the streamservice plugin. This plugin will stream UAVObject out of GCS using some kind of protocol. What you need is something similar that will accept inbound data in your format and apply them to UAVObjects. You could enhance the existing streamservice to handle inbound data and various protocols/formats.

Re: Question about interfacing with LibrePilot
« Reply #10 on: January 05, 2017, 09:03:11 pm »
@f5soh, the input protocol will be DDS. So the interface between the UAV and GCS will be DDS. I want to take the incoming DDS messages, create a UAVObject and push it out if that makes sense.

@filnet, so this will be the only connection to GCS. I'm taking a look at the streamservice plugin now. Thanks.

filnet

  • *****
  • 113
Re: Question about interfacing with LibrePilot
« Reply #11 on: January 05, 2017, 09:39:12 pm »
You lost me a bit...

You have several routes:

1- your process connects (in some way, using some protocols) to GCS, sends data to GCS and GCS forwards that to the UAV.
You leverage GCS but have to enhance the inter process connectivity features of GCS.

2- your process interfaces directly with the UAV using the UAVTalk protocol.
This removes GCS from the picture but you need to "steal" a lot of code (the UAVTalk stack and all) from GCS.
Alternatives for that approach are to use a Java or Python UAVTalk implementations (there are some available).

3- you integrate DDS or alternatives (MQTT) directly into GCS.

PS : btw what is DDS ?
« Last Edit: January 05, 2017, 09:42:14 pm by filnet »

Re: Question about interfacing with LibrePilot
« Reply #12 on: January 05, 2017, 09:51:33 pm »
First of all, thanks for everyones help. Really appreciate it.

DDS is a publish/subscribe standard. More info is here: https://en.wikipedia.org/wiki/Data_Distribution_Service

I think at this point I'm going with route 3: I am going to update LibrePilot code to listen to DDS traffic. I might make some new UAVObjects as well depending on the data.

Looking at StreamServicePlugin::makeSureIsSubscribed(), from the DDSConnection which is listening to the traffic, I can get a list of the current UAVDataObjects in the system and update them and somehow trigger the objectUpdated signal so all the other plugins/widgets that are interested in the updates will process the change. This should update the GUI to reflect changes the data.

jcg1541

  • **
  • 98
    • Phones, Networks, And The Red Pill
Re: Question about interfacing with LibrePilot
« Reply #13 on: April 21, 2017, 10:38:04 pm »
Why not implement MQTT on the vehicle side? I heard some people, on youtube Joshua Bradwell, said that the ARM32F4 CPU is only utilized 2% with quads. There is plenty of CPU power to run a lot more software stack, like TCP/ IP over modem oplink and SSL/TLS stack, on the vehicle side.

You lost me a bit...

You have several routes:

1- your process connects (in some way, using some protocols) to GCS, sends data to GCS and GCS forwards that to the UAV.
You leverage GCS but have to enhance the inter process connectivity features of GCS.

2- your process interfaces directly with the UAV using the UAVTalk protocol.
This removes GCS from the picture but you need to "steal" a lot of code (the UAVTalk stack and all) from GCS.
Alternatives for that approach are to use a Java or Python UAVTalk implementations (there are some available).

3- you integrate DDS or alternatives (MQTT) directly into GCS.

PS : btw what is DDS ?