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.
ModuleControlMsgs.h
00001 #ifndef _ROS_zetabot_main_ModuleControlMsgs_h 00002 #define _ROS_zetabot_main_ModuleControlMsgs_h 00003 00004 #include <stdint.h> 00005 #include <string.h> 00006 #include <stdlib.h> 00007 #include "ros/msg.h" 00008 00009 namespace zetabot_main 00010 { 00011 00012 class ModuleControlMsgs : public ros::Msg 00013 { 00014 public: 00015 bool module_power[11]; 00016 uint8_t led[4]; 00017 typedef uint16_t _pulifier_type; 00018 _pulifier_type pulifier; 00019 00020 ModuleControlMsgs(): 00021 module_power(), 00022 led(), 00023 pulifier(0) 00024 { 00025 } 00026 00027 virtual int serialize(unsigned char *outbuffer) const 00028 { 00029 int offset = 0; 00030 for( uint32_t i = 0; i < 11; i++){ 00031 union { 00032 bool real; 00033 uint8_t base; 00034 } u_module_poweri; 00035 u_module_poweri.real = this->module_power[i]; 00036 *(outbuffer + offset + 0) = (u_module_poweri.base >> (8 * 0)) & 0xFF; 00037 offset += sizeof(this->module_power[i]); 00038 } 00039 for( uint32_t i = 0; i < 4; i++){ 00040 *(outbuffer + offset + 0) = (this->led[i] >> (8 * 0)) & 0xFF; 00041 offset += sizeof(this->led[i]); 00042 } 00043 *(outbuffer + offset + 0) = (this->pulifier >> (8 * 0)) & 0xFF; 00044 *(outbuffer + offset + 1) = (this->pulifier >> (8 * 1)) & 0xFF; 00045 offset += sizeof(this->pulifier); 00046 return offset; 00047 } 00048 00049 virtual int deserialize(unsigned char *inbuffer) 00050 { 00051 int offset = 0; 00052 for( uint32_t i = 0; i < 11; i++){ 00053 union { 00054 bool real; 00055 uint8_t base; 00056 } u_module_poweri; 00057 u_module_poweri.base = 0; 00058 u_module_poweri.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); 00059 this->module_power[i] = u_module_poweri.real; 00060 offset += sizeof(this->module_power[i]); 00061 } 00062 for( uint32_t i = 0; i < 4; i++){ 00063 this->led[i] = ((uint8_t) (*(inbuffer + offset))); 00064 offset += sizeof(this->led[i]); 00065 } 00066 this->pulifier = ((uint16_t) (*(inbuffer + offset))); 00067 this->pulifier |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); 00068 offset += sizeof(this->pulifier); 00069 return offset; 00070 } 00071 00072 const char * getType(){ return "zetabot_main/ModuleControlMsgs"; }; 00073 const char * getMD5(){ return "a6e1b56a9c48d8ddceea7d34c90fe596"; }; 00074 00075 }; 00076 00077 } 00078 #endif 00079
Generated on Tue Jul 12 2022 18:31:24 by
1.7.2