Go to the documentation of this file.00001 #ifndef _ROS_moveit_msgs_BoundingVolume_h
00002 #define _ROS_moveit_msgs_BoundingVolume_h
00003
00004 #include <stdint.h>
00005 #include <string.h>
00006 #include <stdlib.h>
00007 #include "ros/msg.h"
00008 #include "shape_msgs/SolidPrimitive.h"
00009 #include "geometry_msgs/Pose.h"
00010 #include "shape_msgs/Mesh.h"
00011
00012 namespace moveit_msgs
00013 {
00014
00015 class BoundingVolume : public ros::Msg
00016 {
00017 public:
00018 uint8_t primitives_length;
00019 shape_msgs::SolidPrimitive st_primitives;
00020 shape_msgs::SolidPrimitive * primitives;
00021 uint8_t primitive_poses_length;
00022 geometry_msgs::Pose st_primitive_poses;
00023 geometry_msgs::Pose * primitive_poses;
00024 uint8_t meshes_length;
00025 shape_msgs::Mesh st_meshes;
00026 shape_msgs::Mesh * meshes;
00027 uint8_t mesh_poses_length;
00028 geometry_msgs::Pose st_mesh_poses;
00029 geometry_msgs::Pose * mesh_poses;
00030
00031 virtual int serialize(unsigned char *outbuffer) const
00032 {
00033 int offset = 0;
00034 *(outbuffer + offset++) = primitives_length;
00035 *(outbuffer + offset++) = 0;
00036 *(outbuffer + offset++) = 0;
00037 *(outbuffer + offset++) = 0;
00038 for( uint8_t i = 0; i < primitives_length; i++){
00039 offset += this->primitives[i].serialize(outbuffer + offset);
00040 }
00041 *(outbuffer + offset++) = primitive_poses_length;
00042 *(outbuffer + offset++) = 0;
00043 *(outbuffer + offset++) = 0;
00044 *(outbuffer + offset++) = 0;
00045 for( uint8_t i = 0; i < primitive_poses_length; i++){
00046 offset += this->primitive_poses[i].serialize(outbuffer + offset);
00047 }
00048 *(outbuffer + offset++) = meshes_length;
00049 *(outbuffer + offset++) = 0;
00050 *(outbuffer + offset++) = 0;
00051 *(outbuffer + offset++) = 0;
00052 for( uint8_t i = 0; i < meshes_length; i++){
00053 offset += this->meshes[i].serialize(outbuffer + offset);
00054 }
00055 *(outbuffer + offset++) = mesh_poses_length;
00056 *(outbuffer + offset++) = 0;
00057 *(outbuffer + offset++) = 0;
00058 *(outbuffer + offset++) = 0;
00059 for( uint8_t i = 0; i < mesh_poses_length; i++){
00060 offset += this->mesh_poses[i].serialize(outbuffer + offset);
00061 }
00062 return offset;
00063 }
00064
00065 virtual int deserialize(unsigned char *inbuffer)
00066 {
00067 int offset = 0;
00068 uint8_t primitives_lengthT = *(inbuffer + offset++);
00069 if(primitives_lengthT > primitives_length)
00070 this->primitives = (shape_msgs::SolidPrimitive*)realloc(this->primitives, primitives_lengthT * sizeof(shape_msgs::SolidPrimitive));
00071 offset += 3;
00072 primitives_length = primitives_lengthT;
00073 for( uint8_t i = 0; i < primitives_length; i++){
00074 offset += this->st_primitives.deserialize(inbuffer + offset);
00075 memcpy( &(this->primitives[i]), &(this->st_primitives), sizeof(shape_msgs::SolidPrimitive));
00076 }
00077 uint8_t primitive_poses_lengthT = *(inbuffer + offset++);
00078 if(primitive_poses_lengthT > primitive_poses_length)
00079 this->primitive_poses = (geometry_msgs::Pose*)realloc(this->primitive_poses, primitive_poses_lengthT * sizeof(geometry_msgs::Pose));
00080 offset += 3;
00081 primitive_poses_length = primitive_poses_lengthT;
00082 for( uint8_t i = 0; i < primitive_poses_length; i++){
00083 offset += this->st_primitive_poses.deserialize(inbuffer + offset);
00084 memcpy( &(this->primitive_poses[i]), &(this->st_primitive_poses), sizeof(geometry_msgs::Pose));
00085 }
00086 uint8_t meshes_lengthT = *(inbuffer + offset++);
00087 if(meshes_lengthT > meshes_length)
00088 this->meshes = (shape_msgs::Mesh*)realloc(this->meshes, meshes_lengthT * sizeof(shape_msgs::Mesh));
00089 offset += 3;
00090 meshes_length = meshes_lengthT;
00091 for( uint8_t i = 0; i < meshes_length; i++){
00092 offset += this->st_meshes.deserialize(inbuffer + offset);
00093 memcpy( &(this->meshes[i]), &(this->st_meshes), sizeof(shape_msgs::Mesh));
00094 }
00095 uint8_t mesh_poses_lengthT = *(inbuffer + offset++);
00096 if(mesh_poses_lengthT > mesh_poses_length)
00097 this->mesh_poses = (geometry_msgs::Pose*)realloc(this->mesh_poses, mesh_poses_lengthT * sizeof(geometry_msgs::Pose));
00098 offset += 3;
00099 mesh_poses_length = mesh_poses_lengthT;
00100 for( uint8_t i = 0; i < mesh_poses_length; i++){
00101 offset += this->st_mesh_poses.deserialize(inbuffer + offset);
00102 memcpy( &(this->mesh_poses[i]), &(this->st_mesh_poses), sizeof(geometry_msgs::Pose));
00103 }
00104 return offset;
00105 }
00106
00107 const char * getType(){ return "moveit_msgs/BoundingVolume"; };
00108 const char * getMD5(){ return "22db94010f39e9198032cb4a1aeda26e"; };
00109
00110 };
00111
00112 }
00113 #endif