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
002811e8
Commit
002811e8
authored
Jul 15, 2014
by
Thomas Gubler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use new attitude externel sp message
parent
25f824db
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
7 deletions
+21
-7
UAS.cc
src/uas/UAS.cc
+21
-7
No files found.
src/uas/UAS.cc
View file @
002811e8
...
...
@@ -2990,10 +2990,10 @@ void UAS::setManualControlCommands(float roll, float pitch, float yaw, float thr
// const float newPitchCommand = pitch * axesScaling;
// const float newYawCommand = yaw * 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
);
//
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)
...
...
@@ -3001,9 +3001,23 @@ void UAS::setManualControlCommands(float roll, float pitch, float yaw, float thr
// Send the MANUAL_COMMAND message
mavlink_message_t
message
;
//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
);
// send an external attitude setpoint command (rate control disabled)
float
attitudeQuaternion
[
4
];
mavlink_euler_to_quaternion
(
roll
,
pitch
,
yaw
,
attitudeQuaternion
);
uint8_t
typeMask
=
0
b111
;
// disable rate control
mavlink_msg_attitude_setpoint_external_pack
(
mavlink
->
getSystemId
(),
mavlink
->
getComponentId
(),
&
message
,
QGC
::
groundTimeUsecs
(),
this
->
uasId
,
0
,
typeMask
,
attitudeQuaternion
,
0
,
0
,
0
,
thrust
);
sendMessage
(
message
);
// 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