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.
Diff: ros_lib/mavros_msgs/CommandTOL.h
- Revision:
- 0:8f3710bfd298
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ros_lib/mavros_msgs/CommandTOL.h Wed Sep 02 13:51:31 2020 +0000 @@ -0,0 +1,215 @@ +#ifndef _ROS_SERVICE_CommandTOL_h +#define _ROS_SERVICE_CommandTOL_h +#include <stdint.h> +#include <string.h> +#include <stdlib.h> +#include "ros/msg.h" + +namespace mavros_msgs +{ + +static const char COMMANDTOL[] = "mavros_msgs/CommandTOL"; + + class CommandTOLRequest : public ros::Msg + { + public: + typedef float _min_pitch_type; + _min_pitch_type min_pitch; + typedef float _yaw_type; + _yaw_type yaw; + typedef float _latitude_type; + _latitude_type latitude; + typedef float _longitude_type; + _longitude_type longitude; + typedef float _altitude_type; + _altitude_type altitude; + + CommandTOLRequest(): + min_pitch(0), + yaw(0), + latitude(0), + longitude(0), + altitude(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + float real; + uint32_t base; + } u_min_pitch; + u_min_pitch.real = this->min_pitch; + *(outbuffer + offset + 0) = (u_min_pitch.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_min_pitch.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_min_pitch.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_min_pitch.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_pitch); + union { + float real; + uint32_t base; + } u_yaw; + u_yaw.real = this->yaw; + *(outbuffer + offset + 0) = (u_yaw.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_yaw.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_yaw.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_yaw.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->yaw); + union { + float real; + uint32_t base; + } u_latitude; + u_latitude.real = this->latitude; + *(outbuffer + offset + 0) = (u_latitude.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_latitude.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_latitude.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_latitude.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->latitude); + union { + float real; + uint32_t base; + } u_longitude; + u_longitude.real = this->longitude; + *(outbuffer + offset + 0) = (u_longitude.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_longitude.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_longitude.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_longitude.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->longitude); + union { + float real; + uint32_t base; + } u_altitude; + u_altitude.real = this->altitude; + *(outbuffer + offset + 0) = (u_altitude.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_altitude.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_altitude.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_altitude.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->altitude); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + float real; + uint32_t base; + } u_min_pitch; + u_min_pitch.base = 0; + u_min_pitch.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_min_pitch.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_min_pitch.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_min_pitch.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->min_pitch = u_min_pitch.real; + offset += sizeof(this->min_pitch); + union { + float real; + uint32_t base; + } u_yaw; + u_yaw.base = 0; + u_yaw.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_yaw.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_yaw.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_yaw.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->yaw = u_yaw.real; + offset += sizeof(this->yaw); + union { + float real; + uint32_t base; + } u_latitude; + u_latitude.base = 0; + u_latitude.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_latitude.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_latitude.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_latitude.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->latitude = u_latitude.real; + offset += sizeof(this->latitude); + union { + float real; + uint32_t base; + } u_longitude; + u_longitude.base = 0; + u_longitude.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_longitude.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_longitude.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_longitude.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->longitude = u_longitude.real; + offset += sizeof(this->longitude); + union { + float real; + uint32_t base; + } u_altitude; + u_altitude.base = 0; + u_altitude.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_altitude.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_altitude.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_altitude.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->altitude = u_altitude.real; + offset += sizeof(this->altitude); + return offset; + } + + const char * getType(){ return COMMANDTOL; }; + const char * getMD5(){ return "5aec7e34bcfe9ec68949aebae7bcd1ec"; }; + + }; + + class CommandTOLResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef uint8_t _result_type; + _result_type result; + + CommandTOLResponse(): + success(0), + result(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + *(outbuffer + offset + 0) = (this->result >> (8 * 0)) & 0xFF; + offset += sizeof(this->result); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + this->result = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->result); + return offset; + } + + const char * getType(){ return COMMANDTOL; }; + const char * getMD5(){ return "1cd894375e4e3d2861d2222772894fdb"; }; + + }; + + class CommandTOL { + public: + typedef CommandTOLRequest Request; + typedef CommandTOLResponse Response; + }; + +} +#endif