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
PegInHoleCmd.h
00001 #ifndef _ROS_catchrobo_msgs_PegInHoleCmd_h 00002 #define _ROS_catchrobo_msgs_PegInHoleCmd_h 00003 00004 #include <stdint.h> 00005 #include <string.h> 00006 #include <stdlib.h> 00007 #include "ros/msg.h" 00008 00009 namespace catchrobo_msgs 00010 { 00011 00012 class PegInHoleCmd : public ros::Msg 00013 { 00014 public: 00015 typedef bool _run_type; 00016 _run_type run; 00017 typedef float _center_x_type; 00018 _center_x_type center_x; 00019 typedef float _center_y_type; 00020 _center_y_type center_y; 00021 00022 PegInHoleCmd(): 00023 run(0), 00024 center_x(0), 00025 center_y(0) 00026 { 00027 } 00028 00029 virtual int serialize(unsigned char *outbuffer) const 00030 { 00031 int offset = 0; 00032 union { 00033 bool real; 00034 uint8_t base; 00035 } u_run; 00036 u_run.real = this->run; 00037 *(outbuffer + offset + 0) = (u_run.base >> (8 * 0)) & 0xFF; 00038 offset += sizeof(this->run); 00039 union { 00040 float real; 00041 uint32_t base; 00042 } u_center_x; 00043 u_center_x.real = this->center_x; 00044 *(outbuffer + offset + 0) = (u_center_x.base >> (8 * 0)) & 0xFF; 00045 *(outbuffer + offset + 1) = (u_center_x.base >> (8 * 1)) & 0xFF; 00046 *(outbuffer + offset + 2) = (u_center_x.base >> (8 * 2)) & 0xFF; 00047 *(outbuffer + offset + 3) = (u_center_x.base >> (8 * 3)) & 0xFF; 00048 offset += sizeof(this->center_x); 00049 union { 00050 float real; 00051 uint32_t base; 00052 } u_center_y; 00053 u_center_y.real = this->center_y; 00054 *(outbuffer + offset + 0) = (u_center_y.base >> (8 * 0)) & 0xFF; 00055 *(outbuffer + offset + 1) = (u_center_y.base >> (8 * 1)) & 0xFF; 00056 *(outbuffer + offset + 2) = (u_center_y.base >> (8 * 2)) & 0xFF; 00057 *(outbuffer + offset + 3) = (u_center_y.base >> (8 * 3)) & 0xFF; 00058 offset += sizeof(this->center_y); 00059 return offset; 00060 } 00061 00062 virtual int deserialize(unsigned char *inbuffer) 00063 { 00064 int offset = 0; 00065 union { 00066 bool real; 00067 uint8_t base; 00068 } u_run; 00069 u_run.base = 0; 00070 u_run.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); 00071 this->run = u_run.real; 00072 offset += sizeof(this->run); 00073 union { 00074 float real; 00075 uint32_t base; 00076 } u_center_x; 00077 u_center_x.base = 0; 00078 u_center_x.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); 00079 u_center_x.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); 00080 u_center_x.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); 00081 u_center_x.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); 00082 this->center_x = u_center_x.real; 00083 offset += sizeof(this->center_x); 00084 union { 00085 float real; 00086 uint32_t base; 00087 } u_center_y; 00088 u_center_y.base = 0; 00089 u_center_y.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); 00090 u_center_y.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); 00091 u_center_y.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); 00092 u_center_y.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); 00093 this->center_y = u_center_y.real; 00094 offset += sizeof(this->center_y); 00095 return offset; 00096 } 00097 00098 virtual const char * getType(){ return "catchrobo_msgs/PegInHoleCmd"; }; 00099 virtual const char * getMD5(){ return "0dd1ede2ea0ac9ce8042ed6bf7bedb0b"; }; 00100 00101 }; 00102 00103 } 00104 #endif
Generated on Mon Sep 26 2022 13:47:02 by
