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

Dependencies:   BufferedSerial

hero_msgs/hero_flipper_state.h

Committer:
gosari
Date:
2022-01-27
Revision:
2:65cba0dcf634

File content as of revision 2:65cba0dcf634:

#ifndef _ROS_hero_msgs_hero_flipper_state_h
#define _ROS_hero_msgs_hero_flipper_state_h

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

namespace hero_msgs
{

  class hero_flipper_state : public ros::Msg
  {
    public:
      typedef float _Depth_type;
      _Depth_type Depth;
      typedef float _Roll_type;
      _Roll_type Roll;
      typedef float _Pitch_type;
      _Pitch_type Pitch;
      typedef float _Yaw_type;
      _Yaw_type Yaw;
      typedef float _velBtmX_type;
      _velBtmX_type velBtmX;
      typedef float _velBtmY_type;
      _velBtmY_type velBtmY;
      typedef float _velBtmZ_type;
      _velBtmZ_type velBtmZ;
      typedef float _Altitude_type;
      _Altitude_type Altitude;
      typedef float _Checksum_type;
      _Checksum_type Checksum;

    hero_flipper_state():
      Depth(0),
      Roll(0),
      Pitch(0),
      Yaw(0),
      velBtmX(0),
      velBtmY(0),
      velBtmZ(0),
      Altitude(0),
      Checksum(0)
    {
    }

    virtual int serialize(unsigned char *outbuffer) const
    {
      int offset = 0;
      union {
        float real;
        uint32_t base;
      } u_Depth;
      u_Depth.real = this->Depth;
      *(outbuffer + offset + 0) = (u_Depth.base >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (u_Depth.base >> (8 * 1)) & 0xFF;
      *(outbuffer + offset + 2) = (u_Depth.base >> (8 * 2)) & 0xFF;
      *(outbuffer + offset + 3) = (u_Depth.base >> (8 * 3)) & 0xFF;
      offset += sizeof(this->Depth);
      union {
        float real;
        uint32_t base;
      } u_Roll;
      u_Roll.real = this->Roll;
      *(outbuffer + offset + 0) = (u_Roll.base >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (u_Roll.base >> (8 * 1)) & 0xFF;
      *(outbuffer + offset + 2) = (u_Roll.base >> (8 * 2)) & 0xFF;
      *(outbuffer + offset + 3) = (u_Roll.base >> (8 * 3)) & 0xFF;
      offset += sizeof(this->Roll);
      union {
        float real;
        uint32_t base;
      } u_Pitch;
      u_Pitch.real = this->Pitch;
      *(outbuffer + offset + 0) = (u_Pitch.base >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (u_Pitch.base >> (8 * 1)) & 0xFF;
      *(outbuffer + offset + 2) = (u_Pitch.base >> (8 * 2)) & 0xFF;
      *(outbuffer + offset + 3) = (u_Pitch.base >> (8 * 3)) & 0xFF;
      offset += sizeof(this->Pitch);
      union {
        float real;
        uint32_t base;
      } u_Yaw;
      u_Yaw.real = this->Yaw;
      *(outbuffer + offset + 0) = (u_Yaw.base >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (u_Yaw.base >> (8 * 1)) & 0xFF;
      *(outbuffer + offset + 2) = (u_Yaw.base >> (8 * 2)) & 0xFF;
      *(outbuffer + offset + 3) = (u_Yaw.base >> (8 * 3)) & 0xFF;
      offset += sizeof(this->Yaw);
      union {
        float real;
        uint32_t base;
      } u_velBtmX;
      u_velBtmX.real = this->velBtmX;
      *(outbuffer + offset + 0) = (u_velBtmX.base >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (u_velBtmX.base >> (8 * 1)) & 0xFF;
      *(outbuffer + offset + 2) = (u_velBtmX.base >> (8 * 2)) & 0xFF;
      *(outbuffer + offset + 3) = (u_velBtmX.base >> (8 * 3)) & 0xFF;
      offset += sizeof(this->velBtmX);
      union {
        float real;
        uint32_t base;
      } u_velBtmY;
      u_velBtmY.real = this->velBtmY;
      *(outbuffer + offset + 0) = (u_velBtmY.base >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (u_velBtmY.base >> (8 * 1)) & 0xFF;
      *(outbuffer + offset + 2) = (u_velBtmY.base >> (8 * 2)) & 0xFF;
      *(outbuffer + offset + 3) = (u_velBtmY.base >> (8 * 3)) & 0xFF;
      offset += sizeof(this->velBtmY);
      union {
        float real;
        uint32_t base;
      } u_velBtmZ;
      u_velBtmZ.real = this->velBtmZ;
      *(outbuffer + offset + 0) = (u_velBtmZ.base >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (u_velBtmZ.base >> (8 * 1)) & 0xFF;
      *(outbuffer + offset + 2) = (u_velBtmZ.base >> (8 * 2)) & 0xFF;
      *(outbuffer + offset + 3) = (u_velBtmZ.base >> (8 * 3)) & 0xFF;
      offset += sizeof(this->velBtmZ);
      union {
        float real;
        uint32_t base;
      } u_Altitude;
      u_Altitude.real = this->Altitude;
      *(outbuffer + offset + 0) = (u_Altitude.base >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (u_Altitude.base >> (8 * 1)) & 0xFF;
      *(outbuffer + offset + 2) = (u_Altitude.base >> (8 * 2)) & 0xFF;
      *(outbuffer + offset + 3) = (u_Altitude.base >> (8 * 3)) & 0xFF;
      offset += sizeof(this->Altitude);
      union {
        float real;
        uint32_t base;
      } u_Checksum;
      u_Checksum.real = this->Checksum;
      *(outbuffer + offset + 0) = (u_Checksum.base >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (u_Checksum.base >> (8 * 1)) & 0xFF;
      *(outbuffer + offset + 2) = (u_Checksum.base >> (8 * 2)) & 0xFF;
      *(outbuffer + offset + 3) = (u_Checksum.base >> (8 * 3)) & 0xFF;
      offset += sizeof(this->Checksum);
      return offset;
    }

    virtual int deserialize(unsigned char *inbuffer)
    {
      int offset = 0;
      union {
        float real;
        uint32_t base;
      } u_Depth;
      u_Depth.base = 0;
      u_Depth.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
      u_Depth.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
      u_Depth.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
      u_Depth.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
      this->Depth = u_Depth.real;
      offset += sizeof(this->Depth);
      union {
        float real;
        uint32_t base;
      } u_Roll;
      u_Roll.base = 0;
      u_Roll.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
      u_Roll.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
      u_Roll.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
      u_Roll.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
      this->Roll = u_Roll.real;
      offset += sizeof(this->Roll);
      union {
        float real;
        uint32_t base;
      } u_Pitch;
      u_Pitch.base = 0;
      u_Pitch.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
      u_Pitch.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
      u_Pitch.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
      u_Pitch.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
      this->Pitch = u_Pitch.real;
      offset += sizeof(this->Pitch);
      union {
        float real;
        uint32_t base;
      } u_Yaw;
      u_Yaw.base = 0;
      u_Yaw.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
      u_Yaw.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
      u_Yaw.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
      u_Yaw.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
      this->Yaw = u_Yaw.real;
      offset += sizeof(this->Yaw);
      union {
        float real;
        uint32_t base;
      } u_velBtmX;
      u_velBtmX.base = 0;
      u_velBtmX.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
      u_velBtmX.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
      u_velBtmX.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
      u_velBtmX.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
      this->velBtmX = u_velBtmX.real;
      offset += sizeof(this->velBtmX);
      union {
        float real;
        uint32_t base;
      } u_velBtmY;
      u_velBtmY.base = 0;
      u_velBtmY.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
      u_velBtmY.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
      u_velBtmY.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
      u_velBtmY.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
      this->velBtmY = u_velBtmY.real;
      offset += sizeof(this->velBtmY);
      union {
        float real;
        uint32_t base;
      } u_velBtmZ;
      u_velBtmZ.base = 0;
      u_velBtmZ.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
      u_velBtmZ.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
      u_velBtmZ.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
      u_velBtmZ.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
      this->velBtmZ = u_velBtmZ.real;
      offset += sizeof(this->velBtmZ);
      union {
        float real;
        uint32_t base;
      } u_Altitude;
      u_Altitude.base = 0;
      u_Altitude.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
      u_Altitude.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
      u_Altitude.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
      u_Altitude.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
      this->Altitude = u_Altitude.real;
      offset += sizeof(this->Altitude);
      union {
        float real;
        uint32_t base;
      } u_Checksum;
      u_Checksum.base = 0;
      u_Checksum.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
      u_Checksum.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
      u_Checksum.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
      u_Checksum.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
      this->Checksum = u_Checksum.real;
      offset += sizeof(this->Checksum);
     return offset;
    }

    const char * getType(){ return "hero_msgs/hero_flipper_state"; };
    const char * getMD5(){ return "3966e56c0419a7687728b66479964a92"; };

  };

}
#endif