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.
Vibration.h
00001 #ifndef _ROS_mavros_msgs_Vibration_h 00002 #define _ROS_mavros_msgs_Vibration_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 "geometry_msgs/Vector3.h" 00010 00011 namespace mavros_msgs 00012 { 00013 00014 class Vibration : public ros::Msg 00015 { 00016 public: 00017 typedef std_msgs::Header _header_type; 00018 _header_type header; 00019 typedef geometry_msgs::Vector3 _vibration_type; 00020 _vibration_type vibration; 00021 float clipping[3]; 00022 00023 Vibration(): 00024 header(), 00025 vibration(), 00026 clipping() 00027 { 00028 } 00029 00030 virtual int serialize(unsigned char *outbuffer) const 00031 { 00032 int offset = 0; 00033 offset += this->header.serialize(outbuffer + offset); 00034 offset += this->vibration.serialize(outbuffer + offset); 00035 for( uint32_t i = 0; i < 3; i++){ 00036 union { 00037 float real; 00038 uint32_t base; 00039 } u_clippingi; 00040 u_clippingi.real = this->clipping[i]; 00041 *(outbuffer + offset + 0) = (u_clippingi.base >> (8 * 0)) & 0xFF; 00042 *(outbuffer + offset + 1) = (u_clippingi.base >> (8 * 1)) & 0xFF; 00043 *(outbuffer + offset + 2) = (u_clippingi.base >> (8 * 2)) & 0xFF; 00044 *(outbuffer + offset + 3) = (u_clippingi.base >> (8 * 3)) & 0xFF; 00045 offset += sizeof(this->clipping[i]); 00046 } 00047 return offset; 00048 } 00049 00050 virtual int deserialize(unsigned char *inbuffer) 00051 { 00052 int offset = 0; 00053 offset += this->header.deserialize(inbuffer + offset); 00054 offset += this->vibration.deserialize(inbuffer + offset); 00055 for( uint32_t i = 0; i < 3; i++){ 00056 union { 00057 float real; 00058 uint32_t base; 00059 } u_clippingi; 00060 u_clippingi.base = 0; 00061 u_clippingi.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); 00062 u_clippingi.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); 00063 u_clippingi.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); 00064 u_clippingi.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); 00065 this->clipping[i] = u_clippingi.real; 00066 offset += sizeof(this->clipping[i]); 00067 } 00068 return offset; 00069 } 00070 00071 const char * getType(){ return "mavros_msgs/Vibration"; }; 00072 const char * getMD5(){ return "eb92bf9b7aa735dfcd06b3ede5027d02"; }; 00073 00074 }; 00075 00076 } 00077 #endif
Generated on Thu Jul 14 2022 10:09:24 by
