rosserial library for mbed Inspired by nucho's rosserial library This library is still under development
Dependents: mbed_roshydro_test
Library still under development!
control_msgs/SingleJointPositionGoal.h
- Committer:
- akashvibhute
- Date:
- 2015-02-15
- Revision:
- 0:30537dec6e0b
File content as of revision 0:30537dec6e0b:
#ifndef _ROS_control_msgs_SingleJointPositionGoal_h #define _ROS_control_msgs_SingleJointPositionGoal_h #include <stdint.h> #include <string.h> #include <stdlib.h> #include "ros/msg.h" #include "ros/duration.h" namespace control_msgs { class SingleJointPositionGoal : public ros::Msg { public: float position; ros::Duration min_duration; float max_velocity; SingleJointPositionGoal(): position(0), min_duration(), max_velocity(0) { } virtual int serialize(unsigned char *outbuffer) const { int offset = 0; offset += serializeAvrFloat64(outbuffer + offset, this->position); *(outbuffer + offset + 0) = (this->min_duration.sec >> (8 * 0)) & 0xFF; *(outbuffer + offset + 1) = (this->min_duration.sec >> (8 * 1)) & 0xFF; *(outbuffer + offset + 2) = (this->min_duration.sec >> (8 * 2)) & 0xFF; *(outbuffer + offset + 3) = (this->min_duration.sec >> (8 * 3)) & 0xFF; offset += sizeof(this->min_duration.sec); *(outbuffer + offset + 0) = (this->min_duration.nsec >> (8 * 0)) & 0xFF; *(outbuffer + offset + 1) = (this->min_duration.nsec >> (8 * 1)) & 0xFF; *(outbuffer + offset + 2) = (this->min_duration.nsec >> (8 * 2)) & 0xFF; *(outbuffer + offset + 3) = (this->min_duration.nsec >> (8 * 3)) & 0xFF; offset += sizeof(this->min_duration.nsec); offset += serializeAvrFloat64(outbuffer + offset, this->max_velocity); return offset; } virtual int deserialize(unsigned char *inbuffer) { int offset = 0; offset += deserializeAvrFloat64(inbuffer + offset, &(this->position)); this->min_duration.sec = ((uint32_t) (*(inbuffer + offset))); this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); offset += sizeof(this->min_duration.sec); this->min_duration.nsec = ((uint32_t) (*(inbuffer + offset))); this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); offset += sizeof(this->min_duration.nsec); offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_velocity)); return offset; } const char * getType(){ return "control_msgs/SingleJointPositionGoal"; }; const char * getMD5(){ return "fbaaa562a23a013fd5053e5f72cbb35c"; }; }; } #endif