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
9e1d9e95
Commit
9e1d9e95
authored
Jul 17, 2014
by
Thomas Gubler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make joystick changed signal work again
parent
1bb5779d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
8 deletions
+10
-8
JoystickInput.cc
src/input/JoystickInput.cc
+3
-2
JoystickInput.h
src/input/JoystickInput.h
+4
-4
UAS.cc
src/uas/UAS.cc
+2
-1
UAS.h
src/uas/UAS.h
+1
-1
No files found.
src/input/JoystickInput.cc
View file @
9e1d9e95
...
...
@@ -323,7 +323,7 @@ void JoystickInput::setActiveUAS(UASInterface* uas)
tmp
=
dynamic_cast
<
UAS
*>
(
this
->
uas
);
if
(
tmp
)
{
disconnect
(
this
,
SIGNAL
(
joystickChanged
(
float
,
float
,
float
,
float
,
qint8
,
qint8
,
quint16
,
JOYSTICK_MODE
)),
tmp
,
SLOT
(
setExternalControlSetpoint
(
float
,
float
,
float
,
float
,
qint8
,
qint8
,
quint16
,
JOYSTICK_MODE
)));
disconnect
(
this
,
SIGNAL
(
joystickChanged
(
float
,
float
,
float
,
float
,
qint8
,
qint8
,
quint16
,
quint8
)),
tmp
,
SLOT
(
setExternalControlSetpoint
(
float
,
float
,
float
,
float
,
qint8
,
qint8
,
quint16
,
quint8
)));
disconnect
(
this
,
SIGNAL
(
actionTriggered
(
int
)),
tmp
,
SLOT
(
triggerAction
(
int
)));
}
uasCanReverse
=
false
;
...
...
@@ -339,7 +339,8 @@ void JoystickInput::setActiveUAS(UASInterface* uas)
if
(
this
->
uas
&&
(
tmp
=
dynamic_cast
<
UAS
*>
(
this
->
uas
)))
{
connect
(
this
,
SIGNAL
(
joystickChanged
(
float
,
float
,
float
,
float
,
qint8
,
qint8
,
quint16
,
JOYSTICK_MODE
)),
tmp
,
SLOT
(
setExternalControlSetpoint
(
float
,
float
,
float
,
float
,
qint8
,
qint8
,
quint16
,
JOYSTICK_MODE
)));
connect
(
this
,
SIGNAL
(
joystickChanged
(
float
,
float
,
float
,
float
,
qint8
,
qint8
,
quint16
,
quint8
)),
tmp
,
SLOT
(
setExternalControlSetpoint
(
float
,
float
,
float
,
float
,
qint8
,
qint8
,
quint16
,
quint8
)));
qDebug
()
<<
"connected joystick"
;
connect
(
this
,
SIGNAL
(
actionTriggered
(
int
)),
tmp
,
SLOT
(
triggerAction
(
int
)));
uasCanReverse
=
tmp
->
systemCanReverse
();
...
...
src/input/JoystickInput.h
View file @
9e1d9e95
...
...
@@ -96,8 +96,8 @@ public:
enum
JOYSTICK_MODE
{
JOYSTICK_MODE_ATTITUDE
=
0
,
JOYSTICK_MODE_POSITION
=
1
,
JOYSTICK_MODE_FORCE
=
2
,
JOYSTICK_MODE_POSITION
=
1
,
JOYSTICK_MODE_FORCE
=
2
};
/**
...
...
@@ -253,7 +253,7 @@ signals:
* @param yHat hat vector in left-right direction, -1 left, 0 center, +1 right
* @param mode (setpoint type) see JOYSTICK_MODE enum
*/
void
joystickChanged
(
float
roll
,
float
pitch
,
float
yaw
,
float
throttle
,
qint8
xHat
,
qint8
yHat
,
quint16
buttons
,
JOYSTICK_MODE
mode
);
void
joystickChanged
(
float
roll
,
float
pitch
,
float
yaw
,
float
throttle
,
qint8
xHat
,
qint8
yHat
,
quint16
buttons
,
quint8
mode
);
/**
* @brief Emit a new value for an axis
...
...
@@ -366,7 +366,7 @@ public slots:
* @brief Specify which setpoints should be sent to the UAS when moving the joystick
* @param newMode the mode (setpoint type) see the JOYSTICK_MODE enum
*/
void
setMode
(
int
newMode
)
void
setMode
(
quint8
newMode
)
{
mode
=
(
JOYSTICK_MODE
)
newMode
;
}
...
...
src/uas/UAS.cc
View file @
9e1d9e95
...
...
@@ -2933,7 +2933,7 @@ void UAS::toggleAutonomy()
* Set the manual control commands.
* This can only be done if the system has manual inputs enabled and is armed.
*/
void
UAS
::
setExternalControlSetpoint
(
float
roll
,
float
pitch
,
float
yaw
,
float
thrust
,
qint8
xHat
,
qint8
yHat
,
quint16
buttons
,
JoystickInput
::
JOYSTICK_MODE
joystickMode
)
void
UAS
::
setExternalControlSetpoint
(
float
roll
,
float
pitch
,
float
yaw
,
float
thrust
,
qint8
xHat
,
qint8
yHat
,
quint16
buttons
,
quint8
joystickMode
)
{
Q_UNUSED
(
xHat
);
Q_UNUSED
(
yHat
);
...
...
@@ -2978,6 +2978,7 @@ void UAS::setExternalControlSetpoint(float roll, float pitch, float yaw, float t
manualButtons
=
buttons
;
mavlink_message_t
message
;
qDebug
()
<<
"js mode"
<<
joystickMode
;
if
(
joystickMode
==
JoystickInput
::
JOYSTICK_MODE_ATTITUDE
)
{
...
...
src/uas/UAS.h
View file @
9e1d9e95
...
...
@@ -839,7 +839,7 @@ public slots:
void
toggleAutonomy
();
/** @brief Set the values for the manual control of the vehicle */
void
setExternalControlSetpoint
(
float
roll
,
float
pitch
,
float
yaw
,
float
thrust
,
qint8
xHat
,
qint8
yHat
,
quint16
buttons
,
JoystickInput
::
JOYSTICK_MODE
joystickMode
);
void
setExternalControlSetpoint
(
float
roll
,
float
pitch
,
float
yaw
,
float
thrust
,
qint8
xHat
,
qint8
yHat
,
quint16
buttons
,
quint8
);
/** @brief Set the values for the 6dof manual control of the vehicle */
void
setManual6DOFControlCommands
(
double
x
,
double
y
,
double
z
,
double
roll
,
double
pitch
,
double
yaw
);
...
...
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