kitt_platform
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Macros
TF2Error.h
Go to the documentation of this file.
1 #ifndef _ROS_tf2_msgs_TF2Error_h
2 #define _ROS_tf2_msgs_TF2Error_h
3 
4 #include <stdint.h>
5 #include <string.h>
6 #include <stdlib.h>
7 #include "ros/msg.h"
8 
9 namespace tf2_msgs
10 {
11 
12  class TF2Error : public ros::Msg
13  {
14  public:
15  uint8_t error;
16  const char* error_string;
17  enum { NO_ERROR = 0 };
18  enum { LOOKUP_ERROR = 1 };
19  enum { CONNECTIVITY_ERROR = 2 };
20  enum { EXTRAPOLATION_ERROR = 3 };
21  enum { INVALID_ARGUMENT_ERROR = 4 };
22  enum { TIMEOUT_ERROR = 5 };
23  enum { TRANSFORM_ERROR = 6 };
24 
26  error(0),
27  error_string("")
28  {
29  }
30 
31  virtual int serialize(unsigned char *outbuffer) const
32  {
33  int offset = 0;
34  *(outbuffer + offset + 0) = (this->error >> (8 * 0)) & 0xFF;
35  offset += sizeof(this->error);
36  uint32_t length_error_string = strlen(this->error_string);
37  memcpy(outbuffer + offset, &length_error_string, sizeof(uint32_t));
38  offset += 4;
39  memcpy(outbuffer + offset, this->error_string, length_error_string);
40  offset += length_error_string;
41  return offset;
42  }
43 
44  virtual int deserialize(unsigned char *inbuffer)
45  {
46  int offset = 0;
47  this->error = ((uint8_t) (*(inbuffer + offset)));
48  offset += sizeof(this->error);
49  uint32_t length_error_string;
50  memcpy(&length_error_string, (inbuffer + offset), sizeof(uint32_t));
51  offset += 4;
52  for(unsigned int k= offset; k< offset+length_error_string; ++k){
53  inbuffer[k-1]=inbuffer[k];
54  }
55  inbuffer[offset+length_error_string-1]=0;
56  this->error_string = (char *)(inbuffer + offset-1);
57  offset += length_error_string;
58  return offset;
59  }
60 
61  const char * getType(){ return "tf2_msgs/TF2Error"; };
62  const char * getMD5(){ return "bc6848fd6fd750c92e38575618a4917d"; };
63 
64  };
65 
66 }
67 #endif
Definition: TF2Error.h:23
uint8_t error
Definition: TF2Error.h:15
Definition: TF2Error.h:18
const char * getType()
Definition: TF2Error.h:61
Definition: TF2Error.h:17
const char * getMD5()
Definition: TF2Error.h:62
const char * error_string
Definition: TF2Error.h:16
Definition: TF2Error.h:12
TF2Error()
Definition: TF2Error.h:25
virtual int deserialize(unsigned char *inbuffer)
Definition: TF2Error.h:44
Definition: TF2Error.h:22
Definition: msg.h:43
virtual int serialize(unsigned char *outbuffer) const
Definition: TF2Error.h:31