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.
ros_lib/mavros_msgs/CommandVtolTransition.h@0:8f3710bfd298, 2020-09-02 (annotated)
- Committer:
- irfantitok
- Date:
- Wed Sep 02 13:51:31 2020 +0000
- Revision:
- 0:8f3710bfd298
Resolved round not found
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| irfantitok | 0:8f3710bfd298 | 1 | #ifndef _ROS_SERVICE_CommandVtolTransition_h |
| irfantitok | 0:8f3710bfd298 | 2 | #define _ROS_SERVICE_CommandVtolTransition_h |
| irfantitok | 0:8f3710bfd298 | 3 | #include <stdint.h> |
| irfantitok | 0:8f3710bfd298 | 4 | #include <string.h> |
| irfantitok | 0:8f3710bfd298 | 5 | #include <stdlib.h> |
| irfantitok | 0:8f3710bfd298 | 6 | #include "ros/msg.h" |
| irfantitok | 0:8f3710bfd298 | 7 | #include "std_msgs/Header.h" |
| irfantitok | 0:8f3710bfd298 | 8 | |
| irfantitok | 0:8f3710bfd298 | 9 | namespace mavros_msgs |
| irfantitok | 0:8f3710bfd298 | 10 | { |
| irfantitok | 0:8f3710bfd298 | 11 | |
| irfantitok | 0:8f3710bfd298 | 12 | static const char COMMANDVTOLTRANSITION[] = "mavros_msgs/CommandVtolTransition"; |
| irfantitok | 0:8f3710bfd298 | 13 | |
| irfantitok | 0:8f3710bfd298 | 14 | class CommandVtolTransitionRequest : public ros::Msg |
| irfantitok | 0:8f3710bfd298 | 15 | { |
| irfantitok | 0:8f3710bfd298 | 16 | public: |
| irfantitok | 0:8f3710bfd298 | 17 | typedef std_msgs::Header _header_type; |
| irfantitok | 0:8f3710bfd298 | 18 | _header_type header; |
| irfantitok | 0:8f3710bfd298 | 19 | typedef uint8_t _state_type; |
| irfantitok | 0:8f3710bfd298 | 20 | _state_type state; |
| irfantitok | 0:8f3710bfd298 | 21 | enum { STATE_MC = 3 }; |
| irfantitok | 0:8f3710bfd298 | 22 | enum { STATE_FW = 4 }; |
| irfantitok | 0:8f3710bfd298 | 23 | |
| irfantitok | 0:8f3710bfd298 | 24 | CommandVtolTransitionRequest(): |
| irfantitok | 0:8f3710bfd298 | 25 | header(), |
| irfantitok | 0:8f3710bfd298 | 26 | state(0) |
| irfantitok | 0:8f3710bfd298 | 27 | { |
| irfantitok | 0:8f3710bfd298 | 28 | } |
| irfantitok | 0:8f3710bfd298 | 29 | |
| irfantitok | 0:8f3710bfd298 | 30 | virtual int serialize(unsigned char *outbuffer) const |
| irfantitok | 0:8f3710bfd298 | 31 | { |
| irfantitok | 0:8f3710bfd298 | 32 | int offset = 0; |
| irfantitok | 0:8f3710bfd298 | 33 | offset += this->header.serialize(outbuffer + offset); |
| irfantitok | 0:8f3710bfd298 | 34 | *(outbuffer + offset + 0) = (this->state >> (8 * 0)) & 0xFF; |
| irfantitok | 0:8f3710bfd298 | 35 | offset += sizeof(this->state); |
| irfantitok | 0:8f3710bfd298 | 36 | return offset; |
| irfantitok | 0:8f3710bfd298 | 37 | } |
| irfantitok | 0:8f3710bfd298 | 38 | |
| irfantitok | 0:8f3710bfd298 | 39 | virtual int deserialize(unsigned char *inbuffer) |
| irfantitok | 0:8f3710bfd298 | 40 | { |
| irfantitok | 0:8f3710bfd298 | 41 | int offset = 0; |
| irfantitok | 0:8f3710bfd298 | 42 | offset += this->header.deserialize(inbuffer + offset); |
| irfantitok | 0:8f3710bfd298 | 43 | this->state = ((uint8_t) (*(inbuffer + offset))); |
| irfantitok | 0:8f3710bfd298 | 44 | offset += sizeof(this->state); |
| irfantitok | 0:8f3710bfd298 | 45 | return offset; |
| irfantitok | 0:8f3710bfd298 | 46 | } |
| irfantitok | 0:8f3710bfd298 | 47 | |
| irfantitok | 0:8f3710bfd298 | 48 | const char * getType(){ return COMMANDVTOLTRANSITION; }; |
| irfantitok | 0:8f3710bfd298 | 49 | const char * getMD5(){ return "0f073c606cdf8c014b856a5033900f3e"; }; |
| irfantitok | 0:8f3710bfd298 | 50 | |
| irfantitok | 0:8f3710bfd298 | 51 | }; |
| irfantitok | 0:8f3710bfd298 | 52 | |
| irfantitok | 0:8f3710bfd298 | 53 | class CommandVtolTransitionResponse : public ros::Msg |
| irfantitok | 0:8f3710bfd298 | 54 | { |
| irfantitok | 0:8f3710bfd298 | 55 | public: |
| irfantitok | 0:8f3710bfd298 | 56 | typedef bool _success_type; |
| irfantitok | 0:8f3710bfd298 | 57 | _success_type success; |
| irfantitok | 0:8f3710bfd298 | 58 | typedef uint8_t _result_type; |
| irfantitok | 0:8f3710bfd298 | 59 | _result_type result; |
| irfantitok | 0:8f3710bfd298 | 60 | |
| irfantitok | 0:8f3710bfd298 | 61 | CommandVtolTransitionResponse(): |
| irfantitok | 0:8f3710bfd298 | 62 | success(0), |
| irfantitok | 0:8f3710bfd298 | 63 | result(0) |
| irfantitok | 0:8f3710bfd298 | 64 | { |
| irfantitok | 0:8f3710bfd298 | 65 | } |
| irfantitok | 0:8f3710bfd298 | 66 | |
| irfantitok | 0:8f3710bfd298 | 67 | virtual int serialize(unsigned char *outbuffer) const |
| irfantitok | 0:8f3710bfd298 | 68 | { |
| irfantitok | 0:8f3710bfd298 | 69 | int offset = 0; |
| irfantitok | 0:8f3710bfd298 | 70 | union { |
| irfantitok | 0:8f3710bfd298 | 71 | bool real; |
| irfantitok | 0:8f3710bfd298 | 72 | uint8_t base; |
| irfantitok | 0:8f3710bfd298 | 73 | } u_success; |
| irfantitok | 0:8f3710bfd298 | 74 | u_success.real = this->success; |
| irfantitok | 0:8f3710bfd298 | 75 | *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; |
| irfantitok | 0:8f3710bfd298 | 76 | offset += sizeof(this->success); |
| irfantitok | 0:8f3710bfd298 | 77 | *(outbuffer + offset + 0) = (this->result >> (8 * 0)) & 0xFF; |
| irfantitok | 0:8f3710bfd298 | 78 | offset += sizeof(this->result); |
| irfantitok | 0:8f3710bfd298 | 79 | return offset; |
| irfantitok | 0:8f3710bfd298 | 80 | } |
| irfantitok | 0:8f3710bfd298 | 81 | |
| irfantitok | 0:8f3710bfd298 | 82 | virtual int deserialize(unsigned char *inbuffer) |
| irfantitok | 0:8f3710bfd298 | 83 | { |
| irfantitok | 0:8f3710bfd298 | 84 | int offset = 0; |
| irfantitok | 0:8f3710bfd298 | 85 | union { |
| irfantitok | 0:8f3710bfd298 | 86 | bool real; |
| irfantitok | 0:8f3710bfd298 | 87 | uint8_t base; |
| irfantitok | 0:8f3710bfd298 | 88 | } u_success; |
| irfantitok | 0:8f3710bfd298 | 89 | u_success.base = 0; |
| irfantitok | 0:8f3710bfd298 | 90 | u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); |
| irfantitok | 0:8f3710bfd298 | 91 | this->success = u_success.real; |
| irfantitok | 0:8f3710bfd298 | 92 | offset += sizeof(this->success); |
| irfantitok | 0:8f3710bfd298 | 93 | this->result = ((uint8_t) (*(inbuffer + offset))); |
| irfantitok | 0:8f3710bfd298 | 94 | offset += sizeof(this->result); |
| irfantitok | 0:8f3710bfd298 | 95 | return offset; |
| irfantitok | 0:8f3710bfd298 | 96 | } |
| irfantitok | 0:8f3710bfd298 | 97 | |
| irfantitok | 0:8f3710bfd298 | 98 | const char * getType(){ return COMMANDVTOLTRANSITION; }; |
| irfantitok | 0:8f3710bfd298 | 99 | const char * getMD5(){ return "1cd894375e4e3d2861d2222772894fdb"; }; |
| irfantitok | 0:8f3710bfd298 | 100 | |
| irfantitok | 0:8f3710bfd298 | 101 | }; |
| irfantitok | 0:8f3710bfd298 | 102 | |
| irfantitok | 0:8f3710bfd298 | 103 | class CommandVtolTransition { |
| irfantitok | 0:8f3710bfd298 | 104 | public: |
| irfantitok | 0:8f3710bfd298 | 105 | typedef CommandVtolTransitionRequest Request; |
| irfantitok | 0:8f3710bfd298 | 106 | typedef CommandVtolTransitionResponse Response; |
| irfantitok | 0:8f3710bfd298 | 107 | }; |
| irfantitok | 0:8f3710bfd298 | 108 | |
| irfantitok | 0:8f3710bfd298 | 109 | } |
| irfantitok | 0:8f3710bfd298 | 110 | #endif |