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_std_msgs_Bool_h
Jeonghoon 3:2a3664dc6634 2 #define _ROS_std_msgs_Bool_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 std_msgs
Jeonghoon 3:2a3664dc6634 10 {
Jeonghoon 3:2a3664dc6634 11
Jeonghoon 3:2a3664dc6634 12 class Bool : public ros::Msg
Jeonghoon 3:2a3664dc6634 13 {
Jeonghoon 3:2a3664dc6634 14 public:
Jeonghoon 3:2a3664dc6634 15 typedef bool _data_type;
Jeonghoon 3:2a3664dc6634 16 _data_type data;
Jeonghoon 3:2a3664dc6634 17
Jeonghoon 3:2a3664dc6634 18 Bool():
Jeonghoon 3:2a3664dc6634 19 data(0)
Jeonghoon 3:2a3664dc6634 20 {
Jeonghoon 3:2a3664dc6634 21 }
Jeonghoon 3:2a3664dc6634 22
Jeonghoon 3:2a3664dc6634 23 virtual int serialize(unsigned char *outbuffer) const
Jeonghoon 3:2a3664dc6634 24 {
Jeonghoon 3:2a3664dc6634 25 int offset = 0;
Jeonghoon 3:2a3664dc6634 26 union {
Jeonghoon 3:2a3664dc6634 27 bool real;
Jeonghoon 3:2a3664dc6634 28 uint8_t base;
Jeonghoon 3:2a3664dc6634 29 } u_data;
Jeonghoon 3:2a3664dc6634 30 u_data.real = this->data;
Jeonghoon 3:2a3664dc6634 31 *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF;
Jeonghoon 3:2a3664dc6634 32 offset += sizeof(this->data);
Jeonghoon 3:2a3664dc6634 33 return offset;
Jeonghoon 3:2a3664dc6634 34 }
Jeonghoon 3:2a3664dc6634 35
Jeonghoon 3:2a3664dc6634 36 virtual int deserialize(unsigned char *inbuffer)
Jeonghoon 3:2a3664dc6634 37 {
Jeonghoon 3:2a3664dc6634 38 int offset = 0;
Jeonghoon 3:2a3664dc6634 39 union {
Jeonghoon 3:2a3664dc6634 40 bool real;
Jeonghoon 3:2a3664dc6634 41 uint8_t base;
Jeonghoon 3:2a3664dc6634 42 } u_data;
Jeonghoon 3:2a3664dc6634 43 u_data.base = 0;
Jeonghoon 3:2a3664dc6634 44 u_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
Jeonghoon 3:2a3664dc6634 45 this->data = u_data.real;
Jeonghoon 3:2a3664dc6634 46 offset += sizeof(this->data);
Jeonghoon 3:2a3664dc6634 47 return offset;
Jeonghoon 3:2a3664dc6634 48 }
Jeonghoon 3:2a3664dc6634 49
Jeonghoon 3:2a3664dc6634 50 const char * getType(){ return "std_msgs/Bool"; };
Jeonghoon 3:2a3664dc6634 51 const char * getMD5(){ return "8b94c1b53db61fb6aed406028ad6332a"; };
Jeonghoon 3:2a3664dc6634 52
Jeonghoon 3:2a3664dc6634 53 };
Jeonghoon 3:2a3664dc6634 54
Jeonghoon 3:2a3664dc6634 55 }
Jeonghoon 3:2a3664dc6634 56 #endif