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/CommandTriggerInterval.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_CommandTriggerInterval_h |
| irfantitok | 0:8f3710bfd298 | 2 | #define _ROS_SERVICE_CommandTriggerInterval_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 | |
| irfantitok | 0:8f3710bfd298 | 8 | namespace mavros_msgs |
| irfantitok | 0:8f3710bfd298 | 9 | { |
| irfantitok | 0:8f3710bfd298 | 10 | |
| irfantitok | 0:8f3710bfd298 | 11 | static const char COMMANDTRIGGERINTERVAL[] = "mavros_msgs/CommandTriggerInterval"; |
| irfantitok | 0:8f3710bfd298 | 12 | |
| irfantitok | 0:8f3710bfd298 | 13 | class CommandTriggerIntervalRequest : public ros::Msg |
| irfantitok | 0:8f3710bfd298 | 14 | { |
| irfantitok | 0:8f3710bfd298 | 15 | public: |
| irfantitok | 0:8f3710bfd298 | 16 | typedef float _cycle_time_type; |
| irfantitok | 0:8f3710bfd298 | 17 | _cycle_time_type cycle_time; |
| irfantitok | 0:8f3710bfd298 | 18 | typedef float _integration_time_type; |
| irfantitok | 0:8f3710bfd298 | 19 | _integration_time_type integration_time; |
| irfantitok | 0:8f3710bfd298 | 20 | |
| irfantitok | 0:8f3710bfd298 | 21 | CommandTriggerIntervalRequest(): |
| irfantitok | 0:8f3710bfd298 | 22 | cycle_time(0), |
| irfantitok | 0:8f3710bfd298 | 23 | integration_time(0) |
| irfantitok | 0:8f3710bfd298 | 24 | { |
| irfantitok | 0:8f3710bfd298 | 25 | } |
| irfantitok | 0:8f3710bfd298 | 26 | |
| irfantitok | 0:8f3710bfd298 | 27 | virtual int serialize(unsigned char *outbuffer) const |
| irfantitok | 0:8f3710bfd298 | 28 | { |
| irfantitok | 0:8f3710bfd298 | 29 | int offset = 0; |
| irfantitok | 0:8f3710bfd298 | 30 | union { |
| irfantitok | 0:8f3710bfd298 | 31 | float real; |
| irfantitok | 0:8f3710bfd298 | 32 | uint32_t base; |
| irfantitok | 0:8f3710bfd298 | 33 | } u_cycle_time; |
| irfantitok | 0:8f3710bfd298 | 34 | u_cycle_time.real = this->cycle_time; |
| irfantitok | 0:8f3710bfd298 | 35 | *(outbuffer + offset + 0) = (u_cycle_time.base >> (8 * 0)) & 0xFF; |
| irfantitok | 0:8f3710bfd298 | 36 | *(outbuffer + offset + 1) = (u_cycle_time.base >> (8 * 1)) & 0xFF; |
| irfantitok | 0:8f3710bfd298 | 37 | *(outbuffer + offset + 2) = (u_cycle_time.base >> (8 * 2)) & 0xFF; |
| irfantitok | 0:8f3710bfd298 | 38 | *(outbuffer + offset + 3) = (u_cycle_time.base >> (8 * 3)) & 0xFF; |
| irfantitok | 0:8f3710bfd298 | 39 | offset += sizeof(this->cycle_time); |
| irfantitok | 0:8f3710bfd298 | 40 | union { |
| irfantitok | 0:8f3710bfd298 | 41 | float real; |
| irfantitok | 0:8f3710bfd298 | 42 | uint32_t base; |
| irfantitok | 0:8f3710bfd298 | 43 | } u_integration_time; |
| irfantitok | 0:8f3710bfd298 | 44 | u_integration_time.real = this->integration_time; |
| irfantitok | 0:8f3710bfd298 | 45 | *(outbuffer + offset + 0) = (u_integration_time.base >> (8 * 0)) & 0xFF; |
| irfantitok | 0:8f3710bfd298 | 46 | *(outbuffer + offset + 1) = (u_integration_time.base >> (8 * 1)) & 0xFF; |
| irfantitok | 0:8f3710bfd298 | 47 | *(outbuffer + offset + 2) = (u_integration_time.base >> (8 * 2)) & 0xFF; |
| irfantitok | 0:8f3710bfd298 | 48 | *(outbuffer + offset + 3) = (u_integration_time.base >> (8 * 3)) & 0xFF; |
| irfantitok | 0:8f3710bfd298 | 49 | offset += sizeof(this->integration_time); |
| irfantitok | 0:8f3710bfd298 | 50 | return offset; |
| irfantitok | 0:8f3710bfd298 | 51 | } |
| irfantitok | 0:8f3710bfd298 | 52 | |
| irfantitok | 0:8f3710bfd298 | 53 | virtual int deserialize(unsigned char *inbuffer) |
| irfantitok | 0:8f3710bfd298 | 54 | { |
| irfantitok | 0:8f3710bfd298 | 55 | int offset = 0; |
| irfantitok | 0:8f3710bfd298 | 56 | union { |
| irfantitok | 0:8f3710bfd298 | 57 | float real; |
| irfantitok | 0:8f3710bfd298 | 58 | uint32_t base; |
| irfantitok | 0:8f3710bfd298 | 59 | } u_cycle_time; |
| irfantitok | 0:8f3710bfd298 | 60 | u_cycle_time.base = 0; |
| irfantitok | 0:8f3710bfd298 | 61 | u_cycle_time.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); |
| irfantitok | 0:8f3710bfd298 | 62 | u_cycle_time.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
| irfantitok | 0:8f3710bfd298 | 63 | u_cycle_time.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
| irfantitok | 0:8f3710bfd298 | 64 | u_cycle_time.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
| irfantitok | 0:8f3710bfd298 | 65 | this->cycle_time = u_cycle_time.real; |
| irfantitok | 0:8f3710bfd298 | 66 | offset += sizeof(this->cycle_time); |
| irfantitok | 0:8f3710bfd298 | 67 | union { |
| irfantitok | 0:8f3710bfd298 | 68 | float real; |
| irfantitok | 0:8f3710bfd298 | 69 | uint32_t base; |
| irfantitok | 0:8f3710bfd298 | 70 | } u_integration_time; |
| irfantitok | 0:8f3710bfd298 | 71 | u_integration_time.base = 0; |
| irfantitok | 0:8f3710bfd298 | 72 | u_integration_time.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); |
| irfantitok | 0:8f3710bfd298 | 73 | u_integration_time.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
| irfantitok | 0:8f3710bfd298 | 74 | u_integration_time.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
| irfantitok | 0:8f3710bfd298 | 75 | u_integration_time.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
| irfantitok | 0:8f3710bfd298 | 76 | this->integration_time = u_integration_time.real; |
| irfantitok | 0:8f3710bfd298 | 77 | offset += sizeof(this->integration_time); |
| irfantitok | 0:8f3710bfd298 | 78 | return offset; |
| irfantitok | 0:8f3710bfd298 | 79 | } |
| irfantitok | 0:8f3710bfd298 | 80 | |
| irfantitok | 0:8f3710bfd298 | 81 | const char * getType(){ return COMMANDTRIGGERINTERVAL; }; |
| irfantitok | 0:8f3710bfd298 | 82 | const char * getMD5(){ return "54f6167a076ced593aa096ea6eb1a519"; }; |
| irfantitok | 0:8f3710bfd298 | 83 | |
| irfantitok | 0:8f3710bfd298 | 84 | }; |
| irfantitok | 0:8f3710bfd298 | 85 | |
| irfantitok | 0:8f3710bfd298 | 86 | class CommandTriggerIntervalResponse : public ros::Msg |
| irfantitok | 0:8f3710bfd298 | 87 | { |
| irfantitok | 0:8f3710bfd298 | 88 | public: |
| irfantitok | 0:8f3710bfd298 | 89 | typedef bool _success_type; |
| irfantitok | 0:8f3710bfd298 | 90 | _success_type success; |
| irfantitok | 0:8f3710bfd298 | 91 | typedef uint8_t _result_type; |
| irfantitok | 0:8f3710bfd298 | 92 | _result_type result; |
| irfantitok | 0:8f3710bfd298 | 93 | |
| irfantitok | 0:8f3710bfd298 | 94 | CommandTriggerIntervalResponse(): |
| irfantitok | 0:8f3710bfd298 | 95 | success(0), |
| irfantitok | 0:8f3710bfd298 | 96 | result(0) |
| irfantitok | 0:8f3710bfd298 | 97 | { |
| irfantitok | 0:8f3710bfd298 | 98 | } |
| irfantitok | 0:8f3710bfd298 | 99 | |
| irfantitok | 0:8f3710bfd298 | 100 | virtual int serialize(unsigned char *outbuffer) const |
| irfantitok | 0:8f3710bfd298 | 101 | { |
| irfantitok | 0:8f3710bfd298 | 102 | int offset = 0; |
| irfantitok | 0:8f3710bfd298 | 103 | union { |
| irfantitok | 0:8f3710bfd298 | 104 | bool real; |
| irfantitok | 0:8f3710bfd298 | 105 | uint8_t base; |
| irfantitok | 0:8f3710bfd298 | 106 | } u_success; |
| irfantitok | 0:8f3710bfd298 | 107 | u_success.real = this->success; |
| irfantitok | 0:8f3710bfd298 | 108 | *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; |
| irfantitok | 0:8f3710bfd298 | 109 | offset += sizeof(this->success); |
| irfantitok | 0:8f3710bfd298 | 110 | *(outbuffer + offset + 0) = (this->result >> (8 * 0)) & 0xFF; |
| irfantitok | 0:8f3710bfd298 | 111 | offset += sizeof(this->result); |
| irfantitok | 0:8f3710bfd298 | 112 | return offset; |
| irfantitok | 0:8f3710bfd298 | 113 | } |
| irfantitok | 0:8f3710bfd298 | 114 | |
| irfantitok | 0:8f3710bfd298 | 115 | virtual int deserialize(unsigned char *inbuffer) |
| irfantitok | 0:8f3710bfd298 | 116 | { |
| irfantitok | 0:8f3710bfd298 | 117 | int offset = 0; |
| irfantitok | 0:8f3710bfd298 | 118 | union { |
| irfantitok | 0:8f3710bfd298 | 119 | bool real; |
| irfantitok | 0:8f3710bfd298 | 120 | uint8_t base; |
| irfantitok | 0:8f3710bfd298 | 121 | } u_success; |
| irfantitok | 0:8f3710bfd298 | 122 | u_success.base = 0; |
| irfantitok | 0:8f3710bfd298 | 123 | u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); |
| irfantitok | 0:8f3710bfd298 | 124 | this->success = u_success.real; |
| irfantitok | 0:8f3710bfd298 | 125 | offset += sizeof(this->success); |
| irfantitok | 0:8f3710bfd298 | 126 | this->result = ((uint8_t) (*(inbuffer + offset))); |
| irfantitok | 0:8f3710bfd298 | 127 | offset += sizeof(this->result); |
| irfantitok | 0:8f3710bfd298 | 128 | return offset; |
| irfantitok | 0:8f3710bfd298 | 129 | } |
| irfantitok | 0:8f3710bfd298 | 130 | |
| irfantitok | 0:8f3710bfd298 | 131 | const char * getType(){ return COMMANDTRIGGERINTERVAL; }; |
| irfantitok | 0:8f3710bfd298 | 132 | const char * getMD5(){ return "1cd894375e4e3d2861d2222772894fdb"; }; |
| irfantitok | 0:8f3710bfd298 | 133 | |
| irfantitok | 0:8f3710bfd298 | 134 | }; |
| irfantitok | 0:8f3710bfd298 | 135 | |
| irfantitok | 0:8f3710bfd298 | 136 | class CommandTriggerInterval { |
| irfantitok | 0:8f3710bfd298 | 137 | public: |
| irfantitok | 0:8f3710bfd298 | 138 | typedef CommandTriggerIntervalRequest Request; |
| irfantitok | 0:8f3710bfd298 | 139 | typedef CommandTriggerIntervalResponse Response; |
| irfantitok | 0:8f3710bfd298 | 140 | }; |
| irfantitok | 0:8f3710bfd298 | 141 | |
| irfantitok | 0:8f3710bfd298 | 142 | } |
| irfantitok | 0:8f3710bfd298 | 143 | #endif |