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.
TeleportRelative.h
00001 #ifndef _ROS_SERVICE_TeleportRelative_h 00002 #define _ROS_SERVICE_TeleportRelative_h 00003 #include <stdint.h> 00004 #include <string.h> 00005 #include <stdlib.h> 00006 #include "ros/msg.h" 00007 00008 namespace turtlesim 00009 { 00010 00011 static const char TELEPORTRELATIVE[] = "turtlesim/TeleportRelative"; 00012 00013 class TeleportRelativeRequest : public ros::Msg 00014 { 00015 public: 00016 typedef float _linear_type; 00017 _linear_type linear; 00018 typedef float _angular_type; 00019 _angular_type angular; 00020 00021 TeleportRelativeRequest(): 00022 linear(0), 00023 angular(0) 00024 { 00025 } 00026 00027 virtual int serialize(unsigned char *outbuffer) const 00028 { 00029 int offset = 0; 00030 union { 00031 float real; 00032 uint32_t base; 00033 } u_linear; 00034 u_linear.real = this->linear; 00035 *(outbuffer + offset + 0) = (u_linear.base >> (8 * 0)) & 0xFF; 00036 *(outbuffer + offset + 1) = (u_linear.base >> (8 * 1)) & 0xFF; 00037 *(outbuffer + offset + 2) = (u_linear.base >> (8 * 2)) & 0xFF; 00038 *(outbuffer + offset + 3) = (u_linear.base >> (8 * 3)) & 0xFF; 00039 offset += sizeof(this->linear); 00040 union { 00041 float real; 00042 uint32_t base; 00043 } u_angular; 00044 u_angular.real = this->angular; 00045 *(outbuffer + offset + 0) = (u_angular.base >> (8 * 0)) & 0xFF; 00046 *(outbuffer + offset + 1) = (u_angular.base >> (8 * 1)) & 0xFF; 00047 *(outbuffer + offset + 2) = (u_angular.base >> (8 * 2)) & 0xFF; 00048 *(outbuffer + offset + 3) = (u_angular.base >> (8 * 3)) & 0xFF; 00049 offset += sizeof(this->angular); 00050 return offset; 00051 } 00052 00053 virtual int deserialize(unsigned char *inbuffer) 00054 { 00055 int offset = 0; 00056 union { 00057 float real; 00058 uint32_t base; 00059 } u_linear; 00060 u_linear.base = 0; 00061 u_linear.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); 00062 u_linear.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); 00063 u_linear.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); 00064 u_linear.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); 00065 this->linear = u_linear.real; 00066 offset += sizeof(this->linear); 00067 union { 00068 float real; 00069 uint32_t base; 00070 } u_angular; 00071 u_angular.base = 0; 00072 u_angular.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); 00073 u_angular.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); 00074 u_angular.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); 00075 u_angular.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); 00076 this->angular = u_angular.real; 00077 offset += sizeof(this->angular); 00078 return offset; 00079 } 00080 00081 const char * getType(){ return TELEPORTRELATIVE; }; 00082 const char * getMD5(){ return "9d5c2dcd348ac8f76ce2a4307bd63a13"; }; 00083 00084 }; 00085 00086 class TeleportRelativeResponse : public ros::Msg 00087 { 00088 public: 00089 00090 TeleportRelativeResponse() 00091 { 00092 } 00093 00094 virtual int serialize(unsigned char *outbuffer) const 00095 { 00096 int offset = 0; 00097 return offset; 00098 } 00099 00100 virtual int deserialize(unsigned char *inbuffer) 00101 { 00102 int offset = 0; 00103 return offset; 00104 } 00105 00106 const char * getType(){ return TELEPORTRELATIVE; }; 00107 const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; 00108 00109 }; 00110 00111 class TeleportRelative { 00112 public: 00113 typedef TeleportRelativeRequest Request; 00114 typedef TeleportRelativeResponse Response; 00115 }; 00116 00117 } 00118 #endif
Generated on Wed Jul 13 2022 23:30:18 by
