Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
1f54d9a3
Commit
1f54d9a3
authored
Nov 19, 2010
by
Mariano Lizarraga
Browse files
Merge branch 'master' of
git://github.com/tecnosapiens/qgroundcontrol
into mergeRemote
parents
2226a433
6d43e99e
Changes
12
Hide whitespace changes
Inline
Side-by-side
src/Waypoint.cc
View file @
1f54d9a3
...
@@ -75,6 +75,7 @@ bool Waypoint::load(QTextStream &loadStream)
...
@@ -75,6 +75,7 @@ bool Waypoint::load(QTextStream &loadStream)
return
false
;
return
false
;
}
}
void
Waypoint
::
setId
(
quint16
id
)
void
Waypoint
::
setId
(
quint16
id
)
{
{
this
->
id
=
id
;
this
->
id
=
id
;
...
...
src/Waypoint.h
View file @
1f54d9a3
...
@@ -59,6 +59,7 @@ public:
...
@@ -59,6 +59,7 @@ public:
bool
load
(
QTextStream
&
loadStream
);
bool
load
(
QTextStream
&
loadStream
);
protected:
protected:
quint16
id
;
quint16
id
;
float
x
;
float
x
;
...
...
src/uas/SlugsMAV.cc
View file @
1f54d9a3
...
@@ -80,7 +80,7 @@ void SlugsMAV::receiveMessage(LinkInterface* link, mavlink_message_t message)
...
@@ -80,7 +80,7 @@ void SlugsMAV::receiveMessage(LinkInterface* link, mavlink_message_t message)
case
MAVLINK_MSG_ID_RAW_IMU
:
case
MAVLINK_MSG_ID_RAW_IMU
:
mavlink_msg_raw_imu_decode
(
&
message
,
&
mlRawImuData
);
mavlink_msg_raw_imu_decode
(
&
message
,
&
mlRawImuData
);
break
;
break
;
#ifdef MAVLINK_ENABLED_SLUGS
#ifdef MAVLINK_ENABLED_SLUGS
...
@@ -97,21 +97,21 @@ void SlugsMAV::receiveMessage(LinkInterface* link, mavlink_message_t message)
...
@@ -97,21 +97,21 @@ void SlugsMAV::receiveMessage(LinkInterface* link, mavlink_message_t message)
case
MAVLINK_MSG_ID_GPS_RAW
:
case
MAVLINK_MSG_ID_GPS_RAW
:
mavlink_msg_gps_raw_decode
(
&
message
,
&
mlGpsData
);
mavlink_msg_gps_raw_decode
(
&
message
,
&
mlGpsData
);
break
;
break
;
case
MAVLINK_MSG_ID_ACTION_ACK
:
// 62
case
MAVLINK_MSG_ID_ACTION_ACK
:
// 62
mavlink_msg_action_ack_decode
(
&
message
,
&
mlActionAck
);
mavlink_msg_action_ack_decode
(
&
message
,
&
mlActionAck
);
break
;
break
;
case
MAVLINK_MSG_ID_CPU_LOAD
:
//170
case
MAVLINK_MSG_ID_CPU_LOAD
:
//170
mavlink_msg_cpu_load_decode
(
&
message
,
&
mlCpuLoadData
);
mavlink_msg_cpu_load_decode
(
&
message
,
&
mlCpuLoadData
);
break
;
break
;
case
MAVLINK_MSG_ID_AIR_DATA
:
//171
case
MAVLINK_MSG_ID_AIR_DATA
:
//171
mavlink_msg_air_data_decode
(
&
message
,
&
mlAirData
);
mavlink_msg_air_data_decode
(
&
message
,
&
mlAirData
);
break
;
break
;
case
MAVLINK_MSG_ID_SENSOR_BIAS
:
//172
case
MAVLINK_MSG_ID_SENSOR_BIAS
:
//172
mavlink_msg_sensor_bias_decode
(
&
message
,
&
mlSensorBiasData
);
mavlink_msg_sensor_bias_decode
(
&
message
,
&
mlSensorBiasData
);
...
@@ -123,7 +123,7 @@ void SlugsMAV::receiveMessage(LinkInterface* link, mavlink_message_t message)
...
@@ -123,7 +123,7 @@ void SlugsMAV::receiveMessage(LinkInterface* link, mavlink_message_t message)
case
MAVLINK_MSG_ID_PILOT_CONSOLE
:
//174
case
MAVLINK_MSG_ID_PILOT_CONSOLE
:
//174
mavlink_msg_pilot_console_decode
(
&
message
,
&
mlPilotConsoleData
);
mavlink_msg_pilot_console_decode
(
&
message
,
&
mlPilotConsoleData
);
break
;
break
;
case
MAVLINK_MSG_ID_PWM_COMMANDS
:
//175
case
MAVLINK_MSG_ID_PWM_COMMANDS
:
//175
mavlink_msg_pwm_commands_decode
(
&
message
,
&
mlPwmCommands
);
mavlink_msg_pwm_commands_decode
(
&
message
,
&
mlPwmCommands
);
...
@@ -131,7 +131,7 @@ void SlugsMAV::receiveMessage(LinkInterface* link, mavlink_message_t message)
...
@@ -131,7 +131,7 @@ void SlugsMAV::receiveMessage(LinkInterface* link, mavlink_message_t message)
case
MAVLINK_MSG_ID_SLUGS_NAVIGATION
:
//176
case
MAVLINK_MSG_ID_SLUGS_NAVIGATION
:
//176
mavlink_msg_slugs_navigation_decode
(
&
message
,
&
mlNavigation
);
mavlink_msg_slugs_navigation_decode
(
&
message
,
&
mlNavigation
);
break
;
break
;
case
MAVLINK_MSG_ID_DATA_LOG
:
//177
case
MAVLINK_MSG_ID_DATA_LOG
:
//177
mavlink_msg_data_log_decode
(
&
message
,
&
mlDataLog
);
mavlink_msg_data_log_decode
(
&
message
,
&
mlDataLog
);
...
@@ -143,7 +143,7 @@ void SlugsMAV::receiveMessage(LinkInterface* link, mavlink_message_t message)
...
@@ -143,7 +143,7 @@ void SlugsMAV::receiveMessage(LinkInterface* link, mavlink_message_t message)
case
MAVLINK_MSG_ID_GPS_DATE_TIME
:
//179
case
MAVLINK_MSG_ID_GPS_DATE_TIME
:
//179
mavlink_msg_gps_date_time_decode
(
&
message
,
&
mlGpsDateTime
);
mavlink_msg_gps_date_time_decode
(
&
message
,
&
mlGpsDateTime
);
break
;
break
;
case
MAVLINK_MSG_ID_MID_LVL_CMDS
:
//180
case
MAVLINK_MSG_ID_MID_LVL_CMDS
:
//180
...
@@ -151,7 +151,7 @@ void SlugsMAV::receiveMessage(LinkInterface* link, mavlink_message_t message)
...
@@ -151,7 +151,7 @@ void SlugsMAV::receiveMessage(LinkInterface* link, mavlink_message_t message)
case
MAVLINK_MSG_ID_CTRL_SRFC_PT
:
//181
case
MAVLINK_MSG_ID_CTRL_SRFC_PT
:
//181
break
;
break
;
case
MAVLINK_MSG_ID_PID
:
//182
case
MAVLINK_MSG_ID_PID
:
//182
...
@@ -165,8 +165,8 @@ void SlugsMAV::receiveMessage(LinkInterface* link, mavlink_message_t message)
...
@@ -165,8 +165,8 @@ void SlugsMAV::receiveMessage(LinkInterface* link, mavlink_message_t message)
default:
default:
// qDebug() << "\nSLUGS RECEIVED MESSAGE WITH ID" << message.msgid;
// qDebug() << "\nSLUGS RECEIVED MESSAGE WITH ID" << message.msgid;
break
;
break
;
}
}
}
}
...
@@ -197,13 +197,13 @@ void SlugsMAV::emitSignals (void){
...
@@ -197,13 +197,13 @@ void SlugsMAV::emitSignals (void){
case
5
:
case
5
:
emit
slugsFilteredData
(
uasId
,
mlFilteredData
);
emit
slugsFilteredData
(
uasId
,
mlFilteredData
);
emit
slugsGPSDateTime
(
uasId
,
mlGpsDateTime
);
emit
slugsGPSDateTime
(
uasId
,
mlGpsDateTime
);
break
;
break
;
case
6
:
case
6
:
emit
slugsActionAck
(
uasId
,
mlActionAck
);
emit
slugsActionAck
(
uasId
,
mlActionAck
);
emit
emitGpsSignals
();
emit
emitGpsSignals
();
break
;
break
;
}
}
emit
slugsAttitude
(
uasId
,
mlAttitude
);
emit
slugsAttitude
(
uasId
,
mlAttitude
);
emit
attitudeChanged
(
this
,
emit
attitudeChanged
(
this
,
...
@@ -238,7 +238,7 @@ void SlugsMAV::emitGpsSignals (void){
...
@@ -238,7 +238,7 @@ void SlugsMAV::emitGpsSignals (void){
}
else
{
}
else
{
emit
textMessageReceived
(
uasId
,
uasId
,
255
,
QString
(
"GCS ERROR: RECEIVED INVALID SPEED OF %1 m/s"
).
arg
(
mlGpsData
.
v
));
emit
textMessageReceived
(
uasId
,
uasId
,
255
,
QString
(
"GCS ERROR: RECEIVED INVALID SPEED OF %1 m/s"
).
arg
(
mlGpsData
.
v
));
}
}
}
}
}
}
#endif // MAVLINK_ENABLED_SLUGS
#endif // MAVLINK_ENABLED_SLUGS
src/uas/SlugsMAV.h
View file @
1f54d9a3
...
@@ -105,6 +105,8 @@ protected:
...
@@ -105,6 +105,8 @@ protected:
mavlink_slugs_action_t
mlAction
;
mavlink_slugs_action_t
mlAction
;
// Standart messages MAVLINK used by SLUGS
private:
private:
...
...
src/uas/UASWaypointManager.cc
View file @
1f54d9a3
...
@@ -383,9 +383,12 @@ void UASWaypointManager::localLoadWaypoints(const QString &loadFile)
...
@@ -383,9 +383,12 @@ void UASWaypointManager::localLoadWaypoints(const QString &loadFile)
}
}
file
.
close
();
file
.
close
();
emit
loadWPFile
();
emit
waypointListChanged
();
emit
waypointListChanged
();
}
}
void
UASWaypointManager
::
globalAddWaypoint
(
Waypoint
*
wp
)
void
UASWaypointManager
::
globalAddWaypoint
(
Waypoint
*
wp
)
{
{
...
...
src/uas/UASWaypointManager.h
View file @
1f54d9a3
...
@@ -91,6 +91,7 @@ public:
...
@@ -91,6 +91,7 @@ public:
void
localMoveWaypoint
(
quint16
cur_seq
,
quint16
new_seq
);
///< locally move a waypoint from its current position cur_seq to a new position new_seq
void
localMoveWaypoint
(
quint16
cur_seq
,
quint16
new_seq
);
///< locally move a waypoint from its current position cur_seq to a new position new_seq
void
localSaveWaypoints
(
const
QString
&
saveFile
);
///< saves the local waypoint list to saveFile
void
localSaveWaypoints
(
const
QString
&
saveFile
);
///< saves the local waypoint list to saveFile
void
localLoadWaypoints
(
const
QString
&
loadFile
);
///< loads a waypoint list from loadFile
void
localLoadWaypoints
(
const
QString
&
loadFile
);
///< loads a waypoint list from loadFile
/*@}*/
/*@}*/
/** @name Global waypoint list operations */
/** @name Global waypoint list operations */
...
@@ -120,6 +121,8 @@ signals:
...
@@ -120,6 +121,8 @@ signals:
void
currentWaypointChanged
(
quint16
);
///< emits the new current waypoint sequence number
void
currentWaypointChanged
(
quint16
);
///< emits the new current waypoint sequence number
void
updateStatusString
(
const
QString
&
);
///< emits the current status string
void
updateStatusString
(
const
QString
&
);
///< emits the current status string
void
loadWPFile
();
///< emits signal that a file wp has been load
private:
private:
UAS
&
uas
;
///< Reference to the corresponding UAS
UAS
&
uas
;
///< Reference to the corresponding UAS
quint32
current_retries
;
///< The current number of retries left
quint32
current_retries
;
///< The current number of retries left
...
...
src/ui/MainWindow.cc
View file @
1f54d9a3
...
@@ -401,6 +401,9 @@ void MainWindow::connectActions()
...
@@ -401,6 +401,9 @@ void MainWindow::connectActions()
// Slugs View
// Slugs View
connect
(
ui
.
actionShow_Slugs_View
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadSlugsView
()));
connect
(
ui
.
actionShow_Slugs_View
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadSlugsView
()));
//GlobalOperatorView
// connect(ui.actionGlobalOperatorView,SIGNAL(triggered()),waypointsDockWidget->widget(),SLOT())
}
}
void
MainWindow
::
showHelp
()
void
MainWindow
::
showHelp
()
...
@@ -918,6 +921,7 @@ void MainWindow::loadGlobalOperatorView()
...
@@ -918,6 +921,7 @@ void MainWindow::loadGlobalOperatorView()
{
{
addDockWidget
(
Qt
::
BottomDockWidgetArea
,
waypointsDockWidget
);
addDockWidget
(
Qt
::
BottomDockWidgetArea
,
waypointsDockWidget
);
waypointsDockWidget
->
show
();
waypointsDockWidget
->
show
();
}
}
// Slugs Data View
// Slugs Data View
...
...
src/ui/MapWidget.cc
View file @
1f54d9a3
...
@@ -396,7 +396,17 @@ void MapWidget::createWaypointGraphAtMap(const QPointF coordinate)
...
@@ -396,7 +396,17 @@ void MapWidget::createWaypointGraphAtMap(const QPointF coordinate)
str
=
QString
(
"%1"
).
arg
(
path
->
numberOfPoints
());
str
=
QString
(
"%1"
).
arg
(
path
->
numberOfPoints
());
// create the WP and set everything in the LineString to display the path
// create the WP and set everything in the LineString to display the path
CirclePoint
*
tempCirclePoint
=
new
CirclePoint
(
coordinate
.
x
(),
coordinate
.
y
(),
10
,
str
);
//CirclePoint* tempCirclePoint = new CirclePoint(coordinate.x(), coordinate.y(), 10, str);
Waypoint2DIcon
*
tempCirclePoint
;
if
(
mav
)
{
tempCirclePoint
=
new
Waypoint2DIcon
(
coordinate
.
x
(),
coordinate
.
y
(),
20
,
str
,
qmapcontrol
::
Point
::
Middle
,
new
QPen
(
mav
->
getColor
()));
}
else
{
tempCirclePoint
=
new
Waypoint2DIcon
(
coordinate
.
x
(),
coordinate
.
y
(),
20
,
str
,
qmapcontrol
::
Point
::
Middle
);
}
mc
->
layer
(
"Waypoints"
)
->
addGeometry
(
tempCirclePoint
);
mc
->
layer
(
"Waypoints"
)
->
addGeometry
(
tempCirclePoint
);
Point
*
tempPoint
=
new
Point
(
coordinate
.
x
(),
coordinate
.
y
(),
str
);
Point
*
tempPoint
=
new
Point
(
coordinate
.
x
(),
coordinate
.
y
(),
str
);
...
...
src/ui/SlugsDataSensorView.cc
View file @
1f54d9a3
...
@@ -10,21 +10,21 @@ SlugsDataSensorView::SlugsDataSensorView(QWidget *parent) :
...
@@ -10,21 +10,21 @@ SlugsDataSensorView::SlugsDataSensorView(QWidget *parent) :
QWidget
(
parent
),
QWidget
(
parent
),
ui
(
new
Ui
::
SlugsDataSensorView
)
ui
(
new
Ui
::
SlugsDataSensorView
)
{
{
ui
->
setupUi
(
this
);
ui
->
setupUi
(
this
);
activeUAS
=
NULL
;
activeUAS
=
NULL
;
this
->
setVisible
(
false
);
this
->
setVisible
(
false
);
}
}
SlugsDataSensorView
::~
SlugsDataSensorView
()
SlugsDataSensorView
::~
SlugsDataSensorView
()
{
{
delete
ui
;
delete
ui
;
}
}
void
SlugsDataSensorView
::
addUAS
(
UASInterface
*
uas
)
void
SlugsDataSensorView
::
addUAS
(
UASInterface
*
uas
)
{
{
SlugsMAV
*
slugsMav
=
dynamic_cast
<
SlugsMAV
*>
(
uas
);
SlugsMAV
*
slugsMav
=
dynamic_cast
<
SlugsMAV
*>
(
uas
);
if
(
slugsMav
!=
NULL
)
{
if
(
slugsMav
!=
NULL
)
{
...
@@ -32,15 +32,15 @@ void SlugsDataSensorView::addUAS(UASInterface* uas)
...
@@ -32,15 +32,15 @@ void SlugsDataSensorView::addUAS(UASInterface* uas)
#ifdef MAVLINK_ENABLED_SLUGS
#ifdef MAVLINK_ENABLED_SLUGS
//connect standar messages
//connect standar messages
connect
(
slugsMav
,
SIGNAL
(
localPositionChanged
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)),
this
,
SLOT
(
slugLocalPositionChanged
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)));
connect
(
slugsMav
,
SIGNAL
(
localPositionChanged
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)),
this
,
SLOT
(
slugLocalPositionChanged
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)));
connect
(
slugsMav
,
SIGNAL
(
speedChanged
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)),
this
,
SLOT
(
slugSpeedLocalPositionChanged
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)));
connect
(
slugsMav
,
SIGNAL
(
speedChanged
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)),
this
,
SLOT
(
slugSpeedLocalPositionChanged
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)));
connect
(
slugsMav
,
SIGNAL
(
attitudeChanged
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)),
this
,
SLOT
(
slugAttitudeChanged
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)));
connect
(
slugsMav
,
SIGNAL
(
attitudeChanged
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)),
this
,
SLOT
(
slugAttitudeChanged
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)));
connect
(
slugsMav
,
SIGNAL
(
globalPositionChanged
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)),
this
,
SLOT
(
slugsGlobalPositionChanged
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)));
connect
(
slugsMav
,
SIGNAL
(
globalPositionChanged
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)),
this
,
SLOT
(
slugsGlobalPositionChanged
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)));
//connect slugs especial messages
//connect slugs especial messages
connect
(
slugsMav
,
SIGNAL
(
slugsSensorBias
(
int
,
const
mavlink_sensor_bias_t
&
)),
this
,
SLOT
(
slugsSensorBiasChanged
(
int
,
const
mavlink_sensor_bias_t
&
)));
connect
(
slugsMav
,
SIGNAL
(
slugsSensorBias
(
int
,
const
mavlink_sensor_bias_t
&
)),
this
,
SLOT
(
slugsSensorBiasChanged
(
int
,
const
mavlink_sensor_bias_t
&
)));
connect
(
slugsMav
,
SIGNAL
(
slugsDiagnostic
(
int
,
const
mavlink_diagnostic_t
&
)),
this
,
SLOT
(
slugsDiagnosticMessageChanged
(
int
,
const
mavlink_diagnostic_t
&
)));
connect
(
slugsMav
,
SIGNAL
(
slugsDiagnostic
(
int
,
const
mavlink_diagnostic_t
&
)),
this
,
SLOT
(
slugsDiagnosticMessageChanged
(
int
,
const
mavlink_diagnostic_t
&
)));
connect
(
slugsMav
,
SIGNAL
(
slugsCPULoad
(
int
,
const
mavlink_cpu_load_t
&
)),
this
,
SLOT
(
slugsCpuLoadChanged
(
int
,
const
mavlink_cpu_load_t
&
)));
connect
(
slugsMav
,
SIGNAL
(
slugsCPULoad
(
int
,
const
mavlink_cpu_load_t
&
)),
this
,
SLOT
(
slugsCpuLoadChanged
(
int
,
const
mavlink_cpu_load_t
&
)));
...
@@ -51,13 +51,12 @@ void SlugsDataSensorView::addUAS(UASInterface* uas)
...
@@ -51,13 +51,12 @@ void SlugsDataSensorView::addUAS(UASInterface* uas)
connect
(
slugsMav
,
SIGNAL
(
slugsGPSDateTime
(
int
,
const
mavlink_gps_date_time_t
&
)),
this
,
SLOT
(
slugsGPSDateTimeChanged
(
int
,
const
mavlink_gps_date_time_t
&
)));
connect
(
slugsMav
,
SIGNAL
(
slugsGPSDateTime
(
int
,
const
mavlink_gps_date_time_t
&
)),
this
,
SLOT
(
slugsGPSDateTimeChanged
(
int
,
const
mavlink_gps_date_time_t
&
)));
#endif // MAVLINK_ENABLED_SLUGS
#endif // MAVLINK_ENABLED_SLUGS
// Set this UAS as active if it is the first one
// Set this UAS as active if it is the first one
if
(
activeUAS
==
0
)
{
if
(
activeUAS
==
0
)
{
activeUAS
=
uas
;
activeUAS
=
uas
;
}
}
}
}
}
}
void
SlugsDataSensorView
::
slugRawDataChanged
(
int
uasId
,
const
mavlink_raw_imu_t
&
rawData
){
void
SlugsDataSensorView
::
slugRawDataChanged
(
int
uasId
,
const
mavlink_raw_imu_t
&
rawData
){
...
@@ -107,7 +106,7 @@ void SlugsDataSensorView::slugSpeedLocalPositionChanged(UASInterface* uas,
...
@@ -107,7 +106,7 @@ void SlugsDataSensorView::slugSpeedLocalPositionChanged(UASInterface* uas,
double
vy
,
double
vy
,
double
vz
,
double
vz
,
quint64
time
)
{
quint64
time
)
{
Q_UNUSED
(
uas
);
Q_UNUSED
(
uas
);
Q_UNUSED
(
time
);
Q_UNUSED
(
time
);
ui
->
ed_vx
->
setPlainText
(
QString
::
number
(
vx
));
ui
->
ed_vx
->
setPlainText
(
QString
::
number
(
vx
));
...
@@ -134,7 +133,7 @@ void SlugsDataSensorView::slugAttitudeChanged(UASInterface* uas,
...
@@ -134,7 +133,7 @@ void SlugsDataSensorView::slugAttitudeChanged(UASInterface* uas,
void
SlugsDataSensorView
::
slugsSensorBiasChanged
(
int
systemId
,
void
SlugsDataSensorView
::
slugsSensorBiasChanged
(
int
systemId
,
const
mavlink_sensor_bias_t
&
sensorBias
){
const
mavlink_sensor_bias_t
&
sensorBias
){
Q_UNUSED
(
systemId
);
Q_UNUSED
(
systemId
);
ui
->
m_AxBiases
->
setText
(
QString
::
number
(
sensorBias
.
axBias
));
ui
->
m_AxBiases
->
setText
(
QString
::
number
(
sensorBias
.
axBias
));
ui
->
m_AyBiases
->
setText
(
QString
::
number
(
sensorBias
.
ayBias
));
ui
->
m_AyBiases
->
setText
(
QString
::
number
(
sensorBias
.
ayBias
));
...
@@ -147,12 +146,12 @@ void SlugsDataSensorView::slugsSensorBiasChanged(int systemId,
...
@@ -147,12 +146,12 @@ void SlugsDataSensorView::slugsSensorBiasChanged(int systemId,
void
SlugsDataSensorView
::
slugsDiagnosticMessageChanged
(
int
systemId
,
void
SlugsDataSensorView
::
slugsDiagnosticMessageChanged
(
int
systemId
,
const
mavlink_diagnostic_t
&
diagnostic
){
const
mavlink_diagnostic_t
&
diagnostic
){
Q_UNUSED
(
systemId
);
Q_UNUSED
(
systemId
);
ui
->
m_Fl1
->
setText
(
QString
::
number
(
diagnostic
.
diagFl1
));
ui
->
m_Fl1
->
setText
(
QString
::
number
(
diagnostic
.
diagFl1
));
ui
->
m_Fl2
->
setText
(
QString
::
number
(
diagnostic
.
diagFl2
));
ui
->
m_Fl2
->
setText
(
QString
::
number
(
diagnostic
.
diagFl2
));
ui
->
m_Fl3
->
setText
(
QString
::
number
(
diagnostic
.
diagFl2
));
ui
->
m_Fl3
->
setText
(
QString
::
number
(
diagnostic
.
diagFl2
));
ui
->
m_Sh1
->
setText
(
QString
::
number
(
diagnostic
.
diagSh1
));
ui
->
m_Sh1
->
setText
(
QString
::
number
(
diagnostic
.
diagSh1
));
ui
->
m_Sh2
->
setText
(
QString
::
number
(
diagnostic
.
diagSh2
));
ui
->
m_Sh2
->
setText
(
QString
::
number
(
diagnostic
.
diagSh2
));
ui
->
m_Sh3
->
setText
(
QString
::
number
(
diagnostic
.
diagSh3
));
ui
->
m_Sh3
->
setText
(
QString
::
number
(
diagnostic
.
diagSh3
));
...
@@ -161,7 +160,7 @@ void SlugsDataSensorView::slugsDiagnosticMessageChanged(int systemId,
...
@@ -161,7 +160,7 @@ void SlugsDataSensorView::slugsDiagnosticMessageChanged(int systemId,
void
SlugsDataSensorView
::
slugsCpuLoadChanged
(
int
systemId
,
void
SlugsDataSensorView
::
slugsCpuLoadChanged
(
int
systemId
,
const
mavlink_cpu_load_t
&
cpuLoad
){
const
mavlink_cpu_load_t
&
cpuLoad
){
Q_UNUSED
(
systemId
);
Q_UNUSED
(
systemId
);
ui
->
ed_sens
->
setText
(
QString
::
number
(
cpuLoad
.
sensLoad
));
ui
->
ed_sens
->
setText
(
QString
::
number
(
cpuLoad
.
sensLoad
));
ui
->
ed_control
->
setText
(
QString
::
number
(
cpuLoad
.
ctrlLoad
));
ui
->
ed_control
->
setText
(
QString
::
number
(
cpuLoad
.
ctrlLoad
));
ui
->
ed_batvolt
->
setText
(
QString
::
number
(
cpuLoad
.
batVolt
));
ui
->
ed_batvolt
->
setText
(
QString
::
number
(
cpuLoad
.
batVolt
));
...
@@ -169,7 +168,7 @@ void SlugsDataSensorView::slugsCpuLoadChanged(int systemId,
...
@@ -169,7 +168,7 @@ void SlugsDataSensorView::slugsCpuLoadChanged(int systemId,
void
SlugsDataSensorView
::
slugsNavegationChanged
(
int
systemId
,
void
SlugsDataSensorView
::
slugsNavegationChanged
(
int
systemId
,
const
mavlink_slugs_navigation_t
&
slugsNavigation
){
const
mavlink_slugs_navigation_t
&
slugsNavigation
){
Q_UNUSED
(
systemId
);
Q_UNUSED
(
systemId
);
ui
->
m_Um
->
setText
(
QString
::
number
(
slugsNavigation
.
u_m
));
ui
->
m_Um
->
setText
(
QString
::
number
(
slugsNavigation
.
u_m
));
ui
->
m_PhiC
->
setText
(
QString
::
number
(
slugsNavigation
.
phi_c
));
ui
->
m_PhiC
->
setText
(
QString
::
number
(
slugsNavigation
.
phi_c
));
ui
->
m_PitchC
->
setText
(
QString
::
number
(
slugsNavigation
.
theta_c
));
ui
->
m_PitchC
->
setText
(
QString
::
number
(
slugsNavigation
.
theta_c
));
...
@@ -185,7 +184,7 @@ void SlugsDataSensorView::slugsNavegationChanged(int systemId,
...
@@ -185,7 +184,7 @@ void SlugsDataSensorView::slugsNavegationChanged(int systemId,
void
SlugsDataSensorView
::
slugsDataLogChanged
(
int
systemId
,
void
SlugsDataSensorView
::
slugsDataLogChanged
(
int
systemId
,
const
mavlink_data_log_t
&
dataLog
){
const
mavlink_data_log_t
&
dataLog
){
Q_UNUSED
(
systemId
);
Q_UNUSED
(
systemId
);
ui
->
m_logFl1
->
setText
(
QString
::
number
(
dataLog
.
fl_1
));
ui
->
m_logFl1
->
setText
(
QString
::
number
(
dataLog
.
fl_1
));
ui
->
m_logFl2
->
setText
(
QString
::
number
(
dataLog
.
fl_2
));
ui
->
m_logFl2
->
setText
(
QString
::
number
(
dataLog
.
fl_2
));
ui
->
m_logFl3
->
setText
(
QString
::
number
(
dataLog
.
fl_3
));
ui
->
m_logFl3
->
setText
(
QString
::
number
(
dataLog
.
fl_3
));
...
@@ -196,7 +195,7 @@ void SlugsDataSensorView::slugsDataLogChanged(int systemId,
...
@@ -196,7 +195,7 @@ void SlugsDataSensorView::slugsDataLogChanged(int systemId,
void
SlugsDataSensorView
::
slugsPWMChanged
(
int
systemId
,
void
SlugsDataSensorView
::
slugsPWMChanged
(
int
systemId
,
const
mavlink_pwm_commands_t
&
pwmCommands
){
const
mavlink_pwm_commands_t
&
pwmCommands
){
Q_UNUSED
(
systemId
);
Q_UNUSED
(
systemId
);
ui
->
m_pwmThro
->
setText
(
QString
::
number
(
pwmCommands
.
dt_c
));
ui
->
m_pwmThro
->
setText
(
QString
::
number
(
pwmCommands
.
dt_c
));
ui
->
m_pwmAile
->
setText
(
QString
::
number
(
pwmCommands
.
dla_c
));
ui
->
m_pwmAile
->
setText
(
QString
::
number
(
pwmCommands
.
dla_c
));
ui
->
m_pwmElev
->
setText
(
QString
::
number
(
pwmCommands
.
dle_c
));
ui
->
m_pwmElev
->
setText
(
QString
::
number
(
pwmCommands
.
dle_c
));
...
@@ -211,7 +210,7 @@ void SlugsDataSensorView::slugsPWMChanged(int systemId,
...
@@ -211,7 +210,7 @@ void SlugsDataSensorView::slugsPWMChanged(int systemId,
void
SlugsDataSensorView
::
slugsFilteredDataChanged
(
int
systemId
,
void
SlugsDataSensorView
::
slugsFilteredDataChanged
(
int
systemId
,
const
mavlink_filtered_data_t
&
filteredData
){
const
mavlink_filtered_data_t
&
filteredData
){
Q_UNUSED
(
systemId
);
Q_UNUSED
(
systemId
);
ui
->
m_Axf
->
setText
(
QString
::
number
(
filteredData
.
aX
));
ui
->
m_Axf
->
setText
(
QString
::
number
(
filteredData
.
aX
));
ui
->
m_Ayf
->
setText
(
QString
::
number
(
filteredData
.
aY
));
ui
->
m_Ayf
->
setText
(
QString
::
number
(
filteredData
.
aY
));
ui
->
m_Azf
->
setText
(
QString
::
number
(
filteredData
.
aZ
));
ui
->
m_Azf
->
setText
(
QString
::
number
(
filteredData
.
aZ
));
...
@@ -225,7 +224,7 @@ void SlugsDataSensorView::slugsFilteredDataChanged(int systemId,
...
@@ -225,7 +224,7 @@ void SlugsDataSensorView::slugsFilteredDataChanged(int systemId,
void
SlugsDataSensorView
::
slugsGPSDateTimeChanged
(
int
systemId
,
void
SlugsDataSensorView
::
slugsGPSDateTimeChanged
(
int
systemId
,
const
mavlink_gps_date_time_t
&
gpsDateTime
){
const
mavlink_gps_date_time_t
&
gpsDateTime
){
Q_UNUSED
(
systemId
);
Q_UNUSED
(
systemId
);
ui
->
m_GpsDate
->
setText
(
QString
::
number
(
gpsDateTime
.
month
)
+
"/"
+
ui
->
m_GpsDate
->
setText
(
QString
::
number
(
gpsDateTime
.
month
)
+
"/"
+
QString
::
number
(
gpsDateTime
.
day
)
+
"/"
+
QString
::
number
(
gpsDateTime
.
day
)
+
"/"
+
QString
::
number
(
gpsDateTime
.
year
));
QString
::
number
(
gpsDateTime
.
year
));
...
...
src/ui/SlugsPIDControl.cpp
View file @
1f54d9a3
...
@@ -162,7 +162,7 @@ void SlugsPIDControl::changeColor_GREEN_AirSpeed_groupBox()
...
@@ -162,7 +162,7 @@ void SlugsPIDControl::changeColor_GREEN_AirSpeed_groupBox()
if
(
slugsMav
!=
NULL
)
if
(
slugsMav
!=
NULL
)
{
{
//create the packet
//create the packet
pidMessage
.
target
=
activeUAS
->
getUASID
();
pidMessage
.
target
=
activeUAS
->
getUASID
();
pidMessage
.
idx
=
0
;
pidMessage
.
idx
=
0
;
pidMessage
.
pVal
=
ui
->
dT_P_set
->
text
().
toFloat
();
pidMessage
.
pVal
=
ui
->
dT_P_set
->
text
().
toFloat
();
...
@@ -174,7 +174,7 @@ void SlugsPIDControl::changeColor_GREEN_AirSpeed_groupBox()
...
@@ -174,7 +174,7 @@ void SlugsPIDControl::changeColor_GREEN_AirSpeed_groupBox()
mavlink_msg_pid_encode
(
MG
::
SYSTEM
::
ID
,
MG
::
SYSTEM
::
COMPID
,
&
msg
,
&
pidMessage
);
mavlink_msg_pid_encode
(
MG
::
SYSTEM
::
ID
,
MG
::
SYSTEM
::
COMPID
,
&
msg
,
&
pidMessage
);
slugsMav
->
sendMessage
(
msg
);
slugsMav
->
sendMessage
(
msg
);
ui
->
AirSpeedHold_groupBox
->
setStyleSheet
(
GREENcolorStyle
);
ui
->
AirSpeedHold_groupBox
->
setStyleSheet
(
GREENcolorStyle
);
}
}
}
}
...
...
src/ui/WaypointList.cc
View file @
1f54d9a3
...
@@ -91,6 +91,7 @@ WaypointList::WaypointList(QWidget *parent, UASInterface* uas) :
...
@@ -91,6 +91,7 @@ WaypointList::WaypointList(QWidget *parent, UASInterface* uas) :
this
->
setVisible
(
false
);
this
->
setVisible
(
false
);
isGlobalWP
=
false
;
isGlobalWP
=
false
;
isLocalWP
=
false
;
isLocalWP
=
false
;
loadFileGlobalWP
=
false
;
centerMapCoordinate
.
setX
(
0.0
);
centerMapCoordinate
.
setX
(
0.0
);
centerMapCoordinate
.
setY
(
0.0
);
centerMapCoordinate
.
setY
(
0.0
);
...
@@ -131,6 +132,7 @@ void WaypointList::setUAS(UASInterface* uas)
...
@@ -131,6 +132,7 @@ void WaypointList::setUAS(UASInterface* uas)
connect
(
&
uas
->
getWaypointManager
(),
SIGNAL
(
updateStatusString
(
const
QString
&
)),
this
,
SLOT
(
updateStatusLabel
(
const
QString
&
)));
connect
(
&
uas
->
getWaypointManager
(),
SIGNAL
(
updateStatusString
(
const
QString
&
)),
this
,
SLOT
(
updateStatusLabel
(
const
QString
&
)));
connect
(
&
uas
->
getWaypointManager
(),
SIGNAL
(
waypointListChanged
(
void
)),
this
,
SLOT
(
waypointListChanged
(
void
)));
connect
(
&
uas
->
getWaypointManager
(),
SIGNAL
(
waypointListChanged
(
void
)),
this
,
SLOT
(
waypointListChanged
(
void
)));
connect
(
&
uas
->
getWaypointManager
(),
SIGNAL
(
currentWaypointChanged
(
quint16
)),
this
,
SLOT
(
currentWaypointChanged
(
quint16
)));
connect
(
&
uas
->
getWaypointManager
(),
SIGNAL
(
currentWaypointChanged
(
quint16
)),
this
,
SLOT
(
currentWaypointChanged
(
quint16
)));
connect
(
&
uas
->
getWaypointManager
(),
SIGNAL
(
loadWPFile
()),
this
,
SLOT
(
setIsLoadFileWP
()));
}
}
}
}
...
@@ -147,9 +149,12 @@ void WaypointList::loadWaypoints()
...
@@ -147,9 +149,12 @@ void WaypointList::loadWaypoints()
{
{
if
(
uas
)
if
(
uas
)
{
{
QString
fileName
=
QFileDialog
::
getOpenFileName
(
this
,
tr
(
"Load File"
),
"."
,
tr
(
"Waypoint File (*.txt)"
));
QString
fileName
=
QFileDialog
::
getOpenFileName
(
this
,
tr
(
"Load File"
),
"."
,
tr
(
"Waypoint File (*.txt)"
));
uas
->
getWaypointManager
().
localLoadWaypoints
(
fileName
);
uas
->
getWaypointManager
().
localLoadWaypoints
(
fileName
);
}
}
}
}
void
WaypointList
::
transmit
()
void
WaypointList
::
transmit
()
...
@@ -336,6 +341,11 @@ void WaypointList::waypointListChanged()
...
@@ -336,6 +341,11 @@ void WaypointList::waypointListChanged()
WaypointGlobalView
*
wpgv
=
wpGlobalViews
.
value
(
wp
);
WaypointGlobalView
*
wpgv
=
wpGlobalViews
.
value
(
wp
);
wpgv
->
updateValues
();
wpgv
->
updateValues
();
listLayout
->
addWidget
(
wpgv
);
listLayout
->
addWidget
(
wpgv
);
if
(
loadFileGlobalWP
)
{
emit
createWaypointAtMap
(
QPointF
(
wp
->
getX
(),
wp
->
getY
()));
qDebug
()
<<
"Emitiendo Pos: "
<<
wp
->
getX
()
<<
" - "
<<
wp
->
getY
();
}
}
}
}
}
...
@@ -391,7 +401,7 @@ void WaypointList::waypointListChanged()
...
@@ -391,7 +401,7 @@ void WaypointList::waypointListChanged()
}
}
loadFileGlobalWP
=
false
;
}
}
...
@@ -622,3 +632,8 @@ void WaypointList::changeWPPositionBySpinBox(Waypoint *wp)
...
@@ -622,3 +632,8 @@ void WaypointList::changeWPPositionBySpinBox(Waypoint *wp)
emit
changePositionWPGlobalBySpinBox
(
wp
->
getId
(),
wp
->
getY
(),
wp
->
getX
());
emit
changePositionWPGlobalBySpinBox
(
wp
->
getId
(),
wp
->
getY
(),
wp
->
getX
());
}
}
void
WaypointList
::
setIsLoadFileWP
()
{
loadFileGlobalWP
=
true
;
}
src/ui/WaypointList.h
View file @
1f54d9a3
...
@@ -65,7 +65,7 @@ public slots:
...
@@ -65,7 +65,7 @@ public slots:
/** @brief Save the local waypoint list to a file */
/** @brief Save the local waypoint list to a file */
void
saveWaypoints
();
void
saveWaypoints
();
/** @brief Load a waypoint list from a file */
/** @brief Load a waypoint list from a file */
void
loadWaypoints
();
void
loadWaypoints
();
/** @brief Transmit the local waypoint list to the UAS */
/** @brief Transmit the local waypoint list to the UAS */
void
transmit
();
void
transmit
();
/** @brief Read the remote waypoint list */
/** @brief Read the remote waypoint list */
...
@@ -102,6 +102,8 @@ public slots:
...
@@ -102,6 +102,8 @@ public slots:
void
moveDown
(
Waypoint
*
wp
);
void
moveDown
(
Waypoint
*
wp
);
void
removeWaypoint
(
Waypoint
*
wp
);
void
removeWaypoint
(
Waypoint
*
wp
);
void
setIsLoadFileWP
();
...
@@ -128,6 +130,7 @@ protected:
...
@@ -128,6 +130,7 @@ protected:
bool
isGlobalWP
;
bool
isGlobalWP
;
bool
isLocalWP
;
bool
isLocalWP
;
QPointF
centerMapCoordinate
;
QPointF
centerMapCoordinate
;
bool
loadFileGlobalWP
;
private:
private:
Ui
::
WaypointList
*
m_ui
;
Ui
::
WaypointList
*
m_ui
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment