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