/* * UAVCAN data structure definition for libcanard. * * Autogenerated, do not edit. * * Source file: E:\000_MyProjects\UAVCAN\libcanard_zrzk\dsdl_compiler\pyuavcan\uavcan\dsdl_files\uavcan\CoarseOrientation.uavcan */ #ifndef __UAVCAN_COARSEORIENTATION #define __UAVCAN_COARSEORIENTATION #include #include "canard.h" #ifdef __cplusplus extern "C" { #endif /******************************* Source text ********************************** # # Nested type. # Coarse, low-resolution 3D orientation represented as fixed axes in 16 bit. # # Roll, pitch, yaw angles in radians should be multiplied by # ANGLE_MULTIPLIER in order to convert them to the coarse representation. # # ANGLE_MULTIPLIER = NORM / PI # # Where NORM is 12, because it: # - Fits the maximum range of a signed 5 bit integer # - Allows to exactly represent the following angles: # 0, 15, 30, 45, 60, 75, 90, 105, 120, 135, 150, 165, 180, and negatives # float32 ANGLE_MULTIPLIER = 4.7746482927568605 int5[3] fixed_axis_roll_pitch_yaw bool orientation_defined # False if the orientation is actually not defined ******************************************************************************/ /********************* DSDL signature source definition *********************** uavcan.CoarseOrientation saturated int5[3] fixed_axis_roll_pitch_yaw saturated bool orientation_defined ******************************************************************************/ #define UAVCAN_COARSEORIENTATION_NAME "uavcan.CoarseOrientation" #define UAVCAN_COARSEORIENTATION_SIGNATURE (0x271BA10B0DAC9E52ULL) #define UAVCAN_COARSEORIENTATION_MAX_SIZE ((16 + 7)/8) // Constants #define UAVCAN_COARSEORIENTATION_ANGLE_MULTIPLIER 4.7746482927568605 // 4.7746482927568605 #define UAVCAN_COARSEORIENTATION_FIXED_AXIS_ROLL_PITCH_YAW_LENGTH 3 typedef struct { // FieldTypes int8_t fixed_axis_roll_pitch_yaw[3]; // Static Array 5bit[3] max items bool orientation_defined; // bit len 1 } uavcan_coarse_orientation_t; extern uint32_t uavcan_CoarseOrientation_encode(uavcan_coarse_orientation_t* source, void* msg_buf); extern int32_t uavcan_CoarseOrientation_decode(const CanardRxTransfer* transfer, uint16_t payload_len, uavcan_coarse_orientation_t* dest, uint8_t** dyn_arr_buf); extern uint32_t uavcan_CoarseOrientation_encode_internal(uavcan_coarse_orientation_t* source, void* msg_buf, uint32_t offset, uint8_t root_item); extern int32_t uavcan_CoarseOrientation_decode_internal(const CanardRxTransfer* transfer, uint16_t payload_len, uavcan_coarse_orientation_t* dest, uint8_t** dyn_arr_buf, int32_t offset); #ifdef __cplusplus } // extern "C" #endif #endif // __UAVCAN_COARSEORIENTATION