Commit fc442534 authored by Lorenz Meier's avatar Lorenz Meier

Added support for fine-granularity sensor status

parent fd950f54
......@@ -475,6 +475,7 @@ signals:
void imageDataReceived(int imgid, const unsigned char* imageData, int length, int startIndex);
/** @brief Emit the new system type */
void systemTypeSet(UASInterface* uas, unsigned int type);
/** @brief Attitude control enabled/disabled */
void attitudeControlEnabled(bool enabled);
/** @brief Position 2D control enabled/disabled */
......@@ -483,6 +484,30 @@ signals:
void positionZControlEnabled(bool enabled);
/** @brief Heading control enabled/disabled */
void positionYawControlEnabled(bool enabled);
/** @brief Optical flow status changed */
void opticalFlowStatusChanged(bool supported, bool enabled, bool ok);
/** @brief Vision based localization status changed */
void visionLocalizationStatusChanged(bool supported, bool enabled, bool ok);
/** @brief Infrared / Ultrasound status changed */
void distanceSensorStatusChanged(bool supported, bool enabled, bool ok);
/** @brief Gyroscope status changed */
void gyroStatusChanged(bool supported, bool enabled, bool ok);
/** @brief Accelerometer status changed */
void accelStatusChanged(bool supported, bool enabled, bool ok);
/** @brief Magnetometer status changed */
void magSensorStatusChanged(bool supported, bool enabled, bool ok);
/** @brief Barometer status changed */
void baroStatusChanged(bool supported, bool enabled, bool ok);
/** @brief Differential pressure / airspeed status changed */
void airspeedStatusChanged(bool supported, bool enabled, bool ok);
/** @brief Actuator status changed */
void actuatorStatusChanged(bool supported, bool enabled, bool ok);
/** @brief Laser scanner status changed */
void laserStatusChanged(bool supported, bool enabled, bool ok);
/** @brief Vicon / Leica Geotracker status changed */
void groundTruthSensorStatusChanged(bool supported, bool enabled, bool ok);
/** @brief Value of a remote control channel (raw) */
void remoteControlChannelRawChanged(int channelId, float raw);
/** @brief Value of a remote control channel (scaled)*/
......
......@@ -123,7 +123,34 @@ HSIDisplay::HSIDisplay(QWidget *parent) :
userSetPointSet(false),
userXYSetPointSet(false),
userZSetPointSet(false),
userYawSetPointSet(false)
userYawSetPointSet(false),
gyroKnown(false),
gyroON(false),
gyroOK(false),
accelKnown(false),
accelON(false),
accelOK(false),
magKnown(false),
magON(false),
magOK(false),
pressureKnown(false),
pressureON(false),
pressureOK(false),
diffPressureKnown(false),
diffPressureON(false),
diffPressureOK(false),
flowKnown(false),
flowON(false),
flowOK(false),
laserKnown(false),
laserON(false),
laserOK(false),
viconKnown(false),
viconON(false),
viconOK(false),
actuatorsKnown(false),
actuatorsON(false),
actuatorsOK(false)
{
refreshTimer->setInterval(updateInterval);
......@@ -845,6 +872,16 @@ void HSIDisplay::setActiveUAS(UASInterface* uas)
disconnect(this->uas, SIGNAL(gpsLocalizationChanged(UASInterface*,int)), this, SLOT(updateGpsLocalization(UASInterface*,int)));
disconnect(this->uas, SIGNAL(irUltraSoundLocalizationChanged(UASInterface*,int)), this, SLOT(updateInfraredUltrasoundLocalization(UASInterface*,int)));
disconnect(this->uas, SIGNAL(objectDetected(uint,int,int,QString,int,float,float)), this, SLOT(updateObjectPosition(uint,int,int,QString,int,float,float)));
disconnect(this->uas, SIGNAL(gyroStatusChanged(bool,bool,bool)), this, SLOT(updateGyroStatus(bool,bool,bool)));
disconnect(this->uas, SIGNAL(accelStatusChanged(bool,bool,bool)), this, SLOT(updateAccelStatus(bool,bool,bool)));
disconnect(this->uas, SIGNAL(magSensorStatusChanged(bool,bool,bool)), this, SLOT(updateMagSensorStatus(bool,bool,bool)));
disconnect(this->uas, SIGNAL(baroStatusChanged(bool,bool,bool)), this, SLOT(updateBaroStatus(bool,bool,bool)));
disconnect(this->uas, SIGNAL(airspeedStatusChanged(bool,bool,bool)), this, SLOT(updateAirspeedStatus(bool,bool,bool)));
disconnect(this->uas, SIGNAL(opticalFlowStatusChanged(bool,bool,bool)), this, SLOT(updateOpticalFlowStatus(bool,bool,bool)));
disconnect(this->uas, SIGNAL(laserStatusChanged(bool,bool,bool)), this, SLOT(updateLaserStatus(bool,bool,bool)));
disconnect(this->uas, SIGNAL(groundTruthSensorStatusChanged(bool,bool,bool)), this, SLOT(updateGroundTruthSensorStatus(bool,bool,bool)));
disconnect(this->uas, SIGNAL(actuatorStatusChanged(bool,bool,bool)), this, SLOT(updateActuatorStatus(bool,bool,bool)));
}
connect(uas, SIGNAL(gpsSatelliteStatusChanged(int,int,float,float,float,bool)), this, SLOT(updateSatellite(int,int,float,float,float,bool)));
......@@ -867,6 +904,16 @@ void HSIDisplay::setActiveUAS(UASInterface* uas)
connect(uas, SIGNAL(irUltraSoundLocalizationChanged(UASInterface*,int)), this, SLOT(updateInfraredUltrasoundLocalization(UASInterface*,int)));
connect(uas, SIGNAL(objectDetected(uint,int,int,QString,int,float,float)), this, SLOT(updateObjectPosition(uint,int,int,QString,int,float,float)));
connect(uas, SIGNAL(gyroStatusChanged(bool,bool,bool)), this, SLOT(updateGyroStatus(bool,bool,bool)));
connect(uas, SIGNAL(accelStatusChanged(bool,bool,bool)), this, SLOT(updateAccelStatus(bool,bool,bool)));
connect(uas, SIGNAL(magSensorStatusChanged(bool,bool,bool)), this, SLOT(updateMagSensorStatus(bool,bool,bool)));
connect(uas, SIGNAL(baroStatusChanged(bool,bool,bool)), this, SLOT(updateBaroStatus(bool,bool,bool)));
connect(uas, SIGNAL(airspeedStatusChanged(bool,bool,bool)), this, SLOT(updateAirspeedStatus(bool,bool,bool)));
connect(uas, SIGNAL(opticalFlowStatusChanged(bool,bool,bool)), this, SLOT(updateOpticalFlowStatus(bool,bool,bool)));
connect(uas, SIGNAL(laserStatusChanged(bool,bool,bool)), this, SLOT(updateLaserStatus(bool,bool,bool)));
connect(uas, SIGNAL(groundTruthSensorStatusChanged(bool,bool,bool)), this, SLOT(updateGroundTruthSensorStatus(bool,bool,bool)));
connect(uas, SIGNAL(actuatorStatusChanged(bool,bool,bool)), this, SLOT(updateActuatorStatus(bool,bool,bool)));
this->uas = uas;
resetMAVState();
......
......@@ -66,6 +66,83 @@ public slots:
void updateAttitudeControllerEnabled(bool enabled);
void updatePositionXYControllerEnabled(bool enabled);
void updatePositionZControllerEnabled(bool enabled);
/** @brief Optical flow status changed */
void updateOpticalFlowStatus(bool supported, bool enabled, bool ok) {
if (supported && enabled && ok) {
visionFix = true;
} else {
visionFix = false;
}
}
/** @brief Vision based localization status changed */
void updateVisionLocalizationStatus(bool supported, bool enabled, bool ok) {
if (enabled && ok) {
visionFix = true;
} else {
visionFix = false;
}
visionFixKnown = supported;
}
/** @brief Infrared / Ultrasound status changed */
void updateDistanceSensorStatus(bool supported, bool enabled, bool ok) {
if (enabled && ok) {
iruFix = true;
} else {
iruFix = false;
}
iruFixKnown = supported;
}
/** @brief Gyroscope status changed */
void updateGyroStatus(bool supported, bool enabled, bool ok) {
gyroKnown = supported;
gyroON = enabled;
gyroOK = ok;
}
/** @brief Accelerometer status changed */
void updateAccelStatus(bool supported, bool enabled, bool ok) {
accelKnown = supported;
accelON = enabled;
accelOK = ok;
}
/** @brief Magnetometer status changed */
void updateMagSensorStatus(bool supported, bool enabled, bool ok) {
magKnown = supported;
magON = enabled;
magOK = ok;
}
/** @brief Barometer status changed */
void updateBaroStatus(bool supported, bool enabled, bool ok) {
pressureKnown = supported;
pressureON = enabled;
pressureOK = ok;
}
/** @brief Differential pressure / airspeed status changed */
void updateAirspeedStatus(bool supported, bool enabled, bool ok) {
diffPressureKnown = supported;
diffPressureON = enabled;
diffPressureOK = ok;
}
/** @brief Actuator status changed */
void updateActuatorStatus(bool supported, bool enabled, bool ok) {
actuatorsKnown = supported;
actuatorsON = enabled;
actuatorsOK = ok;
}
/** @brief Laser scanner status changed */
void updateLaserStatus(bool supported, bool enabled, bool ok) {
laserKnown = supported;
laserON = enabled;
laserOK = ok;
}
/** @brief Vicon / Leica Geotracker status changed */
void updateGroundTruthSensorStatus(bool supported, bool enabled, bool ok) {
viconKnown = supported;
viconON = enabled;
viconOK = ok;
}
void updateObjectPosition(unsigned int time, int id, int type, const QString& name, int quality, float bearing, float distance);
/** @brief Heading control enabled/disabled */
void updatePositionYawControllerEnabled(bool enabled);
......
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