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