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
75851a36
Commit
75851a36
authored
Jul 11, 2013
by
Michael Carpenter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implementation of ArduRover pid configuration screen
parent
9e10b726
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
868 additions
and
4 deletions
+868
-4
qgroundcontrol.pro
qgroundcontrol.pro
+6
-3
ApmSoftwareConfig.cc
src/ui/configuration/ApmSoftwareConfig.cc
+17
-1
ApmSoftwareConfig.h
src/ui/configuration/ApmSoftwareConfig.h
+2
-0
ApmSoftwareConfig.ui
src/ui/configuration/ApmSoftwareConfig.ui
+13
-0
ArduRoverPidConfig.cc
src/ui/configuration/ArduRoverPidConfig.cc
+75
-0
ArduRoverPidConfig.h
src/ui/configuration/ArduRoverPidConfig.h
+23
-0
ArduRoverPidConfig.ui
src/ui/configuration/ArduRoverPidConfig.ui
+732
-0
No files found.
qgroundcontrol.pro
View file @
75851a36
...
...
@@ -260,7 +260,8 @@ FORMS += src/ui/MainWindow.ui \
src
/
ui
/
configuration
/
ApmPlaneLevel
.
ui
\
src
/
ui
/
configuration
/
ParamWidget
.
ui
\
src
/
ui
/
configuration
/
ArduPlanePidConfig
.
ui
\
src
/
ui
/
configuration
/
AdvParameterList
.
ui
src
/
ui
/
configuration
/
AdvParameterList
.
ui
\
src
/
ui
/
configuration
/
ArduRoverPidConfig
.
ui
INCLUDEPATH
+=
src
\
src
/
ui
\
src
/
ui
/
linechart
\
...
...
@@ -445,7 +446,8 @@ HEADERS += src/MG.h \
src
/
ui
/
configuration
/
ApmPlaneLevel
.
h
\
src
/
ui
/
configuration
/
ParamWidget
.
h
\
src
/
ui
/
configuration
/
ArduPlanePidConfig
.
h
\
src
/
ui
/
configuration
/
AdvParameterList
.
h
src
/
ui
/
configuration
/
AdvParameterList
.
h
\
src
/
ui
/
configuration
/
ArduRoverPidConfig
.
h
#
Google
Earth
is
only
supported
on
Mac
OS
and
Windows
with
Visual
Studio
Compiler
macx
|
macx
-
g
++
|
macx
-
g
++
42
|
win32
-
msvc2008
|
win32
-
msvc2010
|
win32
-
msvc2012
::
HEADERS
+=
src
/
ui
/
map3D
/
QGCGoogleEarthView
.
h
...
...
@@ -648,7 +650,8 @@ SOURCES += src/main.cc \
src
/
ui
/
configuration
/
ApmPlaneLevel
.
cc
\
src
/
ui
/
configuration
/
ParamWidget
.
cc
\
src
/
ui
/
configuration
/
ArduPlanePidConfig
.
cc
\
src
/
ui
/
configuration
/
AdvParameterList
.
cc
src
/
ui
/
configuration
/
AdvParameterList
.
cc
\
src
/
ui
/
configuration
/
ArduRoverPidConfig
.
cc
#
Enable
Google
Earth
only
on
Mac
OS
and
Windows
with
Visual
Studio
compiler
macx
|
macx
-
g
++
|
macx
-
g
++
42
|
win32
-
msvc2008
|
win32
-
msvc2010
|
win32
-
msvc2012
::
SOURCES
+=
src
/
ui
/
map3D
/
QGCGoogleEarthView
.
cc
...
...
src/ui/configuration/ApmSoftwareConfig.cc
View file @
75851a36
...
...
@@ -16,6 +16,8 @@ ApmSoftwareConfig::ApmSoftwareConfig(QWidget *parent) : QWidget(parent)
ui
.
advancedParamButton
->
setVisible
(
false
);
ui
.
advParamListButton
->
setVisible
(
false
);
ui
.
arduCopterPidButton
->
setVisible
(
false
);
ui
.
arduRoverPidButton
->
setVisible
(
false
);
ui
.
arduPlanePidButton
->
setVisible
(
false
);
/*basicPidConfig = new BasicPidConfig(this);
ui.stackedWidget->addWidget(basicPidConfig);
...
...
@@ -57,12 +59,18 @@ ApmSoftwareConfig::ApmSoftwareConfig(QWidget *parent) : QWidget(parent)
buttonToConfigWidgetMap
[
ui
.
arduCopterPidButton
]
=
arduCopterPidConfig
;
connect
(
ui
.
arduCopterPidButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
arduPlanePidConfig
=
new
ArduPlanePidConfig
(
this
);
ui
.
stackedWidget
->
addWidget
(
arduPlanePidConfig
);
buttonToConfigWidgetMap
[
ui
.
arduPlanePidButton
]
=
arduPlanePidConfig
;
connect
(
ui
.
arduPlanePidButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
arduRoverPidConfig
=
new
ArduRoverPidConfig
(
this
);
ui
.
stackedWidget
->
addWidget
(
arduRoverPidConfig
);
buttonToConfigWidgetMap
[
ui
.
arduRoverPidButton
]
=
arduRoverPidConfig
;
connect
(
ui
.
arduRoverPidButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
connect
(
UASManager
::
instance
(),
SIGNAL
(
activeUASSet
(
UASInterface
*
)),
this
,
SLOT
(
activeUASSet
(
UASInterface
*
)));
...
...
@@ -101,11 +109,19 @@ void ApmSoftwareConfig::activeUASSet(UASInterface *uas)
{
ui
.
arduPlanePidButton
->
setVisible
(
true
);
ui
.
arduCopterPidButton
->
setVisible
(
false
);
ui
.
arduRoverPidButton
->
setVisible
(
false
);
}
else
if
(
uas
->
getSystemType
()
==
MAV_TYPE_QUADROTOR
)
{
ui
.
arduCopterPidButton
->
setVisible
(
true
);
ui
.
arduPlanePidButton
->
setVisible
(
false
);
ui
.
arduRoverPidButton
->
setVisible
(
false
);
}
else
if
(
uas
->
getSystemType
()
==
MAV_TYPE_GROUND_ROVER
)
{
ui
.
arduRoverPidButton
->
setVisible
(
true
);
ui
.
arduCopterPidButton
->
setVisible
(
false
);
ui
.
arduPlanePidButton
->
setVisible
(
false
);
}
...
...
src/ui/configuration/ApmSoftwareConfig.h
View file @
75851a36
...
...
@@ -11,6 +11,7 @@
#include "AdvancedParamConfig.h"
#include "ArduCopterPidConfig.h"
#include "ArduPlanePidConfig.h"
#include "ArduRoverPidConfig.h"
#include "AdvParameterList.h"
#include "UASInterface.h"
#include "UASManager.h"
...
...
@@ -35,6 +36,7 @@ private:
AdvancedParamConfig
*
advancedParamConfig
;
ArduCopterPidConfig
*
arduCopterPidConfig
;
ArduPlanePidConfig
*
arduPlanePidConfig
;
ArduRoverPidConfig
*
arduRoverPidConfig
;
AdvParameterList
*
advParameterList
;
QMap
<
QObject
*
,
QWidget
*>
buttonToConfigWidgetMap
;
};
...
...
src/ui/configuration/ApmSoftwareConfig.ui
View file @
75851a36
...
...
@@ -200,6 +200,19 @@
</property>
</widget>
</item>
<item>
<widget
class=
"QPushButton"
name=
"arduRoverPidButton"
>
<property
name=
"minimumSize"
>
<size>
<width>
0
</width>
<height>
35
</height>
</size>
</property>
<property
name=
"text"
>
<string>
ArduRover Pids
</string>
</property>
</widget>
</item>
<item>
<spacer
name=
"verticalSpacer"
>
<property
name=
"orientation"
>
...
...
src/ui/configuration/ArduRoverPidConfig.cc
0 → 100644
View file @
75851a36
#include "ArduRoverPidConfig.h"
ArduRoverPidConfig
::
ArduRoverPidConfig
(
QWidget
*
parent
)
:
AP2ConfigWidget
(
parent
)
{
ui
.
setupUi
(
this
);
nameToBoxMap
[
"STEER2SRV_P"
]
=
ui
.
steer2ServoPSpinBox
;
nameToBoxMap
[
"STEER2SRV_I"
]
=
ui
.
steer2ServoISpinBox
;
nameToBoxMap
[
"STEER2SRV_D"
]
=
ui
.
steer2ServoDSpinBox
;
nameToBoxMap
[
"STEER2SRV_IMAX"
]
=
ui
.
steer2ServoIMAXSpinBox
;
nameToBoxMap
[
"XTRK_ANGLE_CD"
]
=
ui
.
xtrackEntryAngleSpinBox
;
nameToBoxMap
[
"XTRK_GAIN_SC"
]
=
ui
.
xtrackGainSpinBox
;
nameToBoxMap
[
"CRUISE_THROTTLE"
]
=
ui
.
throttleCruiseSpinBox
;
nameToBoxMap
[
"THR_MIN"
]
=
ui
.
throttleMinSpinBox
;
nameToBoxMap
[
"THR_MAX"
]
=
ui
.
throttleMaxSpinBox
;
nameToBoxMap
[
"FS_THR_VALUE"
]
=
ui
.
throttleFSSpinBox
;
nameToBoxMap
[
"HDNG2STEER_P"
]
=
ui
.
heading2SteerPSpinBox
;
nameToBoxMap
[
"HDNG2STEER_I"
]
=
ui
.
heading2SteerISpinBox
;
nameToBoxMap
[
"HDNG2STEER_D"
]
=
ui
.
heading2SteerDSpinBox
;
nameToBoxMap
[
"HDNG2STEER_IMAX"
]
=
ui
.
heading2SteerIMAXSpinBox
;
nameToBoxMap
[
"SPEED2THR_P"
]
=
ui
.
speed2ThrottlePSpinBox
;
nameToBoxMap
[
"SPEED2THR_I"
]
=
ui
.
speed2ThrottleISpinBox
;
nameToBoxMap
[
"SPEED2THR_D"
]
=
ui
.
speed2ThrottleDSpinBox
;
nameToBoxMap
[
"SPEED2THR_IMAX"
]
=
ui
.
speed2ThrottleIMAXSpinBox
;
nameToBoxMap
[
"CRUISE_SPEED"
]
=
ui
.
roverCruiseSpinBox
;
nameToBoxMap
[
"SPEED_TURN_GAIN"
]
=
ui
.
roverTurnSpeedSpinBox
;
nameToBoxMap
[
"SPEED_TURN_DIST"
]
=
ui
.
roverTurnDistSpinBox
;
nameToBoxMap
[
"WP_RADIUS"
]
=
ui
.
roverWPRadiusSpinBox
;
nameToBoxMap
[
"SONAR_TRIGGER_CM"
]
=
ui
.
sonarTriggerSpinBox
;
nameToBoxMap
[
"SONAR_TURN_ANGLE"
]
=
ui
.
sonarTurnAngleSpinBox
;
nameToBoxMap
[
"SONAR_TURN_TIME"
]
=
ui
.
sonarTurnTimeSpinBox
;
nameToBoxMap
[
"SONAR_DEBOUNCE"
]
=
ui
.
sonaeDebounceSpinBox
;
}
ArduRoverPidConfig
::~
ArduRoverPidConfig
()
{
}
void
ArduRoverPidConfig
::
writeButtonClicked
()
{
if
(
!
m_uas
)
{
return
;
}
for
(
QMap
<
QString
,
QDoubleSpinBox
*>::
const_iterator
i
=
nameToBoxMap
.
constBegin
();
i
!=
nameToBoxMap
.
constEnd
();
i
++
)
{
m_uas
->
getParamManager
()
->
setParameter
(
1
,
i
.
key
(),
i
.
value
()
->
value
());
}
}
void
ArduRoverPidConfig
::
refreshButtonClicked
()
{
if
(
!
m_uas
)
{
return
;
}
for
(
QMap
<
QString
,
QDoubleSpinBox
*>::
const_iterator
i
=
nameToBoxMap
.
constBegin
();
i
!=
nameToBoxMap
.
constEnd
();
i
++
)
{
m_uas
->
getParamManager
()
->
requestParameterUpdate
(
1
,
i
.
key
());
}
}
void
ArduRoverPidConfig
::
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
)
{
if
(
nameToBoxMap
.
contains
(
parameterName
))
{
nameToBoxMap
[
parameterName
]
->
setValue
(
value
.
toFloat
());
}
}
src/ui/configuration/ArduRoverPidConfig.h
0 → 100644
View file @
75851a36
#ifndef ARDUROVERPIDCONFIG_H
#define ARDUROVERPIDCONFIG_H
#include <QWidget>
#include "ui_ArduRoverPidConfig.h"
#include "AP2ConfigWidget.h"
class
ArduRoverPidConfig
:
public
AP2ConfigWidget
{
Q_OBJECT
public:
explicit
ArduRoverPidConfig
(
QWidget
*
parent
=
0
);
~
ArduRoverPidConfig
();
private
slots
:
void
writeButtonClicked
();
void
refreshButtonClicked
();
void
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
);
private:
QMap
<
QString
,
QDoubleSpinBox
*>
nameToBoxMap
;
Ui
::
ArduRoverPidConfig
ui
;
};
#endif // ARDUROVERPIDCONFIG_H
src/ui/configuration/ArduRoverPidConfig.ui
0 → 100644
View file @
75851a36
This diff is collapsed.
Click to expand it.
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