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/GlobalPositionTarget.h
- Revision:
- 0:8f3710bfd298
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/ros_lib/mavros_msgs/GlobalPositionTarget.h Wed Sep 02 13:51:31 2020 +0000
@@ -0,0 +1,222 @@
+#ifndef _ROS_mavros_msgs_GlobalPositionTarget_h
+#define _ROS_mavros_msgs_GlobalPositionTarget_h
+
+#include <stdint.h>
+#include <string.h>
+#include <stdlib.h>
+#include "ros/msg.h"
+#include "std_msgs/Header.h"
+#include "geometry_msgs/Vector3.h"
+
+namespace mavros_msgs
+{
+
+ class GlobalPositionTarget : public ros::Msg
+ {
+ public:
+ typedef std_msgs::Header _header_type;
+ _header_type header;
+ typedef uint8_t _coordinate_frame_type;
+ _coordinate_frame_type coordinate_frame;
+ typedef uint16_t _type_mask_type;
+ _type_mask_type type_mask;
+ typedef double _latitude_type;
+ _latitude_type latitude;
+ typedef double _longitude_type;
+ _longitude_type longitude;
+ typedef float _altitude_type;
+ _altitude_type altitude;
+ typedef geometry_msgs::Vector3 _velocity_type;
+ _velocity_type velocity;
+ typedef geometry_msgs::Vector3 _acceleration_or_force_type;
+ _acceleration_or_force_type acceleration_or_force;
+ typedef float _yaw_type;
+ _yaw_type yaw;
+ typedef float _yaw_rate_type;
+ _yaw_rate_type yaw_rate;
+ enum { FRAME_GLOBAL_INT = 5 };
+ enum { FRAME_GLOBAL_REL_ALT = 6 };
+ enum { FRAME_GLOBAL_TERRAIN_ALT = 11 };
+ enum { IGNORE_LATITUDE = 1 };
+ enum { IGNORE_LONGITUDE = 2 };
+ enum { IGNORE_ALTITUDE = 4 };
+ enum { IGNORE_VX = 8 };
+ enum { IGNORE_VY = 16 };
+ enum { IGNORE_VZ = 32 };
+ enum { IGNORE_AFX = 64 };
+ enum { IGNORE_AFY = 128 };
+ enum { IGNORE_AFZ = 256 };
+ enum { FORCE = 512 };
+ enum { IGNORE_YAW = 1024 };
+ enum { IGNORE_YAW_RATE = 2048 };
+
+ GlobalPositionTarget():
+ header(),
+ coordinate_frame(0),
+ type_mask(0),
+ latitude(0),
+ longitude(0),
+ altitude(0),
+ velocity(),
+ acceleration_or_force(),
+ yaw(0),
+ yaw_rate(0)
+ {
+ }
+
+ virtual int serialize(unsigned char *outbuffer) const
+ {
+ int offset = 0;
+ offset += this->header.serialize(outbuffer + offset);
+ *(outbuffer + offset + 0) = (this->coordinate_frame >> (8 * 0)) & 0xFF;
+ offset += sizeof(this->coordinate_frame);
+ *(outbuffer + offset + 0) = (this->type_mask >> (8 * 0)) & 0xFF;
+ *(outbuffer + offset + 1) = (this->type_mask >> (8 * 1)) & 0xFF;
+ offset += sizeof(this->type_mask);
+ union {
+ double real;
+ uint64_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;
+ *(outbuffer + offset + 4) = (u_latitude.base >> (8 * 4)) & 0xFF;
+ *(outbuffer + offset + 5) = (u_latitude.base >> (8 * 5)) & 0xFF;
+ *(outbuffer + offset + 6) = (u_latitude.base >> (8 * 6)) & 0xFF;
+ *(outbuffer + offset + 7) = (u_latitude.base >> (8 * 7)) & 0xFF;
+ offset += sizeof(this->latitude);
+ union {
+ double real;
+ uint64_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;
+ *(outbuffer + offset + 4) = (u_longitude.base >> (8 * 4)) & 0xFF;
+ *(outbuffer + offset + 5) = (u_longitude.base >> (8 * 5)) & 0xFF;
+ *(outbuffer + offset + 6) = (u_longitude.base >> (8 * 6)) & 0xFF;
+ *(outbuffer + offset + 7) = (u_longitude.base >> (8 * 7)) & 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);
+ offset += this->velocity.serialize(outbuffer + offset);
+ offset += this->acceleration_or_force.serialize(outbuffer + offset);
+ 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_yaw_rate;
+ u_yaw_rate.real = this->yaw_rate;
+ *(outbuffer + offset + 0) = (u_yaw_rate.base >> (8 * 0)) & 0xFF;
+ *(outbuffer + offset + 1) = (u_yaw_rate.base >> (8 * 1)) & 0xFF;
+ *(outbuffer + offset + 2) = (u_yaw_rate.base >> (8 * 2)) & 0xFF;
+ *(outbuffer + offset + 3) = (u_yaw_rate.base >> (8 * 3)) & 0xFF;
+ offset += sizeof(this->yaw_rate);
+ return offset;
+ }
+
+ virtual int deserialize(unsigned char *inbuffer)
+ {
+ int offset = 0;
+ offset += this->header.deserialize(inbuffer + offset);
+ this->coordinate_frame = ((uint8_t) (*(inbuffer + offset)));
+ offset += sizeof(this->coordinate_frame);
+ this->type_mask = ((uint16_t) (*(inbuffer + offset)));
+ this->type_mask |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1);
+ offset += sizeof(this->type_mask);
+ union {
+ double real;
+ uint64_t base;
+ } u_latitude;
+ u_latitude.base = 0;
+ u_latitude.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
+ u_latitude.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
+ u_latitude.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
+ u_latitude.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
+ u_latitude.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
+ u_latitude.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
+ u_latitude.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
+ u_latitude.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
+ this->latitude = u_latitude.real;
+ offset += sizeof(this->latitude);
+ union {
+ double real;
+ uint64_t base;
+ } u_longitude;
+ u_longitude.base = 0;
+ u_longitude.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
+ u_longitude.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
+ u_longitude.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
+ u_longitude.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
+ u_longitude.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
+ u_longitude.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
+ u_longitude.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
+ u_longitude.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
+ 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);
+ offset += this->velocity.deserialize(inbuffer + offset);
+ offset += this->acceleration_or_force.deserialize(inbuffer + offset);
+ 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_yaw_rate;
+ u_yaw_rate.base = 0;
+ u_yaw_rate.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
+ u_yaw_rate.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
+ u_yaw_rate.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
+ u_yaw_rate.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
+ this->yaw_rate = u_yaw_rate.real;
+ offset += sizeof(this->yaw_rate);
+ return offset;
+ }
+
+ const char * getType(){ return "mavros_msgs/GlobalPositionTarget"; };
+ const char * getMD5(){ return "076ded0190b9e045f9c55264659ef102"; };
+
+ };
+
+}
+#endif