kitt_platform
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Macros
InteractiveMarkerFeedback.h
Go to the documentation of this file.
1 #ifndef _ROS_visualization_msgs_InteractiveMarkerFeedback_h
2 #define _ROS_visualization_msgs_InteractiveMarkerFeedback_h
3 
4 #include <stdint.h>
5 #include <string.h>
6 #include <stdlib.h>
7 #include "ros/msg.h"
8 #include "std_msgs/Header.h"
9 #include "geometry_msgs/Pose.h"
10 #include "geometry_msgs/Point.h"
11 
12 namespace visualization_msgs
13 {
14 
16  {
17  public:
19  const char* client_id;
20  const char* marker_name;
21  const char* control_name;
22  uint8_t event_type;
24  uint32_t menu_entry_id;
27  enum { KEEP_ALIVE = 0 };
28  enum { POSE_UPDATE = 1 };
29  enum { MENU_SELECT = 2 };
30  enum { BUTTON_CLICK = 3 };
31  enum { MOUSE_DOWN = 4 };
32  enum { MOUSE_UP = 5 };
33 
35  header(),
36  client_id(""),
37  marker_name(""),
38  control_name(""),
39  event_type(0),
40  pose(),
41  menu_entry_id(0),
42  mouse_point(),
44  {
45  }
46 
47  virtual int serialize(unsigned char *outbuffer) const
48  {
49  int offset = 0;
50  offset += this->header.serialize(outbuffer + offset);
51  uint32_t length_client_id = strlen(this->client_id);
52  memcpy(outbuffer + offset, &length_client_id, sizeof(uint32_t));
53  offset += 4;
54  memcpy(outbuffer + offset, this->client_id, length_client_id);
55  offset += length_client_id;
56  uint32_t length_marker_name = strlen(this->marker_name);
57  memcpy(outbuffer + offset, &length_marker_name, sizeof(uint32_t));
58  offset += 4;
59  memcpy(outbuffer + offset, this->marker_name, length_marker_name);
60  offset += length_marker_name;
61  uint32_t length_control_name = strlen(this->control_name);
62  memcpy(outbuffer + offset, &length_control_name, sizeof(uint32_t));
63  offset += 4;
64  memcpy(outbuffer + offset, this->control_name, length_control_name);
65  offset += length_control_name;
66  *(outbuffer + offset + 0) = (this->event_type >> (8 * 0)) & 0xFF;
67  offset += sizeof(this->event_type);
68  offset += this->pose.serialize(outbuffer + offset);
69  *(outbuffer + offset + 0) = (this->menu_entry_id >> (8 * 0)) & 0xFF;
70  *(outbuffer + offset + 1) = (this->menu_entry_id >> (8 * 1)) & 0xFF;
71  *(outbuffer + offset + 2) = (this->menu_entry_id >> (8 * 2)) & 0xFF;
72  *(outbuffer + offset + 3) = (this->menu_entry_id >> (8 * 3)) & 0xFF;
73  offset += sizeof(this->menu_entry_id);
74  offset += this->mouse_point.serialize(outbuffer + offset);
75  union {
76  bool real;
77  uint8_t base;
78  } u_mouse_point_valid;
79  u_mouse_point_valid.real = this->mouse_point_valid;
80  *(outbuffer + offset + 0) = (u_mouse_point_valid.base >> (8 * 0)) & 0xFF;
81  offset += sizeof(this->mouse_point_valid);
82  return offset;
83  }
84 
85  virtual int deserialize(unsigned char *inbuffer)
86  {
87  int offset = 0;
88  offset += this->header.deserialize(inbuffer + offset);
89  uint32_t length_client_id;
90  memcpy(&length_client_id, (inbuffer + offset), sizeof(uint32_t));
91  offset += 4;
92  for(unsigned int k= offset; k< offset+length_client_id; ++k){
93  inbuffer[k-1]=inbuffer[k];
94  }
95  inbuffer[offset+length_client_id-1]=0;
96  this->client_id = (char *)(inbuffer + offset-1);
97  offset += length_client_id;
98  uint32_t length_marker_name;
99  memcpy(&length_marker_name, (inbuffer + offset), sizeof(uint32_t));
100  offset += 4;
101  for(unsigned int k= offset; k< offset+length_marker_name; ++k){
102  inbuffer[k-1]=inbuffer[k];
103  }
104  inbuffer[offset+length_marker_name-1]=0;
105  this->marker_name = (char *)(inbuffer + offset-1);
106  offset += length_marker_name;
107  uint32_t length_control_name;
108  memcpy(&length_control_name, (inbuffer + offset), sizeof(uint32_t));
109  offset += 4;
110  for(unsigned int k= offset; k< offset+length_control_name; ++k){
111  inbuffer[k-1]=inbuffer[k];
112  }
113  inbuffer[offset+length_control_name-1]=0;
114  this->control_name = (char *)(inbuffer + offset-1);
115  offset += length_control_name;
116  this->event_type = ((uint8_t) (*(inbuffer + offset)));
117  offset += sizeof(this->event_type);
118  offset += this->pose.deserialize(inbuffer + offset);
119  this->menu_entry_id = ((uint32_t) (*(inbuffer + offset)));
120  this->menu_entry_id |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
121  this->menu_entry_id |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
122  this->menu_entry_id |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
123  offset += sizeof(this->menu_entry_id);
124  offset += this->mouse_point.deserialize(inbuffer + offset);
125  union {
126  bool real;
127  uint8_t base;
128  } u_mouse_point_valid;
129  u_mouse_point_valid.base = 0;
130  u_mouse_point_valid.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
131  this->mouse_point_valid = u_mouse_point_valid.real;
132  offset += sizeof(this->mouse_point_valid);
133  return offset;
134  }
135 
136  const char * getType(){ return "visualization_msgs/InteractiveMarkerFeedback"; };
137  const char * getMD5(){ return "ab0f1eee058667e28c19ff3ffc3f4b78"; };
138 
139  };
140 
141 }
142 #endif
virtual int deserialize(unsigned char *inbuffer)
Definition: Header.h:53
std_msgs::Header header
Definition: InteractiveMarkerFeedback.h:18
Definition: InteractiveMarkerFeedback.h:28
Definition: InteractiveMarkerFeedback.h:30
Definition: InteractiveMarkerFeedback.h:31
uint8_t event_type
Definition: InteractiveMarkerFeedback.h:22
const char * getMD5()
Definition: InteractiveMarkerFeedback.h:137
uint32_t menu_entry_id
Definition: InteractiveMarkerFeedback.h:24
virtual int serialize(unsigned char *outbuffer) const
Definition: Header.h:27
Definition: Point.h:12
const char * client_id
Definition: InteractiveMarkerFeedback.h:19
virtual int serialize(unsigned char *outbuffer) const
Definition: InteractiveMarkerFeedback.h:47
virtual int serialize(unsigned char *outbuffer) const
Definition: Pose.h:26
geometry_msgs::Point mouse_point
Definition: InteractiveMarkerFeedback.h:25
const char * getType()
Definition: InteractiveMarkerFeedback.h:136
virtual int deserialize(unsigned char *inbuffer)
Definition: Pose.h:34
Definition: InteractiveMarkerFeedback.h:27
Definition: Header.h:13
bool mouse_point_valid
Definition: InteractiveMarkerFeedback.h:26
const char * control_name
Definition: InteractiveMarkerFeedback.h:21
Definition: InteractiveMarkerFeedback.h:29
geometry_msgs::Pose pose
Definition: InteractiveMarkerFeedback.h:23
Definition: InteractiveMarkerFeedback.h:15
Definition: InteractiveMarkerFeedback.h:32
virtual int serialize(unsigned char *outbuffer) const
Definition: Point.h:26
Definition: Pose.h:14
InteractiveMarkerFeedback()
Definition: InteractiveMarkerFeedback.h:34
const char * marker_name
Definition: InteractiveMarkerFeedback.h:20
virtual int deserialize(unsigned char *inbuffer)
Definition: Point.h:35
Definition: msg.h:43
virtual int deserialize(unsigned char *inbuffer)
Definition: InteractiveMarkerFeedback.h:85