GraspPlanningResult.h
Go to the documentation of this file.
00001 #ifndef _ROS_manipulation_msgs_GraspPlanningResult_h
00002 #define _ROS_manipulation_msgs_GraspPlanningResult_h
00003 
00004 #include <stdint.h>
00005 #include <string.h>
00006 #include <stdlib.h>
00007 #include "ros/msg.h"
00008 #include "manipulation_msgs/Grasp.h"
00009 #include "manipulation_msgs/GraspPlanningErrorCode.h"
00010 
00011 namespace manipulation_msgs
00012 {
00013 
00014   class GraspPlanningResult : public ros::Msg
00015   {
00016     public:
00017       uint8_t grasps_length;
00018       manipulation_msgs::Grasp st_grasps;
00019       manipulation_msgs::Grasp * grasps;
00020       manipulation_msgs::GraspPlanningErrorCode error_code;
00021 
00022     virtual int serialize(unsigned char *outbuffer) const
00023     {
00024       int offset = 0;
00025       *(outbuffer + offset++) = grasps_length;
00026       *(outbuffer + offset++) = 0;
00027       *(outbuffer + offset++) = 0;
00028       *(outbuffer + offset++) = 0;
00029       for( uint8_t i = 0; i < grasps_length; i++){
00030       offset += this->grasps[i].serialize(outbuffer + offset);
00031       }
00032       offset += this->error_code.serialize(outbuffer + offset);
00033       return offset;
00034     }
00035 
00036     virtual int deserialize(unsigned char *inbuffer)
00037     {
00038       int offset = 0;
00039       uint8_t grasps_lengthT = *(inbuffer + offset++);
00040       if(grasps_lengthT > grasps_length)
00041         this->grasps = (manipulation_msgs::Grasp*)realloc(this->grasps, grasps_lengthT * sizeof(manipulation_msgs::Grasp));
00042       offset += 3;
00043       grasps_length = grasps_lengthT;
00044       for( uint8_t i = 0; i < grasps_length; i++){
00045       offset += this->st_grasps.deserialize(inbuffer + offset);
00046         memcpy( &(this->grasps[i]), &(this->st_grasps), sizeof(manipulation_msgs::Grasp));
00047       }
00048       offset += this->error_code.deserialize(inbuffer + offset);
00049      return offset;
00050     }
00051 
00052     const char * getType(){ return "manipulation_msgs/GraspPlanningResult"; };
00053     const char * getMD5(){ return "ff7a88c4aec40207164535a24dc9c440"; };
00054 
00055   };
00056 
00057 }
00058 #endif


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