capstone_finish

Dependencies:   BufferedSerial motor_sn7544

Committer:
Jeonghoon
Date:
Tue Aug 13 05:53:22 2019 +0000
Revision:
3:2a3664dc6634
with ROS;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Jeonghoon 3:2a3664dc6634 1 #ifndef _ROS_sensor_msgs_NavSatStatus_h
Jeonghoon 3:2a3664dc6634 2 #define _ROS_sensor_msgs_NavSatStatus_h
Jeonghoon 3:2a3664dc6634 3
Jeonghoon 3:2a3664dc6634 4 #include <stdint.h>
Jeonghoon 3:2a3664dc6634 5 #include <string.h>
Jeonghoon 3:2a3664dc6634 6 #include <stdlib.h>
Jeonghoon 3:2a3664dc6634 7 #include "ros/msg.h"
Jeonghoon 3:2a3664dc6634 8
Jeonghoon 3:2a3664dc6634 9 namespace sensor_msgs
Jeonghoon 3:2a3664dc6634 10 {
Jeonghoon 3:2a3664dc6634 11
Jeonghoon 3:2a3664dc6634 12 class NavSatStatus : public ros::Msg
Jeonghoon 3:2a3664dc6634 13 {
Jeonghoon 3:2a3664dc6634 14 public:
Jeonghoon 3:2a3664dc6634 15 typedef int8_t _status_type;
Jeonghoon 3:2a3664dc6634 16 _status_type status;
Jeonghoon 3:2a3664dc6634 17 typedef uint16_t _service_type;
Jeonghoon 3:2a3664dc6634 18 _service_type service;
Jeonghoon 3:2a3664dc6634 19 enum { STATUS_NO_FIX = -1 };
Jeonghoon 3:2a3664dc6634 20 enum { STATUS_FIX = 0 };
Jeonghoon 3:2a3664dc6634 21 enum { STATUS_SBAS_FIX = 1 };
Jeonghoon 3:2a3664dc6634 22 enum { STATUS_GBAS_FIX = 2 };
Jeonghoon 3:2a3664dc6634 23 enum { SERVICE_GPS = 1 };
Jeonghoon 3:2a3664dc6634 24 enum { SERVICE_GLONASS = 2 };
Jeonghoon 3:2a3664dc6634 25 enum { SERVICE_COMPASS = 4 };
Jeonghoon 3:2a3664dc6634 26 enum { SERVICE_GALILEO = 8 };
Jeonghoon 3:2a3664dc6634 27
Jeonghoon 3:2a3664dc6634 28 NavSatStatus():
Jeonghoon 3:2a3664dc6634 29 status(0),
Jeonghoon 3:2a3664dc6634 30 service(0)
Jeonghoon 3:2a3664dc6634 31 {
Jeonghoon 3:2a3664dc6634 32 }
Jeonghoon 3:2a3664dc6634 33
Jeonghoon 3:2a3664dc6634 34 virtual int serialize(unsigned char *outbuffer) const
Jeonghoon 3:2a3664dc6634 35 {
Jeonghoon 3:2a3664dc6634 36 int offset = 0;
Jeonghoon 3:2a3664dc6634 37 union {
Jeonghoon 3:2a3664dc6634 38 int8_t real;
Jeonghoon 3:2a3664dc6634 39 uint8_t base;
Jeonghoon 3:2a3664dc6634 40 } u_status;
Jeonghoon 3:2a3664dc6634 41 u_status.real = this->status;
Jeonghoon 3:2a3664dc6634 42 *(outbuffer + offset + 0) = (u_status.base >> (8 * 0)) & 0xFF;
Jeonghoon 3:2a3664dc6634 43 offset += sizeof(this->status);
Jeonghoon 3:2a3664dc6634 44 *(outbuffer + offset + 0) = (this->service >> (8 * 0)) & 0xFF;
Jeonghoon 3:2a3664dc6634 45 *(outbuffer + offset + 1) = (this->service >> (8 * 1)) & 0xFF;
Jeonghoon 3:2a3664dc6634 46 offset += sizeof(this->service);
Jeonghoon 3:2a3664dc6634 47 return offset;
Jeonghoon 3:2a3664dc6634 48 }
Jeonghoon 3:2a3664dc6634 49
Jeonghoon 3:2a3664dc6634 50 virtual int deserialize(unsigned char *inbuffer)
Jeonghoon 3:2a3664dc6634 51 {
Jeonghoon 3:2a3664dc6634 52 int offset = 0;
Jeonghoon 3:2a3664dc6634 53 union {
Jeonghoon 3:2a3664dc6634 54 int8_t real;
Jeonghoon 3:2a3664dc6634 55 uint8_t base;
Jeonghoon 3:2a3664dc6634 56 } u_status;
Jeonghoon 3:2a3664dc6634 57 u_status.base = 0;
Jeonghoon 3:2a3664dc6634 58 u_status.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
Jeonghoon 3:2a3664dc6634 59 this->status = u_status.real;
Jeonghoon 3:2a3664dc6634 60 offset += sizeof(this->status);
Jeonghoon 3:2a3664dc6634 61 this->service = ((uint16_t) (*(inbuffer + offset)));
Jeonghoon 3:2a3664dc6634 62 this->service |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1);
Jeonghoon 3:2a3664dc6634 63 offset += sizeof(this->service);
Jeonghoon 3:2a3664dc6634 64 return offset;
Jeonghoon 3:2a3664dc6634 65 }
Jeonghoon 3:2a3664dc6634 66
Jeonghoon 3:2a3664dc6634 67 const char * getType(){ return "sensor_msgs/NavSatStatus"; };
Jeonghoon 3:2a3664dc6634 68 const char * getMD5(){ return "331cdbddfa4bc96ffc3b9ad98900a54c"; };
Jeonghoon 3:2a3664dc6634 69
Jeonghoon 3:2a3664dc6634 70 };
Jeonghoon 3:2a3664dc6634 71
Jeonghoon 3:2a3664dc6634 72 }
Jeonghoon 3:2a3664dc6634 73 #endif