Working towards recieving twists

Dependencies:   BufferedSerial

Fork of ros_lib_kinetic by Gary Servin

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Point32.h Source File

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       typedef float _x_type;
00016       _x_type x;
00017       typedef float _y_type;
00018       _y_type y;
00019       typedef float _z_type;
00020       _z_type z;
00021 
00022     Point32():
00023       x(0),
00024       y(0),
00025       z(0)
00026     {
00027     }
00028 
00029     virtual int serialize(unsigned char *outbuffer) const
00030     {
00031       int offset = 0;
00032       union {
00033         float real;
00034         uint32_t base;
00035       } u_x;
00036       u_x.real = this->x;
00037       *(outbuffer + offset + 0) = (u_x.base >> (8 * 0)) & 0xFF;
00038       *(outbuffer + offset + 1) = (u_x.base >> (8 * 1)) & 0xFF;
00039       *(outbuffer + offset + 2) = (u_x.base >> (8 * 2)) & 0xFF;
00040       *(outbuffer + offset + 3) = (u_x.base >> (8 * 3)) & 0xFF;
00041       offset += sizeof(this->x);
00042       union {
00043         float real;
00044         uint32_t base;
00045       } u_y;
00046       u_y.real = this->y;
00047       *(outbuffer + offset + 0) = (u_y.base >> (8 * 0)) & 0xFF;
00048       *(outbuffer + offset + 1) = (u_y.base >> (8 * 1)) & 0xFF;
00049       *(outbuffer + offset + 2) = (u_y.base >> (8 * 2)) & 0xFF;
00050       *(outbuffer + offset + 3) = (u_y.base >> (8 * 3)) & 0xFF;
00051       offset += sizeof(this->y);
00052       union {
00053         float real;
00054         uint32_t base;
00055       } u_z;
00056       u_z.real = this->z;
00057       *(outbuffer + offset + 0) = (u_z.base >> (8 * 0)) & 0xFF;
00058       *(outbuffer + offset + 1) = (u_z.base >> (8 * 1)) & 0xFF;
00059       *(outbuffer + offset + 2) = (u_z.base >> (8 * 2)) & 0xFF;
00060       *(outbuffer + offset + 3) = (u_z.base >> (8 * 3)) & 0xFF;
00061       offset += sizeof(this->z);
00062       return offset;
00063     }
00064 
00065     virtual int deserialize(unsigned char *inbuffer)
00066     {
00067       int offset = 0;
00068       union {
00069         float real;
00070         uint32_t base;
00071       } u_x;
00072       u_x.base = 0;
00073       u_x.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00074       u_x.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00075       u_x.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00076       u_x.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00077       this->x = u_x.real;
00078       offset += sizeof(this->x);
00079       union {
00080         float real;
00081         uint32_t base;
00082       } u_y;
00083       u_y.base = 0;
00084       u_y.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00085       u_y.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00086       u_y.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00087       u_y.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00088       this->y = u_y.real;
00089       offset += sizeof(this->y);
00090       union {
00091         float real;
00092         uint32_t base;
00093       } u_z;
00094       u_z.base = 0;
00095       u_z.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00096       u_z.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00097       u_z.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00098       u_z.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00099       this->z = u_z.real;
00100       offset += sizeof(this->z);
00101      return offset;
00102     }
00103 
00104     const char * getType(){ return "geometry_msgs/Point32"; };
00105     const char * getMD5(){ return "cc153912f1453b708d221682bc23d9ac"; };
00106 
00107   };
00108 
00109 }
00110 #endif