rosserial library for mbed Inspired by nucho's rosserial library This library is still under development
Dependents: mbed_roshydro_test
Library still under development!
manipulation_msgs/GraspPlanningFeedback.h
- Committer:
- akashvibhute
- Date:
- 2015-02-15
- Revision:
- 0:30537dec6e0b
File content as of revision 0:30537dec6e0b:
#ifndef _ROS_manipulation_msgs_GraspPlanningFeedback_h #define _ROS_manipulation_msgs_GraspPlanningFeedback_h #include <stdint.h> #include <string.h> #include <stdlib.h> #include "ros/msg.h" #include "manipulation_msgs/Grasp.h" namespace manipulation_msgs { class GraspPlanningFeedback : public ros::Msg { public: uint8_t grasps_length; manipulation_msgs::Grasp st_grasps; manipulation_msgs::Grasp * grasps; GraspPlanningFeedback(): grasps_length(0), grasps(NULL) { } virtual int serialize(unsigned char *outbuffer) const { int offset = 0; *(outbuffer + offset++) = grasps_length; *(outbuffer + offset++) = 0; *(outbuffer + offset++) = 0; *(outbuffer + offset++) = 0; for( uint8_t i = 0; i < grasps_length; i++){ offset += this->grasps[i].serialize(outbuffer + offset); } return offset; } virtual int deserialize(unsigned char *inbuffer) { int offset = 0; uint8_t grasps_lengthT = *(inbuffer + offset++); if(grasps_lengthT > grasps_length) this->grasps = (manipulation_msgs::Grasp*)realloc(this->grasps, grasps_lengthT * sizeof(manipulation_msgs::Grasp)); offset += 3; grasps_length = grasps_lengthT; for( uint8_t i = 0; i < grasps_length; i++){ offset += this->st_grasps.deserialize(inbuffer + offset); memcpy( &(this->grasps[i]), &(this->st_grasps), sizeof(manipulation_msgs::Grasp)); } return offset; } const char * getType(){ return "manipulation_msgs/GraspPlanningFeedback"; }; const char * getMD5(){ return "0b493f83ef98679f05dc681205fbe54c"; }; }; } #endif