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 Point.h Source File

Point.h

00001 #ifndef _ROS_geometry_msgs_Point_h
00002 #define _ROS_geometry_msgs_Point_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 Point : public ros::Msg
00013   {
00014     public:
00015       typedef double _x_type;
00016       _x_type x;
00017       typedef double _y_type;
00018       _y_type y;
00019       typedef double _z_type;
00020       _z_type z;
00021 
00022     Point():
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         double real;
00034         uint64_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       *(outbuffer + offset + 4) = (u_x.base >> (8 * 4)) & 0xFF;
00042       *(outbuffer + offset + 5) = (u_x.base >> (8 * 5)) & 0xFF;
00043       *(outbuffer + offset + 6) = (u_x.base >> (8 * 6)) & 0xFF;
00044       *(outbuffer + offset + 7) = (u_x.base >> (8 * 7)) & 0xFF;
00045       offset += sizeof(this->x);
00046       union {
00047         double real;
00048         uint64_t base;
00049       } u_y;
00050       u_y.real = this->y;
00051       *(outbuffer + offset + 0) = (u_y.base >> (8 * 0)) & 0xFF;
00052       *(outbuffer + offset + 1) = (u_y.base >> (8 * 1)) & 0xFF;
00053       *(outbuffer + offset + 2) = (u_y.base >> (8 * 2)) & 0xFF;
00054       *(outbuffer + offset + 3) = (u_y.base >> (8 * 3)) & 0xFF;
00055       *(outbuffer + offset + 4) = (u_y.base >> (8 * 4)) & 0xFF;
00056       *(outbuffer + offset + 5) = (u_y.base >> (8 * 5)) & 0xFF;
00057       *(outbuffer + offset + 6) = (u_y.base >> (8 * 6)) & 0xFF;
00058       *(outbuffer + offset + 7) = (u_y.base >> (8 * 7)) & 0xFF;
00059       offset += sizeof(this->y);
00060       union {
00061         double real;
00062         uint64_t base;
00063       } u_z;
00064       u_z.real = this->z;
00065       *(outbuffer + offset + 0) = (u_z.base >> (8 * 0)) & 0xFF;
00066       *(outbuffer + offset + 1) = (u_z.base >> (8 * 1)) & 0xFF;
00067       *(outbuffer + offset + 2) = (u_z.base >> (8 * 2)) & 0xFF;
00068       *(outbuffer + offset + 3) = (u_z.base >> (8 * 3)) & 0xFF;
00069       *(outbuffer + offset + 4) = (u_z.base >> (8 * 4)) & 0xFF;
00070       *(outbuffer + offset + 5) = (u_z.base >> (8 * 5)) & 0xFF;
00071       *(outbuffer + offset + 6) = (u_z.base >> (8 * 6)) & 0xFF;
00072       *(outbuffer + offset + 7) = (u_z.base >> (8 * 7)) & 0xFF;
00073       offset += sizeof(this->z);
00074       return offset;
00075     }
00076 
00077     virtual int deserialize(unsigned char *inbuffer)
00078     {
00079       int offset = 0;
00080       union {
00081         double real;
00082         uint64_t base;
00083       } u_x;
00084       u_x.base = 0;
00085       u_x.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
00086       u_x.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
00087       u_x.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
00088       u_x.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
00089       u_x.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
00090       u_x.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
00091       u_x.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
00092       u_x.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
00093       this->x = u_x.real;
00094       offset += sizeof(this->x);
00095       union {
00096         double real;
00097         uint64_t base;
00098       } u_y;
00099       u_y.base = 0;
00100       u_y.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
00101       u_y.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
00102       u_y.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
00103       u_y.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
00104       u_y.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
00105       u_y.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
00106       u_y.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
00107       u_y.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
00108       this->y = u_y.real;
00109       offset += sizeof(this->y);
00110       union {
00111         double real;
00112         uint64_t base;
00113       } u_z;
00114       u_z.base = 0;
00115       u_z.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
00116       u_z.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
00117       u_z.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
00118       u_z.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
00119       u_z.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
00120       u_z.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
00121       u_z.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
00122       u_z.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
00123       this->z = u_z.real;
00124       offset += sizeof(this->z);
00125      return offset;
00126     }
00127 
00128     const char * getType(){ return "geometry_msgs/Point"; };
00129     const char * getMD5(){ return "4a842b65f413084dc2b10fb484ea7f17"; };
00130 
00131   };
00132 
00133 }
00134 #endif