ROS Serial library for Mbed platforms for ROS Melodic Morenia. Check http://wiki.ros.org/rosserial_mbed/ for more information.

Dependencies:   BufferedSerial

Committer:
krogedal
Date:
Thu May 27 19:25:46 2021 +0000
Revision:
2:fa426560b283
Parent:
0:04ac6be8229a
no change

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Gary Servin 0:04ac6be8229a 1 #ifndef _ROS_SERVICE_QueryCalibrationState_h
Gary Servin 0:04ac6be8229a 2 #define _ROS_SERVICE_QueryCalibrationState_h
Gary Servin 0:04ac6be8229a 3 #include <stdint.h>
Gary Servin 0:04ac6be8229a 4 #include <string.h>
Gary Servin 0:04ac6be8229a 5 #include <stdlib.h>
Gary Servin 0:04ac6be8229a 6 #include "ros/msg.h"
Gary Servin 0:04ac6be8229a 7
Gary Servin 0:04ac6be8229a 8 namespace control_msgs
Gary Servin 0:04ac6be8229a 9 {
Gary Servin 0:04ac6be8229a 10
Gary Servin 0:04ac6be8229a 11 static const char QUERYCALIBRATIONSTATE[] = "control_msgs/QueryCalibrationState";
Gary Servin 0:04ac6be8229a 12
Gary Servin 0:04ac6be8229a 13 class QueryCalibrationStateRequest : public ros::Msg
Gary Servin 0:04ac6be8229a 14 {
Gary Servin 0:04ac6be8229a 15 public:
Gary Servin 0:04ac6be8229a 16
Gary Servin 0:04ac6be8229a 17 QueryCalibrationStateRequest()
Gary Servin 0:04ac6be8229a 18 {
Gary Servin 0:04ac6be8229a 19 }
Gary Servin 0:04ac6be8229a 20
Gary Servin 0:04ac6be8229a 21 virtual int serialize(unsigned char *outbuffer) const
Gary Servin 0:04ac6be8229a 22 {
Gary Servin 0:04ac6be8229a 23 int offset = 0;
Gary Servin 0:04ac6be8229a 24 return offset;
Gary Servin 0:04ac6be8229a 25 }
Gary Servin 0:04ac6be8229a 26
Gary Servin 0:04ac6be8229a 27 virtual int deserialize(unsigned char *inbuffer)
Gary Servin 0:04ac6be8229a 28 {
Gary Servin 0:04ac6be8229a 29 int offset = 0;
Gary Servin 0:04ac6be8229a 30 return offset;
Gary Servin 0:04ac6be8229a 31 }
Gary Servin 0:04ac6be8229a 32
Gary Servin 0:04ac6be8229a 33 const char * getType(){ return QUERYCALIBRATIONSTATE; };
Gary Servin 0:04ac6be8229a 34 const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; };
Gary Servin 0:04ac6be8229a 35
Gary Servin 0:04ac6be8229a 36 };
Gary Servin 0:04ac6be8229a 37
Gary Servin 0:04ac6be8229a 38 class QueryCalibrationStateResponse : public ros::Msg
Gary Servin 0:04ac6be8229a 39 {
Gary Servin 0:04ac6be8229a 40 public:
Gary Servin 0:04ac6be8229a 41 typedef bool _is_calibrated_type;
Gary Servin 0:04ac6be8229a 42 _is_calibrated_type is_calibrated;
Gary Servin 0:04ac6be8229a 43
Gary Servin 0:04ac6be8229a 44 QueryCalibrationStateResponse():
Gary Servin 0:04ac6be8229a 45 is_calibrated(0)
Gary Servin 0:04ac6be8229a 46 {
Gary Servin 0:04ac6be8229a 47 }
Gary Servin 0:04ac6be8229a 48
Gary Servin 0:04ac6be8229a 49 virtual int serialize(unsigned char *outbuffer) const
Gary Servin 0:04ac6be8229a 50 {
Gary Servin 0:04ac6be8229a 51 int offset = 0;
Gary Servin 0:04ac6be8229a 52 union {
Gary Servin 0:04ac6be8229a 53 bool real;
Gary Servin 0:04ac6be8229a 54 uint8_t base;
Gary Servin 0:04ac6be8229a 55 } u_is_calibrated;
Gary Servin 0:04ac6be8229a 56 u_is_calibrated.real = this->is_calibrated;
Gary Servin 0:04ac6be8229a 57 *(outbuffer + offset + 0) = (u_is_calibrated.base >> (8 * 0)) & 0xFF;
Gary Servin 0:04ac6be8229a 58 offset += sizeof(this->is_calibrated);
Gary Servin 0:04ac6be8229a 59 return offset;
Gary Servin 0:04ac6be8229a 60 }
Gary Servin 0:04ac6be8229a 61
Gary Servin 0:04ac6be8229a 62 virtual int deserialize(unsigned char *inbuffer)
Gary Servin 0:04ac6be8229a 63 {
Gary Servin 0:04ac6be8229a 64 int offset = 0;
Gary Servin 0:04ac6be8229a 65 union {
Gary Servin 0:04ac6be8229a 66 bool real;
Gary Servin 0:04ac6be8229a 67 uint8_t base;
Gary Servin 0:04ac6be8229a 68 } u_is_calibrated;
Gary Servin 0:04ac6be8229a 69 u_is_calibrated.base = 0;
Gary Servin 0:04ac6be8229a 70 u_is_calibrated.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
Gary Servin 0:04ac6be8229a 71 this->is_calibrated = u_is_calibrated.real;
Gary Servin 0:04ac6be8229a 72 offset += sizeof(this->is_calibrated);
Gary Servin 0:04ac6be8229a 73 return offset;
Gary Servin 0:04ac6be8229a 74 }
Gary Servin 0:04ac6be8229a 75
Gary Servin 0:04ac6be8229a 76 const char * getType(){ return QUERYCALIBRATIONSTATE; };
Gary Servin 0:04ac6be8229a 77 const char * getMD5(){ return "28af3beedcb84986b8e470dc5470507d"; };
Gary Servin 0:04ac6be8229a 78
Gary Servin 0:04ac6be8229a 79 };
Gary Servin 0:04ac6be8229a 80
Gary Servin 0:04ac6be8229a 81 class QueryCalibrationState {
Gary Servin 0:04ac6be8229a 82 public:
Gary Servin 0:04ac6be8229a 83 typedef QueryCalibrationStateRequest Request;
Gary Servin 0:04ac6be8229a 84 typedef QueryCalibrationStateResponse Response;
Gary Servin 0:04ac6be8229a 85 };
Gary Servin 0:04ac6be8229a 86
Gary Servin 0:04ac6be8229a 87 }
Gary Servin 0:04ac6be8229a 88 #endif