rosserial library for mbed Inspired by nucho's rosserial library This library is still under development
Dependents: mbed_roshydro_test
Library still under development!
Diff: manipulation_msgs/GraspPlanningFeedback.h
- Revision:
- 0:30537dec6e0b
diff -r 000000000000 -r 30537dec6e0b manipulation_msgs/GraspPlanningFeedback.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/manipulation_msgs/GraspPlanningFeedback.h Sun Feb 15 10:53:43 2015 +0000 @@ -0,0 +1,59 @@ +#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