Working towards recieving twists

Dependencies:   BufferedSerial

Fork of ros_lib_kinetic by Gary Servin

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SetJointProperties.h Source File

SetJointProperties.h

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