Porting mros2 as an Mbed library.

Dependents:   mbed-os-example-mros2 example-mbed-mros2-sub-pose example-mbed-mros2-pub-twist example-mbed-mros2-mturtle-teleop

mros2_msgs/std_msgs/msg/float32.hpp

Committer:
smoritaemb
Date:
2022-03-19
Revision:
7:c80f65422d99
Parent:
2:159877d749c2

File content as of revision 7:c80f65422d99:

#include <string>

namespace std_msgs
{
namespace msg
{
class Float32
{
public:
  std::string getTypeName();
  float data;
  void copyToBuf(uint8_t *addrPtr)
  {
    memcpy(addrPtr, &data, 4);
    addrPtr += 4;
  }

  void copyFromBuf(const uint8_t *addrPtr)
  {
    memcpy(&data, addrPtr, 4);
    addrPtr += 4;
  }

  void memAlign(uint8_t *addrPtr){
    return;
  }

  uint8_t getTotalSize()
  {
    return 4;
  }
private:
  std::string type_name = "std_msgs::msg::dds_::Float32";
};
}//namspace msg
}//namespace std_msgs

namespace message_traits
{

template<>
struct TypeName<std_msgs::msg::Float32*> {
  static const char* value()
  {
    return "std_msgs::msg::dds_::Float32_";
  }
};

}