ros melodic library with custom message
Dependents: Robot_team1_QEI_Douglas Robot_team1
ros_lib/dynamic_reconfigure/Config.h@0:020db18a476d, 2019-10-30 (annotated)
- Committer:
- scarter1
- Date:
- Wed Oct 30 14:59:49 2019 +0000
- Revision:
- 0:020db18a476d
melodic library;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
scarter1 | 0:020db18a476d | 1 | #ifndef _ROS_dynamic_reconfigure_Config_h |
scarter1 | 0:020db18a476d | 2 | #define _ROS_dynamic_reconfigure_Config_h |
scarter1 | 0:020db18a476d | 3 | |
scarter1 | 0:020db18a476d | 4 | #include <stdint.h> |
scarter1 | 0:020db18a476d | 5 | #include <string.h> |
scarter1 | 0:020db18a476d | 6 | #include <stdlib.h> |
scarter1 | 0:020db18a476d | 7 | #include "ros/msg.h" |
scarter1 | 0:020db18a476d | 8 | #include "dynamic_reconfigure/BoolParameter.h" |
scarter1 | 0:020db18a476d | 9 | #include "dynamic_reconfigure/IntParameter.h" |
scarter1 | 0:020db18a476d | 10 | #include "dynamic_reconfigure/StrParameter.h" |
scarter1 | 0:020db18a476d | 11 | #include "dynamic_reconfigure/DoubleParameter.h" |
scarter1 | 0:020db18a476d | 12 | #include "dynamic_reconfigure/GroupState.h" |
scarter1 | 0:020db18a476d | 13 | |
scarter1 | 0:020db18a476d | 14 | namespace dynamic_reconfigure |
scarter1 | 0:020db18a476d | 15 | { |
scarter1 | 0:020db18a476d | 16 | |
scarter1 | 0:020db18a476d | 17 | class Config : public ros::Msg |
scarter1 | 0:020db18a476d | 18 | { |
scarter1 | 0:020db18a476d | 19 | public: |
scarter1 | 0:020db18a476d | 20 | uint32_t bools_length; |
scarter1 | 0:020db18a476d | 21 | typedef dynamic_reconfigure::BoolParameter _bools_type; |
scarter1 | 0:020db18a476d | 22 | _bools_type st_bools; |
scarter1 | 0:020db18a476d | 23 | _bools_type * bools; |
scarter1 | 0:020db18a476d | 24 | uint32_t ints_length; |
scarter1 | 0:020db18a476d | 25 | typedef dynamic_reconfigure::IntParameter _ints_type; |
scarter1 | 0:020db18a476d | 26 | _ints_type st_ints; |
scarter1 | 0:020db18a476d | 27 | _ints_type * ints; |
scarter1 | 0:020db18a476d | 28 | uint32_t strs_length; |
scarter1 | 0:020db18a476d | 29 | typedef dynamic_reconfigure::StrParameter _strs_type; |
scarter1 | 0:020db18a476d | 30 | _strs_type st_strs; |
scarter1 | 0:020db18a476d | 31 | _strs_type * strs; |
scarter1 | 0:020db18a476d | 32 | uint32_t doubles_length; |
scarter1 | 0:020db18a476d | 33 | typedef dynamic_reconfigure::DoubleParameter _doubles_type; |
scarter1 | 0:020db18a476d | 34 | _doubles_type st_doubles; |
scarter1 | 0:020db18a476d | 35 | _doubles_type * doubles; |
scarter1 | 0:020db18a476d | 36 | uint32_t groups_length; |
scarter1 | 0:020db18a476d | 37 | typedef dynamic_reconfigure::GroupState _groups_type; |
scarter1 | 0:020db18a476d | 38 | _groups_type st_groups; |
scarter1 | 0:020db18a476d | 39 | _groups_type * groups; |
scarter1 | 0:020db18a476d | 40 | |
scarter1 | 0:020db18a476d | 41 | Config(): |
scarter1 | 0:020db18a476d | 42 | bools_length(0), bools(NULL), |
scarter1 | 0:020db18a476d | 43 | ints_length(0), ints(NULL), |
scarter1 | 0:020db18a476d | 44 | strs_length(0), strs(NULL), |
scarter1 | 0:020db18a476d | 45 | doubles_length(0), doubles(NULL), |
scarter1 | 0:020db18a476d | 46 | groups_length(0), groups(NULL) |
scarter1 | 0:020db18a476d | 47 | { |
scarter1 | 0:020db18a476d | 48 | } |
scarter1 | 0:020db18a476d | 49 | |
scarter1 | 0:020db18a476d | 50 | virtual int serialize(unsigned char *outbuffer) const |
scarter1 | 0:020db18a476d | 51 | { |
scarter1 | 0:020db18a476d | 52 | int offset = 0; |
scarter1 | 0:020db18a476d | 53 | *(outbuffer + offset + 0) = (this->bools_length >> (8 * 0)) & 0xFF; |
scarter1 | 0:020db18a476d | 54 | *(outbuffer + offset + 1) = (this->bools_length >> (8 * 1)) & 0xFF; |
scarter1 | 0:020db18a476d | 55 | *(outbuffer + offset + 2) = (this->bools_length >> (8 * 2)) & 0xFF; |
scarter1 | 0:020db18a476d | 56 | *(outbuffer + offset + 3) = (this->bools_length >> (8 * 3)) & 0xFF; |
scarter1 | 0:020db18a476d | 57 | offset += sizeof(this->bools_length); |
scarter1 | 0:020db18a476d | 58 | for( uint32_t i = 0; i < bools_length; i++){ |
scarter1 | 0:020db18a476d | 59 | offset += this->bools[i].serialize(outbuffer + offset); |
scarter1 | 0:020db18a476d | 60 | } |
scarter1 | 0:020db18a476d | 61 | *(outbuffer + offset + 0) = (this->ints_length >> (8 * 0)) & 0xFF; |
scarter1 | 0:020db18a476d | 62 | *(outbuffer + offset + 1) = (this->ints_length >> (8 * 1)) & 0xFF; |
scarter1 | 0:020db18a476d | 63 | *(outbuffer + offset + 2) = (this->ints_length >> (8 * 2)) & 0xFF; |
scarter1 | 0:020db18a476d | 64 | *(outbuffer + offset + 3) = (this->ints_length >> (8 * 3)) & 0xFF; |
scarter1 | 0:020db18a476d | 65 | offset += sizeof(this->ints_length); |
scarter1 | 0:020db18a476d | 66 | for( uint32_t i = 0; i < ints_length; i++){ |
scarter1 | 0:020db18a476d | 67 | offset += this->ints[i].serialize(outbuffer + offset); |
scarter1 | 0:020db18a476d | 68 | } |
scarter1 | 0:020db18a476d | 69 | *(outbuffer + offset + 0) = (this->strs_length >> (8 * 0)) & 0xFF; |
scarter1 | 0:020db18a476d | 70 | *(outbuffer + offset + 1) = (this->strs_length >> (8 * 1)) & 0xFF; |
scarter1 | 0:020db18a476d | 71 | *(outbuffer + offset + 2) = (this->strs_length >> (8 * 2)) & 0xFF; |
scarter1 | 0:020db18a476d | 72 | *(outbuffer + offset + 3) = (this->strs_length >> (8 * 3)) & 0xFF; |
scarter1 | 0:020db18a476d | 73 | offset += sizeof(this->strs_length); |
scarter1 | 0:020db18a476d | 74 | for( uint32_t i = 0; i < strs_length; i++){ |
scarter1 | 0:020db18a476d | 75 | offset += this->strs[i].serialize(outbuffer + offset); |
scarter1 | 0:020db18a476d | 76 | } |
scarter1 | 0:020db18a476d | 77 | *(outbuffer + offset + 0) = (this->doubles_length >> (8 * 0)) & 0xFF; |
scarter1 | 0:020db18a476d | 78 | *(outbuffer + offset + 1) = (this->doubles_length >> (8 * 1)) & 0xFF; |
scarter1 | 0:020db18a476d | 79 | *(outbuffer + offset + 2) = (this->doubles_length >> (8 * 2)) & 0xFF; |
scarter1 | 0:020db18a476d | 80 | *(outbuffer + offset + 3) = (this->doubles_length >> (8 * 3)) & 0xFF; |
scarter1 | 0:020db18a476d | 81 | offset += sizeof(this->doubles_length); |
scarter1 | 0:020db18a476d | 82 | for( uint32_t i = 0; i < doubles_length; i++){ |
scarter1 | 0:020db18a476d | 83 | offset += this->doubles[i].serialize(outbuffer + offset); |
scarter1 | 0:020db18a476d | 84 | } |
scarter1 | 0:020db18a476d | 85 | *(outbuffer + offset + 0) = (this->groups_length >> (8 * 0)) & 0xFF; |
scarter1 | 0:020db18a476d | 86 | *(outbuffer + offset + 1) = (this->groups_length >> (8 * 1)) & 0xFF; |
scarter1 | 0:020db18a476d | 87 | *(outbuffer + offset + 2) = (this->groups_length >> (8 * 2)) & 0xFF; |
scarter1 | 0:020db18a476d | 88 | *(outbuffer + offset + 3) = (this->groups_length >> (8 * 3)) & 0xFF; |
scarter1 | 0:020db18a476d | 89 | offset += sizeof(this->groups_length); |
scarter1 | 0:020db18a476d | 90 | for( uint32_t i = 0; i < groups_length; i++){ |
scarter1 | 0:020db18a476d | 91 | offset += this->groups[i].serialize(outbuffer + offset); |
scarter1 | 0:020db18a476d | 92 | } |
scarter1 | 0:020db18a476d | 93 | return offset; |
scarter1 | 0:020db18a476d | 94 | } |
scarter1 | 0:020db18a476d | 95 | |
scarter1 | 0:020db18a476d | 96 | virtual int deserialize(unsigned char *inbuffer) |
scarter1 | 0:020db18a476d | 97 | { |
scarter1 | 0:020db18a476d | 98 | int offset = 0; |
scarter1 | 0:020db18a476d | 99 | uint32_t bools_lengthT = ((uint32_t) (*(inbuffer + offset))); |
scarter1 | 0:020db18a476d | 100 | bools_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
scarter1 | 0:020db18a476d | 101 | bools_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
scarter1 | 0:020db18a476d | 102 | bools_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
scarter1 | 0:020db18a476d | 103 | offset += sizeof(this->bools_length); |
scarter1 | 0:020db18a476d | 104 | if(bools_lengthT > bools_length) |
scarter1 | 0:020db18a476d | 105 | this->bools = (dynamic_reconfigure::BoolParameter*)realloc(this->bools, bools_lengthT * sizeof(dynamic_reconfigure::BoolParameter)); |
scarter1 | 0:020db18a476d | 106 | bools_length = bools_lengthT; |
scarter1 | 0:020db18a476d | 107 | for( uint32_t i = 0; i < bools_length; i++){ |
scarter1 | 0:020db18a476d | 108 | offset += this->st_bools.deserialize(inbuffer + offset); |
scarter1 | 0:020db18a476d | 109 | memcpy( &(this->bools[i]), &(this->st_bools), sizeof(dynamic_reconfigure::BoolParameter)); |
scarter1 | 0:020db18a476d | 110 | } |
scarter1 | 0:020db18a476d | 111 | uint32_t ints_lengthT = ((uint32_t) (*(inbuffer + offset))); |
scarter1 | 0:020db18a476d | 112 | ints_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
scarter1 | 0:020db18a476d | 113 | ints_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
scarter1 | 0:020db18a476d | 114 | ints_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
scarter1 | 0:020db18a476d | 115 | offset += sizeof(this->ints_length); |
scarter1 | 0:020db18a476d | 116 | if(ints_lengthT > ints_length) |
scarter1 | 0:020db18a476d | 117 | this->ints = (dynamic_reconfigure::IntParameter*)realloc(this->ints, ints_lengthT * sizeof(dynamic_reconfigure::IntParameter)); |
scarter1 | 0:020db18a476d | 118 | ints_length = ints_lengthT; |
scarter1 | 0:020db18a476d | 119 | for( uint32_t i = 0; i < ints_length; i++){ |
scarter1 | 0:020db18a476d | 120 | offset += this->st_ints.deserialize(inbuffer + offset); |
scarter1 | 0:020db18a476d | 121 | memcpy( &(this->ints[i]), &(this->st_ints), sizeof(dynamic_reconfigure::IntParameter)); |
scarter1 | 0:020db18a476d | 122 | } |
scarter1 | 0:020db18a476d | 123 | uint32_t strs_lengthT = ((uint32_t) (*(inbuffer + offset))); |
scarter1 | 0:020db18a476d | 124 | strs_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
scarter1 | 0:020db18a476d | 125 | strs_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
scarter1 | 0:020db18a476d | 126 | strs_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
scarter1 | 0:020db18a476d | 127 | offset += sizeof(this->strs_length); |
scarter1 | 0:020db18a476d | 128 | if(strs_lengthT > strs_length) |
scarter1 | 0:020db18a476d | 129 | this->strs = (dynamic_reconfigure::StrParameter*)realloc(this->strs, strs_lengthT * sizeof(dynamic_reconfigure::StrParameter)); |
scarter1 | 0:020db18a476d | 130 | strs_length = strs_lengthT; |
scarter1 | 0:020db18a476d | 131 | for( uint32_t i = 0; i < strs_length; i++){ |
scarter1 | 0:020db18a476d | 132 | offset += this->st_strs.deserialize(inbuffer + offset); |
scarter1 | 0:020db18a476d | 133 | memcpy( &(this->strs[i]), &(this->st_strs), sizeof(dynamic_reconfigure::StrParameter)); |
scarter1 | 0:020db18a476d | 134 | } |
scarter1 | 0:020db18a476d | 135 | uint32_t doubles_lengthT = ((uint32_t) (*(inbuffer + offset))); |
scarter1 | 0:020db18a476d | 136 | doubles_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
scarter1 | 0:020db18a476d | 137 | doubles_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
scarter1 | 0:020db18a476d | 138 | doubles_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
scarter1 | 0:020db18a476d | 139 | offset += sizeof(this->doubles_length); |
scarter1 | 0:020db18a476d | 140 | if(doubles_lengthT > doubles_length) |
scarter1 | 0:020db18a476d | 141 | this->doubles = (dynamic_reconfigure::DoubleParameter*)realloc(this->doubles, doubles_lengthT * sizeof(dynamic_reconfigure::DoubleParameter)); |
scarter1 | 0:020db18a476d | 142 | doubles_length = doubles_lengthT; |
scarter1 | 0:020db18a476d | 143 | for( uint32_t i = 0; i < doubles_length; i++){ |
scarter1 | 0:020db18a476d | 144 | offset += this->st_doubles.deserialize(inbuffer + offset); |
scarter1 | 0:020db18a476d | 145 | memcpy( &(this->doubles[i]), &(this->st_doubles), sizeof(dynamic_reconfigure::DoubleParameter)); |
scarter1 | 0:020db18a476d | 146 | } |
scarter1 | 0:020db18a476d | 147 | uint32_t groups_lengthT = ((uint32_t) (*(inbuffer + offset))); |
scarter1 | 0:020db18a476d | 148 | groups_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
scarter1 | 0:020db18a476d | 149 | groups_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
scarter1 | 0:020db18a476d | 150 | groups_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
scarter1 | 0:020db18a476d | 151 | offset += sizeof(this->groups_length); |
scarter1 | 0:020db18a476d | 152 | if(groups_lengthT > groups_length) |
scarter1 | 0:020db18a476d | 153 | this->groups = (dynamic_reconfigure::GroupState*)realloc(this->groups, groups_lengthT * sizeof(dynamic_reconfigure::GroupState)); |
scarter1 | 0:020db18a476d | 154 | groups_length = groups_lengthT; |
scarter1 | 0:020db18a476d | 155 | for( uint32_t i = 0; i < groups_length; i++){ |
scarter1 | 0:020db18a476d | 156 | offset += this->st_groups.deserialize(inbuffer + offset); |
scarter1 | 0:020db18a476d | 157 | memcpy( &(this->groups[i]), &(this->st_groups), sizeof(dynamic_reconfigure::GroupState)); |
scarter1 | 0:020db18a476d | 158 | } |
scarter1 | 0:020db18a476d | 159 | return offset; |
scarter1 | 0:020db18a476d | 160 | } |
scarter1 | 0:020db18a476d | 161 | |
scarter1 | 0:020db18a476d | 162 | const char * getType(){ return "dynamic_reconfigure/Config"; }; |
scarter1 | 0:020db18a476d | 163 | const char * getMD5(){ return "958f16a05573709014982821e6822580"; }; |
scarter1 | 0:020db18a476d | 164 | |
scarter1 | 0:020db18a476d | 165 | }; |
scarter1 | 0:020db18a476d | 166 | |
scarter1 | 0:020db18a476d | 167 | } |
scarter1 | 0:020db18a476d | 168 | #endif |