Gary Servin / ros_lib_indigo

Dependencies:   BufferedSerial

Dependents:   rosserial_mbed_hello_world_publisher rtos_base_control rosserial_mbed_F64MA ROS-RTOS ... more

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