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.
Fork of rosserial_mbed_lib by
Point32.h
00001 #ifndef _ROS_geometry_msgs_Point32_h 00002 #define _ROS_geometry_msgs_Point32_h 00003 00004 #include <stdint.h> 00005 #include <string.h> 00006 #include <stdlib.h> 00007 #include "ros/msg.h" 00008 00009 namespace geometry_msgs 00010 { 00011 00012 class Point32 : public ros::Msg 00013 { 00014 public: 00015 float x; 00016 float y; 00017 float z; 00018 00019 virtual int serialize(unsigned char *outbuffer) const 00020 { 00021 int offset = 0; 00022 union { 00023 float real; 00024 uint32_t base; 00025 } u_x; 00026 u_x.real = this->x; 00027 *(outbuffer + offset + 0) = (u_x.base >> (8 * 0)) & 0xFF; 00028 *(outbuffer + offset + 1) = (u_x.base >> (8 * 1)) & 0xFF; 00029 *(outbuffer + offset + 2) = (u_x.base >> (8 * 2)) & 0xFF; 00030 *(outbuffer + offset + 3) = (u_x.base >> (8 * 3)) & 0xFF; 00031 offset += sizeof(this->x); 00032 union { 00033 float real; 00034 uint32_t base; 00035 } u_y; 00036 u_y.real = this->y; 00037 *(outbuffer + offset + 0) = (u_y.base >> (8 * 0)) & 0xFF; 00038 *(outbuffer + offset + 1) = (u_y.base >> (8 * 1)) & 0xFF; 00039 *(outbuffer + offset + 2) = (u_y.base >> (8 * 2)) & 0xFF; 00040 *(outbuffer + offset + 3) = (u_y.base >> (8 * 3)) & 0xFF; 00041 offset += sizeof(this->y); 00042 union { 00043 float real; 00044 uint32_t base; 00045 } u_z; 00046 u_z.real = this->z; 00047 *(outbuffer + offset + 0) = (u_z.base >> (8 * 0)) & 0xFF; 00048 *(outbuffer + offset + 1) = (u_z.base >> (8 * 1)) & 0xFF; 00049 *(outbuffer + offset + 2) = (u_z.base >> (8 * 2)) & 0xFF; 00050 *(outbuffer + offset + 3) = (u_z.base >> (8 * 3)) & 0xFF; 00051 offset += sizeof(this->z); 00052 return offset; 00053 } 00054 00055 virtual int deserialize(unsigned char *inbuffer) 00056 { 00057 int offset = 0; 00058 union { 00059 float real; 00060 uint32_t base; 00061 } u_x; 00062 u_x.base = 0; 00063 u_x.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); 00064 u_x.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); 00065 u_x.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); 00066 u_x.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); 00067 this->x = u_x.real; 00068 offset += sizeof(this->x); 00069 union { 00070 float real; 00071 uint32_t base; 00072 } u_y; 00073 u_y.base = 0; 00074 u_y.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); 00075 u_y.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); 00076 u_y.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); 00077 u_y.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); 00078 this->y = u_y.real; 00079 offset += sizeof(this->y); 00080 union { 00081 float real; 00082 uint32_t base; 00083 } u_z; 00084 u_z.base = 0; 00085 u_z.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); 00086 u_z.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); 00087 u_z.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); 00088 u_z.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); 00089 this->z = u_z.real; 00090 offset += sizeof(this->z); 00091 return offset; 00092 } 00093 00094 virtual const char * getType(){ return "geometry_msgs/Point32"; }; 00095 virtual const char * getMD5(){ return "cc153912f1453b708d221682bc23d9ac"; }; 00096 00097 }; 00098 00099 } 00100 #endif
Generated on Tue Jul 12 2022 19:53:57 by
 1.7.2
 1.7.2 
    