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
HumanSkeleton.h
00001 #ifndef _ROS_jsk_recognition_msgs_HumanSkeleton_h 00002 #define _ROS_jsk_recognition_msgs_HumanSkeleton_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 "jsk_recognition_msgs/Segment.h" 00010 00011 namespace jsk_recognition_msgs 00012 { 00013 00014 class HumanSkeleton : public ros::Msg 00015 { 00016 public: 00017 typedef std_msgs::Header _header_type; 00018 _header_type header; 00019 uint32_t bone_names_length; 00020 typedef char* _bone_names_type; 00021 _bone_names_type st_bone_names; 00022 _bone_names_type * bone_names; 00023 uint32_t bones_length; 00024 typedef jsk_recognition_msgs::Segment _bones_type; 00025 _bones_type st_bones; 00026 _bones_type * bones; 00027 00028 HumanSkeleton(): 00029 header(), 00030 bone_names_length(0), bone_names(NULL), 00031 bones_length(0), bones(NULL) 00032 { 00033 } 00034 00035 virtual int serialize(unsigned char *outbuffer) const 00036 { 00037 int offset = 0; 00038 offset += this->header.serialize(outbuffer + offset); 00039 *(outbuffer + offset + 0) = (this->bone_names_length >> (8 * 0)) & 0xFF; 00040 *(outbuffer + offset + 1) = (this->bone_names_length >> (8 * 1)) & 0xFF; 00041 *(outbuffer + offset + 2) = (this->bone_names_length >> (8 * 2)) & 0xFF; 00042 *(outbuffer + offset + 3) = (this->bone_names_length >> (8 * 3)) & 0xFF; 00043 offset += sizeof(this->bone_names_length); 00044 for( uint32_t i = 0; i < bone_names_length; i++){ 00045 uint32_t length_bone_namesi = strlen(this->bone_names[i]); 00046 varToArr(outbuffer + offset, length_bone_namesi); 00047 offset += 4; 00048 memcpy(outbuffer + offset, this->bone_names[i], length_bone_namesi); 00049 offset += length_bone_namesi; 00050 } 00051 *(outbuffer + offset + 0) = (this->bones_length >> (8 * 0)) & 0xFF; 00052 *(outbuffer + offset + 1) = (this->bones_length >> (8 * 1)) & 0xFF; 00053 *(outbuffer + offset + 2) = (this->bones_length >> (8 * 2)) & 0xFF; 00054 *(outbuffer + offset + 3) = (this->bones_length >> (8 * 3)) & 0xFF; 00055 offset += sizeof(this->bones_length); 00056 for( uint32_t i = 0; i < bones_length; i++){ 00057 offset += this->bones[i].serialize(outbuffer + offset); 00058 } 00059 return offset; 00060 } 00061 00062 virtual int deserialize(unsigned char *inbuffer) 00063 { 00064 int offset = 0; 00065 offset += this->header.deserialize(inbuffer + offset); 00066 uint32_t bone_names_lengthT = ((uint32_t) (*(inbuffer + offset))); 00067 bone_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); 00068 bone_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); 00069 bone_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); 00070 offset += sizeof(this->bone_names_length); 00071 if(bone_names_lengthT > bone_names_length) 00072 this->bone_names = (char**)realloc(this->bone_names, bone_names_lengthT * sizeof(char*)); 00073 bone_names_length = bone_names_lengthT; 00074 for( uint32_t i = 0; i < bone_names_length; i++){ 00075 uint32_t length_st_bone_names; 00076 arrToVar(length_st_bone_names, (inbuffer + offset)); 00077 offset += 4; 00078 for(unsigned int k= offset; k< offset+length_st_bone_names; ++k){ 00079 inbuffer[k-1]=inbuffer[k]; 00080 } 00081 inbuffer[offset+length_st_bone_names-1]=0; 00082 this->st_bone_names = (char *)(inbuffer + offset-1); 00083 offset += length_st_bone_names; 00084 memcpy( &(this->bone_names[i]), &(this->st_bone_names), sizeof(char*)); 00085 } 00086 uint32_t bones_lengthT = ((uint32_t) (*(inbuffer + offset))); 00087 bones_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); 00088 bones_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); 00089 bones_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); 00090 offset += sizeof(this->bones_length); 00091 if(bones_lengthT > bones_length) 00092 this->bones = (jsk_recognition_msgs::Segment*)realloc(this->bones, bones_lengthT * sizeof(jsk_recognition_msgs::Segment)); 00093 bones_length = bones_lengthT; 00094 for( uint32_t i = 0; i < bones_length; i++){ 00095 offset += this->st_bones.deserialize(inbuffer + offset); 00096 memcpy( &(this->bones[i]), &(this->st_bones), sizeof(jsk_recognition_msgs::Segment)); 00097 } 00098 return offset; 00099 } 00100 00101 virtual const char * getType(){ return "jsk_recognition_msgs/HumanSkeleton"; }; 00102 virtual const char * getMD5(){ return "b8098e195ee1734e91bc2e38c969a23f"; }; 00103 00104 }; 00105 00106 } 00107 #endif
Generated on Mon Sep 26 2022 13:47:01 by
