Commit 0d757aae authored by lm's avatar lm

Merge branch 'master' of git@pixhawk.ethz.ch:qgroundcontrol

parents 6e8f316a dc492f13
# Onboard parameters for system MAV 042
#
# MAV ID COMPONENT ID PARAM NAME VALUE (FLOAT)
42 200 ACC_NAV_OFFS_X 0
42 200 ACC_NAV_OFFS_Y 0
42 200 ACC_NAV_OFFS_Z -1000
42 200 ACC_OFFSET_X 0
42 200 ACC_OFFSET_Y 0
42 200 ACC_OFFSET_Z 0
42 200 ATT_KAL_IYAW 1
42 200 ATT_KAL_KACC 0.0033
42 200 ATT_OFFSET_X 0
42 200 ATT_OFFSET_Y 0
42 200 ATT_OFFSET_Z -0.08
42 200 CAM_EXP 1000
42 200 CAM_INTERVAL 36000
42 200 DEBUG_1 0
42 200 DEBUG_2 0
42 200 DEBUG_3 0
42 200 DEBUG_4 0
42 200 DEBUG_5 0
42 200 DEBUG_6 0
42 200 GYRO_OFFSET_X 29760
42 200 GYRO_OFFSET_Y 29860
42 200 GYRO_OFFSET_Z 29877
42 200 MIX_OFFSET 0
42 200 MIX_POSITION 0
42 200 MIX_POS_YAW 0
42 200 MIX_REMOTE 0
42 200 MIX_Z_POSITION 0
42 200 PID_ATT_AWU 0.3
42 200 PID_ATT_D 30
42 200 PID_ATT_I 60
42 200 PID_ATT_P 90
42 200 PID_POS_AWU 5
42 200 PID_POS_D 2
42 200 PID_POS_I 0.4
42 200 PID_POS_P 1.8
42 200 PID_POS_Z_AWU 3
42 200 PID_POS_Z_D 0.2
42 200 PID_POS_Z_I 0.4
42 200 PID_POS_Z_LIM 0.3
42 200 PID_POS_Z_P 0.5
42 200 PID_YAWPOS_AWU 1
42 200 PID_YAWPOS_D 1
42 200 PID_YAWPOS_I 0.1
42 200 PID_YAWPOS_P 5
42 200 PID_YAWSPEED_D 0
42 200 PID_YAWSPEED_I 10
42 200 PID_YAWSPEED_P 30
42 200 PID_YAWSPE_AWU 1
42 200 POS_SP_ACCEPT 1
42 200 POS_SP_X 3.1
42 200 POS_SP_Y 3
42 200 POS_SP_YAW 0
42 200 POS_SP_Z -0.7
42 200 POS_TIMEOUT 2e+06
42 200 RC_NICK_CHAN 1
42 200 RC_ROLL_CHAN 2
42 200 RC_SAFETY_CHAN 5
42 200 RC_THRUST_CHAN 3
42 200 RC_TRIM_CHAN 0
42 200 RC_TUNE_CHAN1 7
42 200 RC_TUNE_CHAN2 5
42 200 RC_TUNE_CHAN3 6
42 200 RC_TUNE_CHAN4 8
42 200 RC_YAW_CHAN 4
42 200 SEND_DEBUGCHAN 0
42 200 SLOT_ATTITUDE 0
42 200 SLOT_CONTROL 0
42 200 SLOT_RAW_IMU 0
42 200 SLOT_RC 0
42 200 SYS_COMP_ID 200
42 200 SYS_ID 42
42 200 SYS_IMU_RESET 0
42 200 SYS_SW_VER 2001
42 200 SYS_TYPE 2
42 200 UART_0_BAUD 115200
42 200 UART_1_BAUD 57600
42 200 VEL_DAMP 0.95
42 200 VEL_OFFSET_X 0
42 200 VEL_OFFSET_Y 0
42 200 VEL_OFFSET_Z 0
42 200 VIS_OUTL_TRESH 0.2
42 200 VIS_YAWCORR 0
......@@ -298,11 +298,11 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
emit valueChanged(uasId, "x", pos.x, time);
emit valueChanged(uasId, "y", pos.y, time);
emit valueChanged(uasId, "z", pos.z, time);
emit valueChanged(uasId, "vx", pos.vx, time);
emit valueChanged(uasId, "vy", pos.vy, time);
emit valueChanged(uasId, "vz", pos.vz, time);
emit valueChanged(uasId, "roll", pos.roll, time);
emit valueChanged(uasId, "pitch", pos.pitch, time);
emit valueChanged(uasId, "yaw", pos.yaw, time);
emit localPositionChanged(this, pos.x, pos.y, pos.z, time);
emit speedChanged(this, pos.vx, pos.vy, pos.vz, time);
emit speedChanged(this, pos.roll, pos.pitch, pos.yaw, time);
// Set internal state
if (!positionLock)
{
......
......@@ -340,6 +340,11 @@ signals:
* @param fix 0: lost, 1: 2D local position hold, 2: 2D localization, 3: 3D localization
*/
void visionLocalizationChanged(UASInterface* uas, int fix);
/**
* @brief IR/U localization quality changed
* @param fix 0: No IR/Ultrasound sensor, N > 0: Found N active sensors
*/
void irUltraSoundLocalizationChanged(UASInterface* uas, int fix);
};
Q_DECLARE_INTERFACE(UASInterface, "org.qgroundcontrol/1.0");
......
......@@ -145,6 +145,7 @@ void HSIDisplay::paintDisplay()
drawPositionLock(2, 5, tr("POS"), positionFix, painter);
drawPositionLock(22, 5, tr("VIS"), visionFix, painter);
drawPositionLock(44, 5, tr("GPS"), gpsFix, painter);
drawPositionLock(66, 5, tr("IRU"), iruFix, painter);
// Draw base instrument
......@@ -422,6 +423,7 @@ void HSIDisplay::setActiveUAS(UASInterface* uas)
connect(uas, SIGNAL(localizationChanged(UASInterface*,int)), this, SLOT(updateLocalization(UASInterface*,int)));
connect(uas, SIGNAL(visionLocalizationChanged(UASInterface*,int)), this, SLOT(updateVisionLocalization(UASInterface*,int)));
connect(uas, SIGNAL(gpsLocalizationChanged(UASInterface*,int)), this, SLOT(updateGpsLocalization(UASInterface*,int)));
connect(uas, SIGNAL(irUltraSoundLocalizationChanged(UASInterface*,int)), this, SLOT(updateInfraredUltrasoundLocalization(UASInterface*,int)));
// Now connect the new UAS
......@@ -569,6 +571,15 @@ void HSIDisplay::updateVisionLocalization(UASInterface* uas, int fix)
visionFix = fix;
}
/**
* @param fix 0: lost, 1-N: Localized with N ultrasound or infrared sensors
*/
void HSIDisplay::updateInfraredUltrasoundLocalization(UASInterface* uas, int fix)
{
Q_UNUSED(uas);
iruFix = fix;
}
QColor HSIDisplay::getColorForSNR(float snr)
{
QColor color;
......@@ -615,6 +626,29 @@ void HSIDisplay::drawSetpointXY(float x, float y, float yaw, const QColor &color
drawCircle(p.x(), p.y(), radius * 0.1f, 0.1f, color, &painter);
}
void HSIDisplay::drawWaypoints(QPainter& painter)
{
QColor color = uas->getColor();
float x = 1.1;
float y = 1.1;
float radius = vwidth / 20.0f;
QPen pen(color);
pen.setWidthF(refLineWidthToPen(0.4f));
pen.setColor(color);
painter.setPen(pen);
painter.setBrush(Qt::NoBrush);
QPointF in(x, y);
// Transform from body to world coordinates
in = metricWorldToBody(in);
// Scale from metric to screen reference coordinates
QPointF p = metricBodyToRef(in);
drawCircle(p.x(), p.y(), radius, 0.4f, color, &painter);
radius *= 0.8;
drawLine(p.x(), p.y(), p.x()+sin(yaw) * radius, p.y()-cos(yaw) * radius, refLineWidthToPen(0.4f), color, &painter);
painter.setBrush(color);
drawCircle(p.x(), p.y(), radius * 0.1f, 0.1f, color, &painter);
}
void HSIDisplay::drawSafetyArea(const QPointF &topLeft, const QPointF &bottomRight, const QColor &color, QPainter &painter)
{
QPen pen(color);
......
......@@ -65,22 +65,16 @@ public slots:
/** @brief Heading control enabled/disabled */
void updatePositionYawControllerEnabled(bool enabled);
/**
* @brief Localization quality changed
* @param fix 0: lost, 1: 2D local position hold, 2: 2D localization, 3: 3D localization
*/
/** @brief Localization quality changed */
void updateLocalization(UASInterface* uas, int localization);
/**
* @brief GPS localization quality changed
* @param fix 0: lost, 1: at least one satellite, but no GPS fix, 2: 2D localization, 3: 3D localization
*/
/** @brief GPS localization quality changed */
void updateGpsLocalization(UASInterface* uas, int localization);
/**
* @brief Vision localization quality changed
* @param fix 0: lost, 1: 2D local position hold, 2: 2D localization, 3: 3D localization
*/
/** @brief Vision localization quality changed */
void updateVisionLocalization(UASInterface* uas, int localization);
/** @brief Ultrasound/Infrared localization changed */
void updateInfraredUltrasoundLocalization(UASInterface* uas, int fix);
void paintEvent(QPaintEvent * event);
/** @brief Update state from joystick */
void updateJoystick(double roll, double pitch, double yaw, double thrust, int xHat, int yHat);
......@@ -101,6 +95,8 @@ protected slots:
void sendBodySetPointCoordinates();
/** @brief Draw one setpoint */
void drawSetpointXY(float x, float y, float yaw, const QColor &color, QPainter &painter);
/** @brief Draw waypoints of this system */
void drawWaypoints(QPainter& painter);
/** @brief Draw the limiting safety area */
void drawSafetyArea(const QPointF &topLeft, const QPointF &bottomRight, const QColor &color, QPainter &painter);
......@@ -208,18 +204,19 @@ protected:
float metricWidth; ///< Width the instrument represents in meters (the width of the ground shown by the widget)
//
float xCenterPos;
float yCenterPos;
float xCenterPos; ///< X center of instrument in virtual coordinates
float yCenterPos; ///< Y center of instrument in virtual coordinates
bool positionLock;
bool attControlEnabled;
bool xyControlEnabled;
bool zControlEnabled;
bool yawControlEnabled;
int positionFix;
int gpsFix;
int visionFix;
int laserFix;
bool attControlEnabled; ///< Attitude control enabled
bool xyControlEnabled; ///< Horizontal control enabled
bool zControlEnabled; ///< Vertical control enabled
bool yawControlEnabled; ///< Yaw angle position control enabled
int positionFix; ///< Total dimensions the MAV is localizaed in
int gpsFix; ///< Localization dimensions based on GPS
int visionFix; ///< Localizaiton dimensions based on computer vision
int laserFix; ///< Localization dimensions based on laser
int iruFix; ///< Localization dimensions based on ultrasound
bool mavInitialized; ///< The MAV is initialized once the setpoint has been received
float bottomMargin; ///< Margin on the bottom of the page, in virtual coordinates
float topMargin; ///< Margin on top of the page, in virtual coordinates
......
0 3.1 3 -0.7 0 0 1 0.1 5000
1 3.1 2 -0.7 0 0 0 0.1 5000
2 3.1 0.6 -0.7 0 0 0 0.1 5000
3 3.1 0.3 -0.7 0 0 0 0.1 5000
4 2 0.3 -0.7 0 0 0 0.1 5000
5 1.5 0.3 -0.7 0 0 0 0.1 5000
6 1.5 0.3 0 0 0 0 0.1 2000
0 3.7 0.3 -0.8 0 1 1 0.1 2000
1 3.1 0.3 -0.8 0 1 0 0.1 2000
2 3.1 0.8 -0.8 0 1 0 0.1 2000
3 3.1 1.3 -0.8 0 1 0 0.1 2000
4 3.1 2 -0.8 0 1 0 0.1 2000
5 3.1 2.8 -0.8 0 1 0 0.1 2000
6 3.1 3.2 -0.8 0 1 0 0.1 2000
7 2.1 3.2 -0.8 0 1 0 0.1 2000
8 1.1 3.2 -0.8 0 1 0 0.1 2000
9 0.4 3.2 -0.8 0 1 0 0.1 2000
10 0.25 3.2 -0.8 0 1 0 0.1 2000
11 0.25 2.2 -0.8 0 1 0 0.1 2000
12 0.25 1.2 -0.8 0 1 0 0.1 2000
13 0.25 0.5 -0.8 0 1 0 0.1 2000
14 0.25 0.3 -0.8 0 1 0 0.1 2000
15 1.1 0.3 -0.8 0 1 0 0.1 2000
16 2.1 0.3 -0.8 0 1 0 0.1 2000
17 2.8 0.3 -0.8 0 1 0 0.1 2000
18 3.1 0.3 -0.8 0 1 0 0.1 2000
19 3.7 0.3 -0.8 0 1 0 0.1 2000
20 3.7 0.3 0 0 1 0 0.1 2000
0 3.7 0.3 -0.8 0 1 1 0.1 2000
1 3.1 0.3 -0.8 0 1 0 0.1 2000
2 3.1 0.8 -0.8 0 1 0 0.1 2000
3 3.1 1.3 -0.8 0 1 0 0.1 2000
4 3.1 1.4 -0.8 0 1 0 0.1 2000
5 3.1 1.3 -0.8 0 1 0 0.1 2000
6 3.1 0.8 -0.8 0 1 0 0.1 2000
7 3.1 0.3 -0.8 0 1 0 0.1 2000
8 3.7 0.3 -0.8 0 1 0 0.1 2000
9 3.7 0.3 0 0 1 0 0.1 2000
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