KinematicSolverInfo.h
Go to the documentation of this file.
00001 #ifndef _ROS_moveit_msgs_KinematicSolverInfo_h
00002 #define _ROS_moveit_msgs_KinematicSolverInfo_h
00003 
00004 #include <stdint.h>
00005 #include <string.h>
00006 #include <stdlib.h>
00007 #include "ros/msg.h"
00008 #include "moveit_msgs/JointLimits.h"
00009 
00010 namespace moveit_msgs
00011 {
00012 
00013   class KinematicSolverInfo : public ros::Msg
00014   {
00015     public:
00016       uint8_t joint_names_length;
00017       char* st_joint_names;
00018       char* * joint_names;
00019       uint8_t limits_length;
00020       moveit_msgs::JointLimits st_limits;
00021       moveit_msgs::JointLimits * limits;
00022       uint8_t link_names_length;
00023       char* st_link_names;
00024       char* * link_names;
00025 
00026     virtual int serialize(unsigned char *outbuffer) const
00027     {
00028       int offset = 0;
00029       *(outbuffer + offset++) = joint_names_length;
00030       *(outbuffer + offset++) = 0;
00031       *(outbuffer + offset++) = 0;
00032       *(outbuffer + offset++) = 0;
00033       for( uint8_t i = 0; i < joint_names_length; i++){
00034       uint32_t length_joint_namesi = strlen(this->joint_names[i]);
00035       memcpy(outbuffer + offset, &length_joint_namesi, sizeof(uint32_t));
00036       offset += 4;
00037       memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi);
00038       offset += length_joint_namesi;
00039       }
00040       *(outbuffer + offset++) = limits_length;
00041       *(outbuffer + offset++) = 0;
00042       *(outbuffer + offset++) = 0;
00043       *(outbuffer + offset++) = 0;
00044       for( uint8_t i = 0; i < limits_length; i++){
00045       offset += this->limits[i].serialize(outbuffer + offset);
00046       }
00047       *(outbuffer + offset++) = link_names_length;
00048       *(outbuffer + offset++) = 0;
00049       *(outbuffer + offset++) = 0;
00050       *(outbuffer + offset++) = 0;
00051       for( uint8_t i = 0; i < link_names_length; i++){
00052       uint32_t length_link_namesi = strlen(this->link_names[i]);
00053       memcpy(outbuffer + offset, &length_link_namesi, sizeof(uint32_t));
00054       offset += 4;
00055       memcpy(outbuffer + offset, this->link_names[i], length_link_namesi);
00056       offset += length_link_namesi;
00057       }
00058       return offset;
00059     }
00060 
00061     virtual int deserialize(unsigned char *inbuffer)
00062     {
00063       int offset = 0;
00064       uint8_t joint_names_lengthT = *(inbuffer + offset++);
00065       if(joint_names_lengthT > joint_names_length)
00066         this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*));
00067       offset += 3;
00068       joint_names_length = joint_names_lengthT;
00069       for( uint8_t i = 0; i < joint_names_length; i++){
00070       uint32_t length_st_joint_names;
00071       memcpy(&length_st_joint_names, (inbuffer + offset), sizeof(uint32_t));
00072       offset += 4;
00073       for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){
00074           inbuffer[k-1]=inbuffer[k];
00075       }
00076       inbuffer[offset+length_st_joint_names-1]=0;
00077       this->st_joint_names = (char *)(inbuffer + offset-1);
00078       offset += length_st_joint_names;
00079         memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*));
00080       }
00081       uint8_t limits_lengthT = *(inbuffer + offset++);
00082       if(limits_lengthT > limits_length)
00083         this->limits = (moveit_msgs::JointLimits*)realloc(this->limits, limits_lengthT * sizeof(moveit_msgs::JointLimits));
00084       offset += 3;
00085       limits_length = limits_lengthT;
00086       for( uint8_t i = 0; i < limits_length; i++){
00087       offset += this->st_limits.deserialize(inbuffer + offset);
00088         memcpy( &(this->limits[i]), &(this->st_limits), sizeof(moveit_msgs::JointLimits));
00089       }
00090       uint8_t link_names_lengthT = *(inbuffer + offset++);
00091       if(link_names_lengthT > link_names_length)
00092         this->link_names = (char**)realloc(this->link_names, link_names_lengthT * sizeof(char*));
00093       offset += 3;
00094       link_names_length = link_names_lengthT;
00095       for( uint8_t i = 0; i < link_names_length; i++){
00096       uint32_t length_st_link_names;
00097       memcpy(&length_st_link_names, (inbuffer + offset), sizeof(uint32_t));
00098       offset += 4;
00099       for(unsigned int k= offset; k< offset+length_st_link_names; ++k){
00100           inbuffer[k-1]=inbuffer[k];
00101       }
00102       inbuffer[offset+length_st_link_names-1]=0;
00103       this->st_link_names = (char *)(inbuffer + offset-1);
00104       offset += length_st_link_names;
00105         memcpy( &(this->link_names[i]), &(this->st_link_names), sizeof(char*));
00106       }
00107      return offset;
00108     }
00109 
00110     const char * getType(){ return "moveit_msgs/KinematicSolverInfo"; };
00111     const char * getMD5(){ return "cc048557c0f9795c392dd80f8bb00489"; };
00112 
00113   };
00114 
00115 }
00116 #endif


ric_mc
Author(s): RoboTiCan
autogenerated on Fri May 20 2016 03:48:55