Ejemplo n.º 1
0
            public static uavcan_olliw_uc4h_DistanceSensorProperties ByteArrayToDroneCANMsg(byte[] transfer, int startoffset)
            {
                var ans = new uavcan_olliw_uc4h_DistanceSensorProperties();

                ans.decode(new DroneCAN.CanardRxTransfer(transfer.Skip(startoffset).ToArray()));
                return(ans);
            }
Ejemplo n.º 2
0
        static void _decode_uavcan_olliw_uc4h_DistanceSensorProperties(CanardRxTransfer transfer, ref uint32_t bit_ofs, uavcan_olliw_uc4h_DistanceSensorProperties msg, bool tao)
        {
            {
                uint16_t float16_val = 0;
                canardDecodeScalar(transfer, bit_ofs, 16, true, ref float16_val);
                msg.range_min = canardConvertFloat16ToNativeFloat(float16_val);
            }
            bit_ofs += 16;

            {
                uint16_t float16_val = 0;
                canardDecodeScalar(transfer, bit_ofs, 16, true, ref float16_val);
                msg.range_max = canardConvertFloat16ToNativeFloat(float16_val);
            }
            bit_ofs += 16;

            {
                uint16_t float16_val = 0;
                canardDecodeScalar(transfer, bit_ofs, 16, true, ref float16_val);
                msg.vertical_field_of_view = canardConvertFloat16ToNativeFloat(float16_val);
            }
            bit_ofs += 16;

            {
                uint16_t float16_val = 0;
                canardDecodeScalar(transfer, bit_ofs, 16, true, ref float16_val);
                msg.horizontal_field_of_view = canardConvertFloat16ToNativeFloat(float16_val);
            }
            bit_ofs += 16;
        }
Ejemplo n.º 3
0
 static void _encode_uavcan_olliw_uc4h_DistanceSensorProperties(uint8_t[] buffer, uavcan_olliw_uc4h_DistanceSensorProperties msg, uavcan_serializer_chunk_cb_ptr_t chunk_cb, object ctx, bool tao)
 {
     memset(buffer, 0, 8);
     {
         uint16_t float16_val = canardConvertNativeFloatToFloat16(msg.range_min);
         canardEncodeScalar(buffer, 0, 16, float16_val);
     }
     chunk_cb(buffer, 16, ctx);
     memset(buffer, 0, 8);
     {
         uint16_t float16_val = canardConvertNativeFloatToFloat16(msg.range_max);
         canardEncodeScalar(buffer, 0, 16, float16_val);
     }
     chunk_cb(buffer, 16, ctx);
     memset(buffer, 0, 8);
     {
         uint16_t float16_val = canardConvertNativeFloatToFloat16(msg.vertical_field_of_view);
         canardEncodeScalar(buffer, 0, 16, float16_val);
     }
     chunk_cb(buffer, 16, ctx);
     memset(buffer, 0, 8);
     {
         uint16_t float16_val = canardConvertNativeFloatToFloat16(msg.horizontal_field_of_view);
         canardEncodeScalar(buffer, 0, 16, float16_val);
     }
     chunk_cb(buffer, 16, ctx);
 }
Ejemplo n.º 4
0
        static uint32_t decode_uavcan_olliw_uc4h_DistanceSensorProperties(CanardRxTransfer transfer, uavcan_olliw_uc4h_DistanceSensorProperties msg)
        {
            uint32_t bit_ofs = 0;

            _decode_uavcan_olliw_uc4h_DistanceSensorProperties(transfer, ref bit_ofs, msg, true);
            return((bit_ofs + 7) / 8);
        }
Ejemplo n.º 5
0
 static void encode_uavcan_olliw_uc4h_DistanceSensorProperties(uavcan_olliw_uc4h_DistanceSensorProperties msg, uavcan_serializer_chunk_cb_ptr_t chunk_cb, object ctx)
 {
     uint8_t[] buffer = new uint8_t[8];
     _encode_uavcan_olliw_uc4h_DistanceSensorProperties(buffer, msg, chunk_cb, ctx, true);
 }