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: gazebo_msgs/ContactsState.h
- Revision:
- 0:30537dec6e0b
diff -r 000000000000 -r 30537dec6e0b gazebo_msgs/ContactsState.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gazebo_msgs/ContactsState.h Sun Feb 15 10:53:43 2015 +0000 @@ -0,0 +1,64 @@ +#ifndef _ROS_gazebo_msgs_ContactsState_h +#define _ROS_gazebo_msgs_ContactsState_h + +#include <stdint.h> +#include <string.h> +#include <stdlib.h> +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "gazebo_msgs/ContactState.h" + +namespace gazebo_msgs +{ + + class ContactsState : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t states_length; + gazebo_msgs::ContactState st_states; + gazebo_msgs::ContactState * states; + + ContactsState(): + header(), + states_length(0), states(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = states_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < states_length; i++){ + offset += this->states[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t states_lengthT = *(inbuffer + offset++); + if(states_lengthT > states_length) + this->states = (gazebo_msgs::ContactState*)realloc(this->states, states_lengthT * sizeof(gazebo_msgs::ContactState)); + offset += 3; + states_length = states_lengthT; + for( uint8_t i = 0; i < states_length; i++){ + offset += this->st_states.deserialize(inbuffer + offset); + memcpy( &(this->states[i]), &(this->st_states), sizeof(gazebo_msgs::ContactState)); + } + return offset; + } + + const char * getType(){ return "gazebo_msgs/ContactsState"; }; + const char * getMD5(){ return "acbcb1601a8e525bf72509f18e6f668d"; }; + + }; + +} +#endif