diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2014-07-16 14:03:34 +0200 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2014-07-16 14:05:15 +0200 |
commit | 9527cc8293749b9ccdec015f587afef9698be1e6 (patch) | |
tree | 667d6d4834111d5ae22a1be0c733a6f099e3dfb2 /src/modules/mavlink | |
parent | a63f3a173174e28fb5df63a1646c62dcbdc52bbb (diff) | |
download | px4-firmware-9527cc8293749b9ccdec015f587afef9698be1e6.tar.gz px4-firmware-9527cc8293749b9ccdec015f587afef9698be1e6.tar.bz2 px4-firmware-9527cc8293749b9ccdec015f587afef9698be1e6.zip |
att external sp: also write quaternion
Diffstat (limited to 'src/modules/mavlink')
-rw-r--r-- | src/modules/mavlink/mavlink_receiver.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/modules/mavlink/mavlink_receiver.cpp b/src/modules/mavlink/mavlink_receiver.cpp index 952bc8735..e5d380cfb 100644 --- a/src/modules/mavlink/mavlink_receiver.cpp +++ b/src/modules/mavlink/mavlink_receiver.cpp @@ -506,6 +506,7 @@ MavlinkReceiver::handle_message_attitude_setpoint_external(mavlink_message_t *ms offboard_control_sp.timestamp = hrt_absolute_time(); + offboard_control_sp.mode =OFFBOARD_CONTROL_MODE_DIRECT_ATTITUDE; //XXX handle rate control mode if (_offboard_control_sp_pub < 0) { _offboard_control_sp_pub = orb_advertise(ORB_ID(offboard_control_setpoint), &offboard_control_sp); @@ -532,6 +533,8 @@ MavlinkReceiver::handle_message_attitude_setpoint_external(mavlink_message_t *ms mavlink_quaternion_to_euler(attitude_setpoint_external.q, &att_sp.roll_body, &att_sp.pitch_body, &att_sp.yaw_body); att_sp.thrust = attitude_setpoint_external.thrust; + att_sp.q_d_valid = true; + memcpy(att_sp.q_d, attitude_setpoint_external.q, sizeof(att_sp.q_d)); if (_att_sp_pub < 0) { _att_sp_pub = orb_advertise(ORB_ID(vehicle_attitude_setpoint), &att_sp); } else { |