Go to the documentation of this file.00001 #ifndef _ROS_moveit_msgs_CostSource_h
00002 #define _ROS_moveit_msgs_CostSource_h
00003
00004 #include <stdint.h>
00005 #include <string.h>
00006 #include <stdlib.h>
00007 #include "ros/msg.h"
00008 #include "geometry_msgs/Vector3.h"
00009
00010 namespace moveit_msgs
00011 {
00012
00013 class CostSource : public ros::Msg
00014 {
00015 public:
00016 float cost_density;
00017 geometry_msgs::Vector3 aabb_min;
00018 geometry_msgs::Vector3 aabb_max;
00019
00020 virtual int serialize(unsigned char *outbuffer) const
00021 {
00022 int offset = 0;
00023 int32_t * val_cost_density = (int32_t *) &(this->cost_density);
00024 int32_t exp_cost_density = (((*val_cost_density)>>23)&255);
00025 if(exp_cost_density != 0)
00026 exp_cost_density += 1023-127;
00027 int32_t sig_cost_density = *val_cost_density;
00028 *(outbuffer + offset++) = 0;
00029 *(outbuffer + offset++) = 0;
00030 *(outbuffer + offset++) = 0;
00031 *(outbuffer + offset++) = (sig_cost_density<<5) & 0xff;
00032 *(outbuffer + offset++) = (sig_cost_density>>3) & 0xff;
00033 *(outbuffer + offset++) = (sig_cost_density>>11) & 0xff;
00034 *(outbuffer + offset++) = ((exp_cost_density<<4) & 0xF0) | ((sig_cost_density>>19)&0x0F);
00035 *(outbuffer + offset++) = (exp_cost_density>>4) & 0x7F;
00036 if(this->cost_density < 0) *(outbuffer + offset -1) |= 0x80;
00037 offset += this->aabb_min.serialize(outbuffer + offset);
00038 offset += this->aabb_max.serialize(outbuffer + offset);
00039 return offset;
00040 }
00041
00042 virtual int deserialize(unsigned char *inbuffer)
00043 {
00044 int offset = 0;
00045 uint32_t * val_cost_density = (uint32_t*) &(this->cost_density);
00046 offset += 3;
00047 *val_cost_density = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07);
00048 *val_cost_density |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3;
00049 *val_cost_density |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11;
00050 *val_cost_density |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19;
00051 uint32_t exp_cost_density = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4;
00052 exp_cost_density |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4;
00053 if(exp_cost_density !=0)
00054 *val_cost_density |= ((exp_cost_density)-1023+127)<<23;
00055 if( ((*(inbuffer+offset++)) & 0x80) > 0) this->cost_density = -this->cost_density;
00056 offset += this->aabb_min.deserialize(inbuffer + offset);
00057 offset += this->aabb_max.deserialize(inbuffer + offset);
00058 return offset;
00059 }
00060
00061 const char * getType(){ return "moveit_msgs/CostSource"; };
00062 const char * getMD5(){ return "abb7e013237dacaaa8b97e704102f908"; };
00063
00064 };
00065
00066 }
00067 #endif