542 lines
20 KiB
C++
542 lines
20 KiB
C++
/****************************************************************
|
|
|
|
Generated by Eclipse Cyclone DDS IDL to CXX Translator
|
|
File name: AgvBmsState_.idl
|
|
Source: AgvBmsState_.hpp
|
|
Cyclone DDS: v0.10.2
|
|
|
|
*****************************************************************/
|
|
#ifndef DDSCXX_UNITREE_IDL_HG_AGVBMSSTATE__HPP
|
|
#define DDSCXX_UNITREE_IDL_HG_AGVBMSSTATE__HPP
|
|
|
|
#include <cstdint>
|
|
#include <array>
|
|
#include <string>
|
|
|
|
namespace unitree_hg
|
|
{
|
|
namespace msg
|
|
{
|
|
namespace dds_
|
|
{
|
|
class AgvBmsState_
|
|
{
|
|
private:
|
|
std::string software_version_;
|
|
uint8_t battery_percentage_ = 0;
|
|
int32_t current_ = 0;
|
|
std::array<int16_t, 3> temperature_ = { };
|
|
std::string docking_status_;
|
|
bool is_charging_ = false;
|
|
bool is_dc_connected_ = false;
|
|
|
|
public:
|
|
AgvBmsState_() = default;
|
|
|
|
explicit AgvBmsState_(
|
|
const std::string& software_version,
|
|
uint8_t battery_percentage,
|
|
int32_t current,
|
|
const std::array<int16_t, 3>& temperature,
|
|
const std::string& docking_status,
|
|
bool is_charging,
|
|
bool is_dc_connected) :
|
|
software_version_(software_version),
|
|
battery_percentage_(battery_percentage),
|
|
current_(current),
|
|
temperature_(temperature),
|
|
docking_status_(docking_status),
|
|
is_charging_(is_charging),
|
|
is_dc_connected_(is_dc_connected) { }
|
|
|
|
const std::string& software_version() const { return this->software_version_; }
|
|
std::string& software_version() { return this->software_version_; }
|
|
void software_version(const std::string& _val_) { this->software_version_ = _val_; }
|
|
void software_version(std::string&& _val_) { this->software_version_ = _val_; }
|
|
uint8_t battery_percentage() const { return this->battery_percentage_; }
|
|
uint8_t& battery_percentage() { return this->battery_percentage_; }
|
|
void battery_percentage(uint8_t _val_) { this->battery_percentage_ = _val_; }
|
|
int32_t current() const { return this->current_; }
|
|
int32_t& current() { return this->current_; }
|
|
void current(int32_t _val_) { this->current_ = _val_; }
|
|
const std::array<int16_t, 3>& temperature() const { return this->temperature_; }
|
|
std::array<int16_t, 3>& temperature() { return this->temperature_; }
|
|
void temperature(const std::array<int16_t, 3>& _val_) { this->temperature_ = _val_; }
|
|
void temperature(std::array<int16_t, 3>&& _val_) { this->temperature_ = _val_; }
|
|
const std::string& docking_status() const { return this->docking_status_; }
|
|
std::string& docking_status() { return this->docking_status_; }
|
|
void docking_status(const std::string& _val_) { this->docking_status_ = _val_; }
|
|
void docking_status(std::string&& _val_) { this->docking_status_ = _val_; }
|
|
bool is_charging() const { return this->is_charging_; }
|
|
bool& is_charging() { return this->is_charging_; }
|
|
void is_charging(bool _val_) { this->is_charging_ = _val_; }
|
|
bool is_dc_connected() const { return this->is_dc_connected_; }
|
|
bool& is_dc_connected() { return this->is_dc_connected_; }
|
|
void is_dc_connected(bool _val_) { this->is_dc_connected_ = _val_; }
|
|
|
|
bool operator==(const AgvBmsState_& _other) const
|
|
{
|
|
(void) _other;
|
|
return software_version_ == _other.software_version_ &&
|
|
battery_percentage_ == _other.battery_percentage_ &&
|
|
current_ == _other.current_ &&
|
|
temperature_ == _other.temperature_ &&
|
|
docking_status_ == _other.docking_status_ &&
|
|
is_charging_ == _other.is_charging_ &&
|
|
is_dc_connected_ == _other.is_dc_connected_;
|
|
}
|
|
|
|
bool operator!=(const AgvBmsState_& _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<::unitree_hg::msg::dds_::AgvBmsState_>::getTypeName()
|
|
{
|
|
return "unitree_hg::msg::dds_::AgvBmsState_";
|
|
}
|
|
|
|
template <> constexpr bool TopicTraits<::unitree_hg::msg::dds_::AgvBmsState_>::isSelfContained()
|
|
{
|
|
return false;
|
|
}
|
|
|
|
template <> constexpr bool TopicTraits<::unitree_hg::msg::dds_::AgvBmsState_>::isKeyless()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
#ifdef DDSCXX_HAS_TYPE_DISCOVERY
|
|
template<> constexpr unsigned int TopicTraits<::unitree_hg::msg::dds_::AgvBmsState_>::type_map_blob_sz() { return 550; }
|
|
template<> constexpr unsigned int TopicTraits<::unitree_hg::msg::dds_::AgvBmsState_>::type_info_blob_sz() { return 100; }
|
|
template<> inline const uint8_t * TopicTraits<::unitree_hg::msg::dds_::AgvBmsState_>::type_map_blob() {
|
|
static const uint8_t blob[] = {
|
|
0xa7, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xf1, 0xed, 0x44, 0x74, 0x98, 0xd8, 0x24, 0x53,
|
|
0xc2, 0x7f, 0x74, 0xa8, 0x32, 0x31, 0x6b, 0x00, 0x8f, 0x00, 0x00, 0x00, 0xf1, 0x51, 0x01, 0x00,
|
|
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
|
|
0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x70, 0x00, 0xed, 0x06, 0xdc, 0x4c,
|
|
0x0b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x1e, 0x1c, 0x79, 0x06, 0x00,
|
|
0x0b, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x43, 0xb5, 0xc9, 0x17, 0x00,
|
|
0x16, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x90, 0xf3, 0x01, 0x00, 0x00, 0x00,
|
|
0x01, 0x00, 0x00, 0x00, 0x03, 0x03, 0xee, 0xf4, 0x38, 0xf7, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
|
|
0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x70, 0x00, 0xc9, 0xbd, 0x04, 0xb8, 0x0b, 0x00, 0x00, 0x00,
|
|
0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0xb4, 0x46, 0x31, 0x5e, 0x00, 0x0b, 0x00, 0x00, 0x00,
|
|
0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x0d, 0x78, 0x71, 0x07, 0x00, 0x4e, 0x01, 0x00, 0x00,
|
|
0x01, 0x00, 0x00, 0x00, 0xf2, 0xa4, 0x53, 0x00, 0x3b, 0x5b, 0x09, 0xe8, 0x8e, 0x24, 0xb5, 0xc7,
|
|
0x86, 0x52, 0x54, 0x00, 0x36, 0x01, 0x00, 0x00, 0xf2, 0x51, 0x01, 0x00, 0x2c, 0x00, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x75, 0x6e, 0x69, 0x74, 0x72, 0x65, 0x65, 0x5f,
|
|
0x68, 0x67, 0x3a, 0x3a, 0x6d, 0x73, 0x67, 0x3a, 0x3a, 0x64, 0x64, 0x73, 0x5f, 0x3a, 0x3a, 0x41,
|
|
0x67, 0x76, 0x42, 0x6d, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x00, 0xfe, 0x00, 0x00, 0x00,
|
|
0x07, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x70, 0x00,
|
|
0x11, 0x00, 0x00, 0x00, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x5f, 0x76, 0x65, 0x72,
|
|
0x73, 0x69, 0x6f, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
|
0x01, 0x00, 0x02, 0x00, 0x13, 0x00, 0x00, 0x00, 0x62, 0x61, 0x74, 0x74, 0x65, 0x72, 0x79, 0x5f,
|
|
0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
0x16, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00,
|
|
0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00,
|
|
0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x90, 0xf3, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
|
0x03, 0x03, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x74, 0x65, 0x6d, 0x70, 0x65, 0x72, 0x61, 0x74,
|
|
0x75, 0x72, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
|
|
0x01, 0x00, 0x70, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x64, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x5f,
|
|
0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00,
|
|
0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x69, 0x73, 0x5f, 0x63,
|
|
0x68, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00,
|
|
0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x10, 0x00, 0x00, 0x00, 0x69, 0x73, 0x5f, 0x64,
|
|
0x63, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
0x22, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xf2, 0xa4, 0x53, 0x00, 0x3b, 0x5b, 0x09, 0xe8,
|
|
0x8e, 0x24, 0xb5, 0xc7, 0x86, 0x52, 0x54, 0xf1, 0xed, 0x44, 0x74, 0x98, 0xd8, 0x24, 0x53, 0xc2,
|
|
0x7f, 0x74, 0xa8, 0x32, 0x31, 0x6b, };
|
|
return blob;
|
|
}
|
|
template<> inline const uint8_t * TopicTraits<::unitree_hg::msg::dds_::AgvBmsState_>::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, 0xed, 0x44, 0x74, 0x98, 0xd8, 0x24, 0x53, 0xc2, 0x7f, 0x74, 0xa8,
|
|
0x32, 0x31, 0x6b, 0x00, 0x93, 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, 0xa4, 0x53, 0x00, 0x3b, 0x5b, 0x09, 0xe8, 0x8e, 0x24, 0xb5, 0xc7,
|
|
0x86, 0x52, 0x54, 0x00, 0x3a, 0x01, 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<::unitree_hg::msg::dds_::AgvBmsState_>
|
|
{
|
|
static std::string value()
|
|
{
|
|
return org::eclipse::cyclonedds::topic::TopicTraits<::unitree_hg::msg::dds_::AgvBmsState_>::getTypeName();
|
|
}
|
|
};
|
|
|
|
}
|
|
}
|
|
|
|
REGISTER_TOPIC_TYPE(::unitree_hg::msg::dds_::AgvBmsState_)
|
|
|
|
namespace org{
|
|
namespace eclipse{
|
|
namespace cyclonedds{
|
|
namespace core{
|
|
namespace cdr{
|
|
|
|
template<>
|
|
propvec &get_type_props<::unitree_hg::msg::dds_::AgvBmsState_>();
|
|
|
|
template<typename T, std::enable_if_t<std::is_base_of<cdr_stream, T>::value, bool> = true >
|
|
bool write(T& streamer, const ::unitree_hg::msg::dds_::AgvBmsState_& 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 (!write_string(streamer, instance.software_version(), 0))
|
|
return false;
|
|
if (!streamer.finish_member(*prop))
|
|
return false;
|
|
break;
|
|
case 1:
|
|
if (!streamer.start_member(*prop))
|
|
return false;
|
|
if (!write(streamer, instance.battery_percentage()))
|
|
return false;
|
|
if (!streamer.finish_member(*prop))
|
|
return false;
|
|
break;
|
|
case 2:
|
|
if (!streamer.start_member(*prop))
|
|
return false;
|
|
if (!write(streamer, instance.current()))
|
|
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.temperature()[0], instance.temperature().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_string(streamer, instance.docking_status(), 0))
|
|
return false;
|
|
if (!streamer.finish_member(*prop))
|
|
return false;
|
|
break;
|
|
case 5:
|
|
if (!streamer.start_member(*prop))
|
|
return false;
|
|
if (!write(streamer, instance.is_charging()))
|
|
return false;
|
|
if (!streamer.finish_member(*prop))
|
|
return false;
|
|
break;
|
|
case 6:
|
|
if (!streamer.start_member(*prop))
|
|
return false;
|
|
if (!write(streamer, instance.is_dc_connected()))
|
|
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 ::unitree_hg::msg::dds_::AgvBmsState_& instance, bool as_key) {
|
|
auto &props = get_type_props<::unitree_hg::msg::dds_::AgvBmsState_>();
|
|
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, ::unitree_hg::msg::dds_::AgvBmsState_& 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 (!read_string(streamer, instance.software_version(), 0))
|
|
return false;
|
|
if (!streamer.finish_member(*prop))
|
|
return false;
|
|
break;
|
|
case 1:
|
|
if (!streamer.start_member(*prop))
|
|
return false;
|
|
if (!read(streamer, instance.battery_percentage()))
|
|
return false;
|
|
if (!streamer.finish_member(*prop))
|
|
return false;
|
|
break;
|
|
case 2:
|
|
if (!streamer.start_member(*prop))
|
|
return false;
|
|
if (!read(streamer, instance.current()))
|
|
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.temperature()[0], instance.temperature().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_string(streamer, instance.docking_status(), 0))
|
|
return false;
|
|
if (!streamer.finish_member(*prop))
|
|
return false;
|
|
break;
|
|
case 5:
|
|
if (!streamer.start_member(*prop))
|
|
return false;
|
|
if (!read(streamer, instance.is_charging()))
|
|
return false;
|
|
if (!streamer.finish_member(*prop))
|
|
return false;
|
|
break;
|
|
case 6:
|
|
if (!streamer.start_member(*prop))
|
|
return false;
|
|
if (!read(streamer, instance.is_dc_connected()))
|
|
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, ::unitree_hg::msg::dds_::AgvBmsState_& instance, bool as_key) {
|
|
auto &props = get_type_props<::unitree_hg::msg::dds_::AgvBmsState_>();
|
|
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 ::unitree_hg::msg::dds_::AgvBmsState_& 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 (!move_string(streamer, instance.software_version(), 0))
|
|
return false;
|
|
if (!streamer.finish_member(*prop))
|
|
return false;
|
|
break;
|
|
case 1:
|
|
if (!streamer.start_member(*prop))
|
|
return false;
|
|
if (!move(streamer, instance.battery_percentage()))
|
|
return false;
|
|
if (!streamer.finish_member(*prop))
|
|
return false;
|
|
break;
|
|
case 2:
|
|
if (!streamer.start_member(*prop))
|
|
return false;
|
|
if (!move(streamer, instance.current()))
|
|
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.temperature()[0], instance.temperature().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_string(streamer, instance.docking_status(), 0))
|
|
return false;
|
|
if (!streamer.finish_member(*prop))
|
|
return false;
|
|
break;
|
|
case 5:
|
|
if (!streamer.start_member(*prop))
|
|
return false;
|
|
if (!move(streamer, instance.is_charging()))
|
|
return false;
|
|
if (!streamer.finish_member(*prop))
|
|
return false;
|
|
break;
|
|
case 6:
|
|
if (!streamer.start_member(*prop))
|
|
return false;
|
|
if (!move(streamer, instance.is_dc_connected()))
|
|
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 ::unitree_hg::msg::dds_::AgvBmsState_& instance, bool as_key) {
|
|
auto &props = get_type_props<::unitree_hg::msg::dds_::AgvBmsState_>();
|
|
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 ::unitree_hg::msg::dds_::AgvBmsState_& 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 (!max_string(streamer, instance.software_version(), 0))
|
|
return false;
|
|
if (!streamer.finish_member(*prop))
|
|
return false;
|
|
break;
|
|
case 1:
|
|
if (!streamer.start_member(*prop))
|
|
return false;
|
|
if (!max(streamer, instance.battery_percentage()))
|
|
return false;
|
|
if (!streamer.finish_member(*prop))
|
|
return false;
|
|
break;
|
|
case 2:
|
|
if (!streamer.start_member(*prop))
|
|
return false;
|
|
if (!max(streamer, instance.current()))
|
|
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.temperature()[0], instance.temperature().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_string(streamer, instance.docking_status(), 0))
|
|
return false;
|
|
if (!streamer.finish_member(*prop))
|
|
return false;
|
|
break;
|
|
case 5:
|
|
if (!streamer.start_member(*prop))
|
|
return false;
|
|
if (!max(streamer, instance.is_charging()))
|
|
return false;
|
|
if (!streamer.finish_member(*prop))
|
|
return false;
|
|
break;
|
|
case 6:
|
|
if (!streamer.start_member(*prop))
|
|
return false;
|
|
if (!max(streamer, instance.is_dc_connected()))
|
|
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 ::unitree_hg::msg::dds_::AgvBmsState_& instance, bool as_key) {
|
|
auto &props = get_type_props<::unitree_hg::msg::dds_::AgvBmsState_>();
|
|
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_UNITREE_IDL_HG_AGVBMSSTATE__HPP
|