00001 #ifndef _ROS_pr2_mechanism_msgs_MechanismStatistics_h 00002 #define _ROS_pr2_mechanism_msgs_MechanismStatistics_h 00003 00004 #include <stdint.h> 00005 #include <string.h> 00006 #include <stdlib.h> 00007 #include "ros/msg.h" 00008 #include "std_msgs/Header.h" 00009 #include "pr2_mechanism_msgs/ActuatorStatistics.h" 00010 #include "pr2_mechanism_msgs/JointStatistics.h" 00011 #include "pr2_mechanism_msgs/ControllerStatistics.h" 00012 00013 namespace pr2_mechanism_msgs 00014 { 00015 00016 class MechanismStatistics : public ros::Msg 00017 { 00018 public: 00019 std_msgs::Header header; 00020 uint8_t actuator_statistics_length; 00021 pr2_mechanism_msgs::ActuatorStatistics st_actuator_statistics; 00022 pr2_mechanism_msgs::ActuatorStatistics * actuator_statistics; 00023 uint8_t joint_statistics_length; 00024 pr2_mechanism_msgs::JointStatistics st_joint_statistics; 00025 pr2_mechanism_msgs::JointStatistics * joint_statistics; 00026 uint8_t controller_statistics_length; 00027 pr2_mechanism_msgs::ControllerStatistics st_controller_statistics; 00028 pr2_mechanism_msgs::ControllerStatistics * controller_statistics; 00029 00030 virtual int serialize(unsigned char *outbuffer) const 00031 { 00032 int offset = 0; 00033 offset += this->header.serialize(outbuffer + offset); 00034 *(outbuffer + offset++) = actuator_statistics_length; 00035 *(outbuffer + offset++) = 0; 00036 *(outbuffer + offset++) = 0; 00037 *(outbuffer + offset++) = 0; 00038 for( uint8_t i = 0; i < actuator_statistics_length; i++){ 00039 offset += this->actuator_statistics[i].serialize(outbuffer + offset); 00040 } 00041 *(outbuffer + offset++) = joint_statistics_length; 00042 *(outbuffer + offset++) = 0; 00043 *(outbuffer + offset++) = 0; 00044 *(outbuffer + offset++) = 0; 00045 for( uint8_t i = 0; i < joint_statistics_length; i++){ 00046 offset += this->joint_statistics[i].serialize(outbuffer + offset); 00047 } 00048 *(outbuffer + offset++) = controller_statistics_length; 00049 *(outbuffer + offset++) = 0; 00050 *(outbuffer + offset++) = 0; 00051 *(outbuffer + offset++) = 0; 00052 for( uint8_t i = 0; i < controller_statistics_length; i++){ 00053 offset += this->controller_statistics[i].serialize(outbuffer + offset); 00054 } 00055 return offset; 00056 } 00057 00058 virtual int deserialize(unsigned char *inbuffer) 00059 { 00060 int offset = 0; 00061 offset += this->header.deserialize(inbuffer + offset); 00062 uint8_t actuator_statistics_lengthT = *(inbuffer + offset++); 00063 if(actuator_statistics_lengthT > actuator_statistics_length) 00064 this->actuator_statistics = (pr2_mechanism_msgs::ActuatorStatistics*)realloc(this->actuator_statistics, actuator_statistics_lengthT * sizeof(pr2_mechanism_msgs::ActuatorStatistics)); 00065 offset += 3; 00066 actuator_statistics_length = actuator_statistics_lengthT; 00067 for( uint8_t i = 0; i < actuator_statistics_length; i++){ 00068 offset += this->st_actuator_statistics.deserialize(inbuffer + offset); 00069 memcpy( &(this->actuator_statistics[i]), &(this->st_actuator_statistics), sizeof(pr2_mechanism_msgs::ActuatorStatistics)); 00070 } 00071 uint8_t joint_statistics_lengthT = *(inbuffer + offset++); 00072 if(joint_statistics_lengthT > joint_statistics_length) 00073 this->joint_statistics = (pr2_mechanism_msgs::JointStatistics*)realloc(this->joint_statistics, joint_statistics_lengthT * sizeof(pr2_mechanism_msgs::JointStatistics)); 00074 offset += 3; 00075 joint_statistics_length = joint_statistics_lengthT; 00076 for( uint8_t i = 0; i < joint_statistics_length; i++){ 00077 offset += this->st_joint_statistics.deserialize(inbuffer + offset); 00078 memcpy( &(this->joint_statistics[i]), &(this->st_joint_statistics), sizeof(pr2_mechanism_msgs::JointStatistics)); 00079 } 00080 uint8_t controller_statistics_lengthT = *(inbuffer + offset++); 00081 if(controller_statistics_lengthT > controller_statistics_length) 00082 this->controller_statistics = (pr2_mechanism_msgs::ControllerStatistics*)realloc(this->controller_statistics, controller_statistics_lengthT * sizeof(pr2_mechanism_msgs::ControllerStatistics)); 00083 offset += 3; 00084 controller_statistics_length = controller_statistics_lengthT; 00085 for( uint8_t i = 0; i < controller_statistics_length; i++){ 00086 offset += this->st_controller_statistics.deserialize(inbuffer + offset); 00087 memcpy( &(this->controller_statistics[i]), &(this->st_controller_statistics), sizeof(pr2_mechanism_msgs::ControllerStatistics)); 00088 } 00089 return offset; 00090 } 00091 00092 const char * getType(){ return "pr2_mechanism_msgs/MechanismStatistics"; }; 00093 const char * getMD5(){ return "b4a99069393681672c01f8c823458e04"; }; 00094 00095 }; 00096 00097 } 00098 #endif