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
69d38e40
Commit
69d38e40
authored
Aug 22, 2015
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for new bus config message
parent
8aac00ff
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
1 deletion
+66
-1
PowerComponent.qml
src/AutoPilotPlugins/PX4/PowerComponent.qml
+31
-0
PowerComponentController.cc
src/AutoPilotPlugins/PX4/PowerComponentController.cc
+33
-1
PowerComponentController.h
src/AutoPilotPlugins/PX4/PowerComponentController.h
+2
-0
No files found.
src/AutoPilotPlugins/PX4/PowerComponent.qml
View file @
69d38e40
...
...
@@ -263,6 +263,37 @@ QGCView {
}
}
QGCLabel
{
text
:
"
UAVCAN ESC Configuration
"
font.pixelSize
:
ScreenTools
.
mediumFontPixelSize
}
Rectangle
{
width
:
parent
.
width
height
:
140
color
:
palette
.
windowShade
Column
{
anchors.margins
:
10
anchors.fill
:
parent
spacing
:
10
QGCLabel
{
color
:
"
yellow
"
text
:
"
<font color=
\"
yellow
\"
>WARNING: Propellers must be removed from vehicle prior to performing UAVCAN ESC configuration.</font>
"
}
QGCLabel
{
text
:
"
You must use USB connection for this operation.
"
}
QGCButton
{
text
:
"
Configure
"
onClicked
:
controller
.
busConfigureActuators
()
}
}
}
/*
* This is disabled for now
Row {
...
...
src/AutoPilotPlugins/PX4/PowerComponentController.cc
View file @
69d38e40
...
...
@@ -49,11 +49,23 @@ void PowerComponentController::calibrateEsc(void)
_uas
->
startCalibration
(
UASInterface
::
StartCalibrationEsc
);
}
void
PowerComponentController
::
busConfigureActuators
(
void
)
{
_warningMessages
.
clear
();
connect
(
_uas
,
&
UASInterface
::
textMessageReceived
,
this
,
&
PowerComponentController
::
_handleUASTextMessage
);
_uas
->
startBusConfig
(
UASInterface
::
StartBusConfigActuators
);
}
void
PowerComponentController
::
_stopCalibration
(
void
)
{
disconnect
(
_uas
,
&
UASInterface
::
textMessageReceived
,
this
,
&
PowerComponentController
::
_handleUASTextMessage
);
}
void
PowerComponentController
::
_stopBusConfig
(
void
)
{
_stopCalibration
();
}
void
PowerComponentController
::
_handleUASTextMessage
(
int
uasId
,
int
compId
,
int
severity
,
QString
text
)
{
Q_UNUSED
(
compId
);
...
...
@@ -130,8 +142,28 @@ void PowerComponentController::_handleUASTextMessage(int uasId, int compId, int
return
;
}
QString
warningPrefix
(
"c
alibration
warning: "
);
QString
warningPrefix
(
"c
onfig
warning: "
);
if
(
text
.
startsWith
(
warningPrefix
))
{
_warningMessages
<<
text
.
right
(
text
.
length
()
-
warningPrefix
.
length
());
}
QString
busFailedPrefix
(
"bus conf fail:"
);
if
(
text
.
startsWith
(
busFailedPrefix
))
{
_stopBusConfig
();
emit
calibrationFailed
(
text
.
right
(
text
.
length
()
-
failedPrefix
.
length
()));
return
;
}
QString
busCompletePrefix
(
"bus conf done:"
);
if
(
text
.
startsWith
(
calCompletePrefix
))
{
_stopBusConfig
();
emit
calibrationSuccess
(
_warningMessages
);
return
;
}
QString
busWarningPrefix
(
"bus conf warn: "
);
if
(
text
.
startsWith
(
busWarningPrefix
))
{
_warningMessages
<<
text
.
right
(
text
.
length
()
-
warningPrefix
.
length
());
}
}
src/AutoPilotPlugins/PX4/PowerComponentController.h
View file @
69d38e40
...
...
@@ -43,6 +43,7 @@ public:
~
PowerComponentController
();
Q_INVOKABLE
void
calibrateEsc
(
void
);
Q_INVOKABLE
void
busConfigureActuators
(
void
);
signals:
void
oldFirmware
(
void
);
...
...
@@ -59,6 +60,7 @@ private slots:
private:
void
_stopCalibration
(
void
);
void
_stopBusConfig
(
void
);
QStringList
_warningMessages
;
static
const
int
_neededFirmwareRev
=
1
;
...
...
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