PlaceGoal.h
Go to the documentation of this file.
00001 #ifndef _ROS_moveit_msgs_PlaceGoal_h
00002 #define _ROS_moveit_msgs_PlaceGoal_h
00003 
00004 #include <stdint.h>
00005 #include <string.h>
00006 #include <stdlib.h>
00007 #include "ros/msg.h"
00008 #include "moveit_msgs/PlaceLocation.h"
00009 #include "moveit_msgs/Constraints.h"
00010 #include "moveit_msgs/PlanningOptions.h"
00011 
00012 namespace moveit_msgs
00013 {
00014 
00015   class PlaceGoal : public ros::Msg
00016   {
00017     public:
00018       const char* group_name;
00019       const char* attached_object_name;
00020       uint8_t place_locations_length;
00021       moveit_msgs::PlaceLocation st_place_locations;
00022       moveit_msgs::PlaceLocation * place_locations;
00023       bool place_eef;
00024       const char* support_surface_name;
00025       bool allow_gripper_support_collision;
00026       moveit_msgs::Constraints path_constraints;
00027       const char* planner_id;
00028       uint8_t allowed_touch_objects_length;
00029       char* st_allowed_touch_objects;
00030       char* * allowed_touch_objects;
00031       float allowed_planning_time;
00032       moveit_msgs::PlanningOptions planning_options;
00033 
00034     virtual int serialize(unsigned char *outbuffer) const
00035     {
00036       int offset = 0;
00037       uint32_t length_group_name = strlen(this->group_name);
00038       memcpy(outbuffer + offset, &length_group_name, sizeof(uint32_t));
00039       offset += 4;
00040       memcpy(outbuffer + offset, this->group_name, length_group_name);
00041       offset += length_group_name;
00042       uint32_t length_attached_object_name = strlen(this->attached_object_name);
00043       memcpy(outbuffer + offset, &length_attached_object_name, sizeof(uint32_t));
00044       offset += 4;
00045       memcpy(outbuffer + offset, this->attached_object_name, length_attached_object_name);
00046       offset += length_attached_object_name;
00047       *(outbuffer + offset++) = place_locations_length;
00048       *(outbuffer + offset++) = 0;
00049       *(outbuffer + offset++) = 0;
00050       *(outbuffer + offset++) = 0;
00051       for( uint8_t i = 0; i < place_locations_length; i++){
00052       offset += this->place_locations[i].serialize(outbuffer + offset);
00053       }
00054       union {
00055         bool real;
00056         uint8_t base;
00057       } u_place_eef;
00058       u_place_eef.real = this->place_eef;
00059       *(outbuffer + offset + 0) = (u_place_eef.base >> (8 * 0)) & 0xFF;
00060       offset += sizeof(this->place_eef);
00061       uint32_t length_support_surface_name = strlen(this->support_surface_name);
00062       memcpy(outbuffer + offset, &length_support_surface_name, sizeof(uint32_t));
00063       offset += 4;
00064       memcpy(outbuffer + offset, this->support_surface_name, length_support_surface_name);
00065       offset += length_support_surface_name;
00066       union {
00067         bool real;
00068         uint8_t base;
00069       } u_allow_gripper_support_collision;
00070       u_allow_gripper_support_collision.real = this->allow_gripper_support_collision;
00071       *(outbuffer + offset + 0) = (u_allow_gripper_support_collision.base >> (8 * 0)) & 0xFF;
00072       offset += sizeof(this->allow_gripper_support_collision);
00073       offset += this->path_constraints.serialize(outbuffer + offset);
00074       uint32_t length_planner_id = strlen(this->planner_id);
00075       memcpy(outbuffer + offset, &length_planner_id, sizeof(uint32_t));
00076       offset += 4;
00077       memcpy(outbuffer + offset, this->planner_id, length_planner_id);
00078       offset += length_planner_id;
00079       *(outbuffer + offset++) = allowed_touch_objects_length;
00080       *(outbuffer + offset++) = 0;
00081       *(outbuffer + offset++) = 0;
00082       *(outbuffer + offset++) = 0;
00083       for( uint8_t i = 0; i < allowed_touch_objects_length; i++){
00084       uint32_t length_allowed_touch_objectsi = strlen(this->allowed_touch_objects[i]);
00085       memcpy(outbuffer + offset, &length_allowed_touch_objectsi, sizeof(uint32_t));
00086       offset += 4;
00087       memcpy(outbuffer + offset, this->allowed_touch_objects[i], length_allowed_touch_objectsi);
00088       offset += length_allowed_touch_objectsi;
00089       }
00090       int32_t * val_allowed_planning_time = (int32_t *) &(this->allowed_planning_time);
00091       int32_t exp_allowed_planning_time = (((*val_allowed_planning_time)>>23)&255);
00092       if(exp_allowed_planning_time != 0)
00093         exp_allowed_planning_time += 1023-127;
00094       int32_t sig_allowed_planning_time = *val_allowed_planning_time;
00095       *(outbuffer + offset++) = 0;
00096       *(outbuffer + offset++) = 0;
00097       *(outbuffer + offset++) = 0;
00098       *(outbuffer + offset++) = (sig_allowed_planning_time<<5) & 0xff;
00099       *(outbuffer + offset++) = (sig_allowed_planning_time>>3) & 0xff;
00100       *(outbuffer + offset++) = (sig_allowed_planning_time>>11) & 0xff;
00101       *(outbuffer + offset++) = ((exp_allowed_planning_time<<4) & 0xF0) | ((sig_allowed_planning_time>>19)&0x0F);
00102       *(outbuffer + offset++) = (exp_allowed_planning_time>>4) & 0x7F;
00103       if(this->allowed_planning_time < 0) *(outbuffer + offset -1) |= 0x80;
00104       offset += this->planning_options.serialize(outbuffer + offset);
00105       return offset;
00106     }
00107 
00108     virtual int deserialize(unsigned char *inbuffer)
00109     {
00110       int offset = 0;
00111       uint32_t length_group_name;
00112       memcpy(&length_group_name, (inbuffer + offset), sizeof(uint32_t));
00113       offset += 4;
00114       for(unsigned int k= offset; k< offset+length_group_name; ++k){
00115           inbuffer[k-1]=inbuffer[k];
00116       }
00117       inbuffer[offset+length_group_name-1]=0;
00118       this->group_name = (char *)(inbuffer + offset-1);
00119       offset += length_group_name;
00120       uint32_t length_attached_object_name;
00121       memcpy(&length_attached_object_name, (inbuffer + offset), sizeof(uint32_t));
00122       offset += 4;
00123       for(unsigned int k= offset; k< offset+length_attached_object_name; ++k){
00124           inbuffer[k-1]=inbuffer[k];
00125       }
00126       inbuffer[offset+length_attached_object_name-1]=0;
00127       this->attached_object_name = (char *)(inbuffer + offset-1);
00128       offset += length_attached_object_name;
00129       uint8_t place_locations_lengthT = *(inbuffer + offset++);
00130       if(place_locations_lengthT > place_locations_length)
00131         this->place_locations = (moveit_msgs::PlaceLocation*)realloc(this->place_locations, place_locations_lengthT * sizeof(moveit_msgs::PlaceLocation));
00132       offset += 3;
00133       place_locations_length = place_locations_lengthT;
00134       for( uint8_t i = 0; i < place_locations_length; i++){
00135       offset += this->st_place_locations.deserialize(inbuffer + offset);
00136         memcpy( &(this->place_locations[i]), &(this->st_place_locations), sizeof(moveit_msgs::PlaceLocation));
00137       }
00138       union {
00139         bool real;
00140         uint8_t base;
00141       } u_place_eef;
00142       u_place_eef.base = 0;
00143       u_place_eef.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
00144       this->place_eef = u_place_eef.real;
00145       offset += sizeof(this->place_eef);
00146       uint32_t length_support_surface_name;
00147       memcpy(&length_support_surface_name, (inbuffer + offset), sizeof(uint32_t));
00148       offset += 4;
00149       for(unsigned int k= offset; k< offset+length_support_surface_name; ++k){
00150           inbuffer[k-1]=inbuffer[k];
00151       }
00152       inbuffer[offset+length_support_surface_name-1]=0;
00153       this->support_surface_name = (char *)(inbuffer + offset-1);
00154       offset += length_support_surface_name;
00155       union {
00156         bool real;
00157         uint8_t base;
00158       } u_allow_gripper_support_collision;
00159       u_allow_gripper_support_collision.base = 0;
00160       u_allow_gripper_support_collision.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
00161       this->allow_gripper_support_collision = u_allow_gripper_support_collision.real;
00162       offset += sizeof(this->allow_gripper_support_collision);
00163       offset += this->path_constraints.deserialize(inbuffer + offset);
00164       uint32_t length_planner_id;
00165       memcpy(&length_planner_id, (inbuffer + offset), sizeof(uint32_t));
00166       offset += 4;
00167       for(unsigned int k= offset; k< offset+length_planner_id; ++k){
00168           inbuffer[k-1]=inbuffer[k];
00169       }
00170       inbuffer[offset+length_planner_id-1]=0;
00171       this->planner_id = (char *)(inbuffer + offset-1);
00172       offset += length_planner_id;
00173       uint8_t allowed_touch_objects_lengthT = *(inbuffer + offset++);
00174       if(allowed_touch_objects_lengthT > allowed_touch_objects_length)
00175         this->allowed_touch_objects = (char**)realloc(this->allowed_touch_objects, allowed_touch_objects_lengthT * sizeof(char*));
00176       offset += 3;
00177       allowed_touch_objects_length = allowed_touch_objects_lengthT;
00178       for( uint8_t i = 0; i < allowed_touch_objects_length; i++){
00179       uint32_t length_st_allowed_touch_objects;
00180       memcpy(&length_st_allowed_touch_objects, (inbuffer + offset), sizeof(uint32_t));
00181       offset += 4;
00182       for(unsigned int k= offset; k< offset+length_st_allowed_touch_objects; ++k){
00183           inbuffer[k-1]=inbuffer[k];
00184       }
00185       inbuffer[offset+length_st_allowed_touch_objects-1]=0;
00186       this->st_allowed_touch_objects = (char *)(inbuffer + offset-1);
00187       offset += length_st_allowed_touch_objects;
00188         memcpy( &(this->allowed_touch_objects[i]), &(this->st_allowed_touch_objects), sizeof(char*));
00189       }
00190       uint32_t * val_allowed_planning_time = (uint32_t*) &(this->allowed_planning_time);
00191       offset += 3;
00192       *val_allowed_planning_time = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07);
00193       *val_allowed_planning_time |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3;
00194       *val_allowed_planning_time |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11;
00195       *val_allowed_planning_time |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19;
00196       uint32_t exp_allowed_planning_time = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4;
00197       exp_allowed_planning_time |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4;
00198       if(exp_allowed_planning_time !=0)
00199         *val_allowed_planning_time |= ((exp_allowed_planning_time)-1023+127)<<23;
00200       if( ((*(inbuffer+offset++)) & 0x80) > 0) this->allowed_planning_time = -this->allowed_planning_time;
00201       offset += this->planning_options.deserialize(inbuffer + offset);
00202      return offset;
00203     }
00204 
00205     const char * getType(){ return "moveit_msgs/PlaceGoal"; };
00206     const char * getMD5(){ return "e3f3e956e536ccd313fd8f23023f0a94"; };
00207 
00208   };
00209 
00210 }
00211 #endif


ric_mc
Author(s): RoboTiCan
autogenerated on Fri May 20 2016 03:48:56