Go2Py_SIM/cpp_bridge/include/go2py/Imu.hpp

492 lines
17 KiB
C++
Raw Normal View History

2024-01-04 03:15:04 +08:00
/****************************************************************
Generated by Eclipse Cyclone DDS IDL to CXX Translator
File name: Imu.idl
Source: Imu.hpp
Cyclone DDS: v0.10.2
*****************************************************************/
#ifndef DDSCXX_IMU_HPP
#define DDSCXX_IMU_HPP
#include <cstdint>
#include <array>
namespace msgs
{
class Imu
{
private:
std::array<float, 4> q_ = { };
std::array<float, 3> gyro_ = { };
std::array<float, 3> accel_ = { };
std::array<float, 3> rpy_ = { };
uint8_t tmp_ = 0;
public:
Imu() = default;
explicit Imu(
const std::array<float, 4>& q,
const std::array<float, 3>& gyro,
const std::array<float, 3>& accel,
const std::array<float, 3>& rpy,
uint8_t tmp) :
q_(q),
gyro_(gyro),
accel_(accel),
rpy_(rpy),
tmp_(tmp) { }
const std::array<float, 4>& q() const { return this->q_; }
std::array<float, 4>& q() { return this->q_; }
void q(const std::array<float, 4>& _val_) { this->q_ = _val_; }
void q(std::array<float, 4>&& _val_) { this->q_ = _val_; }
const std::array<float, 3>& gyro() const { return this->gyro_; }
std::array<float, 3>& gyro() { return this->gyro_; }
void gyro(const std::array<float, 3>& _val_) { this->gyro_ = _val_; }
void gyro(std::array<float, 3>&& _val_) { this->gyro_ = _val_; }
const std::array<float, 3>& accel() const { return this->accel_; }
std::array<float, 3>& accel() { return this->accel_; }
void accel(const std::array<float, 3>& _val_) { this->accel_ = _val_; }
void accel(std::array<float, 3>&& _val_) { this->accel_ = _val_; }
const std::array<float, 3>& rpy() const { return this->rpy_; }
std::array<float, 3>& rpy() { return this->rpy_; }
void rpy(const std::array<float, 3>& _val_) { this->rpy_ = _val_; }
void rpy(std::array<float, 3>&& _val_) { this->rpy_ = _val_; }
uint8_t tmp() const { return this->tmp_; }
uint8_t& tmp() { return this->tmp_; }
void tmp(uint8_t _val_) { this->tmp_ = _val_; }
bool operator==(const Imu& _other) const
{
(void) _other;
return q_ == _other.q_ &&
gyro_ == _other.gyro_ &&
accel_ == _other.accel_ &&
rpy_ == _other.rpy_ &&
tmp_ == _other.tmp_;
}
bool operator!=(const Imu& _other) const
{
return !(*this == _other);
}
};
}
#include "dds/topic/TopicTraits.hpp"
#include "org/eclipse/cyclonedds/topic/datatopic.hpp"
namespace org {
namespace eclipse {
namespace cyclonedds {
namespace topic {
template <> constexpr const char* TopicTraits<::msgs::Imu>::getTypeName()
{
return "msgs::Imu";
}
template <> constexpr bool TopicTraits<::msgs::Imu>::isKeyless()
{
return true;
}
#ifdef DDSCXX_HAS_TYPE_DISCOVERY
template<> constexpr unsigned int TopicTraits<::msgs::Imu>::type_map_blob_sz() { return 442; }
template<> constexpr unsigned int TopicTraits<::msgs::Imu>::type_info_blob_sz() { return 100; }
template<> inline const uint8_t * TopicTraits<::msgs::Imu>::type_map_blob() {
static const uint8_t blob[] = {
0xab, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xf1, 0xab, 0x8a, 0x74, 0xa0, 0x59, 0x30, 0x63,
0x7f, 0xb3, 0x36, 0xe0, 0x64, 0x6f, 0xd3, 0x00, 0x93, 0x00, 0x00, 0x00, 0xf1, 0x51, 0x01, 0x00,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x90, 0xf3, 0x01, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x04, 0x09, 0x76, 0x94, 0xf4, 0xa6, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x90, 0xf3, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x03, 0x09, 0x41, 0xe1, 0xdb, 0x58, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0x01, 0x00, 0x90, 0xf3, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x09, 0x98, 0x30,
0x99, 0x65, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x90, 0xf3,
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x09, 0xb0, 0x7d, 0x92, 0xed, 0x00, 0x00,
0x0b, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0xfa, 0x81, 0x6e, 0xdb, 0x00,
0xde, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xf2, 0xa1, 0x90, 0x68, 0x0b, 0xcf, 0x24, 0x8c,
0xb4, 0x1b, 0xaa, 0x07, 0x8f, 0xf4, 0x93, 0x00, 0xc6, 0x00, 0x00, 0x00, 0xf2, 0x51, 0x01, 0x00,
0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x6d, 0x73, 0x67, 0x73,
0x3a, 0x3a, 0x49, 0x6d, 0x75, 0x00, 0x00, 0x00, 0xa6, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x90, 0xf3, 0x01, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x04, 0x09, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x71, 0x00, 0x00, 0x00,
0x1f, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x90, 0xf3, 0x01, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x03, 0x09, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x67, 0x79, 0x72, 0x6f,
0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x90, 0xf3,
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x09, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
0x61, 0x63, 0x63, 0x65, 0x6c, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
0x01, 0x00, 0x90, 0xf3, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x09, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x72, 0x70, 0x79, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, 0x74, 0x6d, 0x70, 0x00,
0x00, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xf2, 0xa1, 0x90, 0x68,
0x0b, 0xcf, 0x24, 0x8c, 0xb4, 0x1b, 0xaa, 0x07, 0x8f, 0xf4, 0x93, 0xf1, 0xab, 0x8a, 0x74, 0xa0,
0x59, 0x30, 0x63, 0x7f, 0xb3, 0x36, 0xe0, 0x64, 0x6f, 0xd3, };
return blob;
}
template<> inline const uint8_t * TopicTraits<::msgs::Imu>::type_info_blob() {
static const uint8_t blob[] = {
0x60, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x40, 0x28, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00,
0x14, 0x00, 0x00, 0x00, 0xf1, 0xab, 0x8a, 0x74, 0xa0, 0x59, 0x30, 0x63, 0x7f, 0xb3, 0x36, 0xe0,
0x64, 0x6f, 0xd3, 0x00, 0x97, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x02, 0x10, 0x00, 0x40, 0x28, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00,
0x14, 0x00, 0x00, 0x00, 0xf2, 0xa1, 0x90, 0x68, 0x0b, 0xcf, 0x24, 0x8c, 0xb4, 0x1b, 0xaa, 0x07,
0x8f, 0xf4, 0x93, 0x00, 0xca, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, };
return blob;
}
#endif //DDSCXX_HAS_TYPE_DISCOVERY
} //namespace topic
} //namespace cyclonedds
} //namespace eclipse
} //namespace org
namespace dds {
namespace topic {
template <>
struct topic_type_name<::msgs::Imu>
{
static std::string value()
{
return org::eclipse::cyclonedds::topic::TopicTraits<::msgs::Imu>::getTypeName();
}
};
}
}
REGISTER_TOPIC_TYPE(::msgs::Imu)
namespace org{
namespace eclipse{
namespace cyclonedds{
namespace core{
namespace cdr{
template<>
propvec &get_type_props<::msgs::Imu>();
template<typename T, std::enable_if_t<std::is_base_of<cdr_stream, T>::value, bool> = true >
bool write(T& streamer, const ::msgs::Imu& instance, entity_properties_t *props) {
(void)instance;
if (!streamer.start_struct(*props))
return false;
auto prop = streamer.first_entity(props);
while (prop) {
switch (prop->m_id) {
case 0:
if (!streamer.start_member(*prop))
return false;
if (!streamer.start_consecutive(true, true))
return false;
if (!write(streamer, instance.q()[0], instance.q().size()))
return false;
if (!streamer.finish_consecutive())
return false;
if (!streamer.finish_member(*prop))
return false;
break;
case 1:
if (!streamer.start_member(*prop))
return false;
if (!streamer.start_consecutive(true, true))
return false;
if (!write(streamer, instance.gyro()[0], instance.gyro().size()))
return false;
if (!streamer.finish_consecutive())
return false;
if (!streamer.finish_member(*prop))
return false;
break;
case 2:
if (!streamer.start_member(*prop))
return false;
if (!streamer.start_consecutive(true, true))
return false;
if (!write(streamer, instance.accel()[0], instance.accel().size()))
return false;
if (!streamer.finish_consecutive())
return false;
if (!streamer.finish_member(*prop))
return false;
break;
case 3:
if (!streamer.start_member(*prop))
return false;
if (!streamer.start_consecutive(true, true))
return false;
if (!write(streamer, instance.rpy()[0], instance.rpy().size()))
return false;
if (!streamer.finish_consecutive())
return false;
if (!streamer.finish_member(*prop))
return false;
break;
case 4:
if (!streamer.start_member(*prop))
return false;
if (!write(streamer, instance.tmp()))
return false;
if (!streamer.finish_member(*prop))
return false;
break;
}
prop = streamer.next_entity(prop);
}
return streamer.finish_struct(*props);
}
template<typename S, std::enable_if_t<std::is_base_of<cdr_stream, S>::value, bool> = true >
bool write(S& str, const ::msgs::Imu& instance, bool as_key) {
auto &props = get_type_props<::msgs::Imu>();
str.set_mode(cdr_stream::stream_mode::write, as_key);
return write(str, instance, props.data());
}
template<typename T, std::enable_if_t<std::is_base_of<cdr_stream, T>::value, bool> = true >
bool read(T& streamer, ::msgs::Imu& instance, entity_properties_t *props) {
(void)instance;
if (!streamer.start_struct(*props))
return false;
auto prop = streamer.first_entity(props);
while (prop) {
switch (prop->m_id) {
case 0:
if (!streamer.start_member(*prop))
return false;
if (!streamer.start_consecutive(true, true))
return false;
if (!read(streamer, instance.q()[0], instance.q().size()))
return false;
if (!streamer.finish_consecutive())
return false;
if (!streamer.finish_member(*prop))
return false;
break;
case 1:
if (!streamer.start_member(*prop))
return false;
if (!streamer.start_consecutive(true, true))
return false;
if (!read(streamer, instance.gyro()[0], instance.gyro().size()))
return false;
if (!streamer.finish_consecutive())
return false;
if (!streamer.finish_member(*prop))
return false;
break;
case 2:
if (!streamer.start_member(*prop))
return false;
if (!streamer.start_consecutive(true, true))
return false;
if (!read(streamer, instance.accel()[0], instance.accel().size()))
return false;
if (!streamer.finish_consecutive())
return false;
if (!streamer.finish_member(*prop))
return false;
break;
case 3:
if (!streamer.start_member(*prop))
return false;
if (!streamer.start_consecutive(true, true))
return false;
if (!read(streamer, instance.rpy()[0], instance.rpy().size()))
return false;
if (!streamer.finish_consecutive())
return false;
if (!streamer.finish_member(*prop))
return false;
break;
case 4:
if (!streamer.start_member(*prop))
return false;
if (!read(streamer, instance.tmp()))
return false;
if (!streamer.finish_member(*prop))
return false;
break;
}
prop = streamer.next_entity(prop);
}
return streamer.finish_struct(*props);
}
template<typename S, std::enable_if_t<std::is_base_of<cdr_stream, S>::value, bool> = true >
bool read(S& str, ::msgs::Imu& instance, bool as_key) {
auto &props = get_type_props<::msgs::Imu>();
str.set_mode(cdr_stream::stream_mode::read, as_key);
return read(str, instance, props.data());
}
template<typename T, std::enable_if_t<std::is_base_of<cdr_stream, T>::value, bool> = true >
bool move(T& streamer, const ::msgs::Imu& instance, entity_properties_t *props) {
(void)instance;
if (!streamer.start_struct(*props))
return false;
auto prop = streamer.first_entity(props);
while (prop) {
switch (prop->m_id) {
case 0:
if (!streamer.start_member(*prop))
return false;
if (!streamer.start_consecutive(true, true))
return false;
if (!move(streamer, instance.q()[0], instance.q().size()))
return false;
if (!streamer.finish_consecutive())
return false;
if (!streamer.finish_member(*prop))
return false;
break;
case 1:
if (!streamer.start_member(*prop))
return false;
if (!streamer.start_consecutive(true, true))
return false;
if (!move(streamer, instance.gyro()[0], instance.gyro().size()))
return false;
if (!streamer.finish_consecutive())
return false;
if (!streamer.finish_member(*prop))
return false;
break;
case 2:
if (!streamer.start_member(*prop))
return false;
if (!streamer.start_consecutive(true, true))
return false;
if (!move(streamer, instance.accel()[0], instance.accel().size()))
return false;
if (!streamer.finish_consecutive())
return false;
if (!streamer.finish_member(*prop))
return false;
break;
case 3:
if (!streamer.start_member(*prop))
return false;
if (!streamer.start_consecutive(true, true))
return false;
if (!move(streamer, instance.rpy()[0], instance.rpy().size()))
return false;
if (!streamer.finish_consecutive())
return false;
if (!streamer.finish_member(*prop))
return false;
break;
case 4:
if (!streamer.start_member(*prop))
return false;
if (!move(streamer, instance.tmp()))
return false;
if (!streamer.finish_member(*prop))
return false;
break;
}
prop = streamer.next_entity(prop);
}
return streamer.finish_struct(*props);
}
template<typename S, std::enable_if_t<std::is_base_of<cdr_stream, S>::value, bool> = true >
bool move(S& str, const ::msgs::Imu& instance, bool as_key) {
auto &props = get_type_props<::msgs::Imu>();
str.set_mode(cdr_stream::stream_mode::move, as_key);
return move(str, instance, props.data());
}
template<typename T, std::enable_if_t<std::is_base_of<cdr_stream, T>::value, bool> = true >
bool max(T& streamer, const ::msgs::Imu& instance, entity_properties_t *props) {
(void)instance;
if (!streamer.start_struct(*props))
return false;
auto prop = streamer.first_entity(props);
while (prop) {
switch (prop->m_id) {
case 0:
if (!streamer.start_member(*prop))
return false;
if (!streamer.start_consecutive(true, true))
return false;
if (!max(streamer, instance.q()[0], instance.q().size()))
return false;
if (!streamer.finish_consecutive())
return false;
if (!streamer.finish_member(*prop))
return false;
break;
case 1:
if (!streamer.start_member(*prop))
return false;
if (!streamer.start_consecutive(true, true))
return false;
if (!max(streamer, instance.gyro()[0], instance.gyro().size()))
return false;
if (!streamer.finish_consecutive())
return false;
if (!streamer.finish_member(*prop))
return false;
break;
case 2:
if (!streamer.start_member(*prop))
return false;
if (!streamer.start_consecutive(true, true))
return false;
if (!max(streamer, instance.accel()[0], instance.accel().size()))
return false;
if (!streamer.finish_consecutive())
return false;
if (!streamer.finish_member(*prop))
return false;
break;
case 3:
if (!streamer.start_member(*prop))
return false;
if (!streamer.start_consecutive(true, true))
return false;
if (!max(streamer, instance.rpy()[0], instance.rpy().size()))
return false;
if (!streamer.finish_consecutive())
return false;
if (!streamer.finish_member(*prop))
return false;
break;
case 4:
if (!streamer.start_member(*prop))
return false;
if (!max(streamer, instance.tmp()))
return false;
if (!streamer.finish_member(*prop))
return false;
break;
}
prop = streamer.next_entity(prop);
}
return streamer.finish_struct(*props);
}
template<typename S, std::enable_if_t<std::is_base_of<cdr_stream, S>::value, bool> = true >
bool max(S& str, const ::msgs::Imu& instance, bool as_key) {
auto &props = get_type_props<::msgs::Imu>();
str.set_mode(cdr_stream::stream_mode::max, as_key);
return max(str, instance, props.data());
}
} //namespace cdr
} //namespace core
} //namespace cyclonedds
} //namespace eclipse
} //namespace org
#endif // DDSCXX_IMU_HPP