MotorStateList.h
Go to the documentation of this file.
00001 #ifndef _ROS_dynamixel_msgs_MotorStateList_h
00002 #define _ROS_dynamixel_msgs_MotorStateList_h
00003 
00004 #include <stdint.h>
00005 #include <string.h>
00006 #include <stdlib.h>
00007 #include "ros/msg.h"
00008 #include "dynamixel_msgs/MotorState.h"
00009 
00010 namespace dynamixel_msgs
00011 {
00012 
00013   class MotorStateList : public ros::Msg
00014   {
00015     public:
00016       uint8_t motor_states_length;
00017       dynamixel_msgs::MotorState st_motor_states;
00018       dynamixel_msgs::MotorState * motor_states;
00019 
00020     virtual int serialize(unsigned char *outbuffer) const
00021     {
00022       int offset = 0;
00023       *(outbuffer + offset++) = motor_states_length;
00024       *(outbuffer + offset++) = 0;
00025       *(outbuffer + offset++) = 0;
00026       *(outbuffer + offset++) = 0;
00027       for( uint8_t i = 0; i < motor_states_length; i++){
00028       offset += this->motor_states[i].serialize(outbuffer + offset);
00029       }
00030       return offset;
00031     }
00032 
00033     virtual int deserialize(unsigned char *inbuffer)
00034     {
00035       int offset = 0;
00036       uint8_t motor_states_lengthT = *(inbuffer + offset++);
00037       if(motor_states_lengthT > motor_states_length)
00038         this->motor_states = (dynamixel_msgs::MotorState*)realloc(this->motor_states, motor_states_lengthT * sizeof(dynamixel_msgs::MotorState));
00039       offset += 3;
00040       motor_states_length = motor_states_lengthT;
00041       for( uint8_t i = 0; i < motor_states_length; i++){
00042       offset += this->st_motor_states.deserialize(inbuffer + offset);
00043         memcpy( &(this->motor_states[i]), &(this->st_motor_states), sizeof(dynamixel_msgs::MotorState));
00044       }
00045      return offset;
00046     }
00047 
00048     const char * getType(){ return "dynamixel_msgs/MotorStateList"; };
00049     const char * getMD5(){ return "9e94ccf6563ca78afce19eb097f9343c"; };
00050 
00051   };
00052 
00053 }
00054 #endif


ric_mc
Author(s): RoboTiCan
autogenerated on Fri May 20 2016 03:48:56