Go to the documentation of this file.00001 #ifndef ros_geometry_msgs_TransformStamped_h
00002 #define ros_geometry_msgs_TransformStamped_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/Transform.h"
00010
00011 namespace geometry_msgs
00012 {
00013
00014 class TransformStamped : public ros::Msg
00015 {
00016 public:
00017 std_msgs::Header header;
00018 char * child_frame_id;
00019 geometry_msgs::Transform transform;
00020
00021 virtual int serialize(unsigned char *outbuffer)
00022 {
00023 int offset = 0;
00024 offset += this->header.serialize(outbuffer + offset);
00025 long * length_child_frame_id = (long *)(outbuffer + offset);
00026 *length_child_frame_id = strlen( (const char*) this->child_frame_id);
00027 offset += 4;
00028 memcpy(outbuffer + offset, this->child_frame_id, *length_child_frame_id);
00029 offset += *length_child_frame_id;
00030 offset += this->transform.serialize(outbuffer + offset);
00031 return offset;
00032 }
00033
00034 virtual int deserialize(unsigned char *inbuffer)
00035 {
00036 int offset = 0;
00037 offset += this->header.deserialize(inbuffer + offset);
00038 uint32_t length_child_frame_id = *(uint32_t *)(inbuffer + offset);
00039 offset += 4;
00040 for(unsigned int k= offset; k< offset+length_child_frame_id; ++k){
00041 inbuffer[k-1]=inbuffer[k];
00042 }
00043 inbuffer[offset+length_child_frame_id-1]=0;
00044 this->child_frame_id = (char *)(inbuffer + offset-1);
00045 offset += length_child_frame_id;
00046 offset += this->transform.deserialize(inbuffer + offset);
00047 return offset;
00048 }
00049
00050 const char * getType(){ return "geometry_msgs/TransformStamped"; };
00051
00052 };
00053
00054 }
00055 #endif