It has only one change from original one. I added robotfeedback message on it.
Dependents: RobotFeedback mobileRobotITU
Fork of ros_lib_indigo by
rosserial_msgs/Log.h
- Committer:
- garyservin
- Date:
- 2016-03-31
- Revision:
- 0:fd24f7ca9688
File content as of revision 0:fd24f7ca9688:
#ifndef _ROS_rosserial_msgs_Log_h #define _ROS_rosserial_msgs_Log_h #include <stdint.h> #include <string.h> #include <stdlib.h> #include "ros/msg.h" namespace rosserial_msgs { class Log : public ros::Msg { public: uint8_t level; const char* msg; enum { ROSDEBUG = 0 }; enum { INFO = 1 }; enum { WARN = 2 }; enum { ERROR = 3 }; enum { FATAL = 4 }; Log(): level(0), msg("") { } virtual int serialize(unsigned char *outbuffer) const { int offset = 0; *(outbuffer + offset + 0) = (this->level >> (8 * 0)) & 0xFF; offset += sizeof(this->level); uint32_t length_msg = strlen(this->msg); memcpy(outbuffer + offset, &length_msg, sizeof(uint32_t)); offset += 4; memcpy(outbuffer + offset, this->msg, length_msg); offset += length_msg; return offset; } virtual int deserialize(unsigned char *inbuffer) { int offset = 0; this->level = ((uint8_t) (*(inbuffer + offset))); offset += sizeof(this->level); uint32_t length_msg; memcpy(&length_msg, (inbuffer + offset), sizeof(uint32_t)); offset += 4; for(unsigned int k= offset; k< offset+length_msg; ++k){ inbuffer[k-1]=inbuffer[k]; } inbuffer[offset+length_msg-1]=0; this->msg = (char *)(inbuffer + offset-1); offset += length_msg; return offset; } const char * getType(){ return "rosserial_msgs/Log"; }; const char * getMD5(){ return "11abd731c25933261cd6183bd12d6295"; }; }; } #endif