test

Dependencies:   mbed Watchdog

Dependents:   STM32-MC_node

Committer:
ommpy
Date:
Tue Jul 07 15:19:06 2020 +0530
Revision:
2:b7fdc74e5c5d
new board files

Who changed what in which revision?

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