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
4d5aa0df
Commit
4d5aa0df
authored
Aug 27, 2013
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed RC mapping check
parent
1f76bbed
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
716 additions
and
24 deletions
+716
-24
cessna_back.png
files/images/px4/rc/cessna_back.png
+0
-0
cessna_side.png
files/images/px4/rc/cessna_side.png
+0
-0
rc_backgrounds.graffle
files/images/px4/rc/rc_backgrounds.graffle
+674
-0
qgroundcontrol.qrc
qgroundcontrol.qrc
+2
-0
QGCPX4VehicleConfig.cc
src/ui/QGCPX4VehicleConfig.cc
+21
-13
QGCPX4VehicleConfig.h
src/ui/QGCPX4VehicleConfig.h
+9
-4
QGCPX4VehicleConfig.ui
src/ui/QGCPX4VehicleConfig.ui
+10
-7
No files found.
files/images/px4/rc/cessna_back.png
0 → 100644
View file @
4d5aa0df
131 KB
files/images/px4/rc/cessna_side.png
0 → 100644
View file @
4d5aa0df
73 KB
files/images/px4/rc/rc_backgrounds.graffle
0 → 100644
View file @
4d5aa0df
This diff is collapsed.
Click to expand it.
qgroundcontrol.qrc
View file @
4d5aa0df
...
...
@@ -180,6 +180,8 @@
<file>files/images/px4/menu/plane.png</file>
<file>files/images/px4/menu/remote.png</file>
<file>files/images/px4/menu/cogwheels.png</file>
<file>files/images/px4/rc/cessna_back.png</file>
<file>files/images/px4/rc/cessna_side.png</file>
</qresource>
<qresource prefix="/general">
<file alias="vera.ttf">files/styles/Vera.ttf</file>
...
...
src/ui/QGCPX4VehicleConfig.cc
View file @
4d5aa0df
...
...
@@ -60,6 +60,8 @@ QGCPX4VehicleConfig::QGCPX4VehicleConfig(QWidget *parent) :
#ifdef QUPGRADE_SUPPORT
firmwareDialog
(
NULL
),
#endif
planeBack
(
":/files/images/px4/rc/cessna_back.png"
),
planeSide
(
":/files/images/px4/rc/cessna_side.png"
),
ui
(
new
Ui
::
QGCPX4VehicleConfig
)
{
doneLoadingConfig
=
false
;
...
...
@@ -142,6 +144,15 @@ QGCPX4VehicleConfig::QGCPX4VehicleConfig(QWidget *parent) :
connect
(
ui
->
advancedCheckBox
,
SIGNAL
(
clicked
(
bool
)),
ui
->
advancedGroupBox
,
SLOT
(
setVisible
(
bool
)));
ui
->
advancedGroupBox
->
setVisible
(
false
);
connect
(
ui
->
advancedCheckBox
,
SIGNAL
(
clicked
(
bool
)),
ui
->
graphicsView
,
SLOT
(
setHidden
(
bool
)));
ui
->
graphicsView
->
setScene
(
&
scene
);
scene
.
addPixmap
(
planeBack
);
scene
.
addPixmap
(
planeSide
);
// XXX hide while WIP
ui
->
graphicsView
->
hide
();
ui
->
rcCalibrationButton
->
setCheckable
(
true
);
connect
(
ui
->
rcCalibrationButton
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
toggleCalibrationRC
(
bool
)));
...
...
@@ -209,6 +220,7 @@ QGCPX4VehicleConfig::QGCPX4VehicleConfig(QWidget *parent) :
rcMappedMin
[
i
]
=
1000
;
rcMappedMax
[
i
]
=
2000
;
rcMappedValue
[
i
]
=
UINT16_MAX
;
rcMappedValueRev
[
i
]
=
UINT16_MAX
;
rcMappedNormalizedValue
[
i
]
=
0.0
f
;
}
...
...
@@ -217,6 +229,7 @@ QGCPX4VehicleConfig::QGCPX4VehicleConfig(QWidget *parent) :
rcMappedMin
[
i
]
=
1000
;
rcMappedMax
[
i
]
=
2000
;
rcMappedValue
[
i
]
=
UINT16_MAX
;
rcMappedValueRev
[
i
]
=
UINT16_MAX
;
rcMappedNormalizedValue
[
i
]
=
0.0
f
;
}
...
...
@@ -1184,13 +1197,12 @@ void QGCPX4VehicleConfig::remoteControlChannelRawChanged(int chan, float fval)
}
// Raw value
float
mappedVal
=
rcMappedValue
[
rcToFunctionMapping
[
chan
]];
float
deltaRaw
=
fabsf
(
fval
-
rcValue
[
chan
]);
float
delta
=
fabsf
(
fval
-
mappedVal
);
float
delta
=
fabsf
(
fval
-
rcMappedValue
[
rcToFunctionMapping
[
chan
]]
);
if
(
!
configEnabled
&&
!
calibrationEnabled
&&
(
deltaRaw
<
12.0
f
&&
delta
<
12.0
f
&&
rcValue
[
chan
]
>
800
&&
rcValue
[
chan
]
<
2200
))
{
//ignore tiny jitter values
//
ignore tiny jitter values
return
;
}
else
{
...
...
@@ -1281,17 +1293,13 @@ void QGCPX4VehicleConfig::remoteControlChannelRawChanged(int chan, float fval)
normalized
=
(
rcRev
[
chan
])
?
-
1.0
f
*
normalized
:
normalized
;
// Find correct mapped channel
for
(
unsigned
int
i
=
0
;
i
<
chanCount
;
i
++
)
{
if
(
chan
==
rcMapping
[
i
])
{
rcMappedValue
[
i
]
=
(
rcRev
[
chan
])
?
rcMax
[
chan
]
-
(
fval
-
rcMin
[
chan
])
:
fval
;
rcMappedValueRev
[
rcToFunctionMapping
[
chan
]]
=
(
rcRev
[
chan
])
?
rcMax
[
chan
]
-
(
fval
-
rcMin
[
chan
])
:
fval
;
rcMappedValue
[
rcToFunctionMapping
[
chan
]]
=
fval
;
// Copy min / max
rcMappedMin
[
i
]
=
rcMin
[
chan
];
rcMappedMax
[
i
]
=
rcMax
[
chan
];
rcMappedNormalizedValue
[
i
]
=
normalized
;
}
}
// Copy min / max
rcMappedMin
[
rcToFunctionMapping
[
chan
]]
=
rcMin
[
chan
];
rcMappedMax
[
rcToFunctionMapping
[
chan
]]
=
rcMax
[
chan
];
rcMappedNormalizedValue
[
rcToFunctionMapping
[
chan
]]
=
normalized
;
if
(
chan
==
rcMapping
[
0
])
{
rcRoll
=
normalized
;
...
...
src/ui/QGCPX4VehicleConfig.h
View file @
4d5aa0df
...
...
@@ -8,6 +8,7 @@
#include <QPushButton>
#include <QStringList>
#include <QMessageBox>
#include <QGraphicsScene>
#include "QGCToolWidget.h"
#include "UASInterface.h"
...
...
@@ -285,10 +286,11 @@ protected:
float
rcScaling
[
chanMax
];
///< Scaling of channel input to control commands
bool
rcRev
[
chanMax
];
///< Channel reverse
int
rcValue
[
chanMax
];
///< Last values, RAW
float
rcValueReversed
[
chanMax
];
///< Last values, accounted for reverse
float
rcMappedMin
[
chanMappedMax
];
///< Mapped channels in default order
float
rcMappedMax
[
chanMappedMax
];
///< Mapped channels in default order
float
rcMappedValue
[
chanMappedMax
];
///< Mapped channels in default order
int
rcValueReversed
[
chanMax
];
///< Last values, accounted for reverse
int
rcMappedMin
[
chanMappedMax
];
///< Mapped channels in default order
int
rcMappedMax
[
chanMappedMax
];
///< Mapped channels in default order
int
rcMappedValue
[
chanMappedMax
];
///< Mapped channels in default order
int
rcMappedValueRev
[
chanMappedMax
];
float
rcMappedNormalizedValue
[
chanMappedMax
];
///< Mapped channels in default order
int
channelWanted
;
///< During channel assignment search the requested default index
int
channelReverseStateWanted
;
...
...
@@ -323,8 +325,11 @@ protected:
QGCPX4AirframeConfig
*
px4AirframeConfig
;
DialogBare
*
firmwareDialog
;
QPixmap
planeBack
;
QPixmap
planeSide
;
QGCPX4SensorCalibration
*
px4SensorCalibration
;
QMessageBox
msgBox
;
QGraphicsScene
scene
;
QPushButton
*
skipActionButton
;
private:
...
...
src/ui/QGCPX4VehicleConfig.ui
View file @
4d5aa0df
...
...
@@ -42,7 +42,7 @@
<item>
<widget
class=
"QStackedWidget"
name=
"stackedWidget"
>
<property
name=
"currentIndex"
>
<number>
0
</number>
<number>
1
</number>
</property>
<widget
class=
"QWidget"
name=
"firmwareTab"
>
<layout
class=
"QVBoxLayout"
name=
"firmwareLayout"
/>
...
...
@@ -205,6 +205,9 @@
</property>
</widget>
</item>
<item>
<widget
class=
"QGraphicsView"
name=
"graphicsView"
/>
</item>
<item>
<widget
class=
"QGroupBox"
name=
"advancedGroupBox"
>
<property
name=
"title"
>
...
...
@@ -819,8 +822,8 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
98
</width>
<height>
28
</height>
<width>
21
</width>
<height>
16
</height>
</rect>
</property>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_4"
>
...
...
@@ -856,8 +859,8 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
98
</width>
<height>
28
</height>
<width>
21
</width>
<height>
16
</height>
</rect>
</property>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_5"
>
...
...
@@ -907,8 +910,8 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
98
</width>
<height>
28
</height>
<width>
16
</width>
<height>
16
</height>
</rect>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_7"
>
...
...
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