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
7f07336a
Commit
7f07336a
authored
Jan 18, 2012
by
hengli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed long command bug: sends the required 7 parameters instead of 4 parameters.
parent
2e26be8a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
25 deletions
+6
-25
UAS.cc
src/uas/UAS.cc
+1
-20
UAS.h
src/uas/UAS.h
+0
-2
UASInterface.h
src/uas/UASInterface.h
+1
-1
QGCCommandButton.cc
src/ui/designer/QGCCommandButton.cc
+4
-2
No files found.
src/uas/UAS.cc
View file @
7f07336a
...
...
@@ -1911,25 +1911,6 @@ void UAS::executeCommand(MAV_CMD command)
sendMessage
(
msg
);
}
void
UAS
::
executeCommand
(
MAV_CMD
command
,
int
confirmation
,
float
param1
,
float
param2
,
float
param3
,
float
param4
,
int
component
)
{
mavlink_message_t
msg
;
mavlink_command_long_t
cmd
;
cmd
.
command
=
(
uint8_t
)
command
;
cmd
.
confirmation
=
confirmation
;
cmd
.
param1
=
param1
;
cmd
.
param2
=
param2
;
cmd
.
param3
=
param3
;
cmd
.
param4
=
param4
;
cmd
.
param5
=
0.0
f
;
cmd
.
param6
=
0.0
f
;
cmd
.
param7
=
0.0
f
;
cmd
.
target_system
=
uasId
;
cmd
.
target_component
=
component
;
mavlink_msg_command_long_encode
(
mavlink
->
getSystemId
(),
mavlink
->
getComponentId
(),
&
msg
,
&
cmd
);
sendMessage
(
msg
);
}
void
UAS
::
executeCommand
(
MAV_CMD
command
,
int
confirmation
,
float
param1
,
float
param2
,
float
param3
,
float
param4
,
float
param5
,
float
param6
,
float
param7
,
int
component
)
{
mavlink_message_t
msg
;
...
...
@@ -2196,7 +2177,7 @@ void UAS::shutdown()
void
UAS
::
setTargetPosition
(
float
x
,
float
y
,
float
z
,
float
yaw
)
{
mavlink_message_t
msg
;
mavlink_msg_command_long_pack
(
mavlink
->
getSystemId
(),
mavlink
->
getComponentId
(),
&
msg
,
uasId
,
MAV_COMP_ID_ALL
,
MAV_CMD_NAV_PATHPLANNING
,
1
,
2
,
2
,
0
,
yaw
,
x
,
y
,
z
);
mavlink_msg_command_long_pack
(
mavlink
->
getSystemId
(),
mavlink
->
getComponentId
(),
&
msg
,
uasId
,
MAV_COMP_ID_ALL
,
MAV_CMD_NAV_PATHPLANNING
,
1
,
2
,
3
,
0
,
yaw
,
x
,
y
,
z
);
sendMessage
(
msg
);
}
...
...
src/uas/UAS.h
View file @
7f07336a
...
...
@@ -411,8 +411,6 @@ public slots:
void
setUASName
(
const
QString
&
name
);
/** @brief Executes a command **/
void
executeCommand
(
MAV_CMD
command
);
/** @brief Executes a command **/
void
executeCommand
(
MAV_CMD
command
,
int
confirmation
,
float
param1
,
float
param2
,
float
param3
,
float
param4
,
int
component
);
/** @brief Executes a command with 7 params */
void
executeCommand
(
MAV_CMD
command
,
int
confirmation
,
float
param1
,
float
param2
,
float
param3
,
float
param4
,
float
param5
,
float
param6
,
float
param7
,
int
component
);
/** @brief Set the current battery type and voltages */
...
...
src/uas/UASInterface.h
View file @
7f07336a
...
...
@@ -215,7 +215,7 @@ public slots:
/** @brief Execute command immediately **/
virtual
void
executeCommand
(
MAV_CMD
command
)
=
0
;
/** @brief Executes a command **/
virtual
void
executeCommand
(
MAV_CMD
command
,
int
confirmation
,
float
param1
,
float
param2
,
float
param3
,
float
param4
,
int
component
)
=
0
;
virtual
void
executeCommand
(
MAV_CMD
command
,
int
confirmation
,
float
param1
,
float
param2
,
float
param3
,
float
param4
,
float
param5
,
float
param6
,
float
param7
,
int
component
)
=
0
;
/** @brief Selects the airframe */
virtual
void
setAirframe
(
int
airframe
)
=
0
;
...
...
src/ui/designer/QGCCommandButton.cc
View file @
7f07336a
...
...
@@ -79,7 +79,6 @@ QGCCommandButton::~QGCCommandButton()
void
QGCCommandButton
::
sendCommand
()
{
if
(
QGCToolWidgetItem
::
uas
)
{
// FIXME
int
index
=
ui
->
editCommandComboBox
->
itemData
(
ui
->
editCommandComboBox
->
currentIndex
()).
toInt
();
MAV_CMD
command
=
static_cast
<
MAV_CMD
>
(
index
);
int
confirm
=
(
ui
->
editConfirmationCheckBox
->
isChecked
())
?
1
:
0
;
...
...
@@ -87,9 +86,12 @@ void QGCCommandButton::sendCommand()
float
param2
=
ui
->
editParam2SpinBox
->
value
();
float
param3
=
ui
->
editParam3SpinBox
->
value
();
float
param4
=
ui
->
editParam4SpinBox
->
value
();
float
param5
=
ui
->
editParam5SpinBox
->
value
();
float
param6
=
ui
->
editParam6SpinBox
->
value
();
float
param7
=
ui
->
editParam7SpinBox
->
value
();
int
component
=
ui
->
editComponentSpinBox
->
value
();
QGCToolWidgetItem
::
uas
->
executeCommand
(
command
,
confirm
,
param1
,
param2
,
param3
,
param4
,
component
);
QGCToolWidgetItem
::
uas
->
executeCommand
(
command
,
confirm
,
param1
,
param2
,
param3
,
param4
,
param5
,
param6
,
param7
,
component
);
qDebug
()
<<
__FILE__
<<
__LINE__
<<
"SENDING COMMAND"
<<
index
;
}
else
{
qDebug
()
<<
__FILE__
<<
__LINE__
<<
"NO UAS SET, DOING NOTHING"
;
...
...
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