att external sp: also write quaternion

This commit is contained in:
Thomas Gubler
2014-07-16 14:03:34 +02:00
parent a63f3a1731
commit 9527cc8293
+3
View File
@@ -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 {