Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
DeviceSensor.h
00001 #ifndef _ROS_jsk_gui_msgs_DeviceSensor_h 00002 #define _ROS_jsk_gui_msgs_DeviceSensor_h 00003 00004 #include <stdint.h> 00005 #include <string.h> 00006 #include <stdlib.h> 00007 #include "ros/msg.h" 00008 00009 namespace jsk_gui_msgs 00010 { 00011 00012 class DeviceSensor : public ros::Msg 00013 { 00014 public: 00015 typedef double _temperature_type; 00016 _temperature_type temperature; 00017 typedef double _relative_humidity_type; 00018 _relative_humidity_type relative_humidity; 00019 typedef double _light_type; 00020 _light_type light; 00021 typedef double _pressure_type; 00022 _pressure_type pressure; 00023 typedef double _proximity_type; 00024 _proximity_type proximity; 00025 00026 DeviceSensor(): 00027 temperature(0), 00028 relative_humidity(0), 00029 light(0), 00030 pressure(0), 00031 proximity(0) 00032 { 00033 } 00034 00035 virtual int serialize(unsigned char *outbuffer) const 00036 { 00037 int offset = 0; 00038 union { 00039 double real; 00040 uint64_t base; 00041 } u_temperature; 00042 u_temperature.real = this->temperature; 00043 *(outbuffer + offset + 0) = (u_temperature.base >> (8 * 0)) & 0xFF; 00044 *(outbuffer + offset + 1) = (u_temperature.base >> (8 * 1)) & 0xFF; 00045 *(outbuffer + offset + 2) = (u_temperature.base >> (8 * 2)) & 0xFF; 00046 *(outbuffer + offset + 3) = (u_temperature.base >> (8 * 3)) & 0xFF; 00047 *(outbuffer + offset + 4) = (u_temperature.base >> (8 * 4)) & 0xFF; 00048 *(outbuffer + offset + 5) = (u_temperature.base >> (8 * 5)) & 0xFF; 00049 *(outbuffer + offset + 6) = (u_temperature.base >> (8 * 6)) & 0xFF; 00050 *(outbuffer + offset + 7) = (u_temperature.base >> (8 * 7)) & 0xFF; 00051 offset += sizeof(this->temperature); 00052 union { 00053 double real; 00054 uint64_t base; 00055 } u_relative_humidity; 00056 u_relative_humidity.real = this->relative_humidity; 00057 *(outbuffer + offset + 0) = (u_relative_humidity.base >> (8 * 0)) & 0xFF; 00058 *(outbuffer + offset + 1) = (u_relative_humidity.base >> (8 * 1)) & 0xFF; 00059 *(outbuffer + offset + 2) = (u_relative_humidity.base >> (8 * 2)) & 0xFF; 00060 *(outbuffer + offset + 3) = (u_relative_humidity.base >> (8 * 3)) & 0xFF; 00061 *(outbuffer + offset + 4) = (u_relative_humidity.base >> (8 * 4)) & 0xFF; 00062 *(outbuffer + offset + 5) = (u_relative_humidity.base >> (8 * 5)) & 0xFF; 00063 *(outbuffer + offset + 6) = (u_relative_humidity.base >> (8 * 6)) & 0xFF; 00064 *(outbuffer + offset + 7) = (u_relative_humidity.base >> (8 * 7)) & 0xFF; 00065 offset += sizeof(this->relative_humidity); 00066 union { 00067 double real; 00068 uint64_t base; 00069 } u_light; 00070 u_light.real = this->light; 00071 *(outbuffer + offset + 0) = (u_light.base >> (8 * 0)) & 0xFF; 00072 *(outbuffer + offset + 1) = (u_light.base >> (8 * 1)) & 0xFF; 00073 *(outbuffer + offset + 2) = (u_light.base >> (8 * 2)) & 0xFF; 00074 *(outbuffer + offset + 3) = (u_light.base >> (8 * 3)) & 0xFF; 00075 *(outbuffer + offset + 4) = (u_light.base >> (8 * 4)) & 0xFF; 00076 *(outbuffer + offset + 5) = (u_light.base >> (8 * 5)) & 0xFF; 00077 *(outbuffer + offset + 6) = (u_light.base >> (8 * 6)) & 0xFF; 00078 *(outbuffer + offset + 7) = (u_light.base >> (8 * 7)) & 0xFF; 00079 offset += sizeof(this->light); 00080 union { 00081 double real; 00082 uint64_t base; 00083 } u_pressure; 00084 u_pressure.real = this->pressure; 00085 *(outbuffer + offset + 0) = (u_pressure.base >> (8 * 0)) & 0xFF; 00086 *(outbuffer + offset + 1) = (u_pressure.base >> (8 * 1)) & 0xFF; 00087 *(outbuffer + offset + 2) = (u_pressure.base >> (8 * 2)) & 0xFF; 00088 *(outbuffer + offset + 3) = (u_pressure.base >> (8 * 3)) & 0xFF; 00089 *(outbuffer + offset + 4) = (u_pressure.base >> (8 * 4)) & 0xFF; 00090 *(outbuffer + offset + 5) = (u_pressure.base >> (8 * 5)) & 0xFF; 00091 *(outbuffer + offset + 6) = (u_pressure.base >> (8 * 6)) & 0xFF; 00092 *(outbuffer + offset + 7) = (u_pressure.base >> (8 * 7)) & 0xFF; 00093 offset += sizeof(this->pressure); 00094 union { 00095 double real; 00096 uint64_t base; 00097 } u_proximity; 00098 u_proximity.real = this->proximity; 00099 *(outbuffer + offset + 0) = (u_proximity.base >> (8 * 0)) & 0xFF; 00100 *(outbuffer + offset + 1) = (u_proximity.base >> (8 * 1)) & 0xFF; 00101 *(outbuffer + offset + 2) = (u_proximity.base >> (8 * 2)) & 0xFF; 00102 *(outbuffer + offset + 3) = (u_proximity.base >> (8 * 3)) & 0xFF; 00103 *(outbuffer + offset + 4) = (u_proximity.base >> (8 * 4)) & 0xFF; 00104 *(outbuffer + offset + 5) = (u_proximity.base >> (8 * 5)) & 0xFF; 00105 *(outbuffer + offset + 6) = (u_proximity.base >> (8 * 6)) & 0xFF; 00106 *(outbuffer + offset + 7) = (u_proximity.base >> (8 * 7)) & 0xFF; 00107 offset += sizeof(this->proximity); 00108 return offset; 00109 } 00110 00111 virtual int deserialize(unsigned char *inbuffer) 00112 { 00113 int offset = 0; 00114 union { 00115 double real; 00116 uint64_t base; 00117 } u_temperature; 00118 u_temperature.base = 0; 00119 u_temperature.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); 00120 u_temperature.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); 00121 u_temperature.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); 00122 u_temperature.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); 00123 u_temperature.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); 00124 u_temperature.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); 00125 u_temperature.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); 00126 u_temperature.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); 00127 this->temperature = u_temperature.real; 00128 offset += sizeof(this->temperature); 00129 union { 00130 double real; 00131 uint64_t base; 00132 } u_relative_humidity; 00133 u_relative_humidity.base = 0; 00134 u_relative_humidity.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); 00135 u_relative_humidity.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); 00136 u_relative_humidity.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); 00137 u_relative_humidity.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); 00138 u_relative_humidity.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); 00139 u_relative_humidity.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); 00140 u_relative_humidity.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); 00141 u_relative_humidity.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); 00142 this->relative_humidity = u_relative_humidity.real; 00143 offset += sizeof(this->relative_humidity); 00144 union { 00145 double real; 00146 uint64_t base; 00147 } u_light; 00148 u_light.base = 0; 00149 u_light.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); 00150 u_light.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); 00151 u_light.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); 00152 u_light.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); 00153 u_light.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); 00154 u_light.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); 00155 u_light.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); 00156 u_light.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); 00157 this->light = u_light.real; 00158 offset += sizeof(this->light); 00159 union { 00160 double real; 00161 uint64_t base; 00162 } u_pressure; 00163 u_pressure.base = 0; 00164 u_pressure.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); 00165 u_pressure.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); 00166 u_pressure.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); 00167 u_pressure.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); 00168 u_pressure.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); 00169 u_pressure.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); 00170 u_pressure.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); 00171 u_pressure.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); 00172 this->pressure = u_pressure.real; 00173 offset += sizeof(this->pressure); 00174 union { 00175 double real; 00176 uint64_t base; 00177 } u_proximity; 00178 u_proximity.base = 0; 00179 u_proximity.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); 00180 u_proximity.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); 00181 u_proximity.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); 00182 u_proximity.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); 00183 u_proximity.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); 00184 u_proximity.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); 00185 u_proximity.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); 00186 u_proximity.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); 00187 this->proximity = u_proximity.real; 00188 offset += sizeof(this->proximity); 00189 return offset; 00190 } 00191 00192 virtual const char * getType(){ return "jsk_gui_msgs/DeviceSensor"; }; 00193 virtual const char * getMD5(){ return "d3861ba768b988b4c249337d4dc6552d"; }; 00194 00195 }; 00196 00197 } 00198 #endif
Generated on Mon Sep 26 2022 13:47:00 by
