Hello,

I am trying to communicate with GCS over UAVTalk protocol, my main purpose is to receive the waypoints from GCS's path planner, Using a serial link, I tried to read data from GCS while waypoints are send from GCS. The object id of the message seems to be 0xd23852dc and I really don't know how the protocol deals with the Waypoint send and receive from and to GCS from a UAV. Kindly help me with this and I could not find any documentation in the Librepilot website, I had seen that the code for dealing with waypoints in GCS is inside modeluavoproxy.cpp as follows:

    // send PathPlan
    bool success = (updateHelper.doObjectAndWait(pathPlan) == UAVObjectUpdaterHelper::SUCCESS);
    progress.setValue(1);

    if (success) {
        // send Waypoint instances
        qDebug() << "sending" << waypointCount << "waypoints";
        for (int i = 0; i < waypointCount; ++i) {
            Waypoint *waypoint = Waypoint::GetInstance(objMngr, i);
            success = (updateHelper.doObjectAndWait(waypoint) == UAVObjectUpdaterHelper::SUCCESS);
            if (!success) {
                break;
            }
            progress.setValue(progress.value() + 1);
        }
    }

    if (success) {
        // send PathAction instances
        qDebug() << "sending" << actionCount << "path actions";
        for (int i = 0; i < actionCount; ++i) {
            PathAction *action = PathAction::GetInstance(objMngr, i);
            success = (updateHelper.doObjectAndWait(action) == UAVObjectUpdaterHelper::SUCCESS);
            if (!success) {
                break;
            }
            progress.setValue(progress.value() + 1);
        }
    }

    qDebug() << "ModelUavoProxy::pathPlanSent - completed" << success;
    if (!success) {
        QMessageBox::critical(NULL, tr("Sending Path Plan Failed!"), tr("Failed to send the path plan to the board."));
    }

    progress.close();


I cannot find the behavior of updateHelper.doObjectAndWait(waypoint) and I suppose that this will finally call the abstract implementation in each UAVObject. I have not setup QT development environment for GCS and don't have a UAVGenerator tool build for my system, though the time is very much limited for me to do a QT setup for this work. Kindly someone help me to rule out the waypoint communication protocol between GCS and UAV. Now I am able to receive a single waypoint, but for more than one the send fails from second onwards. I will just send an ack back from my microcontroller once on receiving 0xd23852dc message. But I think, I need to do something more from the second message onwards. Thanks in advance.

Regards
Jithu

f5soh

  • *****
  • 4572
    • LibrePilot
Hi, welcome.

Sadly all is not documented.
Did you see this pages ?
https://librepilot.atlassian.net/wiki/display/LPDOC/Architecture

I have not setup QT development environment for GCS and don't have a UAVGenerator tool build for my system, though the time is very much limited for me to do a QT setup for this work.

If you build something about firmware or Gcs, uavobject genererator is the first task done.
Howto setup a build env and build is documented for win, linux and osx.
https://librepilot.atlassian.net/wiki/display/LPDOC/Developer+Manual


@marc

  • *
  • 152
  • Ask me about LibrePilot2Go on Android.

Hello,

Thanks for the response. I just had implemented a state machine for the purpose of communicating with the GCS over serial link, means I had connected my controller to my laptop, where GCS is up and running. I established a telemetry link with the GCS by going through the Handshake, Handshake ACK objects exchange. (Successfully received "connected message from the GCS") Now my controller waits for the way-point object and once when the GCS initiates a "send to UAV", then on the controller end, I received first way-point, then the second one, but after which the sending fails in GCS. I need to know the different states or the protocol phases when exchanging the way-point sequence. I know, that just receiving the waypoint objects on the controller side is not enough for the successful exchange of them in between. Kindly someone, if already aware about this, please educate me the steps in receiving them properly, thanks in advance :)

Regards
Jithu

Hi f5soh,

Hello, I had already gone through the documentation and let me see, if I could setup a build locally in my system, thanks anyway, but please share with me if you have any extra piece of documentation or information regarding way-point sequencing in UAVTalk protocol. Thanks again :)

Regards
Jithu

f5soh

  • *****
  • 4572
    • LibrePilot
Personally i don't have any extra documentation about this.

What do you want to do exactly ?

I need to study the UAVTalk protocol and implement a small module, which successfully communicates with the GCS and receives a set of waypoint list, when I press the "Send to UAV" button in the path planner module. I need to receive the waypoint objects and unpack it and read the values from inside it, so I think, I have to go through the build to know more of it, and the way it happens, right? :)

filnet

  • *****
  • 113
You could use the new streamingplugin to tap into the uavtalk stream (but in read only mode).
It is probably simpler as it pushes uavo as json objects.

There is also a doc somewhere that describes waypoint and pathplan object structure but can't find it.

And there is this doc : https://librepilot.atlassian.net/wiki/display/LPDOC/UavTalk

So it sounds like you have your own FC firmware and you want to use the LP GCS to send a set of waypoints to your firmware?

As I recall, the waypoint data must be acknowledged.  WIthout acks, it will only send the first one or two?  This acknowledgement is turned on by default in the GCS UAVO metadata.  GCS -> System ... Click the eyeball at the top of the screen and enable "Show Metadata", then go down to "Data Objects" -> Waypoint and expand it.  Expand Metadata -> Modes.

You probably want to leave acks turned on, but implement them in your FC code.  Sorry, I don't know more about acks without reading the code.  :)

The default for these acks are set in the xml file shared/uavobjectdefinition/waypoint.xml

Yeah, I was sending back the ACK response from FC, whenever I receive a WAYPOINT message, but of no use, I suppose!

Maneke

  • *
  • 24
Hi jithum77
Did you find the way to send your waypoints with UAVO ?