It has only one change from original one. I added robotfeedback message on it.
Dependents: RobotFeedback mobileRobotITU
Fork of ros_lib_indigo by
std_msgs/Header.h
- Committer:
- randalthor
- Date:
- 2017-03-04
- Revision:
- 4:80d9bee5079a
- Parent:
- 0:fd24f7ca9688
File content as of revision 4:80d9bee5079a:
#ifndef _ROS_std_msgs_Header_h #define _ROS_std_msgs_Header_h #include <stdint.h> #include <string.h> #include <stdlib.h> #include "ros/msg.h" #include "ros/time.h" namespace std_msgs { class Header : public ros::Msg { public: uint32_t seq; ros::Time stamp; const char* frame_id; Header(): seq(0), stamp(), frame_id("") { } virtual int serialize(unsigned char *outbuffer) const { int offset = 0; *(outbuffer + offset + 0) = (this->seq >> (8 * 0)) & 0xFF; *(outbuffer + offset + 1) = (this->seq >> (8 * 1)) & 0xFF; *(outbuffer + offset + 2) = (this->seq >> (8 * 2)) & 0xFF; *(outbuffer + offset + 3) = (this->seq >> (8 * 3)) & 0xFF; offset += sizeof(this->seq); *(outbuffer + offset + 0) = (this->stamp.sec >> (8 * 0)) & 0xFF; *(outbuffer + offset + 1) = (this->stamp.sec >> (8 * 1)) & 0xFF; *(outbuffer + offset + 2) = (this->stamp.sec >> (8 * 2)) & 0xFF; *(outbuffer + offset + 3) = (this->stamp.sec >> (8 * 3)) & 0xFF; offset += sizeof(this->stamp.sec); *(outbuffer + offset + 0) = (this->stamp.nsec >> (8 * 0)) & 0xFF; *(outbuffer + offset + 1) = (this->stamp.nsec >> (8 * 1)) & 0xFF; *(outbuffer + offset + 2) = (this->stamp.nsec >> (8 * 2)) & 0xFF; *(outbuffer + offset + 3) = (this->stamp.nsec >> (8 * 3)) & 0xFF; offset += sizeof(this->stamp.nsec); uint32_t length_frame_id = strlen(this->frame_id); memcpy(outbuffer + offset, &length_frame_id, sizeof(uint32_t)); offset += 4; memcpy(outbuffer + offset, this->frame_id, length_frame_id); offset += length_frame_id; return offset; } virtual int deserialize(unsigned char *inbuffer) { int offset = 0; this->seq = ((uint32_t) (*(inbuffer + offset))); this->seq |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); this->seq |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); this->seq |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); offset += sizeof(this->seq); this->stamp.sec = ((uint32_t) (*(inbuffer + offset))); this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); offset += sizeof(this->stamp.sec); this->stamp.nsec = ((uint32_t) (*(inbuffer + offset))); this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); offset += sizeof(this->stamp.nsec); uint32_t length_frame_id; memcpy(&length_frame_id, (inbuffer + offset), sizeof(uint32_t)); offset += 4; for(unsigned int k= offset; k< offset+length_frame_id; ++k){ inbuffer[k-1]=inbuffer[k]; } inbuffer[offset+length_frame_id-1]=0; this->frame_id = (char *)(inbuffer + offset-1); offset += length_frame_id; return offset; } const char * getType(){ return "std_msgs/Header"; }; const char * getMD5(){ return "2176decaecbce78abc3b96ef049fabed"; }; }; } #endif