From 889a8064b1d5f417dbc1046e79a51c413eed4845 Mon Sep 17 00:00:00 2001 From: pixhawk Date: Sun, 31 Oct 2010 19:05:13 +0100 Subject: [PATCH] Working on new point of interest (P(POI) visualization in 3D and 2D views --- src/uas/UAS.cc | 16 ++++++++++++++++ src/uas/UASInterface.h | 4 ++++ 2 files changed, 20 insertions(+) diff --git a/src/uas/UAS.cc b/src/uas/UAS.cc index 570f39c967..347244ea1b 100644 --- a/src/uas/UAS.cc +++ b/src/uas/UAS.cc @@ -556,6 +556,22 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) emit textMessageReceived(uasId, message.compid, severity, text); } break; +#ifdef MAVLINK_ENABLED_PIXHAWK + case MAVLINK_MSG_ID_POINT_OF_INTEREST: + { + mavlink_point_of_interest_t poi; + mavlink_msg_point_of_interest_decode(&message, &poi); + emit poiFound(this, poi.type, poi.color, QString((QChar*)poi.name, MAVLINK_MSG_POINT_OF_INTEREST_FIELD_NAME_LEN), poi.x, poi.y, poi.z); + } + break; + case MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION: + { + mavlink_point_of_interest_connection_t poi; + mavlink_msg_point_of_interest_connection_decode(&message, &poi); + emit poiConnectionFound(this, poi.type, poi.color, QString((QChar*)poi.name, MAVLINK_MSG_POINT_OF_INTEREST_CONNECTION_FIELD_NAME_LEN), poi.x1, poi.y1, poi.z1, poi.x2, poi.y2, poi.z2); + } + break; +#endif #ifdef MAVLINK_ENABLED_UALBERTA case MAVLINK_MSG_ID_NAV_FILTER_BIAS: { diff --git a/src/uas/UASInterface.h b/src/uas/UASInterface.h index 7141405745..d112989501 100644 --- a/src/uas/UASInterface.h +++ b/src/uas/UASInterface.h @@ -258,6 +258,10 @@ signals: * @param text the status text * @param severity The severity of the message, 0 for plain debug messages, 10 for very critical messages */ + + void poiFound(UASInterface* uas, int type, int colorIndex, QString message, float x, float y, float z); + void poiConnectionFound(UASInterface* uas, int type, int colorIndex, QString message, float x1, float y1, float z1, float x2, float y2, float z2); + void textMessageReceived(int uasid, int componentid, int severity, QString text); /** * @brief Update the error count of a device -- GitLab