rosserial library for mbed Inspired by nucho's rosserial library This library is still under development
Dependents: mbed_roshydro_test
Library still under development!
moveit_msgs/JointLimits.h@0:30537dec6e0b, 2015-02-15 (annotated)
- Committer:
- akashvibhute
- Date:
- Sun Feb 15 10:53:43 2015 +0000
- Revision:
- 0:30537dec6e0b
First commit; Library still need to be debugged, compilation issues with new mbed and modserial updates.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
akashvibhute | 0:30537dec6e0b | 1 | #ifndef _ROS_moveit_msgs_JointLimits_h |
akashvibhute | 0:30537dec6e0b | 2 | #define _ROS_moveit_msgs_JointLimits_h |
akashvibhute | 0:30537dec6e0b | 3 | |
akashvibhute | 0:30537dec6e0b | 4 | #include <stdint.h> |
akashvibhute | 0:30537dec6e0b | 5 | #include <string.h> |
akashvibhute | 0:30537dec6e0b | 6 | #include <stdlib.h> |
akashvibhute | 0:30537dec6e0b | 7 | #include "ros/msg.h" |
akashvibhute | 0:30537dec6e0b | 8 | |
akashvibhute | 0:30537dec6e0b | 9 | namespace moveit_msgs |
akashvibhute | 0:30537dec6e0b | 10 | { |
akashvibhute | 0:30537dec6e0b | 11 | |
akashvibhute | 0:30537dec6e0b | 12 | class JointLimits : public ros::Msg |
akashvibhute | 0:30537dec6e0b | 13 | { |
akashvibhute | 0:30537dec6e0b | 14 | public: |
akashvibhute | 0:30537dec6e0b | 15 | const char* joint_name; |
akashvibhute | 0:30537dec6e0b | 16 | bool has_position_limits; |
akashvibhute | 0:30537dec6e0b | 17 | float min_position; |
akashvibhute | 0:30537dec6e0b | 18 | float max_position; |
akashvibhute | 0:30537dec6e0b | 19 | bool has_velocity_limits; |
akashvibhute | 0:30537dec6e0b | 20 | float max_velocity; |
akashvibhute | 0:30537dec6e0b | 21 | bool has_acceleration_limits; |
akashvibhute | 0:30537dec6e0b | 22 | float max_acceleration; |
akashvibhute | 0:30537dec6e0b | 23 | |
akashvibhute | 0:30537dec6e0b | 24 | JointLimits(): |
akashvibhute | 0:30537dec6e0b | 25 | joint_name(""), |
akashvibhute | 0:30537dec6e0b | 26 | has_position_limits(0), |
akashvibhute | 0:30537dec6e0b | 27 | min_position(0), |
akashvibhute | 0:30537dec6e0b | 28 | max_position(0), |
akashvibhute | 0:30537dec6e0b | 29 | has_velocity_limits(0), |
akashvibhute | 0:30537dec6e0b | 30 | max_velocity(0), |
akashvibhute | 0:30537dec6e0b | 31 | has_acceleration_limits(0), |
akashvibhute | 0:30537dec6e0b | 32 | max_acceleration(0) |
akashvibhute | 0:30537dec6e0b | 33 | { |
akashvibhute | 0:30537dec6e0b | 34 | } |
akashvibhute | 0:30537dec6e0b | 35 | |
akashvibhute | 0:30537dec6e0b | 36 | virtual int serialize(unsigned char *outbuffer) const |
akashvibhute | 0:30537dec6e0b | 37 | { |
akashvibhute | 0:30537dec6e0b | 38 | int offset = 0; |
akashvibhute | 0:30537dec6e0b | 39 | uint32_t length_joint_name = strlen(this->joint_name); |
akashvibhute | 0:30537dec6e0b | 40 | memcpy(outbuffer + offset, &length_joint_name, sizeof(uint32_t)); |
akashvibhute | 0:30537dec6e0b | 41 | offset += 4; |
akashvibhute | 0:30537dec6e0b | 42 | memcpy(outbuffer + offset, this->joint_name, length_joint_name); |
akashvibhute | 0:30537dec6e0b | 43 | offset += length_joint_name; |
akashvibhute | 0:30537dec6e0b | 44 | union { |
akashvibhute | 0:30537dec6e0b | 45 | bool real; |
akashvibhute | 0:30537dec6e0b | 46 | uint8_t base; |
akashvibhute | 0:30537dec6e0b | 47 | } u_has_position_limits; |
akashvibhute | 0:30537dec6e0b | 48 | u_has_position_limits.real = this->has_position_limits; |
akashvibhute | 0:30537dec6e0b | 49 | *(outbuffer + offset + 0) = (u_has_position_limits.base >> (8 * 0)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 50 | offset += sizeof(this->has_position_limits); |
akashvibhute | 0:30537dec6e0b | 51 | offset += serializeAvrFloat64(outbuffer + offset, this->min_position); |
akashvibhute | 0:30537dec6e0b | 52 | offset += serializeAvrFloat64(outbuffer + offset, this->max_position); |
akashvibhute | 0:30537dec6e0b | 53 | union { |
akashvibhute | 0:30537dec6e0b | 54 | bool real; |
akashvibhute | 0:30537dec6e0b | 55 | uint8_t base; |
akashvibhute | 0:30537dec6e0b | 56 | } u_has_velocity_limits; |
akashvibhute | 0:30537dec6e0b | 57 | u_has_velocity_limits.real = this->has_velocity_limits; |
akashvibhute | 0:30537dec6e0b | 58 | *(outbuffer + offset + 0) = (u_has_velocity_limits.base >> (8 * 0)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 59 | offset += sizeof(this->has_velocity_limits); |
akashvibhute | 0:30537dec6e0b | 60 | offset += serializeAvrFloat64(outbuffer + offset, this->max_velocity); |
akashvibhute | 0:30537dec6e0b | 61 | union { |
akashvibhute | 0:30537dec6e0b | 62 | bool real; |
akashvibhute | 0:30537dec6e0b | 63 | uint8_t base; |
akashvibhute | 0:30537dec6e0b | 64 | } u_has_acceleration_limits; |
akashvibhute | 0:30537dec6e0b | 65 | u_has_acceleration_limits.real = this->has_acceleration_limits; |
akashvibhute | 0:30537dec6e0b | 66 | *(outbuffer + offset + 0) = (u_has_acceleration_limits.base >> (8 * 0)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 67 | offset += sizeof(this->has_acceleration_limits); |
akashvibhute | 0:30537dec6e0b | 68 | offset += serializeAvrFloat64(outbuffer + offset, this->max_acceleration); |
akashvibhute | 0:30537dec6e0b | 69 | return offset; |
akashvibhute | 0:30537dec6e0b | 70 | } |
akashvibhute | 0:30537dec6e0b | 71 | |
akashvibhute | 0:30537dec6e0b | 72 | virtual int deserialize(unsigned char *inbuffer) |
akashvibhute | 0:30537dec6e0b | 73 | { |
akashvibhute | 0:30537dec6e0b | 74 | int offset = 0; |
akashvibhute | 0:30537dec6e0b | 75 | uint32_t length_joint_name; |
akashvibhute | 0:30537dec6e0b | 76 | memcpy(&length_joint_name, (inbuffer + offset), sizeof(uint32_t)); |
akashvibhute | 0:30537dec6e0b | 77 | offset += 4; |
akashvibhute | 0:30537dec6e0b | 78 | for(unsigned int k= offset; k< offset+length_joint_name; ++k){ |
akashvibhute | 0:30537dec6e0b | 79 | inbuffer[k-1]=inbuffer[k]; |
akashvibhute | 0:30537dec6e0b | 80 | } |
akashvibhute | 0:30537dec6e0b | 81 | inbuffer[offset+length_joint_name-1]=0; |
akashvibhute | 0:30537dec6e0b | 82 | this->joint_name = (char *)(inbuffer + offset-1); |
akashvibhute | 0:30537dec6e0b | 83 | offset += length_joint_name; |
akashvibhute | 0:30537dec6e0b | 84 | union { |
akashvibhute | 0:30537dec6e0b | 85 | bool real; |
akashvibhute | 0:30537dec6e0b | 86 | uint8_t base; |
akashvibhute | 0:30537dec6e0b | 87 | } u_has_position_limits; |
akashvibhute | 0:30537dec6e0b | 88 | u_has_position_limits.base = 0; |
akashvibhute | 0:30537dec6e0b | 89 | u_has_position_limits.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); |
akashvibhute | 0:30537dec6e0b | 90 | this->has_position_limits = u_has_position_limits.real; |
akashvibhute | 0:30537dec6e0b | 91 | offset += sizeof(this->has_position_limits); |
akashvibhute | 0:30537dec6e0b | 92 | offset += deserializeAvrFloat64(inbuffer + offset, &(this->min_position)); |
akashvibhute | 0:30537dec6e0b | 93 | offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_position)); |
akashvibhute | 0:30537dec6e0b | 94 | union { |
akashvibhute | 0:30537dec6e0b | 95 | bool real; |
akashvibhute | 0:30537dec6e0b | 96 | uint8_t base; |
akashvibhute | 0:30537dec6e0b | 97 | } u_has_velocity_limits; |
akashvibhute | 0:30537dec6e0b | 98 | u_has_velocity_limits.base = 0; |
akashvibhute | 0:30537dec6e0b | 99 | u_has_velocity_limits.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); |
akashvibhute | 0:30537dec6e0b | 100 | this->has_velocity_limits = u_has_velocity_limits.real; |
akashvibhute | 0:30537dec6e0b | 101 | offset += sizeof(this->has_velocity_limits); |
akashvibhute | 0:30537dec6e0b | 102 | offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_velocity)); |
akashvibhute | 0:30537dec6e0b | 103 | union { |
akashvibhute | 0:30537dec6e0b | 104 | bool real; |
akashvibhute | 0:30537dec6e0b | 105 | uint8_t base; |
akashvibhute | 0:30537dec6e0b | 106 | } u_has_acceleration_limits; |
akashvibhute | 0:30537dec6e0b | 107 | u_has_acceleration_limits.base = 0; |
akashvibhute | 0:30537dec6e0b | 108 | u_has_acceleration_limits.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); |
akashvibhute | 0:30537dec6e0b | 109 | this->has_acceleration_limits = u_has_acceleration_limits.real; |
akashvibhute | 0:30537dec6e0b | 110 | offset += sizeof(this->has_acceleration_limits); |
akashvibhute | 0:30537dec6e0b | 111 | offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_acceleration)); |
akashvibhute | 0:30537dec6e0b | 112 | return offset; |
akashvibhute | 0:30537dec6e0b | 113 | } |
akashvibhute | 0:30537dec6e0b | 114 | |
akashvibhute | 0:30537dec6e0b | 115 | const char * getType(){ return "moveit_msgs/JointLimits"; }; |
akashvibhute | 0:30537dec6e0b | 116 | const char * getMD5(){ return "8ca618c7329ea46142cbc864a2efe856"; }; |
akashvibhute | 0:30537dec6e0b | 117 | |
akashvibhute | 0:30537dec6e0b | 118 | }; |
akashvibhute | 0:30537dec6e0b | 119 | |
akashvibhute | 0:30537dec6e0b | 120 | } |
akashvibhute | 0:30537dec6e0b | 121 | #endif |