00001 #ifndef _ROS_moveit_msgs_MoveGroupResult_h 00002 #define _ROS_moveit_msgs_MoveGroupResult_h 00003 00004 #include <stdint.h> 00005 #include <string.h> 00006 #include <stdlib.h> 00007 #include "ros/msg.h" 00008 #include "moveit_msgs/MoveItErrorCodes.h" 00009 #include "moveit_msgs/RobotState.h" 00010 #include "moveit_msgs/RobotTrajectory.h" 00011 00012 namespace moveit_msgs 00013 { 00014 00015 class MoveGroupResult : public ros::Msg 00016 { 00017 public: 00018 moveit_msgs::MoveItErrorCodes error_code; 00019 moveit_msgs::RobotState trajectory_start; 00020 moveit_msgs::RobotTrajectory planned_trajectory; 00021 moveit_msgs::RobotTrajectory executed_trajectory; 00022 float planning_time; 00023 00024 virtual int serialize(unsigned char *outbuffer) const 00025 { 00026 int offset = 0; 00027 offset += this->error_code.serialize(outbuffer + offset); 00028 offset += this->trajectory_start.serialize(outbuffer + offset); 00029 offset += this->planned_trajectory.serialize(outbuffer + offset); 00030 offset += this->executed_trajectory.serialize(outbuffer + offset); 00031 int32_t * val_planning_time = (int32_t *) &(this->planning_time); 00032 int32_t exp_planning_time = (((*val_planning_time)>>23)&255); 00033 if(exp_planning_time != 0) 00034 exp_planning_time += 1023-127; 00035 int32_t sig_planning_time = *val_planning_time; 00036 *(outbuffer + offset++) = 0; 00037 *(outbuffer + offset++) = 0; 00038 *(outbuffer + offset++) = 0; 00039 *(outbuffer + offset++) = (sig_planning_time<<5) & 0xff; 00040 *(outbuffer + offset++) = (sig_planning_time>>3) & 0xff; 00041 *(outbuffer + offset++) = (sig_planning_time>>11) & 0xff; 00042 *(outbuffer + offset++) = ((exp_planning_time<<4) & 0xF0) | ((sig_planning_time>>19)&0x0F); 00043 *(outbuffer + offset++) = (exp_planning_time>>4) & 0x7F; 00044 if(this->planning_time < 0) *(outbuffer + offset -1) |= 0x80; 00045 return offset; 00046 } 00047 00048 virtual int deserialize(unsigned char *inbuffer) 00049 { 00050 int offset = 0; 00051 offset += this->error_code.deserialize(inbuffer + offset); 00052 offset += this->trajectory_start.deserialize(inbuffer + offset); 00053 offset += this->planned_trajectory.deserialize(inbuffer + offset); 00054 offset += this->executed_trajectory.deserialize(inbuffer + offset); 00055 uint32_t * val_planning_time = (uint32_t*) &(this->planning_time); 00056 offset += 3; 00057 *val_planning_time = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); 00058 *val_planning_time |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; 00059 *val_planning_time |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; 00060 *val_planning_time |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; 00061 uint32_t exp_planning_time = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; 00062 exp_planning_time |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; 00063 if(exp_planning_time !=0) 00064 *val_planning_time |= ((exp_planning_time)-1023+127)<<23; 00065 if( ((*(inbuffer+offset++)) & 0x80) > 0) this->planning_time = -this->planning_time; 00066 return offset; 00067 } 00068 00069 const char * getType(){ return "moveit_msgs/MoveGroupResult"; }; 00070 const char * getMD5(){ return "34098589d402fee7ae9c3fd413e5a6c6"; }; 00071 00072 }; 00073 00074 } 00075 #endif