ROS Serial library for Mbed platforms for ROS Indigo Igloo. Check http://wiki.ros.org/rosserial_mbed/ for more information

Dependencies:   BufferedSerial

Dependents:   rosserial_mbed_hello_world_publisher rtos_base_control rosserial_mbed_F64MA ROS-RTOS ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers LookupTransformGoal.h Source File

LookupTransformGoal.h

00001 #ifndef _ROS_tf2_msgs_LookupTransformGoal_h
00002 #define _ROS_tf2_msgs_LookupTransformGoal_h
00003 
00004 #include <stdint.h>
00005 #include <string.h>
00006 #include <stdlib.h>
00007 #include "ros/msg.h"
00008 #include "ros/time.h"
00009 #include "ros/duration.h"
00010 
00011 namespace tf2_msgs
00012 {
00013 
00014   class LookupTransformGoal : public ros::Msg
00015   {
00016     public:
00017       const char* target_frame;
00018       const char* source_frame;
00019       ros::Time source_time;
00020       ros::Duration timeout;
00021       ros::Time target_time;
00022       const char* fixed_frame;
00023       bool advanced;
00024 
00025     LookupTransformGoal():
00026       target_frame(""),
00027       source_frame(""),
00028       source_time(),
00029       timeout(),
00030       target_time(),
00031       fixed_frame(""),
00032       advanced(0)
00033     {
00034     }
00035 
00036     virtual int serialize(unsigned char *outbuffer) const
00037     {
00038       int offset = 0;
00039       uint32_t length_target_frame = strlen(this->target_frame);
00040       memcpy(outbuffer + offset, &length_target_frame, sizeof(uint32_t));
00041       offset += 4;
00042       memcpy(outbuffer + offset, this->target_frame, length_target_frame);
00043       offset += length_target_frame;
00044       uint32_t length_source_frame = strlen(this->source_frame);
00045       memcpy(outbuffer + offset, &length_source_frame, sizeof(uint32_t));
00046       offset += 4;
00047       memcpy(outbuffer + offset, this->source_frame, length_source_frame);
00048       offset += length_source_frame;
00049       *(outbuffer + offset + 0) = (this->source_time.sec >> (8 * 0)) & 0xFF;
00050       *(outbuffer + offset + 1) = (this->source_time.sec >> (8 * 1)) & 0xFF;
00051       *(outbuffer + offset + 2) = (this->source_time.sec >> (8 * 2)) & 0xFF;
00052       *(outbuffer + offset + 3) = (this->source_time.sec >> (8 * 3)) & 0xFF;
00053       offset += sizeof(this->source_time.sec);
00054       *(outbuffer + offset + 0) = (this->source_time.nsec >> (8 * 0)) & 0xFF;
00055       *(outbuffer + offset + 1) = (this->source_time.nsec >> (8 * 1)) & 0xFF;
00056       *(outbuffer + offset + 2) = (this->source_time.nsec >> (8 * 2)) & 0xFF;
00057       *(outbuffer + offset + 3) = (this->source_time.nsec >> (8 * 3)) & 0xFF;
00058       offset += sizeof(this->source_time.nsec);
00059       *(outbuffer + offset + 0) = (this->timeout.sec >> (8 * 0)) & 0xFF;
00060       *(outbuffer + offset + 1) = (this->timeout.sec >> (8 * 1)) & 0xFF;
00061       *(outbuffer + offset + 2) = (this->timeout.sec >> (8 * 2)) & 0xFF;
00062       *(outbuffer + offset + 3) = (this->timeout.sec >> (8 * 3)) & 0xFF;
00063       offset += sizeof(this->timeout.sec);
00064       *(outbuffer + offset + 0) = (this->timeout.nsec >> (8 * 0)) & 0xFF;
00065       *(outbuffer + offset + 1) = (this->timeout.nsec >> (8 * 1)) & 0xFF;
00066       *(outbuffer + offset + 2) = (this->timeout.nsec >> (8 * 2)) & 0xFF;
00067       *(outbuffer + offset + 3) = (this->timeout.nsec >> (8 * 3)) & 0xFF;
00068       offset += sizeof(this->timeout.nsec);
00069       *(outbuffer + offset + 0) = (this->target_time.sec >> (8 * 0)) & 0xFF;
00070       *(outbuffer + offset + 1) = (this->target_time.sec >> (8 * 1)) & 0xFF;
00071       *(outbuffer + offset + 2) = (this->target_time.sec >> (8 * 2)) & 0xFF;
00072       *(outbuffer + offset + 3) = (this->target_time.sec >> (8 * 3)) & 0xFF;
00073       offset += sizeof(this->target_time.sec);
00074       *(outbuffer + offset + 0) = (this->target_time.nsec >> (8 * 0)) & 0xFF;
00075       *(outbuffer + offset + 1) = (this->target_time.nsec >> (8 * 1)) & 0xFF;
00076       *(outbuffer + offset + 2) = (this->target_time.nsec >> (8 * 2)) & 0xFF;
00077       *(outbuffer + offset + 3) = (this->target_time.nsec >> (8 * 3)) & 0xFF;
00078       offset += sizeof(this->target_time.nsec);
00079       uint32_t length_fixed_frame = strlen(this->fixed_frame);
00080       memcpy(outbuffer + offset, &length_fixed_frame, sizeof(uint32_t));
00081       offset += 4;
00082       memcpy(outbuffer + offset, this->fixed_frame, length_fixed_frame);
00083       offset += length_fixed_frame;
00084       union {
00085         bool real;
00086         uint8_t base;
00087       } u_advanced;
00088       u_advanced.real = this->advanced;
00089       *(outbuffer + offset + 0) = (u_advanced.base >> (8 * 0)) & 0xFF;
00090       offset += sizeof(this->advanced);
00091       return offset;
00092     }
00093 
00094     virtual int deserialize(unsigned char *inbuffer)
00095     {
00096       int offset = 0;
00097       uint32_t length_target_frame;
00098       memcpy(&length_target_frame, (inbuffer + offset), sizeof(uint32_t));
00099       offset += 4;
00100       for(unsigned int k= offset; k< offset+length_target_frame; ++k){
00101           inbuffer[k-1]=inbuffer[k];
00102       }
00103       inbuffer[offset+length_target_frame-1]=0;
00104       this->target_frame = (char *)(inbuffer + offset-1);
00105       offset += length_target_frame;
00106       uint32_t length_source_frame;
00107       memcpy(&length_source_frame, (inbuffer + offset), sizeof(uint32_t));
00108       offset += 4;
00109       for(unsigned int k= offset; k< offset+length_source_frame; ++k){
00110           inbuffer[k-1]=inbuffer[k];
00111       }
00112       inbuffer[offset+length_source_frame-1]=0;
00113       this->source_frame = (char *)(inbuffer + offset-1);
00114       offset += length_source_frame;
00115       this->source_time.sec =  ((uint32_t) (*(inbuffer + offset)));
00116       this->source_time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00117       this->source_time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00118       this->source_time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00119       offset += sizeof(this->source_time.sec);
00120       this->source_time.nsec =  ((uint32_t) (*(inbuffer + offset)));
00121       this->source_time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00122       this->source_time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00123       this->source_time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00124       offset += sizeof(this->source_time.nsec);
00125       this->timeout.sec =  ((uint32_t) (*(inbuffer + offset)));
00126       this->timeout.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00127       this->timeout.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00128       this->timeout.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00129       offset += sizeof(this->timeout.sec);
00130       this->timeout.nsec =  ((uint32_t) (*(inbuffer + offset)));
00131       this->timeout.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00132       this->timeout.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00133       this->timeout.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00134       offset += sizeof(this->timeout.nsec);
00135       this->target_time.sec =  ((uint32_t) (*(inbuffer + offset)));
00136       this->target_time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00137       this->target_time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00138       this->target_time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00139       offset += sizeof(this->target_time.sec);
00140       this->target_time.nsec =  ((uint32_t) (*(inbuffer + offset)));
00141       this->target_time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00142       this->target_time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00143       this->target_time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00144       offset += sizeof(this->target_time.nsec);
00145       uint32_t length_fixed_frame;
00146       memcpy(&length_fixed_frame, (inbuffer + offset), sizeof(uint32_t));
00147       offset += 4;
00148       for(unsigned int k= offset; k< offset+length_fixed_frame; ++k){
00149           inbuffer[k-1]=inbuffer[k];
00150       }
00151       inbuffer[offset+length_fixed_frame-1]=0;
00152       this->fixed_frame = (char *)(inbuffer + offset-1);
00153       offset += length_fixed_frame;
00154       union {
00155         bool real;
00156         uint8_t base;
00157       } u_advanced;
00158       u_advanced.base = 0;
00159       u_advanced.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
00160       this->advanced = u_advanced.real;
00161       offset += sizeof(this->advanced);
00162      return offset;
00163     }
00164 
00165     const char * getType(){ return "tf2_msgs/LookupTransformGoal"; };
00166     const char * getMD5(){ return "35e3720468131d675a18bb6f3e5f22f8"; };
00167 
00168   };
00169 
00170 }
00171 #endif