catchrobo2022 mbed LPC1768 メインプログラム
Dependencies: mbed
Accuracy.h
00001 #ifndef _ROS_jsk_recognition_msgs_Accuracy_h 00002 #define _ROS_jsk_recognition_msgs_Accuracy_h 00003 00004 #include <stdint.h> 00005 #include <string.h> 00006 #include <stdlib.h> 00007 #include "ros/msg.h" 00008 #include "std_msgs/Header.h" 00009 00010 namespace jsk_recognition_msgs 00011 { 00012 00013 class Accuracy : public ros::Msg 00014 { 00015 public: 00016 typedef std_msgs::Header _header_type; 00017 _header_type header; 00018 typedef float _accuracy_type; 00019 _accuracy_type accuracy; 00020 00021 Accuracy(): 00022 header(), 00023 accuracy(0) 00024 { 00025 } 00026 00027 virtual int serialize(unsigned char *outbuffer) const 00028 { 00029 int offset = 0; 00030 offset += this->header.serialize(outbuffer + offset); 00031 union { 00032 float real; 00033 uint32_t base; 00034 } u_accuracy; 00035 u_accuracy.real = this->accuracy; 00036 *(outbuffer + offset + 0) = (u_accuracy.base >> (8 * 0)) & 0xFF; 00037 *(outbuffer + offset + 1) = (u_accuracy.base >> (8 * 1)) & 0xFF; 00038 *(outbuffer + offset + 2) = (u_accuracy.base >> (8 * 2)) & 0xFF; 00039 *(outbuffer + offset + 3) = (u_accuracy.base >> (8 * 3)) & 0xFF; 00040 offset += sizeof(this->accuracy); 00041 return offset; 00042 } 00043 00044 virtual int deserialize(unsigned char *inbuffer) 00045 { 00046 int offset = 0; 00047 offset += this->header.deserialize(inbuffer + offset); 00048 union { 00049 float real; 00050 uint32_t base; 00051 } u_accuracy; 00052 u_accuracy.base = 0; 00053 u_accuracy.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); 00054 u_accuracy.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); 00055 u_accuracy.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); 00056 u_accuracy.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); 00057 this->accuracy = u_accuracy.real; 00058 offset += sizeof(this->accuracy); 00059 return offset; 00060 } 00061 00062 virtual const char * getType(){ return "jsk_recognition_msgs/Accuracy"; }; 00063 virtual const char * getMD5(){ return "198da9dc2684aac2aa03a85a3344f5ef"; }; 00064 00065 }; 00066 00067 } 00068 #endif
Generated on Mon Sep 26 2022 13:46:59 by
1.7.2