Commit a88e7546 authored by Susurrus's avatar Susurrus

Merge pull request #768 from Susurrus/del_slugs

Delete outdated and unused (all) SLUGS-autopilot-specific code
parents 95e74729 0309f130
......@@ -269,9 +269,6 @@ FORMS += \
src/ui/QMap3D.ui \
src/ui/QGCWebView.ui \
src/ui/map3D/QGCGoogleEarthView.ui \
src/ui/SlugsDataSensorView.ui \
src/ui/SlugsHilSim.ui \
src/ui/SlugsPadCameraControl.ui \
src/ui/uas/QGCUnconnectedInfoWidget.ui \
src/ui/designer/QGCToolWidget.ui \
src/ui/designer/QGCParamSlider.ui \
......@@ -407,7 +404,6 @@ HEADERS += \
src/ui/QGCParamWidget.h \
src/ui/QGCSensorSettingsWidget.h \
src/ui/linechart/Linecharts.h \
src/uas/SlugsMAV.h \
src/uas/PxQuadMAV.h \
src/uas/ArduPilotMegaMAV.h \
src/uas/senseSoarMAV.h \
......@@ -431,9 +427,6 @@ HEADERS += \
src/comm/QGCMAVLink.h \
src/ui/QGCWebView.h \
src/ui/map3D/QGCWebPage.h \
src/ui/SlugsDataSensorView.h \
src/ui/SlugsHilSim.h \
src/ui/SlugsPadCameraControl.h \
src/ui/QGCMainWindowAPConfigurator.h \
src/comm/MAVLinkSwarmSimulationLink.h \
src/ui/uas/QGCUnconnectedInfoWidget.h \
......@@ -601,7 +594,6 @@ SOURCES += \
src/ui/QGCParamWidget.cc \
src/ui/QGCSensorSettingsWidget.cc \
src/ui/linechart/Linecharts.cc \
src/uas/SlugsMAV.cc \
src/uas/PxQuadMAV.cc \
src/uas/ArduPilotMegaMAV.cc \
src/uas/senseSoarMAV.cpp \
......@@ -624,9 +616,6 @@ SOURCES += \
src/ui/RadioCalibration/RadioCalibrationData.cc \
src/ui/QGCWebView.cc \
src/ui/map3D/QGCWebPage.cc \
src/ui/SlugsDataSensorView.cc \
src/ui/SlugsHilSim.cc \
src/ui/SlugsPadCameraControl.cpp \
src/ui/QGCMainWindowAPConfigurator.cc \
src/comm/MAVLinkSwarmSimulationLink.cc \
src/ui/uas/QGCUnconnectedInfoWidget.cc \
......
......@@ -24,7 +24,6 @@
#include "UASManager.h"
#include "UASInterface.h"
#include "UAS.h"
#include "SlugsMAV.h"
#include "PxQuadMAV.h"
#include "ArduPilotMegaMAV.h"
#include "configuration.h"
......
......@@ -67,20 +67,6 @@ UASInterface* QGCMAVLinkUASFactory::createUAS(MAVLinkProtocol* mavlink, LinkInte
uas = px4;
}
break;
case MAV_AUTOPILOT_SLUGS:
{
SlugsMAV* mav = new SlugsMAV(mavlink, worker, sysid);
// Set the system type
mav->setSystemType((int)heartbeat->type);
// Connect this robot to the UAS object
// it is IMPORTANT here to use the right object type,
// else the slot of the parent object is called (and thus the special
// packets never reach their goal)
connect(mavlink, SIGNAL(messageReceived(LinkInterface*, mavlink_message_t)), mav, SLOT(receiveMessage(LinkInterface*, mavlink_message_t)));
uas = mav;
}
break;
case MAV_AUTOPILOT_ARDUPILOTMEGA:
{
ArduPilotMegaMAV* mav = new ArduPilotMegaMAV(mavlink, worker, sysid);
......
......@@ -10,7 +10,6 @@
// INCLUDE ALL MAV/UAS CLASSES USING MAVLINK
#include "UAS.h"
#include "SlugsMAV.h"
#include "PxQuadMAV.h"
#include "senseSoarMAV.h"
#include "ArduPilotMegaMAV.h"
......
#include "SlugsMAV.h"
#include <QDebug>
SlugsMAV::SlugsMAV(MAVLinkProtocol* mavlink, QThread* thread, int id) :
UAS(mavlink, thread, id)
{
widgetTimer = new QTimer (this);
widgetTimer->setInterval(SLUGS_UPDATE_RATE);
connect (widgetTimer, SIGNAL(timeout()), this, SLOT(emitSignals()));
widgetTimer->start();
memset(&mlRawImuData ,0, sizeof(mavlink_raw_imu_t));// clear all the state structures
#ifdef MAVLINK_ENABLED_SLUGS
memset(&mlGpsData, 0, sizeof(mavlink_gps_raw_t));
memset(&mlCpuLoadData, 0, sizeof(mavlink_cpu_load_t));
memset(&mlAirData, 0, sizeof(mavlink_air_data_t));
memset(&mlSensorBiasData, 0, sizeof(mavlink_sensor_bias_t));
memset(&mlDiagnosticData, 0, sizeof(mavlink_diagnostic_t));
memset(&mlBoot ,0, sizeof(mavlink_boot_t));
memset(&mlGpsDateTime ,0, sizeof(mavlink_gps_date_time_t));
memset(&mlApMode ,0, sizeof(mavlink_set_mode_t));
memset(&mlNavigation ,0, sizeof(mavlink_slugs_navigation_t));
memset(&mlDataLog ,0, sizeof(mavlink_data_log_t));
memset(&mlPassthrough ,0, sizeof(mavlink_ctrl_srfc_pt_t));
memset(&mlActionAck,0, sizeof(mavlink_action_ack_t));
memset(&mlAction ,0, sizeof(mavlink_slugs_action_t));
memset(&mlScaled ,0, sizeof(mavlink_scaled_imu_t));
memset(&mlServo ,0, sizeof(mavlink_servo_output_raw_t));
memset(&mlChannels ,0, sizeof(mavlink_rc_channels_raw_t));
updateRoundRobin = 0;
uasId = id;
#endif
}
/**
* This function is called by MAVLink once a complete, uncorrupted (CRC check valid)
* mavlink packet is received.
*
* @param link Hardware link the message came from (e.g. /dev/ttyUSB0 or UDP port).
* messages can be sent back to the system via this link
* @param message MAVLink message, as received from the MAVLink protocol stack
*/
void SlugsMAV::receiveMessage(LinkInterface* link, mavlink_message_t message)
{
UAS::receiveMessage(link, message);// Let UAS handle the default message set
if (message.sysid == uasId) {
#ifdef MAVLINK_ENABLED_SLUGS// Handle your special messages mavlink_message_t* msg = &message;
switch (message.msgid) {
case MAVLINK_MSG_ID_RAW_IMU:
mavlink_msg_raw_imu_decode(&message, &mlRawImuData);
break;
case MAVLINK_MSG_ID_BOOT:
mavlink_msg_boot_decode(&message,&mlBoot);
emit slugsBootMsg(uasId, mlBoot);
break;
case MAVLINK_MSG_ID_ATTITUDE:
mavlink_msg_attitude_decode(&message, &mlAttitude);
break;
case MAVLINK_MSG_ID_GPS_RAW:
mavlink_msg_gps_raw_decode(&message, &mlGpsData);
break;
case MAVLINK_MSG_ID_CPU_LOAD: //170
mavlink_msg_cpu_load_decode(&message,&mlCpuLoadData);
break;
case MAVLINK_MSG_ID_AIR_DATA: //171
mavlink_msg_air_data_decode(&message,&mlAirData);
break;
case MAVLINK_MSG_ID_SENSOR_BIAS: //172
mavlink_msg_sensor_bias_decode(&message,&mlSensorBiasData);
break;
case MAVLINK_MSG_ID_DIAGNOSTIC: //173
mavlink_msg_diagnostic_decode(&message,&mlDiagnosticData);
break;
case MAVLINK_MSG_ID_SLUGS_NAVIGATION://176
mavlink_msg_slugs_navigation_decode(&message,&mlNavigation);
break;
case MAVLINK_MSG_ID_DATA_LOG: //177
mavlink_msg_data_log_decode(&message,&mlDataLog);
break;
case MAVLINK_MSG_ID_GPS_DATE_TIME: //179
mavlink_msg_gps_date_time_decode(&message,&mlGpsDateTime);
break;
case MAVLINK_MSG_ID_MID_LVL_CMDS: //180
mavlink_msg_mid_lvl_cmds_decode(&message, &mlMidLevelCommands);
break;
case MAVLINK_MSG_ID_CTRL_SRFC_PT: //181
mavlink_msg_ctrl_srfc_pt_decode(&message, &mlPassthrough);
break;
case MAVLINK_MSG_ID_SLUGS_ACTION: //183
mavlink_msg_slugs_action_decode(&message, &mlAction);
break;
case MAVLINK_MSG_ID_SCALED_IMU:
mavlink_msg_scaled_imu_decode(&message, &mlScaled);
break;
case MAVLINK_MSG_ID_SERVO_OUTPUT_RAW:
mavlink_msg_servo_output_raw_decode(&message, &mlServo);
break;
case MAVLINK_MSG_ID_RC_CHANNELS_RAW:
mavlink_msg_rc_channels_raw_decode(&message, &mlChannels);
break;
switch (mlAction.actionId) {
case SLUGS_ACTION_EEPROM:
if (mlAction.actionVal == SLUGS_ACTION_FAIL) {
emit textMessageReceived(message.sysid, message.compid, MAV_SEVERITY_ERROR, "EEPROM Write Fail, Data was not saved in Memory!");
}
break;
case SLUGS_ACTION_PT_CHANGE:
if (mlAction.actionVal == SLUGS_ACTION_SUCCESS) {
emit textMessageReceived(message.sysid, message.compid, MAV_SEVERITY_INFO, "Passthrough Succesfully Changed");
}
break;
case SLUGS_ACTION_MLC_CHANGE:
if (mlAction.actionVal == SLUGS_ACTION_SUCCESS) {
emit textMessageReceived(message.sysid, message.compid, MAV_SEVERITY_INFO, "Mid-level Commands Succesfully Changed");
}
break;
}
//break;
default:
// qDebug() << "\nSLUGS RECEIVED MESSAGE WITH ID" << message.msgid;
break;
}
#endif
}
}
void SlugsMAV::emitSignals (void)
{
#ifdef MAVLINK_ENABLED_SLUGS
switch(updateRoundRobin) {
case 1:
emit slugsCPULoad(uasId, mlCpuLoadData);
emit slugsSensorBias(uasId,mlSensorBiasData);
break;
case 2:
emit slugsAirData(uasId, mlAirData);
emit slugsDiagnostic(uasId,mlDiagnosticData);
break;
case 3:
emit slugsNavegation(uasId, mlNavigation);
emit slugsDataLog(uasId, mlDataLog);
break;
case 4:
emit slugsGPSDateTime(uasId, mlGpsDateTime);
break;
case 5:
emit slugsActionAck(uasId,mlActionAck);
emit emitGpsSignals();
break;
case 6:
emit slugsChannels(uasId, mlChannels);
emit slugsServo(uasId, mlServo);
emit slugsScaled(uasId, mlScaled);
break;
}
emit slugsAttitude(uasId, mlAttitude);
emit attitudeChanged(this,
mlAttitude.roll,
mlAttitude.pitch,
mlAttitude.yaw,
0.0);
#endif
emit slugsRawImu(uasId, mlRawImuData);
// wrap around
updateRoundRobin = updateRoundRobin > 10? 1: updateRoundRobin + 1;
}
#ifdef MAVLINK_ENABLED_SLUGS
void SlugsMAV::emitGpsSignals (void)
{
// qDebug()<<"After Emit GPS Signal"<<mlGpsData.fix_type;
//ToDo Uncomment if. it was comment only to test
// if (mlGpsData.fix_type > 0){
emit globalPositionChanged(this,
mlGpsData.lon,
mlGpsData.lat,
mlGpsData.alt,
0.0);
emit slugsGPSCogSog(uasId,mlGpsData.hdg, mlGpsData.v);
}
#endif // MAVLINK_ENABLED_SLUGS
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
#ifndef SLUGSMAV_H
#define SLUGSMAV_H
#include "UAS.h"
#include "mavlink.h"
#include <QTimer>
#define SLUGS_UPDATE_RATE 200 // in ms
class SlugsMAV : public UAS
{
Q_OBJECT
Q_INTERFACES(UASInterface)
enum SLUGS_ACTION {
SLUGS_ACTION_NONE,
SLUGS_ACTION_SUCCESS,
SLUGS_ACTION_FAIL,
SLUGS_ACTION_EEPROM,
SLUGS_ACTION_MODE_CHANGE,
SLUGS_ACTION_MODE_REPORT,
SLUGS_ACTION_PT_CHANGE,
SLUGS_ACTION_PT_REPORT,
SLUGS_ACTION_PID_CHANGE,
SLUGS_ACTION_PID_REPORT,
SLUGS_ACTION_WP_CHANGE,
SLUGS_ACTION_WP_REPORT,
SLUGS_ACTION_MLC_CHANGE,
SLUGS_ACTION_MLC_REPORT
};
public:
SlugsMAV(MAVLinkProtocol* mavlink, QThread* thread, int id = 0);
public slots:
/** @brief Receive a MAVLink message from this MAV */
void receiveMessage(LinkInterface* link, mavlink_message_t message);
void emitSignals (void);
signals:
void slugsRawImu(int uasId, const mavlink_raw_imu_t& rawData);
void slugsGPSCogSog(int uasId, double cog, double sog);
#ifdef MAVLINK_ENABLED_SLUGS
void slugsCPULoad(int systemId, const mavlink_cpu_load_t& cpuLoad);
void slugsAirData(int systemId, const mavlink_air_data_t& airData);
void slugsSensorBias(int systemId, const mavlink_sensor_bias_t& sensorBias);
void slugsDiagnostic(int systemId, const mavlink_diagnostic_t& diagnostic);
void slugsNavegation(int systemId, const mavlink_slugs_navigation_t& slugsNavigation);
void slugsDataLog(int systemId, const mavlink_data_log_t& dataLog);
void slugsGPSDateTime(int systemId, const mavlink_gps_date_time_t& gpsDateTime);
void slugsActionAck(int systemId, const mavlink_action_ack_t& actionAck);
void slugsBootMsg(int uasId, mavlink_boot_t& boot);
void slugsAttitude(int uasId, mavlink_attitude_t& attitude);
void slugsScaled(int uasId, const mavlink_scaled_imu_t& scaled);
void slugsServo(int uasId, const mavlink_servo_output_raw_t& servo);
void slugsChannels(int uasId, const mavlink_rc_channels_raw_t& channels);
#endif
protected:
unsigned char updateRoundRobin;
QTimer* widgetTimer;
mavlink_raw_imu_t mlRawImuData;
#ifdef MAVLINK_ENABLED_SLUGS
mavlink_gps_raw_t mlGpsData;
mavlink_attitude_t mlAttitude;
mavlink_cpu_load_t mlCpuLoadData;
mavlink_air_data_t mlAirData;
mavlink_sensor_bias_t mlSensorBiasData;
mavlink_diagnostic_t mlDiagnosticData;
mavlink_boot_t mlBoot;
mavlink_gps_date_time_t mlGpsDateTime;
mavlink_mid_lvl_cmds_t mlMidLevelCommands;
mavlink_set_mode_t mlApMode;
mavlink_slugs_navigation_t mlNavigation;
mavlink_data_log_t mlDataLog;
mavlink_ctrl_srfc_pt_t mlPassthrough;
mavlink_action_ack_t mlActionAck;
mavlink_slugs_action_t mlAction;
mavlink_scaled_imu_t mlScaled;
mavlink_servo_output_raw_t mlServo;
mavlink_rc_channels_raw_t mlChannels;
// Standart messages MAVLINK used by SLUGS
private:
void emitGpsSignals (void);
void emitPidSignal(void);
int uasId;
#endif // if SLUGS
};
#endif // SLUGSMAV_H
......@@ -85,7 +85,6 @@ This file is part of the QGROUNDCONTROL project
// FIXME Move
#include "PxQuadMAV.h"
#include "SlugsMAV.h"
#include "LogCompressor.h"
......
......@@ -65,12 +65,8 @@ This file is part of the QGROUNDCONTROL project
#include "QGCGoogleEarthView.h"
#endif
#include "QGCToolBar.h"
#include "SlugsDataSensorView.h"
#include "LogCompressor.h"
#include "SlugsHilSim.h"
#include "SlugsPadCameraControl.h"
#include "UASControlParameters.h"
#include "QGCMAVLinkInspector.h"
#include "QGCMAVLinkLogPlayer.h"
......@@ -463,9 +459,6 @@ protected:
QPointer<QDockWidget> hsiDockWidget;
QPointer<QDockWidget> rcViewDockWidget;
QPointer<QDockWidget> hudDockWidget;
QPointer<QDockWidget> slugsDataWidget;
QPointer<QDockWidget> slugsHilSimWidget;
QPointer<QDockWidget> slugsCamControlWidget;
QPointer<QGCToolBar> toolBar;
QPointer<QGCStatusBar> customStatusBar;
......
This diff is collapsed.
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Grpahical presentation of SLUGS generated data
*
* @author Juan F. Robles <jfroblesc@gmail.com>
*
*/
#ifndef SLUGSDATASENSORVIEW_H
#define SLUGSDATASENSORVIEW_H
#include <QWidget>
#include "UASInterface.h"
#include "SlugsMAV.h"
#include "mavlink.h"
namespace Ui
{
class SlugsDataSensorView;
}
class SlugsDataSensorView : public QWidget
{
Q_OBJECT
public:
explicit SlugsDataSensorView(QWidget *parent = 0);
~SlugsDataSensorView();
public slots:
/**
* @brief Adds the UAS for data display
*
* Adds the UAS and makes all the correct connections for data display on the Widgets. If
* there is no current UAS active, it sets it as active.
* @param uas The UAS being added
*/
void addUAS(UASInterface* uas);
/**
* @brief Sets the UAS as active
*
* @param uas The UAS being set as active
*/
void setActiveUAS(UASInterface* uas);
/**
* @brief Updates the Raw Data widget
*/
void slugRawDataChanged (int uasId, const mavlink_raw_imu_t& rawData);
#ifdef MAVLINK_ENABLED_SLUGS
/**
* @brief Adds the UAS for data display
*
* Adds the UAS and makes all the correct connections for data display on the Widgets
*/
void slugLocalPositionChanged(UASInterface* uas,
double x,
double y,
double z,
quint64 time);
/**
* @brief Adds the UAS for data display
*
* Adds the UAS and makes all the correct connections for data display on the Widgets
*/
void slugSpeedLocalPositionChanged(UASInterface* uas,
double vx,
double vy,
double vz,
quint64 time);
/**
* @brief Adds the UAS for data display
*
* Adds the UAS and makes all the correct connections for data display on the Widgets
*/
void slugAttitudeChanged(UASInterface* uas,
double slugroll,
double slugpitch,
double slugyaw,
quint64 time);
/**
* @brief Adds the UAS for data display
*
* Adds the UAS and makes all the correct connections for data display on the Widgets
*/
void slugsGlobalPositionChanged(UASInterface* uas,
double lat,
double lon,
double alt,
quint64 time);
/**
* @brief set COG and SOG values
*
* COG and SOG GPS display on the Widgets
*/
void slugsGPSCogSog(int systemId,
double cog,
double sog);
/**
* @brief Updates the CPU load widget - 170
*/
void slugsCpuLoadChanged(int systemId,
const mavlink_cpu_load_t& cpuLoad);
/**
* @brief Updates the air data widget - 171
*/
void slugsAirDataChanged(int systemId,
const mavlink_air_data_t& airData);
/**
* @brief Updates the sensor bias widget - 172
*/
void slugsSensorBiasChanged(int systemId,
const mavlink_sensor_bias_t& sensorBias);
/**
* @brief Updates the diagnostic widget - 173
*/
void slugsDiagnosticMessageChanged(int systemId,
const mavlink_diagnostic_t& diagnostic);
/**
* @brief Updates the Navigation widget - 176
*/
void slugsNavegationChanged(int systemId,
const mavlink_slugs_navigation_t& slugsNavigation);
/**
* @brief Updates the Data Log widget - 177
*/
void slugsDataLogChanged(int systemId,
const mavlink_data_log_t& dataLog);
// /**
// * @brief Updates the PWM Commands widget - 175
// */
// void slugsPWMChanged(int systemId,
// const mavlink_servo_output_raw_t& pwmCommands);
/**
* @brief Updates the filtered sensor measurements widget - 178
*/
void slugsFilteredDataChanged(int systemId,
const mavlink_scaled_imu_t& filteredData);
/**
* @brief Updates the gps Date Time widget - 179
*/
void slugsGPSDateTimeChanged(int systemId,
const mavlink_gps_date_time_t& gpsDateTime);
void slugsRCRawChannels(int systemId,
const mavlink_rc_channels_raw_t& gpsDateTime);
void slugsRCServo(int systemId,
const mavlink_servo_output_raw_t& gpsDateTime);
#endif // MAVLINK_ENABLED_SLUGS
protected:
UASInterface* activeUAS;
private:
Ui::SlugsDataSensorView *ui;
};
#endif // SLUGSDATASENSORVIEW_H
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Definition of the configuration Window for Slugs' HIL Simulator
* @author Mariano Lizarraga <malife@gmail.com>
*/
#ifndef SLUGSHILSIM_H
#define SLUGSHILSIM_H
#include <stdint.h>
#include <QWidget>
#include <QHostAddress>
#include <QUdpSocket>
#include <QMessageBox>
#include <QByteArray>
#include "LinkInterface.h"
#include "UAS.h"