complete motor

Dependencies:   BufferedSerial motor_sn7544

Committer:
Jeonghoon
Date:
Thu Jul 11 13:30:27 2019 +0000
Revision:
11:2228e8931266
190711; ;

Who changed what in which revision?

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