catchrobo2022 / Mbed 2 deprecated catchrobo2022_mbed

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers OrientationConstraint.h Source File

OrientationConstraint.h

00001 #ifndef _ROS_moveit_msgs_OrientationConstraint_h
00002 #define _ROS_moveit_msgs_OrientationConstraint_h
00003 
00004 #include <stdint.h>
00005 #include <string.h>
00006 #include <stdlib.h>
00007 #include "ros/msg.h"
00008 #include "std_msgs/Header.h"
00009 #include "geometry_msgs/Quaternion.h"
00010 
00011 namespace moveit_msgs
00012 {
00013 
00014   class OrientationConstraint : public ros::Msg
00015   {
00016     public:
00017       typedef std_msgs::Header _header_type;
00018       _header_type header;
00019       typedef geometry_msgs::Quaternion _orientation_type;
00020       _orientation_type orientation;
00021       typedef const char* _link_name_type;
00022       _link_name_type link_name;
00023       typedef double _absolute_x_axis_tolerance_type;
00024       _absolute_x_axis_tolerance_type absolute_x_axis_tolerance;
00025       typedef double _absolute_y_axis_tolerance_type;
00026       _absolute_y_axis_tolerance_type absolute_y_axis_tolerance;
00027       typedef double _absolute_z_axis_tolerance_type;
00028       _absolute_z_axis_tolerance_type absolute_z_axis_tolerance;
00029       typedef double _weight_type;
00030       _weight_type weight;
00031 
00032     OrientationConstraint():
00033       header(),
00034       orientation(),
00035       link_name(""),
00036       absolute_x_axis_tolerance(0),
00037       absolute_y_axis_tolerance(0),
00038       absolute_z_axis_tolerance(0),
00039       weight(0)
00040     {
00041     }
00042 
00043     virtual int serialize(unsigned char *outbuffer) const
00044     {
00045       int offset = 0;
00046       offset += this->header.serialize(outbuffer + offset);
00047       offset += this->orientation.serialize(outbuffer + offset);
00048       uint32_t length_link_name = strlen(this->link_name);
00049       varToArr(outbuffer + offset, length_link_name);
00050       offset += 4;
00051       memcpy(outbuffer + offset, this->link_name, length_link_name);
00052       offset += length_link_name;
00053       union {
00054         double real;
00055         uint64_t base;
00056       } u_absolute_x_axis_tolerance;
00057       u_absolute_x_axis_tolerance.real = this->absolute_x_axis_tolerance;
00058       *(outbuffer + offset + 0) = (u_absolute_x_axis_tolerance.base >> (8 * 0)) & 0xFF;
00059       *(outbuffer + offset + 1) = (u_absolute_x_axis_tolerance.base >> (8 * 1)) & 0xFF;
00060       *(outbuffer + offset + 2) = (u_absolute_x_axis_tolerance.base >> (8 * 2)) & 0xFF;
00061       *(outbuffer + offset + 3) = (u_absolute_x_axis_tolerance.base >> (8 * 3)) & 0xFF;
00062       *(outbuffer + offset + 4) = (u_absolute_x_axis_tolerance.base >> (8 * 4)) & 0xFF;
00063       *(outbuffer + offset + 5) = (u_absolute_x_axis_tolerance.base >> (8 * 5)) & 0xFF;
00064       *(outbuffer + offset + 6) = (u_absolute_x_axis_tolerance.base >> (8 * 6)) & 0xFF;
00065       *(outbuffer + offset + 7) = (u_absolute_x_axis_tolerance.base >> (8 * 7)) & 0xFF;
00066       offset += sizeof(this->absolute_x_axis_tolerance);
00067       union {
00068         double real;
00069         uint64_t base;
00070       } u_absolute_y_axis_tolerance;
00071       u_absolute_y_axis_tolerance.real = this->absolute_y_axis_tolerance;
00072       *(outbuffer + offset + 0) = (u_absolute_y_axis_tolerance.base >> (8 * 0)) & 0xFF;
00073       *(outbuffer + offset + 1) = (u_absolute_y_axis_tolerance.base >> (8 * 1)) & 0xFF;
00074       *(outbuffer + offset + 2) = (u_absolute_y_axis_tolerance.base >> (8 * 2)) & 0xFF;
00075       *(outbuffer + offset + 3) = (u_absolute_y_axis_tolerance.base >> (8 * 3)) & 0xFF;
00076       *(outbuffer + offset + 4) = (u_absolute_y_axis_tolerance.base >> (8 * 4)) & 0xFF;
00077       *(outbuffer + offset + 5) = (u_absolute_y_axis_tolerance.base >> (8 * 5)) & 0xFF;
00078       *(outbuffer + offset + 6) = (u_absolute_y_axis_tolerance.base >> (8 * 6)) & 0xFF;
00079       *(outbuffer + offset + 7) = (u_absolute_y_axis_tolerance.base >> (8 * 7)) & 0xFF;
00080       offset += sizeof(this->absolute_y_axis_tolerance);
00081       union {
00082         double real;
00083         uint64_t base;
00084       } u_absolute_z_axis_tolerance;
00085       u_absolute_z_axis_tolerance.real = this->absolute_z_axis_tolerance;
00086       *(outbuffer + offset + 0) = (u_absolute_z_axis_tolerance.base >> (8 * 0)) & 0xFF;
00087       *(outbuffer + offset + 1) = (u_absolute_z_axis_tolerance.base >> (8 * 1)) & 0xFF;
00088       *(outbuffer + offset + 2) = (u_absolute_z_axis_tolerance.base >> (8 * 2)) & 0xFF;
00089       *(outbuffer + offset + 3) = (u_absolute_z_axis_tolerance.base >> (8 * 3)) & 0xFF;
00090       *(outbuffer + offset + 4) = (u_absolute_z_axis_tolerance.base >> (8 * 4)) & 0xFF;
00091       *(outbuffer + offset + 5) = (u_absolute_z_axis_tolerance.base >> (8 * 5)) & 0xFF;
00092       *(outbuffer + offset + 6) = (u_absolute_z_axis_tolerance.base >> (8 * 6)) & 0xFF;
00093       *(outbuffer + offset + 7) = (u_absolute_z_axis_tolerance.base >> (8 * 7)) & 0xFF;
00094       offset += sizeof(this->absolute_z_axis_tolerance);
00095       union {
00096         double real;
00097         uint64_t base;
00098       } u_weight;
00099       u_weight.real = this->weight;
00100       *(outbuffer + offset + 0) = (u_weight.base >> (8 * 0)) & 0xFF;
00101       *(outbuffer + offset + 1) = (u_weight.base >> (8 * 1)) & 0xFF;
00102       *(outbuffer + offset + 2) = (u_weight.base >> (8 * 2)) & 0xFF;
00103       *(outbuffer + offset + 3) = (u_weight.base >> (8 * 3)) & 0xFF;
00104       *(outbuffer + offset + 4) = (u_weight.base >> (8 * 4)) & 0xFF;
00105       *(outbuffer + offset + 5) = (u_weight.base >> (8 * 5)) & 0xFF;
00106       *(outbuffer + offset + 6) = (u_weight.base >> (8 * 6)) & 0xFF;
00107       *(outbuffer + offset + 7) = (u_weight.base >> (8 * 7)) & 0xFF;
00108       offset += sizeof(this->weight);
00109       return offset;
00110     }
00111 
00112     virtual int deserialize(unsigned char *inbuffer)
00113     {
00114       int offset = 0;
00115       offset += this->header.deserialize(inbuffer + offset);
00116       offset += this->orientation.deserialize(inbuffer + offset);
00117       uint32_t length_link_name;
00118       arrToVar(length_link_name, (inbuffer + offset));
00119       offset += 4;
00120       for(unsigned int k= offset; k< offset+length_link_name; ++k){
00121           inbuffer[k-1]=inbuffer[k];
00122       }
00123       inbuffer[offset+length_link_name-1]=0;
00124       this->link_name = (char *)(inbuffer + offset-1);
00125       offset += length_link_name;
00126       union {
00127         double real;
00128         uint64_t base;
00129       } u_absolute_x_axis_tolerance;
00130       u_absolute_x_axis_tolerance.base = 0;
00131       u_absolute_x_axis_tolerance.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
00132       u_absolute_x_axis_tolerance.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
00133       u_absolute_x_axis_tolerance.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
00134       u_absolute_x_axis_tolerance.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
00135       u_absolute_x_axis_tolerance.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
00136       u_absolute_x_axis_tolerance.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
00137       u_absolute_x_axis_tolerance.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
00138       u_absolute_x_axis_tolerance.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
00139       this->absolute_x_axis_tolerance = u_absolute_x_axis_tolerance.real;
00140       offset += sizeof(this->absolute_x_axis_tolerance);
00141       union {
00142         double real;
00143         uint64_t base;
00144       } u_absolute_y_axis_tolerance;
00145       u_absolute_y_axis_tolerance.base = 0;
00146       u_absolute_y_axis_tolerance.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
00147       u_absolute_y_axis_tolerance.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
00148       u_absolute_y_axis_tolerance.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
00149       u_absolute_y_axis_tolerance.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
00150       u_absolute_y_axis_tolerance.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
00151       u_absolute_y_axis_tolerance.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
00152       u_absolute_y_axis_tolerance.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
00153       u_absolute_y_axis_tolerance.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
00154       this->absolute_y_axis_tolerance = u_absolute_y_axis_tolerance.real;
00155       offset += sizeof(this->absolute_y_axis_tolerance);
00156       union {
00157         double real;
00158         uint64_t base;
00159       } u_absolute_z_axis_tolerance;
00160       u_absolute_z_axis_tolerance.base = 0;
00161       u_absolute_z_axis_tolerance.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
00162       u_absolute_z_axis_tolerance.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
00163       u_absolute_z_axis_tolerance.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
00164       u_absolute_z_axis_tolerance.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
00165       u_absolute_z_axis_tolerance.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
00166       u_absolute_z_axis_tolerance.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
00167       u_absolute_z_axis_tolerance.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
00168       u_absolute_z_axis_tolerance.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
00169       this->absolute_z_axis_tolerance = u_absolute_z_axis_tolerance.real;
00170       offset += sizeof(this->absolute_z_axis_tolerance);
00171       union {
00172         double real;
00173         uint64_t base;
00174       } u_weight;
00175       u_weight.base = 0;
00176       u_weight.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
00177       u_weight.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
00178       u_weight.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
00179       u_weight.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
00180       u_weight.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
00181       u_weight.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
00182       u_weight.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
00183       u_weight.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
00184       this->weight = u_weight.real;
00185       offset += sizeof(this->weight);
00186      return offset;
00187     }
00188 
00189     virtual const char * getType(){ return "moveit_msgs/OrientationConstraint"; };
00190     virtual const char * getMD5(){ return "ab5cefb9bc4c0089620f5eb4caf4e59a"; };
00191 
00192   };
00193 
00194 }
00195 #endif