It has only one change from original one. I added robotfeedback message on it.
Dependents: RobotFeedback mobileRobotITU
Fork of ros_lib_indigo by
actionlib/TestRequestGoal.h@0:fd24f7ca9688, 2016-03-31 (annotated)
- Committer:
- garyservin
- Date:
- Thu Mar 31 14:22:59 2016 +0000
- Revision:
- 0:fd24f7ca9688
Initial commit, generated based on a clean indigo-desktop-full
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
garyservin | 0:fd24f7ca9688 | 1 | #ifndef _ROS_actionlib_TestRequestGoal_h |
garyservin | 0:fd24f7ca9688 | 2 | #define _ROS_actionlib_TestRequestGoal_h |
garyservin | 0:fd24f7ca9688 | 3 | |
garyservin | 0:fd24f7ca9688 | 4 | #include <stdint.h> |
garyservin | 0:fd24f7ca9688 | 5 | #include <string.h> |
garyservin | 0:fd24f7ca9688 | 6 | #include <stdlib.h> |
garyservin | 0:fd24f7ca9688 | 7 | #include "ros/msg.h" |
garyservin | 0:fd24f7ca9688 | 8 | #include "ros/duration.h" |
garyservin | 0:fd24f7ca9688 | 9 | |
garyservin | 0:fd24f7ca9688 | 10 | namespace actionlib |
garyservin | 0:fd24f7ca9688 | 11 | { |
garyservin | 0:fd24f7ca9688 | 12 | |
garyservin | 0:fd24f7ca9688 | 13 | class TestRequestGoal : public ros::Msg |
garyservin | 0:fd24f7ca9688 | 14 | { |
garyservin | 0:fd24f7ca9688 | 15 | public: |
garyservin | 0:fd24f7ca9688 | 16 | int32_t terminate_status; |
garyservin | 0:fd24f7ca9688 | 17 | bool ignore_cancel; |
garyservin | 0:fd24f7ca9688 | 18 | const char* result_text; |
garyservin | 0:fd24f7ca9688 | 19 | int32_t the_result; |
garyservin | 0:fd24f7ca9688 | 20 | bool is_simple_client; |
garyservin | 0:fd24f7ca9688 | 21 | ros::Duration delay_accept; |
garyservin | 0:fd24f7ca9688 | 22 | ros::Duration delay_terminate; |
garyservin | 0:fd24f7ca9688 | 23 | ros::Duration pause_status; |
garyservin | 0:fd24f7ca9688 | 24 | enum { TERMINATE_SUCCESS = 0 }; |
garyservin | 0:fd24f7ca9688 | 25 | enum { TERMINATE_ABORTED = 1 }; |
garyservin | 0:fd24f7ca9688 | 26 | enum { TERMINATE_REJECTED = 2 }; |
garyservin | 0:fd24f7ca9688 | 27 | enum { TERMINATE_LOSE = 3 }; |
garyservin | 0:fd24f7ca9688 | 28 | enum { TERMINATE_DROP = 4 }; |
garyservin | 0:fd24f7ca9688 | 29 | enum { TERMINATE_EXCEPTION = 5 }; |
garyservin | 0:fd24f7ca9688 | 30 | |
garyservin | 0:fd24f7ca9688 | 31 | TestRequestGoal(): |
garyservin | 0:fd24f7ca9688 | 32 | terminate_status(0), |
garyservin | 0:fd24f7ca9688 | 33 | ignore_cancel(0), |
garyservin | 0:fd24f7ca9688 | 34 | result_text(""), |
garyservin | 0:fd24f7ca9688 | 35 | the_result(0), |
garyservin | 0:fd24f7ca9688 | 36 | is_simple_client(0), |
garyservin | 0:fd24f7ca9688 | 37 | delay_accept(), |
garyservin | 0:fd24f7ca9688 | 38 | delay_terminate(), |
garyservin | 0:fd24f7ca9688 | 39 | pause_status() |
garyservin | 0:fd24f7ca9688 | 40 | { |
garyservin | 0:fd24f7ca9688 | 41 | } |
garyservin | 0:fd24f7ca9688 | 42 | |
garyservin | 0:fd24f7ca9688 | 43 | virtual int serialize(unsigned char *outbuffer) const |
garyservin | 0:fd24f7ca9688 | 44 | { |
garyservin | 0:fd24f7ca9688 | 45 | int offset = 0; |
garyservin | 0:fd24f7ca9688 | 46 | union { |
garyservin | 0:fd24f7ca9688 | 47 | int32_t real; |
garyservin | 0:fd24f7ca9688 | 48 | uint32_t base; |
garyservin | 0:fd24f7ca9688 | 49 | } u_terminate_status; |
garyservin | 0:fd24f7ca9688 | 50 | u_terminate_status.real = this->terminate_status; |
garyservin | 0:fd24f7ca9688 | 51 | *(outbuffer + offset + 0) = (u_terminate_status.base >> (8 * 0)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 52 | *(outbuffer + offset + 1) = (u_terminate_status.base >> (8 * 1)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 53 | *(outbuffer + offset + 2) = (u_terminate_status.base >> (8 * 2)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 54 | *(outbuffer + offset + 3) = (u_terminate_status.base >> (8 * 3)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 55 | offset += sizeof(this->terminate_status); |
garyservin | 0:fd24f7ca9688 | 56 | union { |
garyservin | 0:fd24f7ca9688 | 57 | bool real; |
garyservin | 0:fd24f7ca9688 | 58 | uint8_t base; |
garyservin | 0:fd24f7ca9688 | 59 | } u_ignore_cancel; |
garyservin | 0:fd24f7ca9688 | 60 | u_ignore_cancel.real = this->ignore_cancel; |
garyservin | 0:fd24f7ca9688 | 61 | *(outbuffer + offset + 0) = (u_ignore_cancel.base >> (8 * 0)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 62 | offset += sizeof(this->ignore_cancel); |
garyservin | 0:fd24f7ca9688 | 63 | uint32_t length_result_text = strlen(this->result_text); |
garyservin | 0:fd24f7ca9688 | 64 | memcpy(outbuffer + offset, &length_result_text, sizeof(uint32_t)); |
garyservin | 0:fd24f7ca9688 | 65 | offset += 4; |
garyservin | 0:fd24f7ca9688 | 66 | memcpy(outbuffer + offset, this->result_text, length_result_text); |
garyservin | 0:fd24f7ca9688 | 67 | offset += length_result_text; |
garyservin | 0:fd24f7ca9688 | 68 | union { |
garyservin | 0:fd24f7ca9688 | 69 | int32_t real; |
garyservin | 0:fd24f7ca9688 | 70 | uint32_t base; |
garyservin | 0:fd24f7ca9688 | 71 | } u_the_result; |
garyservin | 0:fd24f7ca9688 | 72 | u_the_result.real = this->the_result; |
garyservin | 0:fd24f7ca9688 | 73 | *(outbuffer + offset + 0) = (u_the_result.base >> (8 * 0)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 74 | *(outbuffer + offset + 1) = (u_the_result.base >> (8 * 1)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 75 | *(outbuffer + offset + 2) = (u_the_result.base >> (8 * 2)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 76 | *(outbuffer + offset + 3) = (u_the_result.base >> (8 * 3)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 77 | offset += sizeof(this->the_result); |
garyservin | 0:fd24f7ca9688 | 78 | union { |
garyservin | 0:fd24f7ca9688 | 79 | bool real; |
garyservin | 0:fd24f7ca9688 | 80 | uint8_t base; |
garyservin | 0:fd24f7ca9688 | 81 | } u_is_simple_client; |
garyservin | 0:fd24f7ca9688 | 82 | u_is_simple_client.real = this->is_simple_client; |
garyservin | 0:fd24f7ca9688 | 83 | *(outbuffer + offset + 0) = (u_is_simple_client.base >> (8 * 0)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 84 | offset += sizeof(this->is_simple_client); |
garyservin | 0:fd24f7ca9688 | 85 | *(outbuffer + offset + 0) = (this->delay_accept.sec >> (8 * 0)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 86 | *(outbuffer + offset + 1) = (this->delay_accept.sec >> (8 * 1)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 87 | *(outbuffer + offset + 2) = (this->delay_accept.sec >> (8 * 2)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 88 | *(outbuffer + offset + 3) = (this->delay_accept.sec >> (8 * 3)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 89 | offset += sizeof(this->delay_accept.sec); |
garyservin | 0:fd24f7ca9688 | 90 | *(outbuffer + offset + 0) = (this->delay_accept.nsec >> (8 * 0)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 91 | *(outbuffer + offset + 1) = (this->delay_accept.nsec >> (8 * 1)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 92 | *(outbuffer + offset + 2) = (this->delay_accept.nsec >> (8 * 2)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 93 | *(outbuffer + offset + 3) = (this->delay_accept.nsec >> (8 * 3)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 94 | offset += sizeof(this->delay_accept.nsec); |
garyservin | 0:fd24f7ca9688 | 95 | *(outbuffer + offset + 0) = (this->delay_terminate.sec >> (8 * 0)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 96 | *(outbuffer + offset + 1) = (this->delay_terminate.sec >> (8 * 1)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 97 | *(outbuffer + offset + 2) = (this->delay_terminate.sec >> (8 * 2)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 98 | *(outbuffer + offset + 3) = (this->delay_terminate.sec >> (8 * 3)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 99 | offset += sizeof(this->delay_terminate.sec); |
garyservin | 0:fd24f7ca9688 | 100 | *(outbuffer + offset + 0) = (this->delay_terminate.nsec >> (8 * 0)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 101 | *(outbuffer + offset + 1) = (this->delay_terminate.nsec >> (8 * 1)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 102 | *(outbuffer + offset + 2) = (this->delay_terminate.nsec >> (8 * 2)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 103 | *(outbuffer + offset + 3) = (this->delay_terminate.nsec >> (8 * 3)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 104 | offset += sizeof(this->delay_terminate.nsec); |
garyservin | 0:fd24f7ca9688 | 105 | *(outbuffer + offset + 0) = (this->pause_status.sec >> (8 * 0)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 106 | *(outbuffer + offset + 1) = (this->pause_status.sec >> (8 * 1)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 107 | *(outbuffer + offset + 2) = (this->pause_status.sec >> (8 * 2)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 108 | *(outbuffer + offset + 3) = (this->pause_status.sec >> (8 * 3)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 109 | offset += sizeof(this->pause_status.sec); |
garyservin | 0:fd24f7ca9688 | 110 | *(outbuffer + offset + 0) = (this->pause_status.nsec >> (8 * 0)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 111 | *(outbuffer + offset + 1) = (this->pause_status.nsec >> (8 * 1)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 112 | *(outbuffer + offset + 2) = (this->pause_status.nsec >> (8 * 2)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 113 | *(outbuffer + offset + 3) = (this->pause_status.nsec >> (8 * 3)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 114 | offset += sizeof(this->pause_status.nsec); |
garyservin | 0:fd24f7ca9688 | 115 | return offset; |
garyservin | 0:fd24f7ca9688 | 116 | } |
garyservin | 0:fd24f7ca9688 | 117 | |
garyservin | 0:fd24f7ca9688 | 118 | virtual int deserialize(unsigned char *inbuffer) |
garyservin | 0:fd24f7ca9688 | 119 | { |
garyservin | 0:fd24f7ca9688 | 120 | int offset = 0; |
garyservin | 0:fd24f7ca9688 | 121 | union { |
garyservin | 0:fd24f7ca9688 | 122 | int32_t real; |
garyservin | 0:fd24f7ca9688 | 123 | uint32_t base; |
garyservin | 0:fd24f7ca9688 | 124 | } u_terminate_status; |
garyservin | 0:fd24f7ca9688 | 125 | u_terminate_status.base = 0; |
garyservin | 0:fd24f7ca9688 | 126 | u_terminate_status.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); |
garyservin | 0:fd24f7ca9688 | 127 | u_terminate_status.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
garyservin | 0:fd24f7ca9688 | 128 | u_terminate_status.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
garyservin | 0:fd24f7ca9688 | 129 | u_terminate_status.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
garyservin | 0:fd24f7ca9688 | 130 | this->terminate_status = u_terminate_status.real; |
garyservin | 0:fd24f7ca9688 | 131 | offset += sizeof(this->terminate_status); |
garyservin | 0:fd24f7ca9688 | 132 | union { |
garyservin | 0:fd24f7ca9688 | 133 | bool real; |
garyservin | 0:fd24f7ca9688 | 134 | uint8_t base; |
garyservin | 0:fd24f7ca9688 | 135 | } u_ignore_cancel; |
garyservin | 0:fd24f7ca9688 | 136 | u_ignore_cancel.base = 0; |
garyservin | 0:fd24f7ca9688 | 137 | u_ignore_cancel.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); |
garyservin | 0:fd24f7ca9688 | 138 | this->ignore_cancel = u_ignore_cancel.real; |
garyservin | 0:fd24f7ca9688 | 139 | offset += sizeof(this->ignore_cancel); |
garyservin | 0:fd24f7ca9688 | 140 | uint32_t length_result_text; |
garyservin | 0:fd24f7ca9688 | 141 | memcpy(&length_result_text, (inbuffer + offset), sizeof(uint32_t)); |
garyservin | 0:fd24f7ca9688 | 142 | offset += 4; |
garyservin | 0:fd24f7ca9688 | 143 | for(unsigned int k= offset; k< offset+length_result_text; ++k){ |
garyservin | 0:fd24f7ca9688 | 144 | inbuffer[k-1]=inbuffer[k]; |
garyservin | 0:fd24f7ca9688 | 145 | } |
garyservin | 0:fd24f7ca9688 | 146 | inbuffer[offset+length_result_text-1]=0; |
garyservin | 0:fd24f7ca9688 | 147 | this->result_text = (char *)(inbuffer + offset-1); |
garyservin | 0:fd24f7ca9688 | 148 | offset += length_result_text; |
garyservin | 0:fd24f7ca9688 | 149 | union { |
garyservin | 0:fd24f7ca9688 | 150 | int32_t real; |
garyservin | 0:fd24f7ca9688 | 151 | uint32_t base; |
garyservin | 0:fd24f7ca9688 | 152 | } u_the_result; |
garyservin | 0:fd24f7ca9688 | 153 | u_the_result.base = 0; |
garyservin | 0:fd24f7ca9688 | 154 | u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); |
garyservin | 0:fd24f7ca9688 | 155 | u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
garyservin | 0:fd24f7ca9688 | 156 | u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
garyservin | 0:fd24f7ca9688 | 157 | u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
garyservin | 0:fd24f7ca9688 | 158 | this->the_result = u_the_result.real; |
garyservin | 0:fd24f7ca9688 | 159 | offset += sizeof(this->the_result); |
garyservin | 0:fd24f7ca9688 | 160 | union { |
garyservin | 0:fd24f7ca9688 | 161 | bool real; |
garyservin | 0:fd24f7ca9688 | 162 | uint8_t base; |
garyservin | 0:fd24f7ca9688 | 163 | } u_is_simple_client; |
garyservin | 0:fd24f7ca9688 | 164 | u_is_simple_client.base = 0; |
garyservin | 0:fd24f7ca9688 | 165 | u_is_simple_client.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); |
garyservin | 0:fd24f7ca9688 | 166 | this->is_simple_client = u_is_simple_client.real; |
garyservin | 0:fd24f7ca9688 | 167 | offset += sizeof(this->is_simple_client); |
garyservin | 0:fd24f7ca9688 | 168 | this->delay_accept.sec = ((uint32_t) (*(inbuffer + offset))); |
garyservin | 0:fd24f7ca9688 | 169 | this->delay_accept.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
garyservin | 0:fd24f7ca9688 | 170 | this->delay_accept.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
garyservin | 0:fd24f7ca9688 | 171 | this->delay_accept.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
garyservin | 0:fd24f7ca9688 | 172 | offset += sizeof(this->delay_accept.sec); |
garyservin | 0:fd24f7ca9688 | 173 | this->delay_accept.nsec = ((uint32_t) (*(inbuffer + offset))); |
garyservin | 0:fd24f7ca9688 | 174 | this->delay_accept.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
garyservin | 0:fd24f7ca9688 | 175 | this->delay_accept.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
garyservin | 0:fd24f7ca9688 | 176 | this->delay_accept.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
garyservin | 0:fd24f7ca9688 | 177 | offset += sizeof(this->delay_accept.nsec); |
garyservin | 0:fd24f7ca9688 | 178 | this->delay_terminate.sec = ((uint32_t) (*(inbuffer + offset))); |
garyservin | 0:fd24f7ca9688 | 179 | this->delay_terminate.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
garyservin | 0:fd24f7ca9688 | 180 | this->delay_terminate.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
garyservin | 0:fd24f7ca9688 | 181 | this->delay_terminate.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
garyservin | 0:fd24f7ca9688 | 182 | offset += sizeof(this->delay_terminate.sec); |
garyservin | 0:fd24f7ca9688 | 183 | this->delay_terminate.nsec = ((uint32_t) (*(inbuffer + offset))); |
garyservin | 0:fd24f7ca9688 | 184 | this->delay_terminate.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
garyservin | 0:fd24f7ca9688 | 185 | this->delay_terminate.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
garyservin | 0:fd24f7ca9688 | 186 | this->delay_terminate.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
garyservin | 0:fd24f7ca9688 | 187 | offset += sizeof(this->delay_terminate.nsec); |
garyservin | 0:fd24f7ca9688 | 188 | this->pause_status.sec = ((uint32_t) (*(inbuffer + offset))); |
garyservin | 0:fd24f7ca9688 | 189 | this->pause_status.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
garyservin | 0:fd24f7ca9688 | 190 | this->pause_status.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
garyservin | 0:fd24f7ca9688 | 191 | this->pause_status.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
garyservin | 0:fd24f7ca9688 | 192 | offset += sizeof(this->pause_status.sec); |
garyservin | 0:fd24f7ca9688 | 193 | this->pause_status.nsec = ((uint32_t) (*(inbuffer + offset))); |
garyservin | 0:fd24f7ca9688 | 194 | this->pause_status.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
garyservin | 0:fd24f7ca9688 | 195 | this->pause_status.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
garyservin | 0:fd24f7ca9688 | 196 | this->pause_status.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
garyservin | 0:fd24f7ca9688 | 197 | offset += sizeof(this->pause_status.nsec); |
garyservin | 0:fd24f7ca9688 | 198 | return offset; |
garyservin | 0:fd24f7ca9688 | 199 | } |
garyservin | 0:fd24f7ca9688 | 200 | |
garyservin | 0:fd24f7ca9688 | 201 | const char * getType(){ return "actionlib/TestRequestGoal"; }; |
garyservin | 0:fd24f7ca9688 | 202 | const char * getMD5(){ return "db5d00ba98302d6c6dd3737e9a03ceea"; }; |
garyservin | 0:fd24f7ca9688 | 203 | |
garyservin | 0:fd24f7ca9688 | 204 | }; |
garyservin | 0:fd24f7ca9688 | 205 | |
garyservin | 0:fd24f7ca9688 | 206 | } |
garyservin | 0:fd24f7ca9688 | 207 | #endif |