void send(const hrt_abstime t)
	{
		if (pos_sp_triplet_sub->update(t)) {
			mavlink_msg_global_position_setpoint_int_send(_channel,
					MAV_FRAME_GLOBAL,
					(int32_t)(pos_sp_triplet->current.lat * 1e7),
					(int32_t)(pos_sp_triplet->current.lon * 1e7),
					(int32_t)(pos_sp_triplet->current.alt * 1000),
					(int16_t)(pos_sp_triplet->current.yaw * M_RAD_TO_DEG_F * 100.0f));
		}
	}
Beispiel #2
0
void
l_global_position_setpoint(struct listener *l)
{
    struct vehicle_global_position_setpoint_s global_sp;

    /* copy local position data into local buffer */
    orb_copy(ORB_ID(vehicle_global_position_setpoint), mavlink_subs.spg_sub, &global_sp);

    uint8_t coordinate_frame = MAV_FRAME_GLOBAL;
    if (global_sp.altitude_is_relative)
        coordinate_frame = MAV_FRAME_GLOBAL_RELATIVE_ALT;

    if (gcs_link)
        mavlink_msg_global_position_setpoint_int_send(MAVLINK_COMM_0,
                coordinate_frame,
                global_sp.lat,
                global_sp.lon,
                global_sp.altitude,
                global_sp.yaw);
}