PROJ515 - LED - ROS Serial library for Mbed platforms for ROS Kinetic Kame. Check http://wiki.ros.org/rosserial_mbed/ for more information.
turtlesim/Color.h
- Committer:
- Luka_Danilovic
- Date:
- 2019-05-14
- Revision:
- 3:7bc03f1f0d03
- Parent:
- 0:9e9b7db60fd5
File content as of revision 3:7bc03f1f0d03:
#ifndef _ROS_turtlesim_Color_h #define _ROS_turtlesim_Color_h #include <stdint.h> #include <string.h> #include <stdlib.h> #include "ros/msg.h" namespace turtlesim { class Color : public ros::Msg { public: typedef uint8_t _r_type; _r_type r; typedef uint8_t _g_type; _g_type g; typedef uint8_t _b_type; _b_type b; Color(): r(0), g(0), b(0) { } virtual int serialize(unsigned char *outbuffer) const { int offset = 0; *(outbuffer + offset + 0) = (this->r >> (8 * 0)) & 0xFF; offset += sizeof(this->r); *(outbuffer + offset + 0) = (this->g >> (8 * 0)) & 0xFF; offset += sizeof(this->g); *(outbuffer + offset + 0) = (this->b >> (8 * 0)) & 0xFF; offset += sizeof(this->b); return offset; } virtual int deserialize(unsigned char *inbuffer) { int offset = 0; this->r = ((uint8_t) (*(inbuffer + offset))); offset += sizeof(this->r); this->g = ((uint8_t) (*(inbuffer + offset))); offset += sizeof(this->g); this->b = ((uint8_t) (*(inbuffer + offset))); offset += sizeof(this->b); return offset; } const char * getType(){ return "turtlesim/Color"; }; const char * getMD5(){ return "353891e354491c51aabe32df673fb446"; }; }; } #endif