Irfan Tito Kurniawan / ros_lib
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers GpsWaypoint.h Source File

GpsWaypoint.h

00001 #ifndef _ROS_mav_msgs_GpsWaypoint_h
00002 #define _ROS_mav_msgs_GpsWaypoint_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 mav_msgs
00011 {
00012 
00013   class GpsWaypoint : public ros::Msg
00014   {
00015     public:
00016       typedef std_msgs::Header _header_type;
00017       _header_type header;
00018       typedef double _latitude_type;
00019       _latitude_type latitude;
00020       typedef double _longitude_type;
00021       _longitude_type longitude;
00022       typedef double _altitude_type;
00023       _altitude_type altitude;
00024       typedef double _heading_type;
00025       _heading_type heading;
00026       typedef double _maxSpeed_type;
00027       _maxSpeed_type maxSpeed;
00028       typedef double _maxAcc_type;
00029       _maxAcc_type maxAcc;
00030 
00031     GpsWaypoint():
00032       header(),
00033       latitude(0),
00034       longitude(0),
00035       altitude(0),
00036       heading(0),
00037       maxSpeed(0),
00038       maxAcc(0)
00039     {
00040     }
00041 
00042     virtual int serialize(unsigned char *outbuffer) const
00043     {
00044       int offset = 0;
00045       offset += this->header.serialize(outbuffer + offset);
00046       union {
00047         double real;
00048         uint64_t base;
00049       } u_latitude;
00050       u_latitude.real = this->latitude;
00051       *(outbuffer + offset + 0) = (u_latitude.base >> (8 * 0)) & 0xFF;
00052       *(outbuffer + offset + 1) = (u_latitude.base >> (8 * 1)) & 0xFF;
00053       *(outbuffer + offset + 2) = (u_latitude.base >> (8 * 2)) & 0xFF;
00054       *(outbuffer + offset + 3) = (u_latitude.base >> (8 * 3)) & 0xFF;
00055       *(outbuffer + offset + 4) = (u_latitude.base >> (8 * 4)) & 0xFF;
00056       *(outbuffer + offset + 5) = (u_latitude.base >> (8 * 5)) & 0xFF;
00057       *(outbuffer + offset + 6) = (u_latitude.base >> (8 * 6)) & 0xFF;
00058       *(outbuffer + offset + 7) = (u_latitude.base >> (8 * 7)) & 0xFF;
00059       offset += sizeof(this->latitude);
00060       union {
00061         double real;
00062         uint64_t base;
00063       } u_longitude;
00064       u_longitude.real = this->longitude;
00065       *(outbuffer + offset + 0) = (u_longitude.base >> (8 * 0)) & 0xFF;
00066       *(outbuffer + offset + 1) = (u_longitude.base >> (8 * 1)) & 0xFF;
00067       *(outbuffer + offset + 2) = (u_longitude.base >> (8 * 2)) & 0xFF;
00068       *(outbuffer + offset + 3) = (u_longitude.base >> (8 * 3)) & 0xFF;
00069       *(outbuffer + offset + 4) = (u_longitude.base >> (8 * 4)) & 0xFF;
00070       *(outbuffer + offset + 5) = (u_longitude.base >> (8 * 5)) & 0xFF;
00071       *(outbuffer + offset + 6) = (u_longitude.base >> (8 * 6)) & 0xFF;
00072       *(outbuffer + offset + 7) = (u_longitude.base >> (8 * 7)) & 0xFF;
00073       offset += sizeof(this->longitude);
00074       union {
00075         double real;
00076         uint64_t base;
00077       } u_altitude;
00078       u_altitude.real = this->altitude;
00079       *(outbuffer + offset + 0) = (u_altitude.base >> (8 * 0)) & 0xFF;
00080       *(outbuffer + offset + 1) = (u_altitude.base >> (8 * 1)) & 0xFF;
00081       *(outbuffer + offset + 2) = (u_altitude.base >> (8 * 2)) & 0xFF;
00082       *(outbuffer + offset + 3) = (u_altitude.base >> (8 * 3)) & 0xFF;
00083       *(outbuffer + offset + 4) = (u_altitude.base >> (8 * 4)) & 0xFF;
00084       *(outbuffer + offset + 5) = (u_altitude.base >> (8 * 5)) & 0xFF;
00085       *(outbuffer + offset + 6) = (u_altitude.base >> (8 * 6)) & 0xFF;
00086       *(outbuffer + offset + 7) = (u_altitude.base >> (8 * 7)) & 0xFF;
00087       offset += sizeof(this->altitude);
00088       union {
00089         double real;
00090         uint64_t base;
00091       } u_heading;
00092       u_heading.real = this->heading;
00093       *(outbuffer + offset + 0) = (u_heading.base >> (8 * 0)) & 0xFF;
00094       *(outbuffer + offset + 1) = (u_heading.base >> (8 * 1)) & 0xFF;
00095       *(outbuffer + offset + 2) = (u_heading.base >> (8 * 2)) & 0xFF;
00096       *(outbuffer + offset + 3) = (u_heading.base >> (8 * 3)) & 0xFF;
00097       *(outbuffer + offset + 4) = (u_heading.base >> (8 * 4)) & 0xFF;
00098       *(outbuffer + offset + 5) = (u_heading.base >> (8 * 5)) & 0xFF;
00099       *(outbuffer + offset + 6) = (u_heading.base >> (8 * 6)) & 0xFF;
00100       *(outbuffer + offset + 7) = (u_heading.base >> (8 * 7)) & 0xFF;
00101       offset += sizeof(this->heading);
00102       union {
00103         double real;
00104         uint64_t base;
00105       } u_maxSpeed;
00106       u_maxSpeed.real = this->maxSpeed;
00107       *(outbuffer + offset + 0) = (u_maxSpeed.base >> (8 * 0)) & 0xFF;
00108       *(outbuffer + offset + 1) = (u_maxSpeed.base >> (8 * 1)) & 0xFF;
00109       *(outbuffer + offset + 2) = (u_maxSpeed.base >> (8 * 2)) & 0xFF;
00110       *(outbuffer + offset + 3) = (u_maxSpeed.base >> (8 * 3)) & 0xFF;
00111       *(outbuffer + offset + 4) = (u_maxSpeed.base >> (8 * 4)) & 0xFF;
00112       *(outbuffer + offset + 5) = (u_maxSpeed.base >> (8 * 5)) & 0xFF;
00113       *(outbuffer + offset + 6) = (u_maxSpeed.base >> (8 * 6)) & 0xFF;
00114       *(outbuffer + offset + 7) = (u_maxSpeed.base >> (8 * 7)) & 0xFF;
00115       offset += sizeof(this->maxSpeed);
00116       union {
00117         double real;
00118         uint64_t base;
00119       } u_maxAcc;
00120       u_maxAcc.real = this->maxAcc;
00121       *(outbuffer + offset + 0) = (u_maxAcc.base >> (8 * 0)) & 0xFF;
00122       *(outbuffer + offset + 1) = (u_maxAcc.base >> (8 * 1)) & 0xFF;
00123       *(outbuffer + offset + 2) = (u_maxAcc.base >> (8 * 2)) & 0xFF;
00124       *(outbuffer + offset + 3) = (u_maxAcc.base >> (8 * 3)) & 0xFF;
00125       *(outbuffer + offset + 4) = (u_maxAcc.base >> (8 * 4)) & 0xFF;
00126       *(outbuffer + offset + 5) = (u_maxAcc.base >> (8 * 5)) & 0xFF;
00127       *(outbuffer + offset + 6) = (u_maxAcc.base >> (8 * 6)) & 0xFF;
00128       *(outbuffer + offset + 7) = (u_maxAcc.base >> (8 * 7)) & 0xFF;
00129       offset += sizeof(this->maxAcc);
00130       return offset;
00131     }
00132 
00133     virtual int deserialize(unsigned char *inbuffer)
00134     {
00135       int offset = 0;
00136       offset += this->header.deserialize(inbuffer + offset);
00137       union {
00138         double real;
00139         uint64_t base;
00140       } u_latitude;
00141       u_latitude.base = 0;
00142       u_latitude.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
00143       u_latitude.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
00144       u_latitude.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
00145       u_latitude.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
00146       u_latitude.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
00147       u_latitude.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
00148       u_latitude.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
00149       u_latitude.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
00150       this->latitude = u_latitude.real;
00151       offset += sizeof(this->latitude);
00152       union {
00153         double real;
00154         uint64_t base;
00155       } u_longitude;
00156       u_longitude.base = 0;
00157       u_longitude.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
00158       u_longitude.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
00159       u_longitude.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
00160       u_longitude.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
00161       u_longitude.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
00162       u_longitude.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
00163       u_longitude.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
00164       u_longitude.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
00165       this->longitude = u_longitude.real;
00166       offset += sizeof(this->longitude);
00167       union {
00168         double real;
00169         uint64_t base;
00170       } u_altitude;
00171       u_altitude.base = 0;
00172       u_altitude.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
00173       u_altitude.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
00174       u_altitude.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
00175       u_altitude.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
00176       u_altitude.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
00177       u_altitude.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
00178       u_altitude.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
00179       u_altitude.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
00180       this->altitude = u_altitude.real;
00181       offset += sizeof(this->altitude);
00182       union {
00183         double real;
00184         uint64_t base;
00185       } u_heading;
00186       u_heading.base = 0;
00187       u_heading.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
00188       u_heading.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
00189       u_heading.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
00190       u_heading.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
00191       u_heading.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
00192       u_heading.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
00193       u_heading.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
00194       u_heading.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
00195       this->heading = u_heading.real;
00196       offset += sizeof(this->heading);
00197       union {
00198         double real;
00199         uint64_t base;
00200       } u_maxSpeed;
00201       u_maxSpeed.base = 0;
00202       u_maxSpeed.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
00203       u_maxSpeed.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
00204       u_maxSpeed.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
00205       u_maxSpeed.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
00206       u_maxSpeed.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
00207       u_maxSpeed.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
00208       u_maxSpeed.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
00209       u_maxSpeed.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
00210       this->maxSpeed = u_maxSpeed.real;
00211       offset += sizeof(this->maxSpeed);
00212       union {
00213         double real;
00214         uint64_t base;
00215       } u_maxAcc;
00216       u_maxAcc.base = 0;
00217       u_maxAcc.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
00218       u_maxAcc.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
00219       u_maxAcc.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
00220       u_maxAcc.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
00221       u_maxAcc.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
00222       u_maxAcc.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
00223       u_maxAcc.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
00224       u_maxAcc.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
00225       this->maxAcc = u_maxAcc.real;
00226       offset += sizeof(this->maxAcc);
00227      return offset;
00228     }
00229 
00230     const char * getType(){ return "mav_msgs/GpsWaypoint"; };
00231     const char * getMD5(){ return "61c3751c96f3b418f93879727f9a070a"; };
00232 
00233   };
00234 
00235 }
00236 #endif