catchrobo2022 mbed LPC1768 メインプログラム

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Torus.h Source File

Torus.h

00001 #ifndef _ROS_jsk_recognition_msgs_Torus_h
00002 #define _ROS_jsk_recognition_msgs_Torus_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 #include "geometry_msgs/Pose.h"
00010 
00011 namespace jsk_recognition_msgs
00012 {
00013 
00014   class Torus : public ros::Msg
00015   {
00016     public:
00017       typedef std_msgs::Header _header_type;
00018       _header_type header;
00019       typedef bool _failure_type;
00020       _failure_type failure;
00021       typedef geometry_msgs::Pose _pose_type;
00022       _pose_type pose;
00023       typedef double _large_radius_type;
00024       _large_radius_type large_radius;
00025       typedef double _small_radius_type;
00026       _small_radius_type small_radius;
00027 
00028     Torus():
00029       header(),
00030       failure(0),
00031       pose(),
00032       large_radius(0),
00033       small_radius(0)
00034     {
00035     }
00036 
00037     virtual int serialize(unsigned char *outbuffer) const
00038     {
00039       int offset = 0;
00040       offset += this->header.serialize(outbuffer + offset);
00041       union {
00042         bool real;
00043         uint8_t base;
00044       } u_failure;
00045       u_failure.real = this->failure;
00046       *(outbuffer + offset + 0) = (u_failure.base >> (8 * 0)) & 0xFF;
00047       offset += sizeof(this->failure);
00048       offset += this->pose.serialize(outbuffer + offset);
00049       union {
00050         double real;
00051         uint64_t base;
00052       } u_large_radius;
00053       u_large_radius.real = this->large_radius;
00054       *(outbuffer + offset + 0) = (u_large_radius.base >> (8 * 0)) & 0xFF;
00055       *(outbuffer + offset + 1) = (u_large_radius.base >> (8 * 1)) & 0xFF;
00056       *(outbuffer + offset + 2) = (u_large_radius.base >> (8 * 2)) & 0xFF;
00057       *(outbuffer + offset + 3) = (u_large_radius.base >> (8 * 3)) & 0xFF;
00058       *(outbuffer + offset + 4) = (u_large_radius.base >> (8 * 4)) & 0xFF;
00059       *(outbuffer + offset + 5) = (u_large_radius.base >> (8 * 5)) & 0xFF;
00060       *(outbuffer + offset + 6) = (u_large_radius.base >> (8 * 6)) & 0xFF;
00061       *(outbuffer + offset + 7) = (u_large_radius.base >> (8 * 7)) & 0xFF;
00062       offset += sizeof(this->large_radius);
00063       union {
00064         double real;
00065         uint64_t base;
00066       } u_small_radius;
00067       u_small_radius.real = this->small_radius;
00068       *(outbuffer + offset + 0) = (u_small_radius.base >> (8 * 0)) & 0xFF;
00069       *(outbuffer + offset + 1) = (u_small_radius.base >> (8 * 1)) & 0xFF;
00070       *(outbuffer + offset + 2) = (u_small_radius.base >> (8 * 2)) & 0xFF;
00071       *(outbuffer + offset + 3) = (u_small_radius.base >> (8 * 3)) & 0xFF;
00072       *(outbuffer + offset + 4) = (u_small_radius.base >> (8 * 4)) & 0xFF;
00073       *(outbuffer + offset + 5) = (u_small_radius.base >> (8 * 5)) & 0xFF;
00074       *(outbuffer + offset + 6) = (u_small_radius.base >> (8 * 6)) & 0xFF;
00075       *(outbuffer + offset + 7) = (u_small_radius.base >> (8 * 7)) & 0xFF;
00076       offset += sizeof(this->small_radius);
00077       return offset;
00078     }
00079 
00080     virtual int deserialize(unsigned char *inbuffer)
00081     {
00082       int offset = 0;
00083       offset += this->header.deserialize(inbuffer + offset);
00084       union {
00085         bool real;
00086         uint8_t base;
00087       } u_failure;
00088       u_failure.base = 0;
00089       u_failure.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
00090       this->failure = u_failure.real;
00091       offset += sizeof(this->failure);
00092       offset += this->pose.deserialize(inbuffer + offset);
00093       union {
00094         double real;
00095         uint64_t base;
00096       } u_large_radius;
00097       u_large_radius.base = 0;
00098       u_large_radius.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
00099       u_large_radius.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
00100       u_large_radius.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
00101       u_large_radius.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
00102       u_large_radius.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
00103       u_large_radius.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
00104       u_large_radius.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
00105       u_large_radius.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
00106       this->large_radius = u_large_radius.real;
00107       offset += sizeof(this->large_radius);
00108       union {
00109         double real;
00110         uint64_t base;
00111       } u_small_radius;
00112       u_small_radius.base = 0;
00113       u_small_radius.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
00114       u_small_radius.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
00115       u_small_radius.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
00116       u_small_radius.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
00117       u_small_radius.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
00118       u_small_radius.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
00119       u_small_radius.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
00120       u_small_radius.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
00121       this->small_radius = u_small_radius.real;
00122       offset += sizeof(this->small_radius);
00123      return offset;
00124     }
00125 
00126     virtual const char * getType(){ return "jsk_recognition_msgs/Torus"; };
00127     virtual const char * getMD5(){ return "7172d433485e406ce56f4cf6e9ab1062"; };
00128 
00129   };
00130 
00131 }
00132 #endif