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
ff49ad04
Unverified
Commit
ff49ad04
authored
Apr 15, 2020
by
Don Gagne
Committed by
GitHub
Apr 15, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8601 from booo/joystick-emergency-stop
add emergency stop as joystick button action
parents
d69d17a1
953e92bc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
Joystick.cc
src/Joystick/Joystick.cc
+6
-0
Joystick.h
src/Joystick/Joystick.h
+2
-0
No files found.
src/Joystick/Joystick.cc
View file @
ff49ad04
...
...
@@ -64,6 +64,7 @@ const char* Joystick::_buttonActionGimbalUp = QT_TR_NOOP("Gimbal Up");
const
char
*
Joystick
::
_buttonActionGimbalLeft
=
QT_TR_NOOP
(
"Gimbal Left"
);
const
char
*
Joystick
::
_buttonActionGimbalRight
=
QT_TR_NOOP
(
"Gimbal Right"
);
const
char
*
Joystick
::
_buttonActionGimbalCenter
=
QT_TR_NOOP
(
"Gimbal Center"
);
const
char
*
Joystick
::
_buttonActionEmergencyStop
=
QT_TR_NOOP
(
"Emergency Stop"
);
const
char
*
Joystick
::
_rgFunctionSettingsKey
[
Joystick
::
maxFunction
]
=
{
"RollAxis"
,
...
...
@@ -684,6 +685,7 @@ void Joystick::startPolling(Vehicle* vehicle)
disconnect
(
this
,
&
Joystick
::
gimbalYawStep
,
_activeVehicle
,
&
Vehicle
::
gimbalYawStep
);
disconnect
(
this
,
&
Joystick
::
centerGimbal
,
_activeVehicle
,
&
Vehicle
::
centerGimbal
);
disconnect
(
this
,
&
Joystick
::
gimbalControlValue
,
_activeVehicle
,
&
Vehicle
::
gimbalControlValue
);
disconnect
(
this
,
&
Joystick
::
emergencyStop
,
_activeVehicle
,
&
Vehicle
::
emergencyStop
);
}
// Always set up the new vehicle
_activeVehicle
=
vehicle
;
...
...
@@ -707,6 +709,7 @@ void Joystick::startPolling(Vehicle* vehicle)
connect
(
this
,
&
Joystick
::
gimbalYawStep
,
_activeVehicle
,
&
Vehicle
::
gimbalYawStep
);
connect
(
this
,
&
Joystick
::
centerGimbal
,
_activeVehicle
,
&
Vehicle
::
centerGimbal
);
connect
(
this
,
&
Joystick
::
gimbalControlValue
,
_activeVehicle
,
&
Vehicle
::
gimbalControlValue
);
connect
(
this
,
&
Joystick
::
emergencyStop
,
_activeVehicle
,
&
Vehicle
::
emergencyStop
);
// FIXME: ****
//connect(this, &Joystick::buttonActionTriggered, uas, &UAS::triggerAction);
}
...
...
@@ -1028,6 +1031,8 @@ void Joystick::_executeButtonAction(const QString& action, bool buttonDown)
_localYaw
=
0.0
;
emit
gimbalControlValue
(
0.0
,
0.0
);
}
}
else
if
(
action
==
_buttonActionEmergencyStop
)
{
if
(
buttonDown
)
emit
emergencyStop
();
}
else
{
qCDebug
(
JoystickLog
)
<<
"_buttonAction unknown action:"
<<
action
;
}
...
...
@@ -1116,6 +1121,7 @@ void Joystick::_buildActionList(Vehicle* activeVehicle)
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionGimbalLeft
,
true
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionGimbalRight
,
true
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionGimbalCenter
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionEmergencyStop
));
for
(
int
i
=
0
;
i
<
_assignableButtonActions
.
count
();
i
++
)
{
AssignableButtonAction
*
p
=
qobject_cast
<
AssignableButtonAction
*>
(
_assignableButtonActions
[
i
]);
_availableActionTitles
<<
p
->
action
();
...
...
src/Joystick/Joystick.h
View file @
ff49ad04
...
...
@@ -225,6 +225,7 @@ signals:
void
setArmed
(
bool
arm
);
void
setVtolInFwdFlight
(
bool
set
);
void
setFlightMode
(
const
QString
&
flightMode
);
void
emergencyStop
();
protected:
void
_setDefaultCalibration
();
...
...
@@ -351,6 +352,7 @@ private:
static
const
char
*
_buttonActionGimbalLeft
;
static
const
char
*
_buttonActionGimbalRight
;
static
const
char
*
_buttonActionGimbalCenter
;
static
const
char
*
_buttonActionEmergencyStop
;
private
slots
:
void
_activeVehicleChanged
(
Vehicle
*
activeVehicle
);
...
...
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