Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
GetStateValidity.h
00001 #ifndef _ROS_SERVICE_GetStateValidity_h 00002 #define _ROS_SERVICE_GetStateValidity_h 00003 #include <stdint.h> 00004 #include <string.h> 00005 #include <stdlib.h> 00006 #include "ros/msg.h" 00007 #include "moveit_msgs/ConstraintEvalResult.h" 00008 #include "moveit_msgs/CostSource.h" 00009 #include "moveit_msgs/ContactInformation.h" 00010 #include "moveit_msgs/RobotState.h" 00011 #include "moveit_msgs/Constraints.h" 00012 00013 namespace moveit_msgs 00014 { 00015 00016 static const char GETSTATEVALIDITY[] = "moveit_msgs/GetStateValidity"; 00017 00018 class GetStateValidityRequest : public ros::Msg 00019 { 00020 public: 00021 typedef moveit_msgs::RobotState _robot_state_type; 00022 _robot_state_type robot_state; 00023 typedef const char* _group_name_type; 00024 _group_name_type group_name; 00025 typedef moveit_msgs::Constraints _constraints_type; 00026 _constraints_type constraints; 00027 00028 GetStateValidityRequest(): 00029 robot_state(), 00030 group_name(""), 00031 constraints() 00032 { 00033 } 00034 00035 virtual int serialize(unsigned char *outbuffer) const 00036 { 00037 int offset = 0; 00038 offset += this->robot_state.serialize(outbuffer + offset); 00039 uint32_t length_group_name = strlen(this->group_name); 00040 varToArr(outbuffer + offset, length_group_name); 00041 offset += 4; 00042 memcpy(outbuffer + offset, this->group_name, length_group_name); 00043 offset += length_group_name; 00044 offset += this->constraints.serialize(outbuffer + offset); 00045 return offset; 00046 } 00047 00048 virtual int deserialize(unsigned char *inbuffer) 00049 { 00050 int offset = 0; 00051 offset += this->robot_state.deserialize(inbuffer + offset); 00052 uint32_t length_group_name; 00053 arrToVar(length_group_name, (inbuffer + offset)); 00054 offset += 4; 00055 for(unsigned int k= offset; k< offset+length_group_name; ++k){ 00056 inbuffer[k-1]=inbuffer[k]; 00057 } 00058 inbuffer[offset+length_group_name-1]=0; 00059 this->group_name = (char *)(inbuffer + offset-1); 00060 offset += length_group_name; 00061 offset += this->constraints.deserialize(inbuffer + offset); 00062 return offset; 00063 } 00064 00065 virtual const char * getType(){ return GETSTATEVALIDITY; }; 00066 virtual const char * getMD5(){ return "b569c609cafad20ba7d0e46e70e7cab1"; }; 00067 00068 }; 00069 00070 class GetStateValidityResponse : public ros::Msg 00071 { 00072 public: 00073 typedef bool _valid_type; 00074 _valid_type valid; 00075 uint32_t contacts_length; 00076 typedef moveit_msgs::ContactInformation _contacts_type; 00077 _contacts_type st_contacts; 00078 _contacts_type * contacts; 00079 uint32_t cost_sources_length; 00080 typedef moveit_msgs::CostSource _cost_sources_type; 00081 _cost_sources_type st_cost_sources; 00082 _cost_sources_type * cost_sources; 00083 uint32_t constraint_result_length; 00084 typedef moveit_msgs::ConstraintEvalResult _constraint_result_type; 00085 _constraint_result_type st_constraint_result; 00086 _constraint_result_type * constraint_result; 00087 00088 GetStateValidityResponse(): 00089 valid(0), 00090 contacts_length(0), contacts(NULL), 00091 cost_sources_length(0), cost_sources(NULL), 00092 constraint_result_length(0), constraint_result(NULL) 00093 { 00094 } 00095 00096 virtual int serialize(unsigned char *outbuffer) const 00097 { 00098 int offset = 0; 00099 union { 00100 bool real; 00101 uint8_t base; 00102 } u_valid; 00103 u_valid.real = this->valid; 00104 *(outbuffer + offset + 0) = (u_valid.base >> (8 * 0)) & 0xFF; 00105 offset += sizeof(this->valid); 00106 *(outbuffer + offset + 0) = (this->contacts_length >> (8 * 0)) & 0xFF; 00107 *(outbuffer + offset + 1) = (this->contacts_length >> (8 * 1)) & 0xFF; 00108 *(outbuffer + offset + 2) = (this->contacts_length >> (8 * 2)) & 0xFF; 00109 *(outbuffer + offset + 3) = (this->contacts_length >> (8 * 3)) & 0xFF; 00110 offset += sizeof(this->contacts_length); 00111 for( uint32_t i = 0; i < contacts_length; i++){ 00112 offset += this->contacts[i].serialize(outbuffer + offset); 00113 } 00114 *(outbuffer + offset + 0) = (this->cost_sources_length >> (8 * 0)) & 0xFF; 00115 *(outbuffer + offset + 1) = (this->cost_sources_length >> (8 * 1)) & 0xFF; 00116 *(outbuffer + offset + 2) = (this->cost_sources_length >> (8 * 2)) & 0xFF; 00117 *(outbuffer + offset + 3) = (this->cost_sources_length >> (8 * 3)) & 0xFF; 00118 offset += sizeof(this->cost_sources_length); 00119 for( uint32_t i = 0; i < cost_sources_length; i++){ 00120 offset += this->cost_sources[i].serialize(outbuffer + offset); 00121 } 00122 *(outbuffer + offset + 0) = (this->constraint_result_length >> (8 * 0)) & 0xFF; 00123 *(outbuffer + offset + 1) = (this->constraint_result_length >> (8 * 1)) & 0xFF; 00124 *(outbuffer + offset + 2) = (this->constraint_result_length >> (8 * 2)) & 0xFF; 00125 *(outbuffer + offset + 3) = (this->constraint_result_length >> (8 * 3)) & 0xFF; 00126 offset += sizeof(this->constraint_result_length); 00127 for( uint32_t i = 0; i < constraint_result_length; i++){ 00128 offset += this->constraint_result[i].serialize(outbuffer + offset); 00129 } 00130 return offset; 00131 } 00132 00133 virtual int deserialize(unsigned char *inbuffer) 00134 { 00135 int offset = 0; 00136 union { 00137 bool real; 00138 uint8_t base; 00139 } u_valid; 00140 u_valid.base = 0; 00141 u_valid.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); 00142 this->valid = u_valid.real; 00143 offset += sizeof(this->valid); 00144 uint32_t contacts_lengthT = ((uint32_t) (*(inbuffer + offset))); 00145 contacts_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); 00146 contacts_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); 00147 contacts_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); 00148 offset += sizeof(this->contacts_length); 00149 if(contacts_lengthT > contacts_length) 00150 this->contacts = (moveit_msgs::ContactInformation*)realloc(this->contacts, contacts_lengthT * sizeof(moveit_msgs::ContactInformation)); 00151 contacts_length = contacts_lengthT; 00152 for( uint32_t i = 0; i < contacts_length; i++){ 00153 offset += this->st_contacts.deserialize(inbuffer + offset); 00154 memcpy( &(this->contacts[i]), &(this->st_contacts), sizeof(moveit_msgs::ContactInformation)); 00155 } 00156 uint32_t cost_sources_lengthT = ((uint32_t) (*(inbuffer + offset))); 00157 cost_sources_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); 00158 cost_sources_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); 00159 cost_sources_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); 00160 offset += sizeof(this->cost_sources_length); 00161 if(cost_sources_lengthT > cost_sources_length) 00162 this->cost_sources = (moveit_msgs::CostSource*)realloc(this->cost_sources, cost_sources_lengthT * sizeof(moveit_msgs::CostSource)); 00163 cost_sources_length = cost_sources_lengthT; 00164 for( uint32_t i = 0; i < cost_sources_length; i++){ 00165 offset += this->st_cost_sources.deserialize(inbuffer + offset); 00166 memcpy( &(this->cost_sources[i]), &(this->st_cost_sources), sizeof(moveit_msgs::CostSource)); 00167 } 00168 uint32_t constraint_result_lengthT = ((uint32_t) (*(inbuffer + offset))); 00169 constraint_result_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); 00170 constraint_result_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); 00171 constraint_result_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); 00172 offset += sizeof(this->constraint_result_length); 00173 if(constraint_result_lengthT > constraint_result_length) 00174 this->constraint_result = (moveit_msgs::ConstraintEvalResult*)realloc(this->constraint_result, constraint_result_lengthT * sizeof(moveit_msgs::ConstraintEvalResult)); 00175 constraint_result_length = constraint_result_lengthT; 00176 for( uint32_t i = 0; i < constraint_result_length; i++){ 00177 offset += this->st_constraint_result.deserialize(inbuffer + offset); 00178 memcpy( &(this->constraint_result[i]), &(this->st_constraint_result), sizeof(moveit_msgs::ConstraintEvalResult)); 00179 } 00180 return offset; 00181 } 00182 00183 virtual const char * getType(){ return GETSTATEVALIDITY; }; 00184 virtual const char * getMD5(){ return "e326fb22b7448f29c0e726d9270d9929"; }; 00185 00186 }; 00187 00188 class GetStateValidity { 00189 public: 00190 typedef GetStateValidityRequest Request; 00191 typedef GetStateValidityResponse Response; 00192 }; 00193 00194 } 00195 #endif
Generated on Mon Sep 26 2022 13:47:00 by
