catchrobo2022 / Mbed 2 deprecated catchrobo2022_mbed

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SlicedPointCloud.h Source File

SlicedPointCloud.h

00001 #ifndef _ROS_jsk_recognition_msgs_SlicedPointCloud_h
00002 #define _ROS_jsk_recognition_msgs_SlicedPointCloud_h
00003 
00004 #include <stdint.h>
00005 #include <string.h>
00006 #include <stdlib.h>
00007 #include "ros/msg.h"
00008 #include "sensor_msgs/PointCloud2.h"
00009 
00010 namespace jsk_recognition_msgs
00011 {
00012 
00013   class SlicedPointCloud : public ros::Msg
00014   {
00015     public:
00016       typedef sensor_msgs::PointCloud2 _point_cloud_type;
00017       _point_cloud_type point_cloud;
00018       typedef uint8_t _slice_index_type;
00019       _slice_index_type slice_index;
00020       typedef uint8_t _sequence_id_type;
00021       _sequence_id_type sequence_id;
00022 
00023     SlicedPointCloud():
00024       point_cloud(),
00025       slice_index(0),
00026       sequence_id(0)
00027     {
00028     }
00029 
00030     virtual int serialize(unsigned char *outbuffer) const
00031     {
00032       int offset = 0;
00033       offset += this->point_cloud.serialize(outbuffer + offset);
00034       *(outbuffer + offset + 0) = (this->slice_index >> (8 * 0)) & 0xFF;
00035       offset += sizeof(this->slice_index);
00036       *(outbuffer + offset + 0) = (this->sequence_id >> (8 * 0)) & 0xFF;
00037       offset += sizeof(this->sequence_id);
00038       return offset;
00039     }
00040 
00041     virtual int deserialize(unsigned char *inbuffer)
00042     {
00043       int offset = 0;
00044       offset += this->point_cloud.deserialize(inbuffer + offset);
00045       this->slice_index =  ((uint8_t) (*(inbuffer + offset)));
00046       offset += sizeof(this->slice_index);
00047       this->sequence_id =  ((uint8_t) (*(inbuffer + offset)));
00048       offset += sizeof(this->sequence_id);
00049      return offset;
00050     }
00051 
00052     virtual const char * getType(){ return "jsk_recognition_msgs/SlicedPointCloud"; };
00053     virtual const char * getMD5(){ return "37376a48b034bf543f8cfd86844487c7"; };
00054 
00055   };
00056 
00057 }
00058 #endif