Go to the documentation of this file.00001 #ifndef _ROS_SERVICE_GetLinkState_h
00002 #define _ROS_SERVICE_GetLinkState_h
00003 #include <stdint.h>
00004 #include <string.h>
00005 #include <stdlib.h>
00006 #include "ros/msg.h"
00007 #include "gazebo_msgs/LinkState.h"
00008
00009 namespace gazebo_msgs
00010 {
00011
00012 static const char GETLINKSTATE[] = "gazebo_msgs/GetLinkState";
00013
00014 class GetLinkStateRequest : public ros::Msg
00015 {
00016 public:
00017 const char* link_name;
00018 const char* reference_frame;
00019
00020 virtual int serialize(unsigned char *outbuffer) const
00021 {
00022 int offset = 0;
00023 uint32_t length_link_name = strlen(this->link_name);
00024 memcpy(outbuffer + offset, &length_link_name, sizeof(uint32_t));
00025 offset += 4;
00026 memcpy(outbuffer + offset, this->link_name, length_link_name);
00027 offset += length_link_name;
00028 uint32_t length_reference_frame = strlen(this->reference_frame);
00029 memcpy(outbuffer + offset, &length_reference_frame, sizeof(uint32_t));
00030 offset += 4;
00031 memcpy(outbuffer + offset, this->reference_frame, length_reference_frame);
00032 offset += length_reference_frame;
00033 return offset;
00034 }
00035
00036 virtual int deserialize(unsigned char *inbuffer)
00037 {
00038 int offset = 0;
00039 uint32_t length_link_name;
00040 memcpy(&length_link_name, (inbuffer + offset), sizeof(uint32_t));
00041 offset += 4;
00042 for(unsigned int k= offset; k< offset+length_link_name; ++k){
00043 inbuffer[k-1]=inbuffer[k];
00044 }
00045 inbuffer[offset+length_link_name-1]=0;
00046 this->link_name = (char *)(inbuffer + offset-1);
00047 offset += length_link_name;
00048 uint32_t length_reference_frame;
00049 memcpy(&length_reference_frame, (inbuffer + offset), sizeof(uint32_t));
00050 offset += 4;
00051 for(unsigned int k= offset; k< offset+length_reference_frame; ++k){
00052 inbuffer[k-1]=inbuffer[k];
00053 }
00054 inbuffer[offset+length_reference_frame-1]=0;
00055 this->reference_frame = (char *)(inbuffer + offset-1);
00056 offset += length_reference_frame;
00057 return offset;
00058 }
00059
00060 const char * getType(){ return GETLINKSTATE; };
00061 const char * getMD5(){ return "7551675c30aaa71f7c288d4864552001"; };
00062
00063 };
00064
00065 class GetLinkStateResponse : public ros::Msg
00066 {
00067 public:
00068 gazebo_msgs::LinkState link_state;
00069 bool success;
00070 const char* status_message;
00071
00072 virtual int serialize(unsigned char *outbuffer) const
00073 {
00074 int offset = 0;
00075 offset += this->link_state.serialize(outbuffer + offset);
00076 union {
00077 bool real;
00078 uint8_t base;
00079 } u_success;
00080 u_success.real = this->success;
00081 *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF;
00082 offset += sizeof(this->success);
00083 uint32_t length_status_message = strlen(this->status_message);
00084 memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t));
00085 offset += 4;
00086 memcpy(outbuffer + offset, this->status_message, length_status_message);
00087 offset += length_status_message;
00088 return offset;
00089 }
00090
00091 virtual int deserialize(unsigned char *inbuffer)
00092 {
00093 int offset = 0;
00094 offset += this->link_state.deserialize(inbuffer + offset);
00095 union {
00096 bool real;
00097 uint8_t base;
00098 } u_success;
00099 u_success.base = 0;
00100 u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
00101 this->success = u_success.real;
00102 offset += sizeof(this->success);
00103 uint32_t length_status_message;
00104 memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t));
00105 offset += 4;
00106 for(unsigned int k= offset; k< offset+length_status_message; ++k){
00107 inbuffer[k-1]=inbuffer[k];
00108 }
00109 inbuffer[offset+length_status_message-1]=0;
00110 this->status_message = (char *)(inbuffer + offset-1);
00111 offset += length_status_message;
00112 return offset;
00113 }
00114
00115 const char * getType(){ return GETLINKSTATE; };
00116 const char * getMD5(){ return "8ba55ad34f9c072e75c0de57b089753b"; };
00117
00118 };
00119
00120 class GetLinkState {
00121 public:
00122 typedef GetLinkStateRequest Request;
00123 typedef GetLinkStateResponse Response;
00124 };
00125
00126 }
00127 #endif