catchrobo2022 / Mbed 2 deprecated catchrobo2022_mbed

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers JointLimits.h Source File

JointLimits.h

00001 #ifndef _ROS_moveit_msgs_JointLimits_h
00002 #define _ROS_moveit_msgs_JointLimits_h
00003 
00004 #include <stdint.h>
00005 #include <string.h>
00006 #include <stdlib.h>
00007 #include "ros/msg.h"
00008 
00009 namespace moveit_msgs
00010 {
00011 
00012   class JointLimits : public ros::Msg
00013   {
00014     public:
00015       typedef const char* _joint_name_type;
00016       _joint_name_type joint_name;
00017       typedef bool _has_position_limits_type;
00018       _has_position_limits_type has_position_limits;
00019       typedef double _min_position_type;
00020       _min_position_type min_position;
00021       typedef double _max_position_type;
00022       _max_position_type max_position;
00023       typedef bool _has_velocity_limits_type;
00024       _has_velocity_limits_type has_velocity_limits;
00025       typedef double _max_velocity_type;
00026       _max_velocity_type max_velocity;
00027       typedef bool _has_acceleration_limits_type;
00028       _has_acceleration_limits_type has_acceleration_limits;
00029       typedef double _max_acceleration_type;
00030       _max_acceleration_type max_acceleration;
00031 
00032     JointLimits():
00033       joint_name(""),
00034       has_position_limits(0),
00035       min_position(0),
00036       max_position(0),
00037       has_velocity_limits(0),
00038       max_velocity(0),
00039       has_acceleration_limits(0),
00040       max_acceleration(0)
00041     {
00042     }
00043 
00044     virtual int serialize(unsigned char *outbuffer) const
00045     {
00046       int offset = 0;
00047       uint32_t length_joint_name = strlen(this->joint_name);
00048       varToArr(outbuffer + offset, length_joint_name);
00049       offset += 4;
00050       memcpy(outbuffer + offset, this->joint_name, length_joint_name);
00051       offset += length_joint_name;
00052       union {
00053         bool real;
00054         uint8_t base;
00055       } u_has_position_limits;
00056       u_has_position_limits.real = this->has_position_limits;
00057       *(outbuffer + offset + 0) = (u_has_position_limits.base >> (8 * 0)) & 0xFF;
00058       offset += sizeof(this->has_position_limits);
00059       union {
00060         double real;
00061         uint64_t base;
00062       } u_min_position;
00063       u_min_position.real = this->min_position;
00064       *(outbuffer + offset + 0) = (u_min_position.base >> (8 * 0)) & 0xFF;
00065       *(outbuffer + offset + 1) = (u_min_position.base >> (8 * 1)) & 0xFF;
00066       *(outbuffer + offset + 2) = (u_min_position.base >> (8 * 2)) & 0xFF;
00067       *(outbuffer + offset + 3) = (u_min_position.base >> (8 * 3)) & 0xFF;
00068       *(outbuffer + offset + 4) = (u_min_position.base >> (8 * 4)) & 0xFF;
00069       *(outbuffer + offset + 5) = (u_min_position.base >> (8 * 5)) & 0xFF;
00070       *(outbuffer + offset + 6) = (u_min_position.base >> (8 * 6)) & 0xFF;
00071       *(outbuffer + offset + 7) = (u_min_position.base >> (8 * 7)) & 0xFF;
00072       offset += sizeof(this->min_position);
00073       union {
00074         double real;
00075         uint64_t base;
00076       } u_max_position;
00077       u_max_position.real = this->max_position;
00078       *(outbuffer + offset + 0) = (u_max_position.base >> (8 * 0)) & 0xFF;
00079       *(outbuffer + offset + 1) = (u_max_position.base >> (8 * 1)) & 0xFF;
00080       *(outbuffer + offset + 2) = (u_max_position.base >> (8 * 2)) & 0xFF;
00081       *(outbuffer + offset + 3) = (u_max_position.base >> (8 * 3)) & 0xFF;
00082       *(outbuffer + offset + 4) = (u_max_position.base >> (8 * 4)) & 0xFF;
00083       *(outbuffer + offset + 5) = (u_max_position.base >> (8 * 5)) & 0xFF;
00084       *(outbuffer + offset + 6) = (u_max_position.base >> (8 * 6)) & 0xFF;
00085       *(outbuffer + offset + 7) = (u_max_position.base >> (8 * 7)) & 0xFF;
00086       offset += sizeof(this->max_position);
00087       union {
00088         bool real;
00089         uint8_t base;
00090       } u_has_velocity_limits;
00091       u_has_velocity_limits.real = this->has_velocity_limits;
00092       *(outbuffer + offset + 0) = (u_has_velocity_limits.base >> (8 * 0)) & 0xFF;
00093       offset += sizeof(this->has_velocity_limits);
00094       union {
00095         double real;
00096         uint64_t base;
00097       } u_max_velocity;
00098       u_max_velocity.real = this->max_velocity;
00099       *(outbuffer + offset + 0) = (u_max_velocity.base >> (8 * 0)) & 0xFF;
00100       *(outbuffer + offset + 1) = (u_max_velocity.base >> (8 * 1)) & 0xFF;
00101       *(outbuffer + offset + 2) = (u_max_velocity.base >> (8 * 2)) & 0xFF;
00102       *(outbuffer + offset + 3) = (u_max_velocity.base >> (8 * 3)) & 0xFF;
00103       *(outbuffer + offset + 4) = (u_max_velocity.base >> (8 * 4)) & 0xFF;
00104       *(outbuffer + offset + 5) = (u_max_velocity.base >> (8 * 5)) & 0xFF;
00105       *(outbuffer + offset + 6) = (u_max_velocity.base >> (8 * 6)) & 0xFF;
00106       *(outbuffer + offset + 7) = (u_max_velocity.base >> (8 * 7)) & 0xFF;
00107       offset += sizeof(this->max_velocity);
00108       union {
00109         bool real;
00110         uint8_t base;
00111       } u_has_acceleration_limits;
00112       u_has_acceleration_limits.real = this->has_acceleration_limits;
00113       *(outbuffer + offset + 0) = (u_has_acceleration_limits.base >> (8 * 0)) & 0xFF;
00114       offset += sizeof(this->has_acceleration_limits);
00115       union {
00116         double real;
00117         uint64_t base;
00118       } u_max_acceleration;
00119       u_max_acceleration.real = this->max_acceleration;
00120       *(outbuffer + offset + 0) = (u_max_acceleration.base >> (8 * 0)) & 0xFF;
00121       *(outbuffer + offset + 1) = (u_max_acceleration.base >> (8 * 1)) & 0xFF;
00122       *(outbuffer + offset + 2) = (u_max_acceleration.base >> (8 * 2)) & 0xFF;
00123       *(outbuffer + offset + 3) = (u_max_acceleration.base >> (8 * 3)) & 0xFF;
00124       *(outbuffer + offset + 4) = (u_max_acceleration.base >> (8 * 4)) & 0xFF;
00125       *(outbuffer + offset + 5) = (u_max_acceleration.base >> (8 * 5)) & 0xFF;
00126       *(outbuffer + offset + 6) = (u_max_acceleration.base >> (8 * 6)) & 0xFF;
00127       *(outbuffer + offset + 7) = (u_max_acceleration.base >> (8 * 7)) & 0xFF;
00128       offset += sizeof(this->max_acceleration);
00129       return offset;
00130     }
00131 
00132     virtual int deserialize(unsigned char *inbuffer)
00133     {
00134       int offset = 0;
00135       uint32_t length_joint_name;
00136       arrToVar(length_joint_name, (inbuffer + offset));
00137       offset += 4;
00138       for(unsigned int k= offset; k< offset+length_joint_name; ++k){
00139           inbuffer[k-1]=inbuffer[k];
00140       }
00141       inbuffer[offset+length_joint_name-1]=0;
00142       this->joint_name = (char *)(inbuffer + offset-1);
00143       offset += length_joint_name;
00144       union {
00145         bool real;
00146         uint8_t base;
00147       } u_has_position_limits;
00148       u_has_position_limits.base = 0;
00149       u_has_position_limits.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
00150       this->has_position_limits = u_has_position_limits.real;
00151       offset += sizeof(this->has_position_limits);
00152       union {
00153         double real;
00154         uint64_t base;
00155       } u_min_position;
00156       u_min_position.base = 0;
00157       u_min_position.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
00158       u_min_position.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
00159       u_min_position.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
00160       u_min_position.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
00161       u_min_position.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
00162       u_min_position.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
00163       u_min_position.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
00164       u_min_position.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
00165       this->min_position = u_min_position.real;
00166       offset += sizeof(this->min_position);
00167       union {
00168         double real;
00169         uint64_t base;
00170       } u_max_position;
00171       u_max_position.base = 0;
00172       u_max_position.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
00173       u_max_position.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
00174       u_max_position.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
00175       u_max_position.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
00176       u_max_position.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
00177       u_max_position.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
00178       u_max_position.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
00179       u_max_position.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
00180       this->max_position = u_max_position.real;
00181       offset += sizeof(this->max_position);
00182       union {
00183         bool real;
00184         uint8_t base;
00185       } u_has_velocity_limits;
00186       u_has_velocity_limits.base = 0;
00187       u_has_velocity_limits.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
00188       this->has_velocity_limits = u_has_velocity_limits.real;
00189       offset += sizeof(this->has_velocity_limits);
00190       union {
00191         double real;
00192         uint64_t base;
00193       } u_max_velocity;
00194       u_max_velocity.base = 0;
00195       u_max_velocity.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
00196       u_max_velocity.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
00197       u_max_velocity.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
00198       u_max_velocity.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
00199       u_max_velocity.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
00200       u_max_velocity.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
00201       u_max_velocity.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
00202       u_max_velocity.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
00203       this->max_velocity = u_max_velocity.real;
00204       offset += sizeof(this->max_velocity);
00205       union {
00206         bool real;
00207         uint8_t base;
00208       } u_has_acceleration_limits;
00209       u_has_acceleration_limits.base = 0;
00210       u_has_acceleration_limits.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
00211       this->has_acceleration_limits = u_has_acceleration_limits.real;
00212       offset += sizeof(this->has_acceleration_limits);
00213       union {
00214         double real;
00215         uint64_t base;
00216       } u_max_acceleration;
00217       u_max_acceleration.base = 0;
00218       u_max_acceleration.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
00219       u_max_acceleration.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
00220       u_max_acceleration.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
00221       u_max_acceleration.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
00222       u_max_acceleration.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
00223       u_max_acceleration.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
00224       u_max_acceleration.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
00225       u_max_acceleration.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
00226       this->max_acceleration = u_max_acceleration.real;
00227       offset += sizeof(this->max_acceleration);
00228      return offset;
00229     }
00230 
00231     virtual const char * getType(){ return "moveit_msgs/JointLimits"; };
00232     virtual const char * getMD5(){ return "8ca618c7329ea46142cbc864a2efe856"; };
00233 
00234   };
00235 
00236 }
00237 #endif