Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
0e6dceb0
Commit
0e6dceb0
authored
Mar 11, 2011
by
Alejandro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change slugs_messages to common_messages
parent
915e3f3a
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
3585 additions
and
3162 deletions
+3585
-3162
SlugsMAV.cc
src/uas/SlugsMAV.cc
+135
-123
SlugsMAV.h
src/uas/SlugsMAV.h
+30
-32
UAS.cc
src/uas/UAS.cc
+4
-4
MapWidget.cc
src/ui/MapWidget.cc
+8
-8
MapWidget.h
src/ui/MapWidget.h
+1
-1
QGCRemoteControlView.cc
src/ui/QGCRemoteControlView.cc
+1
-1
SlugsDataSensorView.cc
src/ui/SlugsDataSensorView.cc
+52
-41
SlugsDataSensorView.h
src/ui/SlugsDataSensorView.h
+212
-209
SlugsDataSensorView.ui
src/ui/SlugsDataSensorView.ui
+3140
-2741
SlugsPadCameraControl.cpp
src/ui/SlugsPadCameraControl.cpp
+1
-1
SlugsPadCameraControl.ui
src/ui/SlugsPadCameraControl.ui
+1
-1
No files found.
src/uas/SlugsMAV.cc
View file @
0e6dceb0
This diff is collapsed.
Click to expand it.
src/uas/SlugsMAV.h
View file @
0e6dceb0
...
...
@@ -28,7 +28,7 @@ This file is part of the QGROUNDCONTROL project
#include "mavlink.h"
#include <QTimer>
#define SLUGS_UPDATE_RATE
1
00 // in ms
#define SLUGS_UPDATE_RATE
2
00 // in ms
class
SlugsMAV
:
public
UAS
{
Q_OBJECT
...
...
@@ -82,41 +82,39 @@ signals:
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
;
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
...
...
src/uas/UAS.cc
View file @
0e6dceb0
...
...
@@ -351,11 +351,11 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
//add for development
emit
remoteControlRSSIChanged
(
state
.
packet_drop
/
1000.0
f
);
//
emit remoteControlRSSIChanged(state.packet_drop/1000.0f);
float
en
=
state
.
packet_drop
/
1000.0
f
;
emit
remoteControlChannelRawChanged
(
0
,
en
);
//MAVLINK_MSG_ID_RC_CHANNELS_RAW
emit
remoteControlChannelScaledChanged
(
0
,
en
/
100.0
f
);
//MAVLINK_MSG_ID_RC_CHANNELS_SCALED
//
float en = state.packet_drop/1000.0f;
//
emit remoteControlChannelRawChanged(0, en);//MAVLINK_MSG_ID_RC_CHANNELS_RAW
//
emit remoteControlChannelScaledChanged(0, en/100.0f);//MAVLINK_MSG_ID_RC_CHANNELS_SCALED
//qDebug() << __FILE__ << __LINE__ << "RCV LOSS: " << state.packet_drop;
...
...
src/ui/MapWidget.cc
View file @
0e6dceb0
...
...
@@ -115,6 +115,11 @@ void MapWidget::init()
lastZoom
=
settings
.
value
(
"LAST_ZOOM"
,
lastZoom
).
toInt
();
settings
.
endGroup
();
index
=
0
;
settings
.
beginGroup
(
"QGC_MAPINDEX"
);
index
=
settings
.
value
(
"MAP_INDEX"
,
index
).
toInt
();
settings
.
endGroup
();
settings
.
beginGroup
(
"QGC_HOMEPOSITION"
);
homeCoordinate
.
setY
(
settings
.
value
(
"HOME_LATITUDE"
,
homeCoordinate
.
y
()).
toDouble
());
homeCoordinate
.
setX
(
settings
.
value
(
"HOME_LONGITUDE"
,
homeCoordinate
.
x
()).
toDouble
());
...
...
@@ -299,20 +304,15 @@ void MapWidget::init()
connect
(
homePosition
,
SIGNAL
(
geometryEndDrag
(
Geometry
*
,
QPointF
)),
this
,
SLOT
(
captureGeometryEndDrag
(
Geometry
*
,
QPointF
)));
this
->
loadSettingsMap
(
settings
);
this
->
loadSettingsMap
(
index
);
this
->
createHomePosition
(
homeCoordinate
);
qDebug
()
<<
"CHECK END"
;
}
}
void
MapWidget
::
loadSettingsMap
(
QSettings
&
settings
)
void
MapWidget
::
loadSettingsMap
(
int8_t
index
)
{
index
=
0
;
settings
.
beginGroup
(
"QGC_MAPINDEX"
);
index
=
settings
.
value
(
"MAP_INDEX"
,
index
).
toInt
();
settings
.
endGroup
();
switch
(
index
)
{
case
0
:
...
...
@@ -1289,7 +1289,7 @@ void MapWidget::createHomePositionClick(bool click)
static_cast
<
double
>
(
homeCoordinate
.
x
()),
0
);
qDebug
()
<<
"Set home position "
<<
homeCoordinate
.
y
()
<<
" "
<<
homeCoordinate
.
x
();
//
qDebug()<<"Set home position "<<homeCoordinate.y()<<" "<<homeCoordinate.x();
}
}
}
src/ui/MapWidget.h
View file @
0e6dceb0
...
...
@@ -164,7 +164,7 @@ protected:
void
createHomePosition
(
const
QMouseEvent
*
event
,
const
QPointF
coordinate
);
void
createHomePosition
(
const
QPointF
coordinate
);
void
createHomePositionClick
(
bool
click
);
void
loadSettingsMap
(
QSettings
&
);
void
loadSettingsMap
(
int8_t
index
);
signals:
void
waypointCreated
(
Waypoint
*
wp
);
...
...
src/ui/QGCRemoteControlView.cc
View file @
0e6dceb0
...
...
@@ -193,7 +193,7 @@ void QGCRemoteControlView::redraw()
// Update RSSI
if
(
rssi
>
0
)
{
rssiBar
->
setValue
(
rssi
*
100
);
//rssiBar->setValue(rssi);//
*100);
}
updated
=
false
;
...
...
src/ui/SlugsDataSensorView.cc
View file @
0e6dceb0
...
...
@@ -56,6 +56,10 @@ void SlugsDataSensorView::addUAS(UASInterface* uas)
connect
(
slugsMav
,
SIGNAL
(
slugsAirData
(
int
,
const
mavlink_air_data_t
&
)),
this
,
SLOT
(
slugsAirDataChanged
(
int
,
const
mavlink_air_data_t
&
)));
connect
(
slugsMav
,
SIGNAL
(
slugsChannels
(
int
,
const
mavlink_rc_channels_raw_t
&
)),
this
,
SLOT
(
slugsRCRawChannels
(
int
,
const
mavlink_rc_channels_raw_t
&
)));
connect
(
slugsMav
,
SIGNAL
(
slugsServo
(
int
,
const
mavlink_servo_output_raw_t
&
)),
this
,
SLOT
(
slugsRCServo
(
int
,
const
mavlink_servo_output_raw_t
&
)));
connect
(
slugsMav
,
SIGNAL
(
slugsScaled
(
int
,
const
mavlink_scaled_imu_t
&
)),
this
,
SLOT
(
slugsFilteredDataChanged
(
int
,
const
mavlink_scaled_imu_t
&
)));
#endif // MAVLINK_ENABLED_SLUGS
// Set this UAS as active if it is the first one
if
(
activeUAS
==
0
)
{
...
...
@@ -82,6 +86,30 @@ void SlugsDataSensorView::slugRawDataChanged(int uasId, const mavlink_raw_imu_t
}
void
SlugsDataSensorView
::
slugsRCRawChannels
(
int
systemId
,
const
mavlink_rc_channels_raw_t
&
gpsDateTime
)
{
Q_UNUSED
(
systemId
);
ui
->
tbRCThrottle
->
setText
(
QString
::
number
(
gpsDateTime
.
chan1_raw
));
ui
->
tbRCAileron
->
setText
(
QString
::
number
(
gpsDateTime
.
chan2_raw
));
ui
->
tbRCRudder
->
setText
(
QString
::
number
(
gpsDateTime
.
chan3_raw
));
ui
->
tbRCElevator
->
setText
(
QString
::
number
(
gpsDateTime
.
chan4_raw
));
}
void
SlugsDataSensorView
::
slugsRCServo
(
int
systemId
,
const
mavlink_servo_output_raw_t
&
gpsDateTime
)
{
Q_UNUSED
(
systemId
);
ui
->
m_pwmThro
->
setText
(
QString
::
number
(
gpsDateTime
.
servo1_raw
));
ui
->
m_pwmAile
->
setText
(
QString
::
number
(
gpsDateTime
.
servo2_raw
));
ui
->
m_pwmRudd
->
setText
(
QString
::
number
(
gpsDateTime
.
servo3_raw
));
ui
->
m_pwmElev
->
setText
(
QString
::
number
(
gpsDateTime
.
servo4_raw
));
ui
->
m_pwmThroTrim
->
setText
(
QString
::
number
(
gpsDateTime
.
servo5_raw
));
ui
->
m_pwmAileTrim
->
setText
(
QString
::
number
(
gpsDateTime
.
servo6_raw
));
ui
->
m_pwmRuddTrim
->
setText
(
QString
::
number
(
gpsDateTime
.
servo7_raw
));
ui
->
m_pwmElevTrim
->
setText
(
QString
::
number
(
gpsDateTime
.
servo8_raw
));
}
void
SlugsDataSensorView
::
setActiveUAS
(
UASInterface
*
uas
){
activeUAS
=
uas
;
addUAS
(
activeUAS
);
...
...
@@ -113,13 +141,10 @@ void SlugsDataSensorView::slugLocalPositionChanged(UASInterface* uas,
Q_UNUSED
(
uas
);
Q_UNUSED
(
time
);
ui
->
ed_x
->
setText
(
QString
::
number
(
x
));
ui
->
ed_y
->
setText
(
QString
::
number
(
y
));
ui
->
ed_z
->
setText
(
QString
::
number
(
z
));
//qDebug()<<"Local Position = "<<x<<" - "<<y<<" - "<<z;
}
void
SlugsDataSensorView
::
slugSpeedLocalPositionChanged
(
UASInterface
*
uas
,
...
...
@@ -220,33 +245,33 @@ void SlugsDataSensorView::slugsDataLogChanged(int systemId,
ui
->
m_logFl6
->
setText
(
QString
::
number
(
dataLog
.
fl_6
));
}
void
SlugsDataSensorView
::
slugsPWMChanged
(
int
systemId
,
const
mavlink_pwm_commands
_t
&
pwmCommands
){
Q_UNUSED
(
systemId
);
ui
->
m_pwmThro
->
setText
(
QString
::
number
(
pwmCommands
.
dt_c
));
ui
->
m_pwmAile
->
setText
(
QString
::
number
(
pwmCommands
.
dla_c
));
ui
->
m_pwmElev
->
setText
(
QString
::
number
(
pwmCommands
.
dle_c
));
ui
->
m_pwmRudd
->
setText
(
QString
::
number
(
pwmCommands
.
dr_c
));
//
void SlugsDataSensorView::slugsPWMChanged(int systemId,
// const mavlink_servo_output_raw
_t& pwmCommands){
//
Q_UNUSED(systemId);
// ui->m_pwmThro->setText(QString::number(pwmCommands.servo1_raw));//
.dt_c));
// ui->m_pwmAile->setText(QString::number(pwmCommands.servo2_raw));//
dla_c));
// ui->m_pwmElev->setText(QString::number(pwmCommands.servo4_raw));//
dle_c));
// ui->m_pwmRudd->setText(QString::number(pwmCommands.servo3_raw));//
dr_c));
ui
->
m_pwmThroTrim
->
setText
(
QString
::
number
(
pwmCommands
.
dre_c
));
ui
->
m_pwmAileTrim
->
setText
(
QString
::
number
(
pwmCommands
.
dlf_c
));
ui
->
m_pwmElevTrim
->
setText
(
QString
::
number
(
pwmCommands
.
drf_c
));
ui
->
m_pwmRuddTrim
->
setText
(
QString
::
number
(
pwmCommands
.
aux1
));
// ui->m_pwmThroTrim->setText(QString::number(pwmCommands.servo5_raw));//
dre_c));
// ui->m_pwmAileTrim->setText(QString::number(pwmCommands.servo6_raw));//
dlf_c));
// ui->m_pwmElevTrim->setText(QString::number(pwmCommands.servo8_raw));//
drf_c));
// ui->m_pwmRuddTrim->setText(QString::number(pwmCommands.servo7_raw));//
aux1));
}
//
}
void
SlugsDataSensorView
::
slugsFilteredDataChanged
(
int
systemId
,
const
mavlink_
filtered_data
_t
&
filteredData
){
Q_UNUSED
(
systemId
);
ui
->
m_Axf
->
setText
(
QString
::
number
(
filteredData
.
aX
));
ui
->
m_Ayf
->
setText
(
QString
::
number
(
filteredData
.
aY
));
ui
->
m_Azf
->
setText
(
QString
::
number
(
filteredData
.
aZ
));
ui
->
m_Gxf
->
setText
(
QString
::
number
(
filteredData
.
gX
));
ui
->
m_Gyf
->
setText
(
QString
::
number
(
filteredData
.
gY
));
ui
->
m_Gzf
->
setText
(
QString
::
number
(
filteredData
.
gZ
));
ui
->
m_Mxf
->
setText
(
QString
::
number
(
filteredData
.
mX
));
ui
->
m_Myf
->
setText
(
QString
::
number
(
filteredData
.
mY
));
ui
->
m_Mzf
->
setText
(
QString
::
number
(
filteredData
.
mZ
));
const
mavlink_
scaled_imu
_t
&
filteredData
){
Q_UNUSED
(
systemId
);
ui
->
m_Axf
->
setText
(
QString
::
number
(
filteredData
.
xacc
/
1000.0
f
));
ui
->
m_Ayf
->
setText
(
QString
::
number
(
filteredData
.
yacc
/
1000.0
f
));
ui
->
m_Azf
->
setText
(
QString
::
number
(
filteredData
.
zacc
/
1000.0
f
));
ui
->
m_Gxf
->
setText
(
QString
::
number
(
filteredData
.
xgyro
/
1000.0
f
));
ui
->
m_Gyf
->
setText
(
QString
::
number
(
filteredData
.
ygyro
/
1000.0
f
));
ui
->
m_Gzf
->
setText
(
QString
::
number
(
filteredData
.
zgyro
/
1000.0
f
));
ui
->
m_Mxf
->
setText
(
QString
::
number
(
filteredData
.
xmag
/
1000.0
f
));
ui
->
m_Myf
->
setText
(
QString
::
number
(
filteredData
.
ymag
/
1000.0
f
));
ui
->
m_Mzf
->
setText
(
QString
::
number
(
filteredData
.
zmag
/
1000.0
f
));
}
void
SlugsDataSensorView
::
slugsGPSDateTimeChanged
(
int
systemId
,
...
...
@@ -294,11 +319,6 @@ void SlugsDataSensorView::slugsAirDataChanged(int systemId, const mavlink_air_da
ui
->
ed_dynamic
->
setText
(
QString
::
number
(
airData
.
dynamicPressure
));
ui
->
ed_static
->
setText
(
QString
::
number
(
airData
.
staticPressure
));
ui
->
ed_temp
->
setText
(
QString
::
number
(
airData
.
temperature
));
// qDebug()<<"Air Data = "<<airData.dynamicPressure<<" - "
// <<airData.staticPressure<<" - "
// <<airData.temperature;
}
/**
...
...
@@ -306,21 +326,12 @@ void SlugsDataSensorView::slugsAirDataChanged(int systemId, const mavlink_air_da
*
* COG and SOG GPS display on the Widgets
*/
void
SlugsDataSensorView
::
slugsGPSCogSog
(
int
systemId
,
double
cog
,
double
sog
)
void
SlugsDataSensorView
::
slugsGPSCogSog
(
int
systemId
,
double
cog
,
double
sog
)
{
Q_UNUSED
(
systemId
);
ui
->
m_GpsCog
->
setText
(
QString
::
number
(
cog
));
ui
->
m_GpsSog
->
setText
(
QString
::
number
(
sog
));
}
#endif // MAVLINK_ENABLED_SLUGS
src/ui/SlugsDataSensorView.h
View file @
0e6dceb0
This diff is collapsed.
Click to expand it.
src/ui/SlugsDataSensorView.ui
View file @
0e6dceb0
This diff is collapsed.
Click to expand it.
src/ui/SlugsPadCameraControl.cpp
View file @
0e6dceb0
...
...
@@ -128,7 +128,7 @@ void SlugsPadCameraControl::getDeltaPositionPad(int x2, int y2)
ui
->
lbPixel
->
setText
(
QString
::
number
(
localMeasures
.
y
()));
ui
->
lbDirection
->
setText
(
dir
);
qDebug
()
<<
dir
;
//
qDebug()<<dir;
update
();
}
}
...
...
src/ui/SlugsPadCameraControl.ui
View file @
0e6dceb0
...
...
@@ -68,7 +68,7 @@
<item>
<widget
class=
"QLabel"
name=
"lbPixel"
>
<property
name=
"styleSheet"
>
<string
notr=
"true"
>
font-color:rgb(0, 0, 0);
</string
>
<string
notr=
"true"
/
>
</property>
<property
name=
"text"
>
<string>
----
</string>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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