rosserial for Hydro
Fork of rosserial_mbed_lib by
sensor_msgs/NavSatStatus.h@3:1cf99502f396, 2011-11-12 (annotated)
- Committer:
- nucho
- Date:
- Sat Nov 12 23:54:45 2011 +0000
- Revision:
- 3:1cf99502f396
- Parent:
- 0:77afd7560544
This program supported the revision of 167 of rosserial.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
nucho | 3:1cf99502f396 | 1 | #ifndef _ROS_sensor_msgs_NavSatStatus_h |
nucho | 3:1cf99502f396 | 2 | #define _ROS_sensor_msgs_NavSatStatus_h |
nucho | 0:77afd7560544 | 3 | |
nucho | 0:77afd7560544 | 4 | #include <stdint.h> |
nucho | 0:77afd7560544 | 5 | #include <string.h> |
nucho | 0:77afd7560544 | 6 | #include <stdlib.h> |
nucho | 3:1cf99502f396 | 7 | #include "ros/msg.h" |
nucho | 0:77afd7560544 | 8 | |
nucho | 0:77afd7560544 | 9 | namespace sensor_msgs |
nucho | 0:77afd7560544 | 10 | { |
nucho | 0:77afd7560544 | 11 | |
nucho | 0:77afd7560544 | 12 | class NavSatStatus : public ros::Msg |
nucho | 0:77afd7560544 | 13 | { |
nucho | 0:77afd7560544 | 14 | public: |
nucho | 3:1cf99502f396 | 15 | int8_t status; |
nucho | 3:1cf99502f396 | 16 | uint16_t service; |
nucho | 3:1cf99502f396 | 17 | enum { STATUS_NO_FIX = -1 }; |
nucho | 3:1cf99502f396 | 18 | enum { STATUS_FIX = 0 }; |
nucho | 3:1cf99502f396 | 19 | enum { STATUS_SBAS_FIX = 1 }; |
nucho | 3:1cf99502f396 | 20 | enum { STATUS_GBAS_FIX = 2 }; |
nucho | 3:1cf99502f396 | 21 | enum { SERVICE_GPS = 1 }; |
nucho | 3:1cf99502f396 | 22 | enum { SERVICE_GLONASS = 2 }; |
nucho | 3:1cf99502f396 | 23 | enum { SERVICE_COMPASS = 4 }; |
nucho | 3:1cf99502f396 | 24 | enum { SERVICE_GALILEO = 8 }; |
nucho | 0:77afd7560544 | 25 | |
nucho | 3:1cf99502f396 | 26 | virtual int serialize(unsigned char *outbuffer) const |
nucho | 0:77afd7560544 | 27 | { |
nucho | 0:77afd7560544 | 28 | int offset = 0; |
nucho | 0:77afd7560544 | 29 | union { |
nucho | 3:1cf99502f396 | 30 | int8_t real; |
nucho | 3:1cf99502f396 | 31 | uint8_t base; |
nucho | 0:77afd7560544 | 32 | } u_status; |
nucho | 0:77afd7560544 | 33 | u_status.real = this->status; |
nucho | 0:77afd7560544 | 34 | *(outbuffer + offset + 0) = (u_status.base >> (8 * 0)) & 0xFF; |
nucho | 0:77afd7560544 | 35 | offset += sizeof(this->status); |
nucho | 3:1cf99502f396 | 36 | *(outbuffer + offset + 0) = (this->service >> (8 * 0)) & 0xFF; |
nucho | 3:1cf99502f396 | 37 | *(outbuffer + offset + 1) = (this->service >> (8 * 1)) & 0xFF; |
nucho | 0:77afd7560544 | 38 | offset += sizeof(this->service); |
nucho | 0:77afd7560544 | 39 | return offset; |
nucho | 0:77afd7560544 | 40 | } |
nucho | 0:77afd7560544 | 41 | |
nucho | 0:77afd7560544 | 42 | virtual int deserialize(unsigned char *inbuffer) |
nucho | 0:77afd7560544 | 43 | { |
nucho | 0:77afd7560544 | 44 | int offset = 0; |
nucho | 0:77afd7560544 | 45 | union { |
nucho | 3:1cf99502f396 | 46 | int8_t real; |
nucho | 3:1cf99502f396 | 47 | uint8_t base; |
nucho | 0:77afd7560544 | 48 | } u_status; |
nucho | 0:77afd7560544 | 49 | u_status.base = 0; |
nucho | 3:1cf99502f396 | 50 | u_status.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); |
nucho | 0:77afd7560544 | 51 | this->status = u_status.real; |
nucho | 0:77afd7560544 | 52 | offset += sizeof(this->status); |
nucho | 3:1cf99502f396 | 53 | this->service |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0); |
nucho | 3:1cf99502f396 | 54 | this->service |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); |
nucho | 0:77afd7560544 | 55 | offset += sizeof(this->service); |
nucho | 0:77afd7560544 | 56 | return offset; |
nucho | 0:77afd7560544 | 57 | } |
nucho | 0:77afd7560544 | 58 | |
nucho | 3:1cf99502f396 | 59 | virtual const char * getType(){ return "sensor_msgs/NavSatStatus"; }; |
nucho | 3:1cf99502f396 | 60 | virtual const char * getMD5(){ return "331cdbddfa4bc96ffc3b9ad98900a54c"; }; |
nucho | 0:77afd7560544 | 61 | |
nucho | 0:77afd7560544 | 62 | }; |
nucho | 0:77afd7560544 | 63 | |
nucho | 0:77afd7560544 | 64 | } |
nucho | 0:77afd7560544 | 65 | #endif |