kitt_platform
All Classes Namespaces Files Functions Variables Typedefs Enumerator Macros
LookupTransformGoal.h
Go to the documentation of this file.
1 #ifndef _ROS_tf2_msgs_LookupTransformGoal_h
2 #define _ROS_tf2_msgs_LookupTransformGoal_h
3 
4 #include <stdint.h>
5 #include <string.h>
6 #include <stdlib.h>
7 #include "ros/msg.h"
8 #include "ros/time.h"
9 #include "ros/duration.h"
10 
11 namespace tf2_msgs
12 {
13 
15  {
16  public:
17  const char* target_frame;
18  const char* source_frame;
22  const char* fixed_frame;
23  bool advanced;
24 
26  target_frame(""),
27  source_frame(""),
28  source_time(),
29  timeout(),
30  target_time(),
31  fixed_frame(""),
32  advanced(0)
33  {
34  }
35 
36  virtual int serialize(unsigned char *outbuffer) const
37  {
38  int offset = 0;
39  uint32_t length_target_frame = strlen(this->target_frame);
40  memcpy(outbuffer + offset, &length_target_frame, sizeof(uint32_t));
41  offset += 4;
42  memcpy(outbuffer + offset, this->target_frame, length_target_frame);
43  offset += length_target_frame;
44  uint32_t length_source_frame = strlen(this->source_frame);
45  memcpy(outbuffer + offset, &length_source_frame, sizeof(uint32_t));
46  offset += 4;
47  memcpy(outbuffer + offset, this->source_frame, length_source_frame);
48  offset += length_source_frame;
49  *(outbuffer + offset + 0) = (this->source_time.sec >> (8 * 0)) & 0xFF;
50  *(outbuffer + offset + 1) = (this->source_time.sec >> (8 * 1)) & 0xFF;
51  *(outbuffer + offset + 2) = (this->source_time.sec >> (8 * 2)) & 0xFF;
52  *(outbuffer + offset + 3) = (this->source_time.sec >> (8 * 3)) & 0xFF;
53  offset += sizeof(this->source_time.sec);
54  *(outbuffer + offset + 0) = (this->source_time.nsec >> (8 * 0)) & 0xFF;
55  *(outbuffer + offset + 1) = (this->source_time.nsec >> (8 * 1)) & 0xFF;
56  *(outbuffer + offset + 2) = (this->source_time.nsec >> (8 * 2)) & 0xFF;
57  *(outbuffer + offset + 3) = (this->source_time.nsec >> (8 * 3)) & 0xFF;
58  offset += sizeof(this->source_time.nsec);
59  *(outbuffer + offset + 0) = (this->timeout.sec >> (8 * 0)) & 0xFF;
60  *(outbuffer + offset + 1) = (this->timeout.sec >> (8 * 1)) & 0xFF;
61  *(outbuffer + offset + 2) = (this->timeout.sec >> (8 * 2)) & 0xFF;
62  *(outbuffer + offset + 3) = (this->timeout.sec >> (8 * 3)) & 0xFF;
63  offset += sizeof(this->timeout.sec);
64  *(outbuffer + offset + 0) = (this->timeout.nsec >> (8 * 0)) & 0xFF;
65  *(outbuffer + offset + 1) = (this->timeout.nsec >> (8 * 1)) & 0xFF;
66  *(outbuffer + offset + 2) = (this->timeout.nsec >> (8 * 2)) & 0xFF;
67  *(outbuffer + offset + 3) = (this->timeout.nsec >> (8 * 3)) & 0xFF;
68  offset += sizeof(this->timeout.nsec);
69  *(outbuffer + offset + 0) = (this->target_time.sec >> (8 * 0)) & 0xFF;
70  *(outbuffer + offset + 1) = (this->target_time.sec >> (8 * 1)) & 0xFF;
71  *(outbuffer + offset + 2) = (this->target_time.sec >> (8 * 2)) & 0xFF;
72  *(outbuffer + offset + 3) = (this->target_time.sec >> (8 * 3)) & 0xFF;
73  offset += sizeof(this->target_time.sec);
74  *(outbuffer + offset + 0) = (this->target_time.nsec >> (8 * 0)) & 0xFF;
75  *(outbuffer + offset + 1) = (this->target_time.nsec >> (8 * 1)) & 0xFF;
76  *(outbuffer + offset + 2) = (this->target_time.nsec >> (8 * 2)) & 0xFF;
77  *(outbuffer + offset + 3) = (this->target_time.nsec >> (8 * 3)) & 0xFF;
78  offset += sizeof(this->target_time.nsec);
79  uint32_t length_fixed_frame = strlen(this->fixed_frame);
80  memcpy(outbuffer + offset, &length_fixed_frame, sizeof(uint32_t));
81  offset += 4;
82  memcpy(outbuffer + offset, this->fixed_frame, length_fixed_frame);
83  offset += length_fixed_frame;
84  union {
85  bool real;
86  uint8_t base;
87  } u_advanced;
88  u_advanced.real = this->advanced;
89  *(outbuffer + offset + 0) = (u_advanced.base >> (8 * 0)) & 0xFF;
90  offset += sizeof(this->advanced);
91  return offset;
92  }
93 
94  virtual int deserialize(unsigned char *inbuffer)
95  {
96  int offset = 0;
97  uint32_t length_target_frame;
98  memcpy(&length_target_frame, (inbuffer + offset), sizeof(uint32_t));
99  offset += 4;
100  for(unsigned int k= offset; k< offset+length_target_frame; ++k){
101  inbuffer[k-1]=inbuffer[k];
102  }
103  inbuffer[offset+length_target_frame-1]=0;
104  this->target_frame = (char *)(inbuffer + offset-1);
105  offset += length_target_frame;
106  uint32_t length_source_frame;
107  memcpy(&length_source_frame, (inbuffer + offset), sizeof(uint32_t));
108  offset += 4;
109  for(unsigned int k= offset; k< offset+length_source_frame; ++k){
110  inbuffer[k-1]=inbuffer[k];
111  }
112  inbuffer[offset+length_source_frame-1]=0;
113  this->source_frame = (char *)(inbuffer + offset-1);
114  offset += length_source_frame;
115  this->source_time.sec = ((uint32_t) (*(inbuffer + offset)));
116  this->source_time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
117  this->source_time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
118  this->source_time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
119  offset += sizeof(this->source_time.sec);
120  this->source_time.nsec = ((uint32_t) (*(inbuffer + offset)));
121  this->source_time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
122  this->source_time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
123  this->source_time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
124  offset += sizeof(this->source_time.nsec);
125  this->timeout.sec = ((uint32_t) (*(inbuffer + offset)));
126  this->timeout.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
127  this->timeout.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
128  this->timeout.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
129  offset += sizeof(this->timeout.sec);
130  this->timeout.nsec = ((uint32_t) (*(inbuffer + offset)));
131  this->timeout.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
132  this->timeout.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
133  this->timeout.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
134  offset += sizeof(this->timeout.nsec);
135  this->target_time.sec = ((uint32_t) (*(inbuffer + offset)));
136  this->target_time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
137  this->target_time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
138  this->target_time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
139  offset += sizeof(this->target_time.sec);
140  this->target_time.nsec = ((uint32_t) (*(inbuffer + offset)));
141  this->target_time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
142  this->target_time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
143  this->target_time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
144  offset += sizeof(this->target_time.nsec);
145  uint32_t length_fixed_frame;
146  memcpy(&length_fixed_frame, (inbuffer + offset), sizeof(uint32_t));
147  offset += 4;
148  for(unsigned int k= offset; k< offset+length_fixed_frame; ++k){
149  inbuffer[k-1]=inbuffer[k];
150  }
151  inbuffer[offset+length_fixed_frame-1]=0;
152  this->fixed_frame = (char *)(inbuffer + offset-1);
153  offset += length_fixed_frame;
154  union {
155  bool real;
156  uint8_t base;
157  } u_advanced;
158  u_advanced.base = 0;
159  u_advanced.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
160  this->advanced = u_advanced.real;
161  offset += sizeof(this->advanced);
162  return offset;
163  }
164 
165  const char * getType(){ return "tf2_msgs/LookupTransformGoal"; };
166  const char * getMD5(){ return "35e3720468131d675a18bb6f3e5f22f8"; };
167 
168  };
169 
170 }
171 #endif
bool advanced
Definition: LookupTransformGoal.h:23
ros::Time source_time
Definition: LookupTransformGoal.h:19
const char * getMD5()
Definition: LookupTransformGoal.h:166
virtual int deserialize(unsigned char *inbuffer)
Definition: LookupTransformGoal.h:94
uint32_t nsec
Definition: time.h:50
ros::Duration timeout
Definition: LookupTransformGoal.h:20
uint32_t sec
Definition: time.h:50
Definition: time.h:47
int32_t sec
Definition: duration.h:48
ros::Time target_time
Definition: LookupTransformGoal.h:21
const char * getType()
Definition: LookupTransformGoal.h:165
LookupTransformGoal()
Definition: LookupTransformGoal.h:25
const char * fixed_frame
Definition: LookupTransformGoal.h:22
virtual int serialize(unsigned char *outbuffer) const
Definition: LookupTransformGoal.h:36
const char * target_frame
Definition: LookupTransformGoal.h:17
const char * source_frame
Definition: LookupTransformGoal.h:18
Definition: duration.h:45
int32_t nsec
Definition: duration.h:48
Definition: LookupTransformGoal.h:14
Definition: msg.h:43