github.com/bluenviron/gomavlib/v2@v2.2.1-0.20240308101627-2c07e3da629c/pkg/dialects/common/message_gimbal_device_attitude_status.go (about) 1 //autogenerated:yes 2 //nolint:revive,misspell,govet,lll 3 package common 4 5 // Message reporting the status of a gimbal device. 6 // This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). 7 // For the angles encoded in the quaternion and the angular velocities holds: 8 // If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). 9 // If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). 10 // If neither of these flags are set, then (for backwards compatibility) it holds: 11 // If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), 12 // else they are relative to the vehicle heading (vehicle frame). 13 // Other conditions of the flags are not allowed. 14 // The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as 15 // q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). 16 // If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, 17 // then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. 18 // New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, 19 // and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN. 20 type MessageGimbalDeviceAttitudeStatus struct { 21 // System ID 22 TargetSystem uint8 23 // Component ID 24 TargetComponent uint8 25 // Timestamp (time since system boot). 26 TimeBootMs uint32 27 // Current gimbal flags set. 28 Flags GIMBAL_DEVICE_FLAGS `mavenum:"uint16"` 29 // Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description. 30 Q [4]float32 31 // X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN if unknown. 32 AngularVelocityX float32 33 // Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN if unknown. 34 AngularVelocityY float32 35 // Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN if unknown. 36 AngularVelocityZ float32 37 // Failure flags (0 for no failure) 38 FailureFlags GIMBAL_DEVICE_ERROR_FLAGS `mavenum:"uint32"` 39 // Yaw angle relating the quaternions in earth and body frames (see message description). NaN if unknown. 40 DeltaYaw float32 `mavext:"true"` 41 // Yaw angular velocity relating the angular velocities in earth and body frames (see message description). NaN if unknown. 42 DeltaYawVelocity float32 `mavext:"true"` 43 // This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set a number between 1-6. If the component ID is separate, this field is not required and must be set to 0. 44 GimbalDeviceId uint8 `mavext:"true"` 45 } 46 47 // GetID implements the message.Message interface. 48 func (*MessageGimbalDeviceAttitudeStatus) GetID() uint32 { 49 return 285 50 }