Commit 957f1e05 authored by pixhawk's avatar pixhawk

changed the handler of WAYPOINT_SET_CURRENT to handle WAYPOINT_CURRENT messages as it was meant to

parent 00fcf547
......@@ -467,11 +467,11 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
}
break;
case MAVLINK_MSG_ID_WAYPOINT_SET_CURRENT:
case MAVLINK_MSG_ID_WAYPOINT_CURRENT:
{
mavlink_waypoint_set_current_t wpsc;
mavlink_msg_waypoint_set_current_decode(&message, &wpsc);
waypointManager.handleWaypointSetCurrent(message.sysid, message.compid, &wpsc);
mavlink_waypoint_current_t wpc;
mavlink_msg_waypoint_current_decode(&message, &wpc);
waypointManager.handleWaypointCurrent(message.sysid, message.compid, &wpc);
}
break;
......
......@@ -176,12 +176,12 @@ void UASWaypointManager::handleWaypointReached(quint8 systemId, quint8 compId, m
}
}
void UASWaypointManager::handleWaypointSetCurrent(quint8 systemId, quint8 compId, mavlink_waypoint_set_current_t *wpr)
void UASWaypointManager::handleWaypointCurrent(quint8 systemId, quint8 compId, mavlink_waypoint_current_t *wpc)
{
if (systemId == uas.getUASID() && compId == MAV_COMP_ID_WAYPOINTPLANNER)
{
qDebug() << "new current waypoint" << wpr->seq;
emit currentWaypointChanged(wpr->seq);
qDebug() << "new current waypoint" << wpc->seq;
emit currentWaypointChanged(wpc->seq);
}
}
......
......@@ -71,7 +71,7 @@ public:
void handleWaypointAck(quint8 systemId, quint8 compId, mavlink_waypoint_ack_t *wpa); ///< Handles received waypoint ack messages
void handleWaypointRequest(quint8 systemId, quint8 compId, mavlink_waypoint_request_t *wpr); ///< Handles received waypoint request messages
void handleWaypointReached(quint8 systemId, quint8 compId, mavlink_waypoint_reached_t *wpr); ///< Handles received waypoint reached messages
void handleWaypointSetCurrent(quint8 systemId, quint8 compId, mavlink_waypoint_set_current_t *wpr); ///< Handles received set current waypoint messages
void handleWaypointCurrent(quint8 systemId, quint8 compId, mavlink_waypoint_current_t *wpc); ///< Handles received set current waypoint messages
/*@}*/
QVector<Waypoint *> &getWaypointList(void) { return waypoints; } ///< Returns a reference to the local waypoint list. Gives full access to the internal data structure - Subject to change: Public const access and friend access for the waypoint list widget.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment