added 1 custom message

Dependencies:   BufferedSerial

Fork of ros_lib_kinetic by Gary Servin

Committer:
randalthor
Date:
Fri May 19 08:59:12 2017 +0000
Revision:
2:af816ffd33df
Parent:
0:9e9b7db60fd5
custom message mobile robot added for ITU cyber physical lab

Who changed what in which revision?

UserRevisionLine numberNew contents of line
garyservin 0:9e9b7db60fd5 1 #ifndef _ROS_geometry_msgs_TransformStamped_h
garyservin 0:9e9b7db60fd5 2 #define _ROS_geometry_msgs_TransformStamped_h
garyservin 0:9e9b7db60fd5 3
garyservin 0:9e9b7db60fd5 4 #include <stdint.h>
garyservin 0:9e9b7db60fd5 5 #include <string.h>
garyservin 0:9e9b7db60fd5 6 #include <stdlib.h>
garyservin 0:9e9b7db60fd5 7 #include "ros/msg.h"
garyservin 0:9e9b7db60fd5 8 #include "std_msgs/Header.h"
garyservin 0:9e9b7db60fd5 9 #include "geometry_msgs/Transform.h"
garyservin 0:9e9b7db60fd5 10
garyservin 0:9e9b7db60fd5 11 namespace geometry_msgs
garyservin 0:9e9b7db60fd5 12 {
garyservin 0:9e9b7db60fd5 13
garyservin 0:9e9b7db60fd5 14 class TransformStamped : public ros::Msg
garyservin 0:9e9b7db60fd5 15 {
garyservin 0:9e9b7db60fd5 16 public:
garyservin 0:9e9b7db60fd5 17 typedef std_msgs::Header _header_type;
garyservin 0:9e9b7db60fd5 18 _header_type header;
garyservin 0:9e9b7db60fd5 19 typedef const char* _child_frame_id_type;
garyservin 0:9e9b7db60fd5 20 _child_frame_id_type child_frame_id;
garyservin 0:9e9b7db60fd5 21 typedef geometry_msgs::Transform _transform_type;
garyservin 0:9e9b7db60fd5 22 _transform_type transform;
garyservin 0:9e9b7db60fd5 23
garyservin 0:9e9b7db60fd5 24 TransformStamped():
garyservin 0:9e9b7db60fd5 25 header(),
garyservin 0:9e9b7db60fd5 26 child_frame_id(""),
garyservin 0:9e9b7db60fd5 27 transform()
garyservin 0:9e9b7db60fd5 28 {
garyservin 0:9e9b7db60fd5 29 }
garyservin 0:9e9b7db60fd5 30
garyservin 0:9e9b7db60fd5 31 virtual int serialize(unsigned char *outbuffer) const
garyservin 0:9e9b7db60fd5 32 {
garyservin 0:9e9b7db60fd5 33 int offset = 0;
garyservin 0:9e9b7db60fd5 34 offset += this->header.serialize(outbuffer + offset);
garyservin 0:9e9b7db60fd5 35 uint32_t length_child_frame_id = strlen(this->child_frame_id);
garyservin 0:9e9b7db60fd5 36 varToArr(outbuffer + offset, length_child_frame_id);
garyservin 0:9e9b7db60fd5 37 offset += 4;
garyservin 0:9e9b7db60fd5 38 memcpy(outbuffer + offset, this->child_frame_id, length_child_frame_id);
garyservin 0:9e9b7db60fd5 39 offset += length_child_frame_id;
garyservin 0:9e9b7db60fd5 40 offset += this->transform.serialize(outbuffer + offset);
garyservin 0:9e9b7db60fd5 41 return offset;
garyservin 0:9e9b7db60fd5 42 }
garyservin 0:9e9b7db60fd5 43
garyservin 0:9e9b7db60fd5 44 virtual int deserialize(unsigned char *inbuffer)
garyservin 0:9e9b7db60fd5 45 {
garyservin 0:9e9b7db60fd5 46 int offset = 0;
garyservin 0:9e9b7db60fd5 47 offset += this->header.deserialize(inbuffer + offset);
garyservin 0:9e9b7db60fd5 48 uint32_t length_child_frame_id;
garyservin 0:9e9b7db60fd5 49 arrToVar(length_child_frame_id, (inbuffer + offset));
garyservin 0:9e9b7db60fd5 50 offset += 4;
garyservin 0:9e9b7db60fd5 51 for(unsigned int k= offset; k< offset+length_child_frame_id; ++k){
garyservin 0:9e9b7db60fd5 52 inbuffer[k-1]=inbuffer[k];
garyservin 0:9e9b7db60fd5 53 }
garyservin 0:9e9b7db60fd5 54 inbuffer[offset+length_child_frame_id-1]=0;
garyservin 0:9e9b7db60fd5 55 this->child_frame_id = (char *)(inbuffer + offset-1);
garyservin 0:9e9b7db60fd5 56 offset += length_child_frame_id;
garyservin 0:9e9b7db60fd5 57 offset += this->transform.deserialize(inbuffer + offset);
garyservin 0:9e9b7db60fd5 58 return offset;
garyservin 0:9e9b7db60fd5 59 }
garyservin 0:9e9b7db60fd5 60
garyservin 0:9e9b7db60fd5 61 const char * getType(){ return "geometry_msgs/TransformStamped"; };
garyservin 0:9e9b7db60fd5 62 const char * getMD5(){ return "b5764a33bfeb3588febc2682852579b0"; };
garyservin 0:9e9b7db60fd5 63
garyservin 0:9e9b7db60fd5 64 };
garyservin 0:9e9b7db60fd5 65
garyservin 0:9e9b7db60fd5 66 }
garyservin 0:9e9b7db60fd5 67 #endif