test

Dependencies:   mbed Watchdog

Dependents:   STM32-MC_node

Committer:
ommpy
Date:
Tue Jul 07 15:19:06 2020 +0530
Revision:
2:b7fdc74e5c5d
new board files

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ommpy 2:b7fdc74e5c5d 1 #ifndef _ROS_actionlib_TestGoal_h
ommpy 2:b7fdc74e5c5d 2 #define _ROS_actionlib_TestGoal_h
ommpy 2:b7fdc74e5c5d 3
ommpy 2:b7fdc74e5c5d 4 #include <stdint.h>
ommpy 2:b7fdc74e5c5d 5 #include <string.h>
ommpy 2:b7fdc74e5c5d 6 #include <stdlib.h>
ommpy 2:b7fdc74e5c5d 7 #include "ros/msg.h"
ommpy 2:b7fdc74e5c5d 8
ommpy 2:b7fdc74e5c5d 9 namespace actionlib
ommpy 2:b7fdc74e5c5d 10 {
ommpy 2:b7fdc74e5c5d 11
ommpy 2:b7fdc74e5c5d 12 class TestGoal : public ros::Msg
ommpy 2:b7fdc74e5c5d 13 {
ommpy 2:b7fdc74e5c5d 14 public:
ommpy 2:b7fdc74e5c5d 15 typedef int32_t _goal_type;
ommpy 2:b7fdc74e5c5d 16 _goal_type goal;
ommpy 2:b7fdc74e5c5d 17
ommpy 2:b7fdc74e5c5d 18 TestGoal():
ommpy 2:b7fdc74e5c5d 19 goal(0)
ommpy 2:b7fdc74e5c5d 20 {
ommpy 2:b7fdc74e5c5d 21 }
ommpy 2:b7fdc74e5c5d 22
ommpy 2:b7fdc74e5c5d 23 virtual int serialize(unsigned char *outbuffer) const
ommpy 2:b7fdc74e5c5d 24 {
ommpy 2:b7fdc74e5c5d 25 int offset = 0;
ommpy 2:b7fdc74e5c5d 26 union {
ommpy 2:b7fdc74e5c5d 27 int32_t real;
ommpy 2:b7fdc74e5c5d 28 uint32_t base;
ommpy 2:b7fdc74e5c5d 29 } u_goal;
ommpy 2:b7fdc74e5c5d 30 u_goal.real = this->goal;
ommpy 2:b7fdc74e5c5d 31 *(outbuffer + offset + 0) = (u_goal.base >> (8 * 0)) & 0xFF;
ommpy 2:b7fdc74e5c5d 32 *(outbuffer + offset + 1) = (u_goal.base >> (8 * 1)) & 0xFF;
ommpy 2:b7fdc74e5c5d 33 *(outbuffer + offset + 2) = (u_goal.base >> (8 * 2)) & 0xFF;
ommpy 2:b7fdc74e5c5d 34 *(outbuffer + offset + 3) = (u_goal.base >> (8 * 3)) & 0xFF;
ommpy 2:b7fdc74e5c5d 35 offset += sizeof(this->goal);
ommpy 2:b7fdc74e5c5d 36 return offset;
ommpy 2:b7fdc74e5c5d 37 }
ommpy 2:b7fdc74e5c5d 38
ommpy 2:b7fdc74e5c5d 39 virtual int deserialize(unsigned char *inbuffer)
ommpy 2:b7fdc74e5c5d 40 {
ommpy 2:b7fdc74e5c5d 41 int offset = 0;
ommpy 2:b7fdc74e5c5d 42 union {
ommpy 2:b7fdc74e5c5d 43 int32_t real;
ommpy 2:b7fdc74e5c5d 44 uint32_t base;
ommpy 2:b7fdc74e5c5d 45 } u_goal;
ommpy 2:b7fdc74e5c5d 46 u_goal.base = 0;
ommpy 2:b7fdc74e5c5d 47 u_goal.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
ommpy 2:b7fdc74e5c5d 48 u_goal.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
ommpy 2:b7fdc74e5c5d 49 u_goal.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
ommpy 2:b7fdc74e5c5d 50 u_goal.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
ommpy 2:b7fdc74e5c5d 51 this->goal = u_goal.real;
ommpy 2:b7fdc74e5c5d 52 offset += sizeof(this->goal);
ommpy 2:b7fdc74e5c5d 53 return offset;
ommpy 2:b7fdc74e5c5d 54 }
ommpy 2:b7fdc74e5c5d 55
ommpy 2:b7fdc74e5c5d 56 const char * getType(){ return "actionlib/TestGoal"; };
ommpy 2:b7fdc74e5c5d 57 const char * getMD5(){ return "18df0149936b7aa95588e3862476ebde"; };
ommpy 2:b7fdc74e5c5d 58
ommpy 2:b7fdc74e5c5d 59 };
ommpy 2:b7fdc74e5c5d 60
ommpy 2:b7fdc74e5c5d 61 }
ommpy 2:b7fdc74e5c5d 62 #endif