uavobjgenerator -java output
« on: January 30, 2019, 08:34:57 pm »
I am working on a non-android java implementation of UavTalk and have successfully generated the UAVObjects for java, but those templates have dependencies on the following classes:

import org.openpilot.uavtalk.UAVObjectManager;
import org.openpilot.uavtalk.UAVObject;
import org.openpilot.uavtalk.UAVDataObject;
import org.openpilot.uavtalk.UAVObjectField;

Does anyone know where I can get the source for these classes? Or any non-android java implementation of UavTalk for that matter?

Mark

f5soh

  • *****
  • 4572
    • LibrePilot
Re: uavobjgenerator -java output
« Reply #1 on: January 31, 2019, 12:18:02 am »
Hi,

You may find some java files here :

Code: [Select]
./ground/gcs/src/libs/juavtalk
├── build.xml
└── src
    └── org
        └── openpilot
            └── uavtalk
                ├── CRC8.java
                ├── UAVObjectFieldDescription.java
                ├── UAVObject.java
                ├── UAVObjectMetaData.java
                ├── UAVObjectsInterface.java
                ├── UAVTalkDefinitions.java
                ├── UAVTalkHelper.java
                └── ValueParser.java

Re: uavobjgenerator -java output
« Reply #2 on: January 31, 2019, 12:49:25 am »
Thank you for the quick reply, Unfortunately there are several classes referenced by the templates that aren't there. The best I've been able to find is this old repo.

https://github.com/cberner/openpilot.git

That has the correct class names, but they must be from a previous branch as they are missing a few fields and methods referenced in the templates. I'm guessing  the -java target of uavobjgenerator hasn't been maintained for some time.

I'll kick the classes I have around a little bit and see if I can get it to deserialize some packets.

Is the original open pilot repo available somewhere?

f5soh

  • *****
  • 4572
    • LibrePilot
Re: uavobjgenerator -java output
« Reply #3 on: January 31, 2019, 08:07:32 am »
Original openpilot repo is here : https://github.com/openpilot/OpenPilot

Maybe should consider update current code and made a PR.

Re: uavobjgenerator -java output
« Reply #4 on: February 02, 2019, 06:47:07 pm »
I've got things working reasonably well.  I've successfully deserialized and re-serialized the GCSTelemetryStats object sent by the GCS in UDP mode. I'm now attempting to send those exact bytes to a CC3D via a HID usb serial connection expecting to get some sort of response, but nothing is coming back. Any idea what I'm doing wrong?

I've also looked into the librepilot2go project, looks like they took an entirely different approach by reading the various uavobject XML files at runtime. It's also horribly entangled with the android API, so not ideal for my purposes.

Strangely enough, neither librepilots or the legacy openpilot repos have any references to the missing java imports.

I'd be glad to contribute my implementation back via PR if I can get it working.

Re: uavobjgenerator -java output
« Reply #5 on: February 03, 2019, 08:26:54 pm »
I think there is a serial/usb connectivity issue going on here, as I can access the pilot's serial telemetry via the main port. Not sure why I can't read anything from the USB interface. The GCS has no problem getting data from the FC, but I get nothing.

f5soh

  • *****
  • 4572
    • LibrePilot
Re: uavobjgenerator -java output
« Reply #6 on: February 03, 2019, 10:51:21 pm »
Default GCS connexion uses HID, you may need to configure the USB VCP (Virtual Com Port) with USBTelemetry.

Re: uavobjgenerator -java output
« Reply #7 on: February 03, 2019, 11:02:10 pm »
I'll try that again. Last time I did, I couldn't connect via GCS anymore and ended up having to perform the rescue procedure. Can you have it both ways?

Thank you.

Mark

f5soh

  • *****
  • 4572
    • LibrePilot
Re: uavobjgenerator -java output
« Reply #8 on: February 03, 2019, 11:14:01 pm »
If you use the VCP you should disable de automatic connexion in Options and connect manually GCS to the Com port.

Re: uavobjgenerator -java output
« Reply #9 on: February 04, 2019, 04:34:16 am »
That was it, thank you again.