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
ce4ca598
Commit
ce4ca598
authored
Jun 21, 2014
by
Julian Oes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UAS: send swarm messages instead of manual control
parent
10e3886d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
6 deletions
+16
-6
UAS.cc
src/uas/UAS.cc
+16
-6
No files found.
src/uas/UAS.cc
View file @
ce4ca598
...
@@ -2930,17 +2930,27 @@ void UAS::setManualControlCommands(float roll, float pitch, float yaw, float thr
...
@@ -2930,17 +2930,27 @@ void UAS::setManualControlCommands(float roll, float pitch, float yaw, float thr
manualButtons
=
buttons
;
manualButtons
=
buttons
;
// Store scaling values for all 3 axes
// Store scaling values for all 3 axes
const
float
axesScaling
=
1
.0
*
1000.0
;
const
float
axesScaling
=
1
000.0
f
;
// Calculate the new commands for roll, pitch, yaw, and thrust
// Calculate the new commands for roll, pitch, yaw, and thrust
const
float
newRollCommand
=
roll
*
axesScaling
;
// const float newRollCommand = roll * axesScaling;
const
float
newPitchCommand
=
pitch
*
axesScaling
;
// const float newPitchCommand = pitch * axesScaling;
const
float
newYawCommand
=
yaw
*
axesScaling
;
// const float newYawCommand = yaw * axesScaling;
const
float
newThrustCommand
=
thrust
*
axesScaling
;
// const float newThrustCommand = thrust * axesScaling;
const
int16_t
rollCommand
=
(
int16_t
)(
roll
*
axesScaling
);
const
int16_t
pitchCommand
=
(
int16_t
)(
pitch
*
axesScaling
);
const
int16_t
yawCommand
=
(
int16_t
)(
yaw
*
axesScaling
);
const
uint16_t
thrustCommand
=
(
uint16_t
)(
thrust
*
axesScaling
);
uint8_t
mode
=
3
;
// for velocity setpoint (OFFBOARD_CONTROL_MODE_DIRECT_VELOCITY)
// Send the MANUAL_COMMAND message
// Send the MANUAL_COMMAND message
mavlink_message_t
message
;
mavlink_message_t
message
;
mavlink_msg_manual_control_pack
(
mavlink
->
getSystemId
(),
mavlink
->
getComponentId
(),
&
message
,
this
->
uasId
,
newPitchCommand
,
newRollCommand
,
newThrustCommand
,
newYawCommand
,
buttons
);
//mavlink_msg_manual_control_pack(mavlink->getSystemId(), mavlink->getComponentId(), &message, this->uasId, newPitchCommand, newRollCommand, newThrustCommand, newYawCommand, buttons);
// hack to send swarm command, TODO: replace with proper message
mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_pack
(
mavlink
->
getSystemId
(),
mavlink
->
getComponentId
(),
&
message
,
this
->
uasId
,
mode
,
&
rollCommand
,
&
pitchCommand
,
&
yawCommand
,
&
thrustCommand
);
sendMessage
(
message
);
sendMessage
(
message
);
// Emit an update in control values to other UI elements, like the HSI display
// Emit an update in control values to other UI elements, like the HSI display
...
...
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