Lib for Gobeur action

Dependents:  

Gobeur.h

Committer:
mondiaye
Date:
2021-07-05
Revision:
0:7312173b8d5f
Child:
2:853546cbc5fe

File content as of revision 0:7312173b8d5f:

#ifndef _ROS_stm32_gobeur_Gobeur_h
#define _ROS_stm32_gobeur_Gobeur_h

#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include "ros/msg.h"

namespace stm32_gobeur
{

  class Gobeur : public ros::Msg
  {
    public:
      typedef uint8_t _gobeur_right_status_type;
      _gobeur_right_status_type gobeur_right_status;
      typedef uint8_t _gobeur_left_status_type;
      _gobeur_left_status_type gobeur_left_status;
      typedef uint8_t _gobeur_right_aspire_type;
      _gobeur_right_aspire_type gobeur_right_aspire;
      typedef uint8_t _gobeur_left_aspire_type;
      _gobeur_left_aspire_type gobeur_left_aspire;
      typedef uint8_t _game_status_type;
      _game_status_type game_status;
      typedef uint8_t _init_status_type;
      _init_status_type init_status;

    Gobeur():
      gobeur_right_status(0),
      gobeur_left_status(0),
      gobeur_right_aspire(0),
      gobeur_left_aspire(0),
      game_status(0),
      init_status(0)
    {
    }

    virtual int serialize(unsigned char *outbuffer) const
    {
      int offset = 0;
      *(outbuffer + offset + 0) = (this->gobeur_right_status >> (8 * 0)) & 0xFF;
      offset += sizeof(this->gobeur_right_status);
      *(outbuffer + offset + 0) = (this->gobeur_left_status >> (8 * 0)) & 0xFF;
      offset += sizeof(this->gobeur_left_status);
      *(outbuffer + offset + 0) = (this->gobeur_right_aspire >> (8 * 0)) & 0xFF;
      offset += sizeof(this->gobeur_right_aspire);
      *(outbuffer + offset + 0) = (this->gobeur_left_aspire >> (8 * 0)) & 0xFF;
      offset += sizeof(this->gobeur_left_aspire);
      *(outbuffer + offset + 0) = (this->game_status >> (8 * 0)) & 0xFF;
      offset += sizeof(this->game_status);
      *(outbuffer + offset + 0) = (this->init_status >> (8 * 0)) & 0xFF;
      offset += sizeof(this->init_status);
      return offset;
    }

    virtual int deserialize(unsigned char *inbuffer)
    {
      int offset = 0;
      this->gobeur_right_status =  ((uint8_t) (*(inbuffer + offset)));
      offset += sizeof(this->gobeur_right_status);
      this->gobeur_left_status =  ((uint8_t) (*(inbuffer + offset)));
      offset += sizeof(this->gobeur_left_status);
      this->gobeur_right_aspire =  ((uint8_t) (*(inbuffer + offset)));
      offset += sizeof(this->gobeur_right_aspire);
      this->gobeur_left_aspire =  ((uint8_t) (*(inbuffer + offset)));
      offset += sizeof(this->gobeur_left_aspire);
      this->game_status =  ((uint8_t) (*(inbuffer + offset)));
      offset += sizeof(this->game_status);
      this->init_status =  ((uint8_t) (*(inbuffer + offset)));
      offset += sizeof(this->init_status);
     return offset;
    }

    const char * getType(){ return "stm32_gobeur/Gobeur"; };
    const char * getMD5(){ return "5e6d8a0a49a30fe003418b63e30ef455"; };

  };

}
#endif