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
Curve1D.h
00001 #ifndef _ROS_posedetection_msgs_Curve1D_h 00002 #define _ROS_posedetection_msgs_Curve1D_h 00003 00004 #include <stdint.h> 00005 #include <string.h> 00006 #include <stdlib.h> 00007 #include "ros/msg.h" 00008 00009 namespace posedetection_msgs 00010 { 00011 00012 class Curve1D : public ros::Msg 00013 { 00014 public: 00015 uint32_t pts_length; 00016 typedef float _pts_type; 00017 _pts_type st_pts; 00018 _pts_type * pts; 00019 00020 Curve1D(): 00021 pts_length(0), pts(NULL) 00022 { 00023 } 00024 00025 virtual int serialize(unsigned char *outbuffer) const 00026 { 00027 int offset = 0; 00028 *(outbuffer + offset + 0) = (this->pts_length >> (8 * 0)) & 0xFF; 00029 *(outbuffer + offset + 1) = (this->pts_length >> (8 * 1)) & 0xFF; 00030 *(outbuffer + offset + 2) = (this->pts_length >> (8 * 2)) & 0xFF; 00031 *(outbuffer + offset + 3) = (this->pts_length >> (8 * 3)) & 0xFF; 00032 offset += sizeof(this->pts_length); 00033 for( uint32_t i = 0; i < pts_length; i++){ 00034 union { 00035 float real; 00036 uint32_t base; 00037 } u_ptsi; 00038 u_ptsi.real = this->pts[i]; 00039 *(outbuffer + offset + 0) = (u_ptsi.base >> (8 * 0)) & 0xFF; 00040 *(outbuffer + offset + 1) = (u_ptsi.base >> (8 * 1)) & 0xFF; 00041 *(outbuffer + offset + 2) = (u_ptsi.base >> (8 * 2)) & 0xFF; 00042 *(outbuffer + offset + 3) = (u_ptsi.base >> (8 * 3)) & 0xFF; 00043 offset += sizeof(this->pts[i]); 00044 } 00045 return offset; 00046 } 00047 00048 virtual int deserialize(unsigned char *inbuffer) 00049 { 00050 int offset = 0; 00051 uint32_t pts_lengthT = ((uint32_t) (*(inbuffer + offset))); 00052 pts_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); 00053 pts_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); 00054 pts_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); 00055 offset += sizeof(this->pts_length); 00056 if(pts_lengthT > pts_length) 00057 this->pts = (float*)realloc(this->pts, pts_lengthT * sizeof(float)); 00058 pts_length = pts_lengthT; 00059 for( uint32_t i = 0; i < pts_length; i++){ 00060 union { 00061 float real; 00062 uint32_t base; 00063 } u_st_pts; 00064 u_st_pts.base = 0; 00065 u_st_pts.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); 00066 u_st_pts.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); 00067 u_st_pts.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); 00068 u_st_pts.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); 00069 this->st_pts = u_st_pts.real; 00070 offset += sizeof(this->st_pts); 00071 memcpy( &(this->pts[i]), &(this->st_pts), sizeof(float)); 00072 } 00073 return offset; 00074 } 00075 00076 virtual const char * getType(){ return "posedetection_msgs/Curve1D"; }; 00077 virtual const char * getMD5(){ return "e5367ca89dc9a58670f8f288e2c52f5d"; }; 00078 00079 }; 00080 00081 } 00082 #endif
Generated on Mon Sep 26 2022 13:47:00 by
