From 07f5ab4746f7d000ed05efa0bd7b82f0a45d255a Mon Sep 17 00:00:00 2001 From: Vincent Tumminello Date: Sat, 12 Sep 2026 16:49:25 +1000 Subject: [PATCH 1/7] Fix k1 appearing under field in nusight --- mujoco/config/camera.yaml | 11 +- mujoco/idl/geometry_msgs/msg/Point.idl | 14 + mujoco/idl/geometry_msgs/msg/Pose.idl | 16 + mujoco/idl/geometry_msgs/msg/Quaternion.idl | 15 + mujoco/idl/regenerate.sh | 8 +- mujoco/idl_gen/geometry_msgs/Point.cxx | 341 +++++++++++++++ mujoco/idl_gen/geometry_msgs/Point.h | 258 ++++++++++++ mujoco/idl_gen/geometry_msgs/PointCdrAux.hpp | 51 +++ mujoco/idl_gen/geometry_msgs/PointCdrAux.ipp | 147 +++++++ .../geometry_msgs/PointPubSubTypes.cxx | 233 +++++++++++ .../idl_gen/geometry_msgs/PointPubSubTypes.h | 196 +++++++++ mujoco/idl_gen/geometry_msgs/Pose.cxx | 310 ++++++++++++++ mujoco/idl_gen/geometry_msgs/Pose.h | 253 +++++++++++ mujoco/idl_gen/geometry_msgs/PoseCdrAux.hpp | 51 +++ mujoco/idl_gen/geometry_msgs/PoseCdrAux.ipp | 139 ++++++ .../idl_gen/geometry_msgs/PosePubSubTypes.cxx | 233 +++++++++++ .../idl_gen/geometry_msgs/PosePubSubTypes.h | 198 +++++++++ mujoco/idl_gen/geometry_msgs/Quaternion.cxx | 394 ++++++++++++++++++ mujoco/idl_gen/geometry_msgs/Quaternion.h | 279 +++++++++++++ .../geometry_msgs/QuaternionCdrAux.hpp | 51 +++ .../geometry_msgs/QuaternionCdrAux.ipp | 155 +++++++ .../geometry_msgs/QuaternionPubSubTypes.cxx | 233 +++++++++++ .../geometry_msgs/QuaternionPubSubTypes.h | 196 +++++++++ mujoco/module/Camera/src/Camera.cpp | 19 +- mujoco/module/SdkBridge/CMakeLists.txt | 3 + mujoco/module/SdkBridge/PROTOCOL.md | 21 +- .../module/SdkBridge/src/StatePublisher.cpp | 19 + .../module/SdkBridge/src/StatePublisher.hpp | 5 +- .../SdkBridge/test_support/SyntheticState.cpp | 9 + mujoco/module/Simulation/src/SimCore.cpp | 16 + mujoco/module/Simulation/src/SimCore.hpp | 3 + mujoco/shared/k1/BoosterApi.hpp | 3 + mujoco/shared/message/SimMessages.hpp | 9 + mujoco/shared/sim/HeadPose.hpp | 53 +++ .../contract/host_client/sdk_client_check.cpp | 40 ++ mujoco/test/unit/test_pd_stand.cpp | 51 ++- 36 files changed, 4005 insertions(+), 28 deletions(-) create mode 100644 mujoco/idl/geometry_msgs/msg/Point.idl create mode 100644 mujoco/idl/geometry_msgs/msg/Pose.idl create mode 100644 mujoco/idl/geometry_msgs/msg/Quaternion.idl create mode 100644 mujoco/idl_gen/geometry_msgs/Point.cxx create mode 100644 mujoco/idl_gen/geometry_msgs/Point.h create mode 100644 mujoco/idl_gen/geometry_msgs/PointCdrAux.hpp create mode 100644 mujoco/idl_gen/geometry_msgs/PointCdrAux.ipp create mode 100644 mujoco/idl_gen/geometry_msgs/PointPubSubTypes.cxx create mode 100644 mujoco/idl_gen/geometry_msgs/PointPubSubTypes.h create mode 100644 mujoco/idl_gen/geometry_msgs/Pose.cxx create mode 100644 mujoco/idl_gen/geometry_msgs/Pose.h create mode 100644 mujoco/idl_gen/geometry_msgs/PoseCdrAux.hpp create mode 100644 mujoco/idl_gen/geometry_msgs/PoseCdrAux.ipp create mode 100644 mujoco/idl_gen/geometry_msgs/PosePubSubTypes.cxx create mode 100644 mujoco/idl_gen/geometry_msgs/PosePubSubTypes.h create mode 100644 mujoco/idl_gen/geometry_msgs/Quaternion.cxx create mode 100644 mujoco/idl_gen/geometry_msgs/Quaternion.h create mode 100644 mujoco/idl_gen/geometry_msgs/QuaternionCdrAux.hpp create mode 100644 mujoco/idl_gen/geometry_msgs/QuaternionCdrAux.ipp create mode 100644 mujoco/idl_gen/geometry_msgs/QuaternionPubSubTypes.cxx create mode 100644 mujoco/idl_gen/geometry_msgs/QuaternionPubSubTypes.h create mode 100644 mujoco/shared/sim/HeadPose.hpp diff --git a/mujoco/config/camera.yaml b/mujoco/config/camera.yaml index ce01e2d..12d0ead 100644 --- a/mujoco/config/camera.yaml +++ b/mujoco/config/camera.yaml @@ -18,11 +18,12 @@ segment: _boostercamera_head_rgb -# Head-pose shared-memory segment (K1Sensors "NBPO" layout; must match -# NUbots_K1's K1Sensors.yaml `segment:`). Head (Head_2) pose in the yaw-only -# base footprint frame, like NUbridge on the real robot. This is the only -# path torso tilt takes into NUbots, i.e. what makes fall detection and the -# GetUp chain work. Empty string disables. +# Head-pose shared-memory segment (the NUbridge-era K1Sensors "NBPO" layout). +# Head frame (0.08 m above Head_pitch, as the robot reports it; see +# shared/sim/HeadPose.hpp) in the yaw-only base footprint frame. Current NUbots_K1 +# reads this pose over DDS instead (rt/head_pose, published by module::SdkBridge +# from the same computation); this segment only serves older K1Sensors builds +# that still read `head_pose: - segment:`. Empty string disables. pose_segment: _head_pose # rgb8, so the segment carries width*height*3 pixel bytes after the header -- diff --git a/mujoco/idl/geometry_msgs/msg/Point.idl b/mujoco/idl/geometry_msgs/msg/Point.idl new file mode 100644 index 0000000..dcc4b06 --- /dev/null +++ b/mujoco/idl/geometry_msgs/msg/Point.idl @@ -0,0 +1,14 @@ +// geometry_msgs::msg::dds_::Point_ — see PROTOCOL.md. +// Field layout verified against include/booster/idl/geometry_msgs/Point.h. + +module geometry_msgs { + module msg { + module dds_ { + struct Point_ { + double x; + double y; + double z; + }; + }; + }; +}; diff --git a/mujoco/idl/geometry_msgs/msg/Pose.idl b/mujoco/idl/geometry_msgs/msg/Pose.idl new file mode 100644 index 0000000..616ddc8 --- /dev/null +++ b/mujoco/idl/geometry_msgs/msg/Pose.idl @@ -0,0 +1,16 @@ +// geometry_msgs::msg::dds_::Pose_ — see PROTOCOL.md. +// Field layout verified against include/booster/idl/geometry_msgs/Pose.h. + +#include "Point.idl" +#include "Quaternion.idl" + +module geometry_msgs { + module msg { + module dds_ { + struct Pose_ { + geometry_msgs::msg::dds_::Point_ position; + geometry_msgs::msg::dds_::Quaternion_ orientation; + }; + }; + }; +}; diff --git a/mujoco/idl/geometry_msgs/msg/Quaternion.idl b/mujoco/idl/geometry_msgs/msg/Quaternion.idl new file mode 100644 index 0000000..b8aa557 --- /dev/null +++ b/mujoco/idl/geometry_msgs/msg/Quaternion.idl @@ -0,0 +1,15 @@ +// geometry_msgs::msg::dds_::Quaternion_ — see PROTOCOL.md. +// Field layout verified against include/booster/idl/geometry_msgs/Quaternion.h. + +module geometry_msgs { + module msg { + module dds_ { + struct Quaternion_ { + double x; + double y; + double z; + double w; + }; + }; + }; +}; diff --git a/mujoco/idl/regenerate.sh b/mujoco/idl/regenerate.sh index a4fcd07..a3e7b8a 100755 --- a/mujoco/idl/regenerate.sh +++ b/mujoco/idl/regenerate.sh @@ -36,8 +36,8 @@ OUT_DIR="$ROOT/idl_gen" echo "== fastddsgen version ==" "$FASTDDSGEN" -version -rm -rf "$OUT_DIR/booster_interface" "$OUT_DIR/booster_msgs" -mkdir -p "$OUT_DIR/booster_interface" "$OUT_DIR/booster_msgs" +rm -rf "$OUT_DIR/booster_interface" "$OUT_DIR/booster_msgs" "$OUT_DIR/geometry_msgs" +mkdir -p "$OUT_DIR/booster_interface" "$OUT_DIR/booster_msgs" "$OUT_DIR/geometry_msgs" gen() { local src_dir="$1" @@ -56,5 +56,9 @@ gen "$IDL_DIR/booster_interface/msg" "$OUT_DIR/booster_interface" \ gen "$IDL_DIR/booster_msgs/msg" "$OUT_DIR/booster_msgs" \ RpcReqMsg.idl RpcRespMsg.idl +# geometry_msgs::msg (rt/head_pose) +gen "$IDL_DIR/geometry_msgs/msg" "$OUT_DIR/geometry_msgs" \ + Point.idl Quaternion.idl Pose.idl + echo "== Generated into $OUT_DIR. Registered type names: ==" grep -rho 'setName("[^"]*")' "$OUT_DIR" | sort -u diff --git a/mujoco/idl_gen/geometry_msgs/Point.cxx b/mujoco/idl_gen/geometry_msgs/Point.cxx new file mode 100644 index 0000000..8f0e5d3 --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/Point.cxx @@ -0,0 +1,341 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Point.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "Point.h" + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define geometry_msgs_msg_dds__Point__max_cdr_typesize 24ULL; + + +namespace geometry_msgs { + +namespace msg { + +namespace dds_ { + + + +Point_::Point_() +{ + // double m_x + m_x = 0.0; + // double m_y + m_y = 0.0; + // double m_z + m_z = 0.0; + +} + +Point_::~Point_() +{ +} + +Point_::Point_( + const Point_& x) +{ + m_x = x.m_x; + + + m_y = x.m_y; + + + m_z = x.m_z; + +} + +Point_::Point_( + Point_&& x) noexcept +{ + m_x = x.m_x; + + + m_y = x.m_y; + + + m_z = x.m_z; + +} + +Point_& Point_::operator =( + const Point_& x) +{ + m_x = x.m_x; + + + m_y = x.m_y; + + + m_z = x.m_z; + + return *this; +} + +Point_& Point_::operator =( + Point_&& x) noexcept +{ + m_x = x.m_x; + + + m_y = x.m_y; + + + m_z = x.m_z; + + return *this; +} + +bool Point_::operator ==( + const Point_& x) const +{ + return (m_x == x.m_x && + m_y == x.m_y && + m_z == x.m_z); +} + +bool Point_::operator !=( + const Point_& x) const +{ + return !(*this == x); +} + +size_t Point_::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return geometry_msgs_msg_dds__Point__max_cdr_typesize; +} + +size_t Point_::getCdrSerializedSize( + const Point_& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + return current_alignment - initial_alignment; +} + + +void Point_::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_x; + + scdr << m_y; + + scdr << m_z; + +} + +void Point_::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_x; + + + + dcdr >> m_y; + + + + dcdr >> m_z; + + +} + + +bool Point_::isKeyDefined() +{ + return false; +} + +void Point_::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member x + * @param _x New value for member x + */ +void Point_::x( + double _x) +{ + m_x = _x; +} + +/*! + * @brief This function returns the value of member x + * @return Value of member x + */ +double Point_::x() const +{ + return m_x; +} + +/*! + * @brief This function returns a reference to member x + * @return Reference to member x + */ +double& Point_::x() +{ + return m_x; +} + + +/*! + * @brief This function sets a value in member y + * @param _y New value for member y + */ +void Point_::y( + double _y) +{ + m_y = _y; +} + +/*! + * @brief This function returns the value of member y + * @return Value of member y + */ +double Point_::y() const +{ + return m_y; +} + +/*! + * @brief This function returns a reference to member y + * @return Reference to member y + */ +double& Point_::y() +{ + return m_y; +} + + +/*! + * @brief This function sets a value in member z + * @param _z New value for member z + */ +void Point_::z( + double _z) +{ + m_z = _z; +} + +/*! + * @brief This function returns the value of member z + * @return Value of member z + */ +double Point_::z() const +{ + return m_z; +} + +/*! + * @brief This function returns a reference to member z + * @return Reference to member z + */ +double& Point_::z() +{ + return m_z; +} + + + + + +} // namespace dds_ + + +} // namespace msg + + +} // namespace geometry_msgs + diff --git a/mujoco/idl_gen/geometry_msgs/Point.h b/mujoco/idl_gen/geometry_msgs/Point.h new file mode 100644 index 0000000..287bf59 --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/Point.h @@ -0,0 +1,258 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Point.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINT_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINT_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(POINT_SOURCE) +#define POINT_DllAPI __declspec( dllexport ) +#else +#define POINT_DllAPI __declspec( dllimport ) +#endif // POINT_SOURCE +#else +#define POINT_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define POINT_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + +namespace geometry_msgs { + namespace msg { + namespace dds_ { + + + /*! + * @brief This class represents the structure Point_ defined by the user in the IDL file. + * @ingroup Point + */ + class Point_ + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Point_(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Point_(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object geometry_msgs::msg::dds_::Point_ that will be copied. + */ + eProsima_user_DllExport Point_( + const Point_& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object geometry_msgs::msg::dds_::Point_ that will be copied. + */ + eProsima_user_DllExport Point_( + Point_&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object geometry_msgs::msg::dds_::Point_ that will be copied. + */ + eProsima_user_DllExport Point_& operator =( + const Point_& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object geometry_msgs::msg::dds_::Point_ that will be copied. + */ + eProsima_user_DllExport Point_& operator =( + Point_&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::dds_::Point_ object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Point_& x) const; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::dds_::Point_ object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Point_& x) const; + + /*! + * @brief This function sets a value in member x + * @param _x New value for member x + */ + eProsima_user_DllExport void x( + double _x); + + /*! + * @brief This function returns the value of member x + * @return Value of member x + */ + eProsima_user_DllExport double x() const; + + /*! + * @brief This function returns a reference to member x + * @return Reference to member x + */ + eProsima_user_DllExport double& x(); + + + /*! + * @brief This function sets a value in member y + * @param _y New value for member y + */ + eProsima_user_DllExport void y( + double _y); + + /*! + * @brief This function returns the value of member y + * @return Value of member y + */ + eProsima_user_DllExport double y() const; + + /*! + * @brief This function returns a reference to member y + * @return Reference to member y + */ + eProsima_user_DllExport double& y(); + + + /*! + * @brief This function sets a value in member z + * @param _z New value for member z + */ + eProsima_user_DllExport void z( + double _z); + + /*! + * @brief This function returns the value of member z + * @return Value of member z + */ + eProsima_user_DllExport double z() const; + + /*! + * @brief This function returns a reference to member z + * @return Reference to member z + */ + eProsima_user_DllExport double& z(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const geometry_msgs::msg::dds_::Point_& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + double m_x; + double m_y; + double m_z; + + }; + + } // namespace dds_ + } // namespace msg +} // namespace geometry_msgs + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINT_H_ + + + diff --git a/mujoco/idl_gen/geometry_msgs/PointCdrAux.hpp b/mujoco/idl_gen/geometry_msgs/PointCdrAux.hpp new file mode 100644 index 0000000..73ae762 --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/PointCdrAux.hpp @@ -0,0 +1,51 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PointCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINTCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINTCDRAUX_HPP_ + +#include "Point.h" + +constexpr uint32_t geometry_msgs_msg_dds__Point__max_cdr_typesize {24UL}; +constexpr uint32_t geometry_msgs_msg_dds__Point__max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::Point_& data); + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINTCDRAUX_HPP_ + diff --git a/mujoco/idl_gen/geometry_msgs/PointCdrAux.ipp b/mujoco/idl_gen/geometry_msgs/PointCdrAux.ipp new file mode 100644 index 0000000..787b2fc --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/PointCdrAux.ipp @@ -0,0 +1,147 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PointCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINTCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINTCDRAUX_IPP_ + +#include "PointCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const geometry_msgs::msg::dds_::Point_& data, + size_t& current_alignment) +{ + using namespace geometry_msgs::msg::dds_; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.x(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.y(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.z(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::Point_& data) +{ + using namespace geometry_msgs::msg::dds_; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.x() + << eprosima::fastcdr::MemberId(1) << data.y() + << eprosima::fastcdr::MemberId(2) << data.z() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + geometry_msgs::msg::dds_::Point_& data) +{ + using namespace geometry_msgs::msg::dds_; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.x(); + break; + + case 1: + dcdr >> data.y(); + break; + + case 2: + dcdr >> data.z(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::Point_& data) +{ + using namespace geometry_msgs::msg::dds_; + + static_cast(scdr); + static_cast(data); +} + + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINTCDRAUX_IPP_ + diff --git a/mujoco/idl_gen/geometry_msgs/PointPubSubTypes.cxx b/mujoco/idl_gen/geometry_msgs/PointPubSubTypes.cxx new file mode 100644 index 0000000..6a8a7f5 --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/PointPubSubTypes.cxx @@ -0,0 +1,233 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PointPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#include + +#include "PointPubSubTypes.h" +#include "PointCdrAux.hpp" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + +namespace geometry_msgs { + namespace msg { + namespace dds_ { + + + Point_PubSubType::Point_PubSubType() + { + setName("geometry_msgs::msg::dds_::Point_"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(Point_::getMaxCdrSerializedSize()); + #else + geometry_msgs_msg_dds__Point__max_cdr_typesize; + #endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; + uint32_t keyLength = geometry_msgs_msg_dds__Point__max_key_cdr_typesize > 16 ? geometry_msgs_msg_dds__Point__max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + Point_PubSubType::~Point_PubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool Point_PubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + Point_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else + payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 + return true; + } + + bool Point_PubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + Point_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; + } + + std::function Point_PubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) + { + return [data, data_representation]() -> uint32_t + { + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 + }; + } + + void* Point_PubSubType::createData() + { + return reinterpret_cast(new Point_()); + } + + void Point_PubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool Point_PubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + Point_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + geometry_msgs_msg_dds__Point__max_key_cdr_typesize); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else + eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 + if (force_md5 || geometry_msgs_msg_dds__Point__max_key_cdr_typesize > 16) + { + m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace dds_ + + + } //End of namespace msg + + +} //End of namespace geometry_msgs + diff --git a/mujoco/idl_gen/geometry_msgs/PointPubSubTypes.h b/mujoco/idl_gen/geometry_msgs/PointPubSubTypes.h new file mode 100644 index 0000000..467cf6e --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/PointPubSubTypes.h @@ -0,0 +1,196 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PointPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINT_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINT_PUBSUBTYPES_H_ + +#include +#include +#include +#include +#include + +#include "Point.h" + + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated Point is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace geometry_msgs +{ + namespace msg + { + namespace dds_ + { + + + + #ifndef SWIG + namespace detail { + + template + struct Point__rob + { + friend constexpr typename Tag::type get( + Tag) + { + return M; + } + + }; + + struct Point__f + { + typedef double Point_::* type; + friend constexpr type get( + Point__f); + }; + + template struct Point__rob; + + template + inline size_t constexpr Point__offset_of() + { + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); + } + + } // namespace detail + #endif // ifndef SWIG + + + /*! + * @brief This class represents the TopicDataType of the type Point_ defined by the user in the IDL file. + * @ingroup Point + */ + class Point_PubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef Point_ type; + + eProsima_user_DllExport Point_PubSubType(); + + eProsima_user_DllExport ~Point_PubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return is_plain_xcdrv1_impl(); + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) + { + return is_plain_xcdrv2_impl(); + } + else + { + return is_plain_xcdrv1_impl(); + } + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) Point_(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + private: + + static constexpr bool is_plain_xcdrv1_impl() + { + return 24ULL == + (detail::Point__offset_of() + + sizeof(double)); + } + + static constexpr bool is_plain_xcdrv2_impl() + { + return 24ULL == + (detail::Point__offset_of() + + sizeof(double)); + } + + }; + } + } +} + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINT_PUBSUBTYPES_H_ + diff --git a/mujoco/idl_gen/geometry_msgs/Pose.cxx b/mujoco/idl_gen/geometry_msgs/Pose.cxx new file mode 100644 index 0000000..8e30257 --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/Pose.cxx @@ -0,0 +1,310 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Pose.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "Pose.h" + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define geometry_msgs_msg_dds__Quaternion__max_cdr_typesize 32ULL; +#define geometry_msgs_msg_dds__Point__max_cdr_typesize 24ULL; +#define geometry_msgs_msg_dds__Pose__max_cdr_typesize 56ULL; + + +namespace geometry_msgs { + +namespace msg { + +namespace dds_ { + + + +Pose_::Pose_() +{ + // geometry_msgs::msg::dds_::Point_ m_position + + // geometry_msgs::msg::dds_::Quaternion_ m_orientation + + +} + +Pose_::~Pose_() +{ +} + +Pose_::Pose_( + const Pose_& x) +{ + m_position = x.m_position; + + + m_orientation = x.m_orientation; + +} + +Pose_::Pose_( + Pose_&& x) noexcept +{ + m_position = std::move(x.m_position); + + + m_orientation = std::move(x.m_orientation); + +} + +Pose_& Pose_::operator =( + const Pose_& x) +{ + m_position = x.m_position; + + + m_orientation = x.m_orientation; + + return *this; +} + +Pose_& Pose_::operator =( + Pose_&& x) noexcept +{ + m_position = std::move(x.m_position); + + + m_orientation = std::move(x.m_orientation); + + return *this; +} + +bool Pose_::operator ==( + const Pose_& x) const +{ + return (m_position == x.m_position && + m_orientation == x.m_orientation); +} + +bool Pose_::operator !=( + const Pose_& x) const +{ + return !(*this == x); +} + +size_t Pose_::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return geometry_msgs_msg_dds__Pose__max_cdr_typesize; +} + +size_t Pose_::getCdrSerializedSize( + const Pose_& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += geometry_msgs::msg::dds_::Point_::getCdrSerializedSize(data.position(), current_alignment); + + + current_alignment += geometry_msgs::msg::dds_::Quaternion_::getCdrSerializedSize(data.orientation(), current_alignment); + + + return current_alignment - initial_alignment; +} + + +void Pose_::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_position; + + scdr << m_orientation; + +} + +void Pose_::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_position; + + + + dcdr >> m_orientation; + + +} + + +bool Pose_::isKeyDefined() +{ + return false; +} + +void Pose_::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member position + * @param _position New value to be copied in member position + */ +void Pose_::position( + const geometry_msgs::msg::dds_::Point_& _position) +{ + m_position = _position; +} + +/*! + * @brief This function moves the value in member position + * @param _position New value to be moved in member position + */ +void Pose_::position( + geometry_msgs::msg::dds_::Point_&& _position) +{ + m_position = std::move(_position); +} + +/*! + * @brief This function returns a constant reference to member position + * @return Constant reference to member position + */ +const geometry_msgs::msg::dds_::Point_& Pose_::position() const +{ + return m_position; +} + +/*! + * @brief This function returns a reference to member position + * @return Reference to member position + */ +geometry_msgs::msg::dds_::Point_& Pose_::position() +{ + return m_position; +} + + +/*! + * @brief This function copies the value in member orientation + * @param _orientation New value to be copied in member orientation + */ +void Pose_::orientation( + const geometry_msgs::msg::dds_::Quaternion_& _orientation) +{ + m_orientation = _orientation; +} + +/*! + * @brief This function moves the value in member orientation + * @param _orientation New value to be moved in member orientation + */ +void Pose_::orientation( + geometry_msgs::msg::dds_::Quaternion_&& _orientation) +{ + m_orientation = std::move(_orientation); +} + +/*! + * @brief This function returns a constant reference to member orientation + * @return Constant reference to member orientation + */ +const geometry_msgs::msg::dds_::Quaternion_& Pose_::orientation() const +{ + return m_orientation; +} + +/*! + * @brief This function returns a reference to member orientation + * @return Reference to member orientation + */ +geometry_msgs::msg::dds_::Quaternion_& Pose_::orientation() +{ + return m_orientation; +} + + + + + +} // namespace dds_ + + +} // namespace msg + + +} // namespace geometry_msgs + diff --git a/mujoco/idl_gen/geometry_msgs/Pose.h b/mujoco/idl_gen/geometry_msgs/Pose.h new file mode 100644 index 0000000..4a01c24 --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/Pose.h @@ -0,0 +1,253 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Pose.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSE_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSE_H_ + +#include "Quaternion.h" +#include "Point.h" + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(POSE_SOURCE) +#define POSE_DllAPI __declspec( dllexport ) +#else +#define POSE_DllAPI __declspec( dllimport ) +#endif // POSE_SOURCE +#else +#define POSE_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define POSE_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + +namespace geometry_msgs { + namespace msg { + namespace dds_ { + + + /*! + * @brief This class represents the structure Pose_ defined by the user in the IDL file. + * @ingroup Pose + */ + class Pose_ + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Pose_(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Pose_(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object geometry_msgs::msg::dds_::Pose_ that will be copied. + */ + eProsima_user_DllExport Pose_( + const Pose_& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object geometry_msgs::msg::dds_::Pose_ that will be copied. + */ + eProsima_user_DllExport Pose_( + Pose_&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object geometry_msgs::msg::dds_::Pose_ that will be copied. + */ + eProsima_user_DllExport Pose_& operator =( + const Pose_& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object geometry_msgs::msg::dds_::Pose_ that will be copied. + */ + eProsima_user_DllExport Pose_& operator =( + Pose_&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::dds_::Pose_ object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Pose_& x) const; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::dds_::Pose_ object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Pose_& x) const; + + /*! + * @brief This function copies the value in member position + * @param _position New value to be copied in member position + */ + eProsima_user_DllExport void position( + const geometry_msgs::msg::dds_::Point_& _position); + + /*! + * @brief This function moves the value in member position + * @param _position New value to be moved in member position + */ + eProsima_user_DllExport void position( + geometry_msgs::msg::dds_::Point_&& _position); + + /*! + * @brief This function returns a constant reference to member position + * @return Constant reference to member position + */ + eProsima_user_DllExport const geometry_msgs::msg::dds_::Point_& position() const; + + /*! + * @brief This function returns a reference to member position + * @return Reference to member position + */ + eProsima_user_DllExport geometry_msgs::msg::dds_::Point_& position(); + + + /*! + * @brief This function copies the value in member orientation + * @param _orientation New value to be copied in member orientation + */ + eProsima_user_DllExport void orientation( + const geometry_msgs::msg::dds_::Quaternion_& _orientation); + + /*! + * @brief This function moves the value in member orientation + * @param _orientation New value to be moved in member orientation + */ + eProsima_user_DllExport void orientation( + geometry_msgs::msg::dds_::Quaternion_&& _orientation); + + /*! + * @brief This function returns a constant reference to member orientation + * @return Constant reference to member orientation + */ + eProsima_user_DllExport const geometry_msgs::msg::dds_::Quaternion_& orientation() const; + + /*! + * @brief This function returns a reference to member orientation + * @return Reference to member orientation + */ + eProsima_user_DllExport geometry_msgs::msg::dds_::Quaternion_& orientation(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const geometry_msgs::msg::dds_::Pose_& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + geometry_msgs::msg::dds_::Point_ m_position; + geometry_msgs::msg::dds_::Quaternion_ m_orientation; + + }; + + } // namespace dds_ + } // namespace msg +} // namespace geometry_msgs + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSE_H_ + + + diff --git a/mujoco/idl_gen/geometry_msgs/PoseCdrAux.hpp b/mujoco/idl_gen/geometry_msgs/PoseCdrAux.hpp new file mode 100644 index 0000000..a431d3a --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/PoseCdrAux.hpp @@ -0,0 +1,51 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PoseCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSECDRAUX_HPP_ + +#include "Pose.h" + +constexpr uint32_t geometry_msgs_msg_dds__Pose__max_cdr_typesize {56UL}; +constexpr uint32_t geometry_msgs_msg_dds__Pose__max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::Pose_& data); + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSECDRAUX_HPP_ + diff --git a/mujoco/idl_gen/geometry_msgs/PoseCdrAux.ipp b/mujoco/idl_gen/geometry_msgs/PoseCdrAux.ipp new file mode 100644 index 0000000..ff157bc --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/PoseCdrAux.ipp @@ -0,0 +1,139 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PoseCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSECDRAUX_IPP_ + +#include "PoseCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const geometry_msgs::msg::dds_::Pose_& data, + size_t& current_alignment) +{ + using namespace geometry_msgs::msg::dds_; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.position(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.orientation(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::Pose_& data) +{ + using namespace geometry_msgs::msg::dds_; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.position() + << eprosima::fastcdr::MemberId(1) << data.orientation() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + geometry_msgs::msg::dds_::Pose_& data) +{ + using namespace geometry_msgs::msg::dds_; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.position(); + break; + + case 1: + dcdr >> data.orientation(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::Pose_& data) +{ + using namespace geometry_msgs::msg::dds_; + + static_cast(scdr); + static_cast(data); +} + + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSECDRAUX_IPP_ + diff --git a/mujoco/idl_gen/geometry_msgs/PosePubSubTypes.cxx b/mujoco/idl_gen/geometry_msgs/PosePubSubTypes.cxx new file mode 100644 index 0000000..abce5e0 --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/PosePubSubTypes.cxx @@ -0,0 +1,233 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PosePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#include + +#include "PosePubSubTypes.h" +#include "PoseCdrAux.hpp" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + +namespace geometry_msgs { + namespace msg { + namespace dds_ { + + + Pose_PubSubType::Pose_PubSubType() + { + setName("geometry_msgs::msg::dds_::Pose_"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(Pose_::getMaxCdrSerializedSize()); + #else + geometry_msgs_msg_dds__Pose__max_cdr_typesize; + #endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; + uint32_t keyLength = geometry_msgs_msg_dds__Pose__max_key_cdr_typesize > 16 ? geometry_msgs_msg_dds__Pose__max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + Pose_PubSubType::~Pose_PubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool Pose_PubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + Pose_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else + payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 + return true; + } + + bool Pose_PubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + Pose_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; + } + + std::function Pose_PubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) + { + return [data, data_representation]() -> uint32_t + { + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 + }; + } + + void* Pose_PubSubType::createData() + { + return reinterpret_cast(new Pose_()); + } + + void Pose_PubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool Pose_PubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + Pose_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + geometry_msgs_msg_dds__Pose__max_key_cdr_typesize); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else + eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 + if (force_md5 || geometry_msgs_msg_dds__Pose__max_key_cdr_typesize > 16) + { + m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace dds_ + + + } //End of namespace msg + + +} //End of namespace geometry_msgs + diff --git a/mujoco/idl_gen/geometry_msgs/PosePubSubTypes.h b/mujoco/idl_gen/geometry_msgs/PosePubSubTypes.h new file mode 100644 index 0000000..1c11f5f --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/PosePubSubTypes.h @@ -0,0 +1,198 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PosePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSE_PUBSUBTYPES_H_ + +#include +#include +#include +#include +#include + +#include "Pose.h" + +#include "QuaternionPubSubTypes.h" +#include "PointPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated Pose is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace geometry_msgs +{ + namespace msg + { + namespace dds_ + { + + + + #ifndef SWIG + namespace detail { + + template + struct Pose__rob + { + friend constexpr typename Tag::type get( + Tag) + { + return M; + } + + }; + + struct Pose__f + { + typedef geometry_msgs::msg::dds_::Quaternion_ Pose_::* type; + friend constexpr type get( + Pose__f); + }; + + template struct Pose__rob; + + template + inline size_t constexpr Pose__offset_of() + { + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); + } + + } // namespace detail + #endif // ifndef SWIG + + + /*! + * @brief This class represents the TopicDataType of the type Pose_ defined by the user in the IDL file. + * @ingroup Pose + */ + class Pose_PubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef Pose_ type; + + eProsima_user_DllExport Pose_PubSubType(); + + eProsima_user_DllExport ~Pose_PubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return is_plain_xcdrv1_impl(); + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) + { + return is_plain_xcdrv2_impl(); + } + else + { + return is_plain_xcdrv1_impl(); + } + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) Pose_(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + private: + + static constexpr bool is_plain_xcdrv1_impl() + { + return 56ULL == + (detail::Pose__offset_of() + + sizeof(geometry_msgs::msg::dds_::Quaternion_)); + } + + static constexpr bool is_plain_xcdrv2_impl() + { + return 56ULL == + (detail::Pose__offset_of() + + sizeof(geometry_msgs::msg::dds_::Quaternion_)); + } + + }; + } + } +} + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSE_PUBSUBTYPES_H_ + diff --git a/mujoco/idl_gen/geometry_msgs/Quaternion.cxx b/mujoco/idl_gen/geometry_msgs/Quaternion.cxx new file mode 100644 index 0000000..a6a9b05 --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/Quaternion.cxx @@ -0,0 +1,394 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Quaternion.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "Quaternion.h" + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define geometry_msgs_msg_dds__Quaternion__max_cdr_typesize 32ULL; + + +namespace geometry_msgs { + +namespace msg { + +namespace dds_ { + + + +Quaternion_::Quaternion_() +{ + // double m_x + m_x = 0.0; + // double m_y + m_y = 0.0; + // double m_z + m_z = 0.0; + // double m_w + m_w = 0.0; + +} + +Quaternion_::~Quaternion_() +{ +} + +Quaternion_::Quaternion_( + const Quaternion_& x) +{ + m_x = x.m_x; + + + m_y = x.m_y; + + + m_z = x.m_z; + + + m_w = x.m_w; + +} + +Quaternion_::Quaternion_( + Quaternion_&& x) noexcept +{ + m_x = x.m_x; + + + m_y = x.m_y; + + + m_z = x.m_z; + + + m_w = x.m_w; + +} + +Quaternion_& Quaternion_::operator =( + const Quaternion_& x) +{ + m_x = x.m_x; + + + m_y = x.m_y; + + + m_z = x.m_z; + + + m_w = x.m_w; + + return *this; +} + +Quaternion_& Quaternion_::operator =( + Quaternion_&& x) noexcept +{ + m_x = x.m_x; + + + m_y = x.m_y; + + + m_z = x.m_z; + + + m_w = x.m_w; + + return *this; +} + +bool Quaternion_::operator ==( + const Quaternion_& x) const +{ + return (m_x == x.m_x && + m_y == x.m_y && + m_z == x.m_z && + m_w == x.m_w); +} + +bool Quaternion_::operator !=( + const Quaternion_& x) const +{ + return !(*this == x); +} + +size_t Quaternion_::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return geometry_msgs_msg_dds__Quaternion__max_cdr_typesize; +} + +size_t Quaternion_::getCdrSerializedSize( + const Quaternion_& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + return current_alignment - initial_alignment; +} + + +void Quaternion_::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_x; + + scdr << m_y; + + scdr << m_z; + + scdr << m_w; + +} + +void Quaternion_::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_x; + + + + dcdr >> m_y; + + + + dcdr >> m_z; + + + + dcdr >> m_w; + + +} + + +bool Quaternion_::isKeyDefined() +{ + return false; +} + +void Quaternion_::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member x + * @param _x New value for member x + */ +void Quaternion_::x( + double _x) +{ + m_x = _x; +} + +/*! + * @brief This function returns the value of member x + * @return Value of member x + */ +double Quaternion_::x() const +{ + return m_x; +} + +/*! + * @brief This function returns a reference to member x + * @return Reference to member x + */ +double& Quaternion_::x() +{ + return m_x; +} + + +/*! + * @brief This function sets a value in member y + * @param _y New value for member y + */ +void Quaternion_::y( + double _y) +{ + m_y = _y; +} + +/*! + * @brief This function returns the value of member y + * @return Value of member y + */ +double Quaternion_::y() const +{ + return m_y; +} + +/*! + * @brief This function returns a reference to member y + * @return Reference to member y + */ +double& Quaternion_::y() +{ + return m_y; +} + + +/*! + * @brief This function sets a value in member z + * @param _z New value for member z + */ +void Quaternion_::z( + double _z) +{ + m_z = _z; +} + +/*! + * @brief This function returns the value of member z + * @return Value of member z + */ +double Quaternion_::z() const +{ + return m_z; +} + +/*! + * @brief This function returns a reference to member z + * @return Reference to member z + */ +double& Quaternion_::z() +{ + return m_z; +} + + +/*! + * @brief This function sets a value in member w + * @param _w New value for member w + */ +void Quaternion_::w( + double _w) +{ + m_w = _w; +} + +/*! + * @brief This function returns the value of member w + * @return Value of member w + */ +double Quaternion_::w() const +{ + return m_w; +} + +/*! + * @brief This function returns a reference to member w + * @return Reference to member w + */ +double& Quaternion_::w() +{ + return m_w; +} + + + + + +} // namespace dds_ + + +} // namespace msg + + +} // namespace geometry_msgs + diff --git a/mujoco/idl_gen/geometry_msgs/Quaternion.h b/mujoco/idl_gen/geometry_msgs/Quaternion.h new file mode 100644 index 0000000..52ea093 --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/Quaternion.h @@ -0,0 +1,279 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Quaternion.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNION_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNION_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(QUATERNION_SOURCE) +#define QUATERNION_DllAPI __declspec( dllexport ) +#else +#define QUATERNION_DllAPI __declspec( dllimport ) +#endif // QUATERNION_SOURCE +#else +#define QUATERNION_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define QUATERNION_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + +namespace geometry_msgs { + namespace msg { + namespace dds_ { + + + /*! + * @brief This class represents the structure Quaternion_ defined by the user in the IDL file. + * @ingroup Quaternion + */ + class Quaternion_ + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Quaternion_(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Quaternion_(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object geometry_msgs::msg::dds_::Quaternion_ that will be copied. + */ + eProsima_user_DllExport Quaternion_( + const Quaternion_& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object geometry_msgs::msg::dds_::Quaternion_ that will be copied. + */ + eProsima_user_DllExport Quaternion_( + Quaternion_&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object geometry_msgs::msg::dds_::Quaternion_ that will be copied. + */ + eProsima_user_DllExport Quaternion_& operator =( + const Quaternion_& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object geometry_msgs::msg::dds_::Quaternion_ that will be copied. + */ + eProsima_user_DllExport Quaternion_& operator =( + Quaternion_&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::dds_::Quaternion_ object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Quaternion_& x) const; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::dds_::Quaternion_ object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Quaternion_& x) const; + + /*! + * @brief This function sets a value in member x + * @param _x New value for member x + */ + eProsima_user_DllExport void x( + double _x); + + /*! + * @brief This function returns the value of member x + * @return Value of member x + */ + eProsima_user_DllExport double x() const; + + /*! + * @brief This function returns a reference to member x + * @return Reference to member x + */ + eProsima_user_DllExport double& x(); + + + /*! + * @brief This function sets a value in member y + * @param _y New value for member y + */ + eProsima_user_DllExport void y( + double _y); + + /*! + * @brief This function returns the value of member y + * @return Value of member y + */ + eProsima_user_DllExport double y() const; + + /*! + * @brief This function returns a reference to member y + * @return Reference to member y + */ + eProsima_user_DllExport double& y(); + + + /*! + * @brief This function sets a value in member z + * @param _z New value for member z + */ + eProsima_user_DllExport void z( + double _z); + + /*! + * @brief This function returns the value of member z + * @return Value of member z + */ + eProsima_user_DllExport double z() const; + + /*! + * @brief This function returns a reference to member z + * @return Reference to member z + */ + eProsima_user_DllExport double& z(); + + + /*! + * @brief This function sets a value in member w + * @param _w New value for member w + */ + eProsima_user_DllExport void w( + double _w); + + /*! + * @brief This function returns the value of member w + * @return Value of member w + */ + eProsima_user_DllExport double w() const; + + /*! + * @brief This function returns a reference to member w + * @return Reference to member w + */ + eProsima_user_DllExport double& w(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const geometry_msgs::msg::dds_::Quaternion_& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + double m_x; + double m_y; + double m_z; + double m_w; + + }; + + } // namespace dds_ + } // namespace msg +} // namespace geometry_msgs + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNION_H_ + + + diff --git a/mujoco/idl_gen/geometry_msgs/QuaternionCdrAux.hpp b/mujoco/idl_gen/geometry_msgs/QuaternionCdrAux.hpp new file mode 100644 index 0000000..b284816 --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/QuaternionCdrAux.hpp @@ -0,0 +1,51 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file QuaternionCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNIONCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNIONCDRAUX_HPP_ + +#include "Quaternion.h" + +constexpr uint32_t geometry_msgs_msg_dds__Quaternion__max_cdr_typesize {32UL}; +constexpr uint32_t geometry_msgs_msg_dds__Quaternion__max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::Quaternion_& data); + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNIONCDRAUX_HPP_ + diff --git a/mujoco/idl_gen/geometry_msgs/QuaternionCdrAux.ipp b/mujoco/idl_gen/geometry_msgs/QuaternionCdrAux.ipp new file mode 100644 index 0000000..8a3b135 --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/QuaternionCdrAux.ipp @@ -0,0 +1,155 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file QuaternionCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNIONCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNIONCDRAUX_IPP_ + +#include "QuaternionCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const geometry_msgs::msg::dds_::Quaternion_& data, + size_t& current_alignment) +{ + using namespace geometry_msgs::msg::dds_; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.x(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.y(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.z(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.w(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::Quaternion_& data) +{ + using namespace geometry_msgs::msg::dds_; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.x() + << eprosima::fastcdr::MemberId(1) << data.y() + << eprosima::fastcdr::MemberId(2) << data.z() + << eprosima::fastcdr::MemberId(3) << data.w() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + geometry_msgs::msg::dds_::Quaternion_& data) +{ + using namespace geometry_msgs::msg::dds_; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.x(); + break; + + case 1: + dcdr >> data.y(); + break; + + case 2: + dcdr >> data.z(); + break; + + case 3: + dcdr >> data.w(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::Quaternion_& data) +{ + using namespace geometry_msgs::msg::dds_; + + static_cast(scdr); + static_cast(data); +} + + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNIONCDRAUX_IPP_ + diff --git a/mujoco/idl_gen/geometry_msgs/QuaternionPubSubTypes.cxx b/mujoco/idl_gen/geometry_msgs/QuaternionPubSubTypes.cxx new file mode 100644 index 0000000..1a32c96 --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/QuaternionPubSubTypes.cxx @@ -0,0 +1,233 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file QuaternionPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#include + +#include "QuaternionPubSubTypes.h" +#include "QuaternionCdrAux.hpp" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + +namespace geometry_msgs { + namespace msg { + namespace dds_ { + + + Quaternion_PubSubType::Quaternion_PubSubType() + { + setName("geometry_msgs::msg::dds_::Quaternion_"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(Quaternion_::getMaxCdrSerializedSize()); + #else + geometry_msgs_msg_dds__Quaternion__max_cdr_typesize; + #endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; + uint32_t keyLength = geometry_msgs_msg_dds__Quaternion__max_key_cdr_typesize > 16 ? geometry_msgs_msg_dds__Quaternion__max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + Quaternion_PubSubType::~Quaternion_PubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool Quaternion_PubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + Quaternion_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else + payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 + return true; + } + + bool Quaternion_PubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + Quaternion_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; + } + + std::function Quaternion_PubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) + { + return [data, data_representation]() -> uint32_t + { + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 + }; + } + + void* Quaternion_PubSubType::createData() + { + return reinterpret_cast(new Quaternion_()); + } + + void Quaternion_PubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool Quaternion_PubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + Quaternion_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + geometry_msgs_msg_dds__Quaternion__max_key_cdr_typesize); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else + eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 + if (force_md5 || geometry_msgs_msg_dds__Quaternion__max_key_cdr_typesize > 16) + { + m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace dds_ + + + } //End of namespace msg + + +} //End of namespace geometry_msgs + diff --git a/mujoco/idl_gen/geometry_msgs/QuaternionPubSubTypes.h b/mujoco/idl_gen/geometry_msgs/QuaternionPubSubTypes.h new file mode 100644 index 0000000..9a7dbcd --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/QuaternionPubSubTypes.h @@ -0,0 +1,196 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file QuaternionPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNION_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNION_PUBSUBTYPES_H_ + +#include +#include +#include +#include +#include + +#include "Quaternion.h" + + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated Quaternion is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace geometry_msgs +{ + namespace msg + { + namespace dds_ + { + + + + #ifndef SWIG + namespace detail { + + template + struct Quaternion__rob + { + friend constexpr typename Tag::type get( + Tag) + { + return M; + } + + }; + + struct Quaternion__f + { + typedef double Quaternion_::* type; + friend constexpr type get( + Quaternion__f); + }; + + template struct Quaternion__rob; + + template + inline size_t constexpr Quaternion__offset_of() + { + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); + } + + } // namespace detail + #endif // ifndef SWIG + + + /*! + * @brief This class represents the TopicDataType of the type Quaternion_ defined by the user in the IDL file. + * @ingroup Quaternion + */ + class Quaternion_PubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef Quaternion_ type; + + eProsima_user_DllExport Quaternion_PubSubType(); + + eProsima_user_DllExport ~Quaternion_PubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return is_plain_xcdrv1_impl(); + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) + { + return is_plain_xcdrv2_impl(); + } + else + { + return is_plain_xcdrv1_impl(); + } + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) Quaternion_(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + private: + + static constexpr bool is_plain_xcdrv1_impl() + { + return 32ULL == + (detail::Quaternion__offset_of() + + sizeof(double)); + } + + static constexpr bool is_plain_xcdrv2_impl() + { + return 32ULL == + (detail::Quaternion__offset_of() + + sizeof(double)); + } + + }; + } + } +} + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNION_PUBSUBTYPES_H_ + diff --git a/mujoco/module/Camera/src/Camera.cpp b/mujoco/module/Camera/src/Camera.cpp index 85d2721..79f86ea 100644 --- a/mujoco/module/Camera/src/Camera.cpp +++ b/mujoco/module/Camera/src/Camera.cpp @@ -15,6 +15,7 @@ #include "module/Camera/src/EglContext.hpp" #include "module/Camera/src/SharedImageWriter.hpp" #include "module/Camera/src/SharedPoseWriter.hpp" +#include "shared/sim/HeadPose.hpp" #include "shared/util/Config.hpp" namespace k1sim::module { @@ -236,21 +237,9 @@ void Camera::render_loop(camera::CameraConfig cfg) { } } if (pose_writer != nullptr) { - // Hrh = (translate(base_x, base_y, 0) * rotz(base_yaw))^-1 * Hwh: head pose in - // the yaw-only base footprint frame, so K1Sensors' yaw-only odometry (Hwr) can - // recompose the true world pose — including torso tilt when fallen. - const mjtNum yaw = std::atan2(2.0 * (base_q[0] * base_q[3] + base_q[1] * base_q[2]), - 1.0 - 2.0 * (base_q[2] * base_q[2] + base_q[3] * base_q[3])); - const mjtNum axis[3]{0, 0, 1}; - mjtNum neg_yaw_q[4]; - mju_axisAngle2Quat(neg_yaw_q, axis, -yaw); - const mjtNum rel_w[3]{head_p[0] - base_xy[0], head_p[1] - base_xy[1], head_p[2]}; - mjtNum rel_p[3]; - mju_rotVecQuat(rel_p, rel_w, neg_yaw_q); - mjtNum rel_q[4]; - mju_mulQuat(rel_q, neg_yaw_q, head_q); - const double pos[3]{rel_p[0], rel_p[1], rel_p[2]}; - const double quat_xyzw[4]{rel_q[1], rel_q[2], rel_q[3], rel_q[0]}; + const FootprintPose Hrh = head_in_footprint(head_p, head_q, base_xy, base_q); + const double pos[3]{Hrh.position[0], Hrh.position[1], Hrh.position[2]}; + const double quat_xyzw[4]{Hrh.quat[1], Hrh.quat[2], Hrh.quat[3], Hrh.quat[0]}; pose_writer->publish(pos, quat_xyzw); } mjr_render(viewport, &scn, &con); diff --git a/mujoco/module/SdkBridge/CMakeLists.txt b/mujoco/module/SdkBridge/CMakeLists.txt index 98e8cdc..9ff18da 100644 --- a/mujoco/module/SdkBridge/CMakeLists.txt +++ b/mujoco/module/SdkBridge/CMakeLists.txt @@ -5,10 +5,12 @@ set(K1SIM_IDL_GEN_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../idl_gen) file(GLOB k1sim_idl_srcs CONFIGURE_DEPENDS ${K1SIM_IDL_GEN_DIR}/booster_interface/*.cxx ${K1SIM_IDL_GEN_DIR}/booster_msgs/*.cxx + ${K1SIM_IDL_GEN_DIR}/geometry_msgs/*.cxx ) file(GLOB k1sim_idl_ipp CONFIGURE_DEPENDS ${K1SIM_IDL_GEN_DIR}/booster_interface/*.ipp ${K1SIM_IDL_GEN_DIR}/booster_msgs/*.ipp + ${K1SIM_IDL_GEN_DIR}/geometry_msgs/*.ipp ) # Each CdrAux.ipp holds explicit fastcdr template specializations # (calculate_serialized_size/serialize/deserialize/serialize_key for that exact @@ -23,6 +25,7 @@ add_library(k1sim_idl STATIC ${k1sim_idl_srcs} ${k1sim_idl_ipp}) target_include_directories( k1sim_idl PUBLIC ${K1SIM_IDL_GEN_DIR}/booster_interface ${K1SIM_IDL_GEN_DIR}/booster_msgs + ${K1SIM_IDL_GEN_DIR}/geometry_msgs ) target_link_libraries(k1sim_idl PUBLIC fastrtps fastcdr) diff --git a/mujoco/module/SdkBridge/PROTOCOL.md b/mujoco/module/SdkBridge/PROTOCOL.md index 5c2993b..c74354b 100644 --- a/mujoco/module/SdkBridge/PROTOCOL.md +++ b/mujoco/module/SdkBridge/PROTOCOL.md @@ -88,6 +88,20 @@ fastddsgen maps to unsigned `octet`/`uint8_t` in the generated C++ — this is t Topic `rt/odometer_state`. Planar ground-truth pose (m, m, rad). +### `geometry_msgs::msg::dds_::Pose_` (geometry_msgs/Pose.h) +| # | field | type | +|---|---|---| +| 1 | `position` | `geometry_msgs::msg::dds_::Point_` (`x`, `y`, `z` : `double`) | +| 2 | `orientation` | `geometry_msgs::msg::dds_::Quaternion_` (`x`, `y`, `z`, `w` : `double`) | + +Topic `rt/head_pose`. Not an SDK API topic: it is what NUbots_K1's `input::K1Sensors` +subscribes to (reliable) for the head pose in the yaw-only base footprint frame, which it +composes with `rt/odometer_state` to place the camera and torso in the world. The head +frame is the robot's, 0.08 m above the `Head_pitch` joint along the head z-axis, not the +`Head_2` body origin: K1Sensors' `Hhp` removes that offset (see `shared/sim/HeadPose.hpp`). Layout and registered name verified against the SDK NUbots_K1 builds against +(`d5d8f7ae`): `geometry_msgs::msg::Pose().getName()` returns +`geometry_msgs::msg::dds_::Pose_`. + ### `booster_interface::msg::dds_::FallDownState_` (FallDownState.h) Enum `FallDownStateType : unsigned long` (C++ `uint32_t`) = `{IS_READY=0, IS_FALLING=1, HAS_FALLEN=2, IS_GETTING_UP=3}`. @@ -184,6 +198,7 @@ booster_interface::msg::dds_::LowCmd_ booster_interface::msg::dds_::MotorCmd_ booster_msgs::msg::dds_::RpcReqMsg_ booster_msgs::msg::dds_::RpcRespMsg_ +geometry_msgs::msg::dds_::Pose_ (+ nested Point_, Quaternion_; rt/head_pose) ``` Also present (not used by us): `booster_interface::msg::dds_::RemoteControllerState_`, @@ -294,8 +309,10 @@ Per the lead's explicit spec (de-risks RPC correctness over squeezing out best-e UDP savings — reliability never hurts a loopback/`--network host` transport, and the SDK's own defaults would silently degrade to best-effort which is a *safe* superset to widen, not narrow), `module::SdkBridge` uses: -- **State writers** (`low_state`, `odometer_state`, `fall_down`, `battery_state`, - `button_event`): `RELIABLE` + `VOLATILE` durability + `KEEP_LAST(5)` history. +- **State writers** (`low_state`, `odometer_state`, `head_pose`, `fall_down`, + `battery_state`, `button_event`): `RELIABLE` + `VOLATILE` durability + `KEEP_LAST(5)` + history. `head_pose` must be `RELIABLE`: K1Sensors creates its reader with + `reliable = true`, which a best-effort writer would not match. - **RPC request reader** (`rt/LocoApiTopicReq`): `RELIABLE` + `KEEP_LAST(10)` history (bursts of calls at startup — e.g. NUbots issuing `ChangeMode` immediately — must not drop). diff --git a/mujoco/module/SdkBridge/src/StatePublisher.cpp b/mujoco/module/SdkBridge/src/StatePublisher.cpp index ae43829..0a45989 100644 --- a/mujoco/module/SdkBridge/src/StatePublisher.cpp +++ b/mujoco/module/SdkBridge/src/StatePublisher.cpp @@ -13,6 +13,8 @@ #include "LowStatePubSubTypes.h" #include "Odometer.h" #include "OdometerPubSubTypes.h" +#include "Pose.h" +#include "PosePubSubTypes.h" #include "shared/k1/BoosterApi.hpp" #include "shared/k1/JointIndex.hpp" @@ -49,11 +51,14 @@ StatePublisher::StatePublisher(DdsParticipant& dds, double battery_soc) : batter using booster_interface::msg::dds_::FallDownState_PubSubType; using booster_interface::msg::dds_::LowState_PubSubType; using booster_interface::msg::dds_::Odometer_PubSubType; + using geometry_msgs::msg::dds_::Pose_PubSubType; low_state_writer_ = dds.create_writer(k1sim::booster::TOPIC_LOW_STATE, DdsParticipant::state_writer_qos()); odometer_writer_ = dds.create_writer(k1sim::booster::TOPIC_ODOMETER_STATE, DdsParticipant::state_writer_qos()); + head_pose_writer_ = + dds.create_writer(k1sim::booster::TOPIC_HEAD_POSE, DdsParticipant::state_writer_qos()); fall_down_writer_ = dds.create_writer(k1sim::booster::TOPIC_FALL_DOWN, DdsParticipant::state_writer_qos()); battery_writer_ = dds.create_writer(k1sim::booster::TOPIC_BATTERY_STATE, @@ -97,6 +102,20 @@ void StatePublisher::publish(const k1sim::message::SimStateUpdate& update) { odom.theta(static_cast(yaw_from_quat(update.base.quat))); odometer_writer_->write(&odom); + // --- rt/head_pose --- The head frame in the yaw-only base footprint frame, which + // K1Sensors composes with the odometry above to place the camera and torso in the world. + if (update.head.valid) { + geometry_msgs::msg::dds_::Pose_ pose; + pose.position().x(update.head.position[0]); + pose.position().y(update.head.position[1]); + pose.position().z(update.head.position[2]); + pose.orientation().w(update.head.quat[0]); + pose.orientation().x(update.head.quat[1]); + pose.orientation().y(update.head.quat[2]); + pose.orientation().z(update.head.quat[3]); + head_pose_writer_->write(&pose); + } + // --- rt/fall_down --- publish on change, or every >=1s as a keepalive. const bool changed = !have_last_fall_state_ || last_fall_state_ != update.fall_state; const bool due_keepalive = (update.sim_time - last_fall_publish_time_) >= 1.0; diff --git a/mujoco/module/SdkBridge/src/StatePublisher.hpp b/mujoco/module/SdkBridge/src/StatePublisher.hpp index 4acbc41..ac3253a 100644 --- a/mujoco/module/SdkBridge/src/StatePublisher.hpp +++ b/mujoco/module/SdkBridge/src/StatePublisher.hpp @@ -17,8 +17,8 @@ class StatePublisher { StatePublisher(DdsParticipant& dds, double battery_soc); // Called at the LowState cadence (50 Hz, on>): writes - // rt/low_state and rt/odometer_state every call, and rt/fall_down whenever - // fall_state changes or >=1s has elapsed since the last publish (keepalive). + // rt/low_state, rt/odometer_state and rt/head_pose every call, and rt/fall_down + // whenever fall_state changes or >=1s has elapsed since the last publish (keepalive). void publish(const k1sim::message::SimStateUpdate& update); // Called on>: writes the constant-SOC rt/battery_state. @@ -27,6 +27,7 @@ class StatePublisher { private: eprosima::fastdds::dds::DataWriter* low_state_writer_ = nullptr; eprosima::fastdds::dds::DataWriter* odometer_writer_ = nullptr; + eprosima::fastdds::dds::DataWriter* head_pose_writer_ = nullptr; eprosima::fastdds::dds::DataWriter* fall_down_writer_ = nullptr; eprosima::fastdds::dds::DataWriter* battery_writer_ = nullptr; eprosima::fastdds::dds::DataWriter* button_event_writer_ = nullptr; // created, never published diff --git a/mujoco/module/SdkBridge/test_support/SyntheticState.cpp b/mujoco/module/SdkBridge/test_support/SyntheticState.cpp index c3ff1e5..cb158b5 100644 --- a/mujoco/module/SdkBridge/test_support/SyntheticState.cpp +++ b/mujoco/module/SdkBridge/test_support/SyntheticState.cpp @@ -86,6 +86,15 @@ SyntheticState::SyntheticState(std::unique_ptr environment const double half = yaw_ * 0.5; update->base.quat = {std::cos(half), 0.0, 0.0, std::sin(half)}; + // Standing head frame in the footprint frame: 0.33 m above the base (the Head_pitch + // joint 0.248 m above the Trunk plus the 0.08 m head frame offset, see + // shared/sim/HeadPose.hpp), turned by the commanded head yaw then pitch. + const double cy = std::cos(head_yaw_ * 0.5), sy = std::sin(head_yaw_ * 0.5); + const double cp = std::cos(head_pitch_ * 0.5), sp = std::sin(head_pitch_ * 0.5); + update->head.valid = true; + update->head.position = {0.0, 0.0, update->base.z + 0.33}; + update->head.quat = {cy * cp, -sy * sp, cy * sp, sy * cp}; + update->mode = mode_; update->fall_state = fall_state_; update->getting_up = false; diff --git a/mujoco/module/Simulation/src/SimCore.cpp b/mujoco/module/Simulation/src/SimCore.cpp index a94279e..68f986f 100644 --- a/mujoco/module/Simulation/src/SimCore.cpp +++ b/mujoco/module/Simulation/src/SimCore.cpp @@ -6,6 +6,7 @@ #include #include "shared/k1/BoosterApi.hpp" +#include "shared/sim/HeadPose.hpp" #include "shared/util/Config.hpp" namespace k1sim { @@ -154,6 +155,11 @@ void SimCore::load_model() { left_foot_body_id_ = mj_name2id(m_, mjOBJ_BODY, "left_foot_link"); right_foot_body_id_ = mj_name2id(m_, mjOBJ_BODY, "right_foot_link"); + + head_body_id_ = mj_name2id(m_, mjOBJ_BODY, "Head_2"); + if (head_body_id_ < 0) { + std::fprintf(stderr, "SimCore: model has no Head_2 body; rt/head_pose will not be published\n"); + } if (!config_.foot_log_path.empty()) { if (left_foot_body_id_ < 0 || right_foot_body_id_ < 0) { std::fprintf(stderr, "SimCore: foot log requested but the model has no left/right_foot_link\n"); @@ -530,6 +536,16 @@ std::unique_ptr SimCore::make_snapshot(uint64_t steps) s->base.ang_vel = {world[0], world[1], world[2]}; } + if (head_body_id_ >= 0) { + const FootprintPose Hrh = head_in_footprint(d_->xpos + 3 * head_body_id_, + d_->xquat + 4 * head_body_id_, + d_->qpos + qadr, + d_->qpos + qadr + 3); + s->head.valid = true; + s->head.position = Hrh.position; + s->head.quat = Hrh.quat; + } + StepController* ctrl = controller_.load(std::memory_order_acquire); if (ctrl != nullptr) { s->mode = ctrl->mode(); diff --git a/mujoco/module/Simulation/src/SimCore.hpp b/mujoco/module/Simulation/src/SimCore.hpp index c08706b..ba0c93c 100644 --- a/mujoco/module/Simulation/src/SimCore.hpp +++ b/mujoco/module/Simulation/src/SimCore.hpp @@ -159,6 +159,9 @@ class SimCore { std::FILE* foot_log_ = nullptr; int left_foot_body_id_ = -1; int right_foot_body_id_ = -1; + + // Head_2, for SimStateUpdate::head (published as rt/head_pose); -1 if absent. + int head_body_id_ = -1; }; } // namespace k1sim diff --git a/mujoco/shared/k1/BoosterApi.hpp b/mujoco/shared/k1/BoosterApi.hpp index ae14e44..8205653 100644 --- a/mujoco/shared/k1/BoosterApi.hpp +++ b/mujoco/shared/k1/BoosterApi.hpp @@ -16,6 +16,9 @@ inline constexpr const char* TOPIC_BATTERY_STATE = "rt/battery_state"; inline constexpr const char* TOPIC_BUTTON_EVENT = "rt/button_event"; inline constexpr const char* TOPIC_RPC_REQUEST = "rt/LocoApiTopicReq"; inline constexpr const char* TOPIC_RPC_RESPONSE = "rt/LocoApiTopicResp"; +// Not an SDK constant: the robot's head pose (geometry_msgs Pose), the topic NUbots' +// K1Sensors subscribes to (K1Sensors.yaml head_pose.topic). +inline constexpr const char* TOPIC_HEAD_POSE = "rt/head_pose"; // LocoApiId values carried in RpcReqMsg.header JSON {"api_id": } enum ApiId : int { diff --git a/mujoco/shared/message/SimMessages.hpp b/mujoco/shared/message/SimMessages.hpp index bd179c6..2f37b1f 100644 --- a/mujoco/shared/message/SimMessages.hpp +++ b/mujoco/shared/message/SimMessages.hpp @@ -35,6 +35,14 @@ struct BaseState { std::array ang_vel{}; // world frame }; +// The real robot's head frame (0.08 m above Head_pitch) in the yaw-only base footprint +// frame (see shared/sim/HeadPose.hpp). +struct HeadPose { + bool valid = false; // false if the model has no Head_2 body + std::array position{}; // m + std::array quat{1, 0, 0, 0}; // w,x,y,z +}; + // Emitted by the physics thread at the LowState cadence (every N steps, 50 Hz). struct SimStateUpdate { double sim_time = 0.0; @@ -42,6 +50,7 @@ struct SimStateUpdate { std::array joints{}; // JointIndexK1 order ImuData imu{}; BaseState base{}; + HeadPose head{}; int mode = 0; // booster::RobotMode value int fall_state = 0; // booster::FallState value bool getting_up = false; diff --git a/mujoco/shared/sim/HeadPose.hpp b/mujoco/shared/sim/HeadPose.hpp new file mode 100644 index 0000000..8e39720 --- /dev/null +++ b/mujoco/shared/sim/HeadPose.hpp @@ -0,0 +1,53 @@ +#ifndef K1SIM_SHARED_SIM_HEADPOSE_HPP +#define K1SIM_SHARED_SIM_HEADPOSE_HPP + +#include +#include +#include + +namespace k1sim { + +// Head pose in the yaw-only base footprint frame, the frame the real robot's rt/head_pose +// is expressed in. NUbots' K1Sensors composes it with its yaw-only odometry (Hwr) to +// recover the true world pose, including torso tilt when fallen. +struct FootprintPose { + std::array position{}; + std::array quat{1, 0, 0, 0}; // w,x,y,z +}; + +// The real robot's head frame sits this far above the Head_pitch joint (the Head_2 body +// origin) along the head's z-axis, near the head's centre of mass (Head_2 inertial z 0.0805). +// NUbots' K1Sensors removes it again with Hhp (translation [0, 0, -0.08], tuned on the robot), +// so publishing the bare Head_2 origin would put NUbots' torso this much too low. +inline constexpr double HEAD_FRAME_ABOVE_PITCH = 0.08; + +// Hrh = (translate(base_x, base_y, 0) * rotz(base_yaw))^-1 * Hwh * translate(0, 0, HEAD_FRAME_ABOVE_PITCH), +// from the Head_2 body's world pose (xpos/xquat) and the root free joint's qpos (xy + wxyz quat). +inline FootprintPose head_in_footprint(const mjtNum head_p[3], + const mjtNum head_q[4], + const mjtNum base_xy[2], + const mjtNum base_q[4]) { + const mjtNum yaw = std::atan2(2.0 * (base_q[0] * base_q[3] + base_q[1] * base_q[2]), + 1.0 - 2.0 * (base_q[2] * base_q[2] + base_q[3] * base_q[3])); + const mjtNum axis[3]{0, 0, 1}; + mjtNum neg_yaw_q[4]; + mju_axisAngle2Quat(neg_yaw_q, axis, -yaw); + const mjtNum rel_w[3]{head_p[0] - base_xy[0], head_p[1] - base_xy[1], head_p[2]}; + mjtNum rel_p[3]; + mju_rotVecQuat(rel_p, rel_w, neg_yaw_q); + mjtNum rel_q[4]; + mju_mulQuat(rel_q, neg_yaw_q, head_q); + + const mjtNum up_h[3]{0, 0, HEAD_FRAME_ABOVE_PITCH}; + mjtNum up_r[3]; + mju_rotVecQuat(up_r, up_h, rel_q); + + FootprintPose pose; + pose.position = {rel_p[0] + up_r[0], rel_p[1] + up_r[1], rel_p[2] + up_r[2]}; + pose.quat = {rel_q[0], rel_q[1], rel_q[2], rel_q[3]}; + return pose; +} + +} // namespace k1sim + +#endif // K1SIM_SHARED_SIM_HEADPOSE_HPP diff --git a/mujoco/test/contract/host_client/sdk_client_check.cpp b/mujoco/test/contract/host_client/sdk_client_check.cpp index 36f9f70..9526669 100644 --- a/mujoco/test/contract/host_client/sdk_client_check.cpp +++ b/mujoco/test/contract/host_client/sdk_client_check.cpp @@ -10,6 +10,9 @@ // - each sample's motor_state_serial has exactly 22 entries with finite, // plausible-magnitude values // - rt/odometer_state received at least once +// - rt/head_pose received at least once with a finite, standing-height pose (the +// topic NUbots' K1Sensors places the camera and torso from). Only when the SDK +// ships booster/idl/geometry_msgs/Pose.h; SKIP printed otherwise. // - rt/battery_state received at least once during the 5s window (published at // 1 Hz via NUClear on>) with soc in (0, 100]. // Only when the SDK being built against ships booster/idl/b1/BatteryState.h — @@ -42,6 +45,10 @@ #define K1SIM_CHECK_BATTERY 1 #define K1SIM_SDK_PINNED 1 #endif +#if __has_include() + #include + #define K1SIM_CHECK_HEAD_POSE 1 +#endif #include #include #include @@ -80,6 +87,24 @@ void OdometerHandler(const void* /*msg*/) { g_odom_count.fetch_add(1, std::memory_order_relaxed); } +#ifdef K1SIM_CHECK_HEAD_POSE +std::atomic g_head_pose_count{0}; +std::atomic g_head_pose_z{-1.0}; +std::atomic g_head_pose_finite{true}; +void HeadPoseHandler(const void* msg) { + const auto* pose = static_cast(msg); + const auto& p = pose->position(); + const auto& q = pose->orientation(); + g_head_pose_count.fetch_add(1, std::memory_order_relaxed); + g_head_pose_z.store(p.z(), std::memory_order_relaxed); + for (double v : {p.x(), p.y(), p.z(), q.x(), q.y(), q.z(), q.w()}) { + if (!std::isfinite(v)) { + g_head_pose_finite.store(false, std::memory_order_relaxed); + } + } +} +#endif + #ifdef K1SIM_CHECK_BATTERY std::atomic g_battery_count{0}; std::atomic g_battery_soc{-1.0f}; @@ -124,6 +149,10 @@ int main() { low_state_sub.InitChannel(); ChannelSubscriber odom_sub(booster::robot::b1::kTopicOdometerState, OdometerHandler); odom_sub.InitChannel(); +#ifdef K1SIM_CHECK_HEAD_POSE + ChannelSubscriber head_pose_sub("rt/head_pose", HeadPoseHandler); + head_pose_sub.InitChannel(); +#endif #ifdef K1SIM_CHECK_BATTERY ChannelSubscriber battery_sub("rt/battery_state", BatteryHandler); battery_sub.InitChannel(); @@ -151,6 +180,17 @@ int main() { check(g_last_motor_count.load() == 22, "rt/low_state motor_state_serial has exactly 22 entries"); check(g_low_state_plausible.load(), "rt/low_state motor/imu values are finite and plausible magnitude"); check(g_odom_count.load() > 0, "rt/odometer_state received at least once"); +#ifdef K1SIM_CHECK_HEAD_POSE + std::printf("head_pose: %llu samples in window, last z=%.3f\n", + static_cast(g_head_pose_count.load()), + g_head_pose_z.load()); + check(g_head_pose_count.load() > 0, "rt/head_pose received at least once"); + check(g_head_pose_finite.load(), "rt/head_pose values are finite"); + check(g_head_pose_z.load() > 0.5 && g_head_pose_z.load() < 1.2, + "rt/head_pose z is a standing head height above the footprint (0.5, 1.2) m"); +#else + std::printf("[SKIP] rt/head_pose checks (SDK build lacks booster/idl/geometry_msgs/Pose.h)\n"); +#endif #ifdef K1SIM_CHECK_BATTERY std::printf("battery_state: %llu samples in window, last soc=%.1f\n", static_cast(g_battery_count.load()), diff --git a/mujoco/test/unit/test_pd_stand.cpp b/mujoco/test/unit/test_pd_stand.cpp index e3da45f..2c51a3e 100644 --- a/mujoco/test/unit/test_pd_stand.cpp +++ b/mujoco/test/unit/test_pd_stand.cpp @@ -14,6 +14,10 @@ // - base height stays within [0.45, 0.62] for the whole run once t > 1s. // - tilt (angle between the base's local z-axis and world z) is < 10 deg at the end. // - the free-run stepping rate is sane (> 1000 steps/s). +// - the head pose (published as rt/head_pose) is present on every update and, once t > 1s, +// reconstructing the trunk from it the way NUbots' K1Sensors does lands within 5 mm of the +// true trunk height. NUbots places the camera and torso from it, so any frame mismatch +// shows up as the robot sunk into (or floating above) the field. #include #include #include @@ -45,6 +49,27 @@ double clamp(double v, double lo, double hi) { return v < lo ? lo : (v > hi ? hi : v); } +// The trunk height NUbots' K1Sensors recovers from rt/head_pose: Hwt = Hrh * Hhp * Htp^-1 with +// Hhp = translate(0, 0, -0.08) and Htp = [Rz(yaw) * Ry(pitch), (0.0056, 0, 0.2149 + 0.033)] +// (NUbots_K1 module/input/K1Sensors: K1Sensors.yaml Hhp, k1_model.hpp compute_Htp). +double k1sensors_trunk_z(const k1sim::message::SimStateUpdate& s) { + mjtNum R_h[9]; // row-major + mju_quat2Mat(R_h, s.head.quat.data()); + + const double yaw = s.joints[k1sim::HeadYaw].q, pitch = s.joints[k1sim::HeadPitch].q; + const double cy = std::cos(yaw), sy = std::sin(yaw), cp = std::cos(pitch), sp = std::sin(pitch); + const double R_tp[3][3] = {{cy * cp, -sy, cy * sp}, {sy * cp, cy, sy * sp}, {-sp, 0.0, cp}}; + const double t_tp[3] = {0.0056, 0.0, 0.2149 + 0.033}; + + // Trunk position in the head frame: Hhp's translation plus Htp^-1's (-R_tp^T t_tp). + double v[3]; + for (int c = 0; c < 3; ++c) { + v[c] = -(R_tp[0][c] * t_tp[0] + R_tp[1][c] * t_tp[1] + R_tp[2][c] * t_tp[2]); + } + v[2] -= 0.08; + return s.head.position[2] + R_h[6] * v[0] + R_h[7] * v[1] + R_h[8] * v[2]; +} + } // namespace int main() { @@ -72,6 +97,8 @@ int main() { std::atomic last_sim_time{0.0}; std::atomic min_height_after_1s{1e9}; std::atomic max_height_after_1s{-1e9}; + std::atomic head_missing{false}; + std::atomic max_trunk_z_error{0.0}; std::atomic done{false}; auto on_state = [&](std::unique_ptr s) { @@ -100,6 +127,14 @@ int main() { if (s->base.z > cur_max) { max_height_after_1s.store(s->base.z, std::memory_order_relaxed); } + + const double trunk_z_error = std::abs(k1sensors_trunk_z(*s) - s->base.z); + if (trunk_z_error > max_trunk_z_error.load(std::memory_order_relaxed)) { + max_trunk_z_error.store(trunk_z_error, std::memory_order_relaxed); + } + } + if (!s->head.valid) { + head_missing.store(true, std::memory_order_relaxed); } // tilt = angle between the base's local z-axis and world z, from the wxyz quat. @@ -162,6 +197,17 @@ int main() { std::fprintf(stderr, "FAIL: final tilt %.2f deg >= 10 deg\n", last_tilt_deg.load()); ok = false; } + if (head_missing.load()) { + std::fprintf(stderr, "FAIL: SimStateUpdate carried no head pose (model has no Head_2?)\n"); + ok = false; + } + if (max_trunk_z_error.load() > 0.005) { + std::fprintf(stderr, + "FAIL: trunk height reconstructed from the head pose as K1Sensors does is off by " + "up to %.4f m after t=1s (> 0.005)\n", + max_trunk_z_error.load()); + ok = false; + } if (steps_per_sec <= 1000.0) { std::fprintf(stderr, "FAIL: free-run stepping rate %.1f steps/s <= 1000\n", steps_per_sec); ok = false; @@ -169,14 +215,15 @@ int main() { std::printf( "test_pd_stand: sim_time=%.3fs steps=%llu wall=%.3fs (%.0f steps/s) " - "height[1s..end]=[%.4f, %.4f] final_tilt=%.2fdeg\n", + "height[1s..end]=[%.4f, %.4f] final_tilt=%.2fdeg max_k1sensors_trunk_z_error=%.4f\n", last_sim_time.load(), static_cast(steps), wall_elapsed, steps_per_sec, min_height_after_1s.load(), max_height_after_1s.load(), - last_tilt_deg.load()); + last_tilt_deg.load(), + max_trunk_z_error.load()); return ok ? 0 : 1; } From 04044ebb236c7e07d53e55425f608f25956c7e84 Mon Sep 17 00:00:00 2001 From: Vincent Tumminello Date: Sat, 12 Sep 2026 19:33:41 +1000 Subject: [PATCH 2/7] Publish rt/odom, the controller's full ROS odometry The real K1 publishes nav_msgs/Odometry on rt/odom (kTopicRosOdometer, 1.7.0 firmware): rt/odometer_state's planar pose plus the velocity, which NUbots_K1 now reads for Sensors.vTw. Publish it from the base state at the LowState cadence, following the ROS convention since Booster does not document the frames: pose in "odom", twist in the body frame "base_link". Adds the nav_msgs, std_msgs and builtin_interfaces types and the geometry_msgs twist and covariance types, with every package's msg/ on the fastddsgen include path so an .idl can include across packages; the existing generated code is unchanged. The synthetic state source now reports the velocity of its commanded walk, and the SDK contract test checks rt/odom. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_014yZBRrPMFAxdS4A93XWANS --- mujoco/idl/builtin_interfaces/msg/Time.idl | 13 + .../geometry_msgs/msg/PoseWithCovariance.idl | 15 + mujoco/idl/geometry_msgs/msg/Twist.idl | 15 + .../geometry_msgs/msg/TwistWithCovariance.idl | 15 + mujoco/idl/geometry_msgs/msg/Vector3.idl | 14 + mujoco/idl/nav_msgs/msg/Odometry.idl | 19 + mujoco/idl/regenerate.sh | 26 +- mujoco/idl/std_msgs/msg/Header.idl | 15 + mujoco/idl_gen/builtin_interfaces/Time.cxx | 288 ++++++++++++ mujoco/idl_gen/builtin_interfaces/Time.h | 237 ++++++++++ .../idl_gen/builtin_interfaces/TimeCdrAux.hpp | 51 ++ .../idl_gen/builtin_interfaces/TimeCdrAux.ipp | 139 ++++++ .../builtin_interfaces/TimePubSubTypes.cxx | 233 +++++++++ .../builtin_interfaces/TimePubSubTypes.h | 196 ++++++++ .../geometry_msgs/PoseWithCovariance.cxx | 313 +++++++++++++ .../geometry_msgs/PoseWithCovariance.h | 252 ++++++++++ .../PoseWithCovarianceCdrAux.hpp | 51 ++ .../PoseWithCovarianceCdrAux.ipp | 139 ++++++ .../PoseWithCovariancePubSubTypes.cxx | 233 +++++++++ .../PoseWithCovariancePubSubTypes.h | 197 ++++++++ mujoco/idl_gen/geometry_msgs/Twist.cxx | 309 ++++++++++++ mujoco/idl_gen/geometry_msgs/Twist.h | 252 ++++++++++ mujoco/idl_gen/geometry_msgs/TwistCdrAux.hpp | 51 ++ mujoco/idl_gen/geometry_msgs/TwistCdrAux.ipp | 139 ++++++ .../geometry_msgs/TwistPubSubTypes.cxx | 233 +++++++++ .../idl_gen/geometry_msgs/TwistPubSubTypes.h | 197 ++++++++ .../geometry_msgs/TwistWithCovariance.cxx | 312 ++++++++++++ .../geometry_msgs/TwistWithCovariance.h | 252 ++++++++++ .../TwistWithCovarianceCdrAux.hpp | 52 ++ .../TwistWithCovarianceCdrAux.ipp | 139 ++++++ .../TwistWithCovariancePubSubTypes.cxx | 233 +++++++++ .../TwistWithCovariancePubSubTypes.h | 197 ++++++++ mujoco/idl_gen/geometry_msgs/Vector3.cxx | 341 ++++++++++++++ mujoco/idl_gen/geometry_msgs/Vector3.h | 258 ++++++++++ .../idl_gen/geometry_msgs/Vector3CdrAux.hpp | 51 ++ .../idl_gen/geometry_msgs/Vector3CdrAux.ipp | 147 ++++++ .../geometry_msgs/Vector3PubSubTypes.cxx | 233 +++++++++ .../geometry_msgs/Vector3PubSubTypes.h | 196 ++++++++ mujoco/idl_gen/nav_msgs/Header.cxx | 309 ++++++++++++ mujoco/idl_gen/nav_msgs/Header.h | 252 ++++++++++ mujoco/idl_gen/nav_msgs/HeaderCdrAux.hpp | 51 ++ mujoco/idl_gen/nav_msgs/HeaderCdrAux.ipp | 139 ++++++ mujoco/idl_gen/nav_msgs/HeaderPubSubTypes.cxx | 233 +++++++++ mujoco/idl_gen/nav_msgs/HeaderPubSubTypes.h | 142 ++++++ mujoco/idl_gen/nav_msgs/Odometry.cxx | 443 ++++++++++++++++++ mujoco/idl_gen/nav_msgs/Odometry.h | 310 ++++++++++++ mujoco/idl_gen/nav_msgs/OdometryCdrAux.hpp | 52 ++ mujoco/idl_gen/nav_msgs/OdometryCdrAux.ipp | 155 ++++++ .../idl_gen/nav_msgs/OdometryPubSubTypes.cxx | 233 +++++++++ mujoco/idl_gen/nav_msgs/OdometryPubSubTypes.h | 144 ++++++ mujoco/idl_gen/nav_msgs/Point.cxx | 341 ++++++++++++++ mujoco/idl_gen/nav_msgs/Point.h | 258 ++++++++++ mujoco/idl_gen/nav_msgs/PointCdrAux.hpp | 51 ++ mujoco/idl_gen/nav_msgs/PointCdrAux.ipp | 147 ++++++ mujoco/idl_gen/nav_msgs/PointPubSubTypes.cxx | 233 +++++++++ mujoco/idl_gen/nav_msgs/PointPubSubTypes.h | 196 ++++++++ mujoco/idl_gen/nav_msgs/Pose.cxx | 310 ++++++++++++ mujoco/idl_gen/nav_msgs/Pose.h | 253 ++++++++++ mujoco/idl_gen/nav_msgs/PoseCdrAux.hpp | 51 ++ mujoco/idl_gen/nav_msgs/PoseCdrAux.ipp | 139 ++++++ mujoco/idl_gen/nav_msgs/PosePubSubTypes.cxx | 233 +++++++++ mujoco/idl_gen/nav_msgs/PosePubSubTypes.h | 198 ++++++++ .../idl_gen/nav_msgs/PoseWithCovariance.cxx | 313 +++++++++++++ mujoco/idl_gen/nav_msgs/PoseWithCovariance.h | 252 ++++++++++ .../nav_msgs/PoseWithCovarianceCdrAux.hpp | 51 ++ .../nav_msgs/PoseWithCovarianceCdrAux.ipp | 139 ++++++ .../PoseWithCovariancePubSubTypes.cxx | 233 +++++++++ .../nav_msgs/PoseWithCovariancePubSubTypes.h | 197 ++++++++ mujoco/idl_gen/nav_msgs/Quaternion.cxx | 394 ++++++++++++++++ mujoco/idl_gen/nav_msgs/Quaternion.h | 279 +++++++++++ mujoco/idl_gen/nav_msgs/QuaternionCdrAux.hpp | 51 ++ mujoco/idl_gen/nav_msgs/QuaternionCdrAux.ipp | 155 ++++++ .../nav_msgs/QuaternionPubSubTypes.cxx | 233 +++++++++ .../idl_gen/nav_msgs/QuaternionPubSubTypes.h | 196 ++++++++ mujoco/idl_gen/nav_msgs/Time.cxx | 288 ++++++++++++ mujoco/idl_gen/nav_msgs/Time.h | 237 ++++++++++ mujoco/idl_gen/nav_msgs/TimeCdrAux.hpp | 51 ++ mujoco/idl_gen/nav_msgs/TimeCdrAux.ipp | 139 ++++++ mujoco/idl_gen/nav_msgs/TimePubSubTypes.cxx | 233 +++++++++ mujoco/idl_gen/nav_msgs/TimePubSubTypes.h | 196 ++++++++ mujoco/idl_gen/nav_msgs/Twist.cxx | 309 ++++++++++++ mujoco/idl_gen/nav_msgs/Twist.h | 252 ++++++++++ mujoco/idl_gen/nav_msgs/TwistCdrAux.hpp | 51 ++ mujoco/idl_gen/nav_msgs/TwistCdrAux.ipp | 139 ++++++ mujoco/idl_gen/nav_msgs/TwistPubSubTypes.cxx | 233 +++++++++ mujoco/idl_gen/nav_msgs/TwistPubSubTypes.h | 197 ++++++++ .../idl_gen/nav_msgs/TwistWithCovariance.cxx | 312 ++++++++++++ mujoco/idl_gen/nav_msgs/TwistWithCovariance.h | 252 ++++++++++ .../nav_msgs/TwistWithCovarianceCdrAux.hpp | 52 ++ .../nav_msgs/TwistWithCovarianceCdrAux.ipp | 139 ++++++ .../TwistWithCovariancePubSubTypes.cxx | 233 +++++++++ .../nav_msgs/TwistWithCovariancePubSubTypes.h | 197 ++++++++ mujoco/idl_gen/nav_msgs/Vector3.cxx | 341 ++++++++++++++ mujoco/idl_gen/nav_msgs/Vector3.h | 258 ++++++++++ mujoco/idl_gen/nav_msgs/Vector3CdrAux.hpp | 51 ++ mujoco/idl_gen/nav_msgs/Vector3CdrAux.ipp | 147 ++++++ .../idl_gen/nav_msgs/Vector3PubSubTypes.cxx | 233 +++++++++ mujoco/idl_gen/nav_msgs/Vector3PubSubTypes.h | 196 ++++++++ mujoco/idl_gen/std_msgs/Header.cxx | 309 ++++++++++++ mujoco/idl_gen/std_msgs/Header.h | 252 ++++++++++ mujoco/idl_gen/std_msgs/HeaderCdrAux.hpp | 51 ++ mujoco/idl_gen/std_msgs/HeaderCdrAux.ipp | 139 ++++++ mujoco/idl_gen/std_msgs/HeaderPubSubTypes.cxx | 233 +++++++++ mujoco/idl_gen/std_msgs/HeaderPubSubTypes.h | 142 ++++++ mujoco/idl_gen/std_msgs/Time.cxx | 288 ++++++++++++ mujoco/idl_gen/std_msgs/Time.h | 237 ++++++++++ mujoco/idl_gen/std_msgs/TimeCdrAux.hpp | 51 ++ mujoco/idl_gen/std_msgs/TimeCdrAux.ipp | 139 ++++++ mujoco/idl_gen/std_msgs/TimePubSubTypes.cxx | 233 +++++++++ mujoco/idl_gen/std_msgs/TimePubSubTypes.h | 196 ++++++++ mujoco/module/SdkBridge/CMakeLists.txt | 9 +- mujoco/module/SdkBridge/PROTOCOL.md | 29 +- .../module/SdkBridge/src/StatePublisher.cpp | 46 ++ .../module/SdkBridge/src/StatePublisher.hpp | 3 +- .../SdkBridge/test_support/SyntheticState.cpp | 3 + mujoco/shared/k1/BoosterApi.hpp | 3 + .../contract/host_client/sdk_client_check.cpp | 41 ++ 117 files changed, 20548 insertions(+), 11 deletions(-) create mode 100644 mujoco/idl/builtin_interfaces/msg/Time.idl create mode 100644 mujoco/idl/geometry_msgs/msg/PoseWithCovariance.idl create mode 100644 mujoco/idl/geometry_msgs/msg/Twist.idl create mode 100644 mujoco/idl/geometry_msgs/msg/TwistWithCovariance.idl create mode 100644 mujoco/idl/geometry_msgs/msg/Vector3.idl create mode 100644 mujoco/idl/nav_msgs/msg/Odometry.idl create mode 100644 mujoco/idl/std_msgs/msg/Header.idl create mode 100644 mujoco/idl_gen/builtin_interfaces/Time.cxx create mode 100644 mujoco/idl_gen/builtin_interfaces/Time.h create mode 100644 mujoco/idl_gen/builtin_interfaces/TimeCdrAux.hpp create mode 100644 mujoco/idl_gen/builtin_interfaces/TimeCdrAux.ipp create mode 100644 mujoco/idl_gen/builtin_interfaces/TimePubSubTypes.cxx create mode 100644 mujoco/idl_gen/builtin_interfaces/TimePubSubTypes.h create mode 100644 mujoco/idl_gen/geometry_msgs/PoseWithCovariance.cxx create mode 100644 mujoco/idl_gen/geometry_msgs/PoseWithCovariance.h create mode 100644 mujoco/idl_gen/geometry_msgs/PoseWithCovarianceCdrAux.hpp create mode 100644 mujoco/idl_gen/geometry_msgs/PoseWithCovarianceCdrAux.ipp create mode 100644 mujoco/idl_gen/geometry_msgs/PoseWithCovariancePubSubTypes.cxx create mode 100644 mujoco/idl_gen/geometry_msgs/PoseWithCovariancePubSubTypes.h create mode 100644 mujoco/idl_gen/geometry_msgs/Twist.cxx create mode 100644 mujoco/idl_gen/geometry_msgs/Twist.h create mode 100644 mujoco/idl_gen/geometry_msgs/TwistCdrAux.hpp create mode 100644 mujoco/idl_gen/geometry_msgs/TwistCdrAux.ipp create mode 100644 mujoco/idl_gen/geometry_msgs/TwistPubSubTypes.cxx create mode 100644 mujoco/idl_gen/geometry_msgs/TwistPubSubTypes.h create mode 100644 mujoco/idl_gen/geometry_msgs/TwistWithCovariance.cxx create mode 100644 mujoco/idl_gen/geometry_msgs/TwistWithCovariance.h create mode 100644 mujoco/idl_gen/geometry_msgs/TwistWithCovarianceCdrAux.hpp create mode 100644 mujoco/idl_gen/geometry_msgs/TwistWithCovarianceCdrAux.ipp create mode 100644 mujoco/idl_gen/geometry_msgs/TwistWithCovariancePubSubTypes.cxx create mode 100644 mujoco/idl_gen/geometry_msgs/TwistWithCovariancePubSubTypes.h create mode 100644 mujoco/idl_gen/geometry_msgs/Vector3.cxx create mode 100644 mujoco/idl_gen/geometry_msgs/Vector3.h create mode 100644 mujoco/idl_gen/geometry_msgs/Vector3CdrAux.hpp create mode 100644 mujoco/idl_gen/geometry_msgs/Vector3CdrAux.ipp create mode 100644 mujoco/idl_gen/geometry_msgs/Vector3PubSubTypes.cxx create mode 100644 mujoco/idl_gen/geometry_msgs/Vector3PubSubTypes.h create mode 100644 mujoco/idl_gen/nav_msgs/Header.cxx create mode 100644 mujoco/idl_gen/nav_msgs/Header.h create mode 100644 mujoco/idl_gen/nav_msgs/HeaderCdrAux.hpp create mode 100644 mujoco/idl_gen/nav_msgs/HeaderCdrAux.ipp create mode 100644 mujoco/idl_gen/nav_msgs/HeaderPubSubTypes.cxx create mode 100644 mujoco/idl_gen/nav_msgs/HeaderPubSubTypes.h create mode 100644 mujoco/idl_gen/nav_msgs/Odometry.cxx create mode 100644 mujoco/idl_gen/nav_msgs/Odometry.h create mode 100644 mujoco/idl_gen/nav_msgs/OdometryCdrAux.hpp create mode 100644 mujoco/idl_gen/nav_msgs/OdometryCdrAux.ipp create mode 100644 mujoco/idl_gen/nav_msgs/OdometryPubSubTypes.cxx create mode 100644 mujoco/idl_gen/nav_msgs/OdometryPubSubTypes.h create mode 100644 mujoco/idl_gen/nav_msgs/Point.cxx create mode 100644 mujoco/idl_gen/nav_msgs/Point.h create mode 100644 mujoco/idl_gen/nav_msgs/PointCdrAux.hpp create mode 100644 mujoco/idl_gen/nav_msgs/PointCdrAux.ipp create mode 100644 mujoco/idl_gen/nav_msgs/PointPubSubTypes.cxx create mode 100644 mujoco/idl_gen/nav_msgs/PointPubSubTypes.h create mode 100644 mujoco/idl_gen/nav_msgs/Pose.cxx create mode 100644 mujoco/idl_gen/nav_msgs/Pose.h create mode 100644 mujoco/idl_gen/nav_msgs/PoseCdrAux.hpp create mode 100644 mujoco/idl_gen/nav_msgs/PoseCdrAux.ipp create mode 100644 mujoco/idl_gen/nav_msgs/PosePubSubTypes.cxx create mode 100644 mujoco/idl_gen/nav_msgs/PosePubSubTypes.h create mode 100644 mujoco/idl_gen/nav_msgs/PoseWithCovariance.cxx create mode 100644 mujoco/idl_gen/nav_msgs/PoseWithCovariance.h create mode 100644 mujoco/idl_gen/nav_msgs/PoseWithCovarianceCdrAux.hpp create mode 100644 mujoco/idl_gen/nav_msgs/PoseWithCovarianceCdrAux.ipp create mode 100644 mujoco/idl_gen/nav_msgs/PoseWithCovariancePubSubTypes.cxx create mode 100644 mujoco/idl_gen/nav_msgs/PoseWithCovariancePubSubTypes.h create mode 100644 mujoco/idl_gen/nav_msgs/Quaternion.cxx create mode 100644 mujoco/idl_gen/nav_msgs/Quaternion.h create mode 100644 mujoco/idl_gen/nav_msgs/QuaternionCdrAux.hpp create mode 100644 mujoco/idl_gen/nav_msgs/QuaternionCdrAux.ipp create mode 100644 mujoco/idl_gen/nav_msgs/QuaternionPubSubTypes.cxx create mode 100644 mujoco/idl_gen/nav_msgs/QuaternionPubSubTypes.h create mode 100644 mujoco/idl_gen/nav_msgs/Time.cxx create mode 100644 mujoco/idl_gen/nav_msgs/Time.h create mode 100644 mujoco/idl_gen/nav_msgs/TimeCdrAux.hpp create mode 100644 mujoco/idl_gen/nav_msgs/TimeCdrAux.ipp create mode 100644 mujoco/idl_gen/nav_msgs/TimePubSubTypes.cxx create mode 100644 mujoco/idl_gen/nav_msgs/TimePubSubTypes.h create mode 100644 mujoco/idl_gen/nav_msgs/Twist.cxx create mode 100644 mujoco/idl_gen/nav_msgs/Twist.h create mode 100644 mujoco/idl_gen/nav_msgs/TwistCdrAux.hpp create mode 100644 mujoco/idl_gen/nav_msgs/TwistCdrAux.ipp create mode 100644 mujoco/idl_gen/nav_msgs/TwistPubSubTypes.cxx create mode 100644 mujoco/idl_gen/nav_msgs/TwistPubSubTypes.h create mode 100644 mujoco/idl_gen/nav_msgs/TwistWithCovariance.cxx create mode 100644 mujoco/idl_gen/nav_msgs/TwistWithCovariance.h create mode 100644 mujoco/idl_gen/nav_msgs/TwistWithCovarianceCdrAux.hpp create mode 100644 mujoco/idl_gen/nav_msgs/TwistWithCovarianceCdrAux.ipp create mode 100644 mujoco/idl_gen/nav_msgs/TwistWithCovariancePubSubTypes.cxx create mode 100644 mujoco/idl_gen/nav_msgs/TwistWithCovariancePubSubTypes.h create mode 100644 mujoco/idl_gen/nav_msgs/Vector3.cxx create mode 100644 mujoco/idl_gen/nav_msgs/Vector3.h create mode 100644 mujoco/idl_gen/nav_msgs/Vector3CdrAux.hpp create mode 100644 mujoco/idl_gen/nav_msgs/Vector3CdrAux.ipp create mode 100644 mujoco/idl_gen/nav_msgs/Vector3PubSubTypes.cxx create mode 100644 mujoco/idl_gen/nav_msgs/Vector3PubSubTypes.h create mode 100644 mujoco/idl_gen/std_msgs/Header.cxx create mode 100644 mujoco/idl_gen/std_msgs/Header.h create mode 100644 mujoco/idl_gen/std_msgs/HeaderCdrAux.hpp create mode 100644 mujoco/idl_gen/std_msgs/HeaderCdrAux.ipp create mode 100644 mujoco/idl_gen/std_msgs/HeaderPubSubTypes.cxx create mode 100644 mujoco/idl_gen/std_msgs/HeaderPubSubTypes.h create mode 100644 mujoco/idl_gen/std_msgs/Time.cxx create mode 100644 mujoco/idl_gen/std_msgs/Time.h create mode 100644 mujoco/idl_gen/std_msgs/TimeCdrAux.hpp create mode 100644 mujoco/idl_gen/std_msgs/TimeCdrAux.ipp create mode 100644 mujoco/idl_gen/std_msgs/TimePubSubTypes.cxx create mode 100644 mujoco/idl_gen/std_msgs/TimePubSubTypes.h diff --git a/mujoco/idl/builtin_interfaces/msg/Time.idl b/mujoco/idl/builtin_interfaces/msg/Time.idl new file mode 100644 index 0000000..a09bb93 --- /dev/null +++ b/mujoco/idl/builtin_interfaces/msg/Time.idl @@ -0,0 +1,13 @@ +// builtin_interfaces::msg::dds_::Time_ — see PROTOCOL.md. +// Field layout verified against include/booster/idl/builtin_interfaces/Time.h. + +module builtin_interfaces { + module msg { + module dds_ { + struct Time_ { + long sec; + unsigned long nanosec; + }; + }; + }; +}; diff --git a/mujoco/idl/geometry_msgs/msg/PoseWithCovariance.idl b/mujoco/idl/geometry_msgs/msg/PoseWithCovariance.idl new file mode 100644 index 0000000..e4a949a --- /dev/null +++ b/mujoco/idl/geometry_msgs/msg/PoseWithCovariance.idl @@ -0,0 +1,15 @@ +// geometry_msgs::msg::dds_::PoseWithCovariance_ — see PROTOCOL.md. +// Field layout verified against include/booster/idl/geometry_msgs/PoseWithCovariance.h. + +#include "Pose.idl" + +module geometry_msgs { + module msg { + module dds_ { + struct PoseWithCovariance_ { + geometry_msgs::msg::dds_::Pose_ pose; + double covariance[36]; + }; + }; + }; +}; diff --git a/mujoco/idl/geometry_msgs/msg/Twist.idl b/mujoco/idl/geometry_msgs/msg/Twist.idl new file mode 100644 index 0000000..3c81ad9 --- /dev/null +++ b/mujoco/idl/geometry_msgs/msg/Twist.idl @@ -0,0 +1,15 @@ +// geometry_msgs::msg::dds_::Twist_ — see PROTOCOL.md. +// Field layout verified against include/booster/idl/geometry_msgs/Twist.h. + +#include "Vector3.idl" + +module geometry_msgs { + module msg { + module dds_ { + struct Twist_ { + geometry_msgs::msg::dds_::Vector3_ linear; + geometry_msgs::msg::dds_::Vector3_ angular; + }; + }; + }; +}; diff --git a/mujoco/idl/geometry_msgs/msg/TwistWithCovariance.idl b/mujoco/idl/geometry_msgs/msg/TwistWithCovariance.idl new file mode 100644 index 0000000..b2e92ee --- /dev/null +++ b/mujoco/idl/geometry_msgs/msg/TwistWithCovariance.idl @@ -0,0 +1,15 @@ +// geometry_msgs::msg::dds_::TwistWithCovariance_ — see PROTOCOL.md. +// Field layout verified against include/booster/idl/geometry_msgs/TwistWithCovariance.h. + +#include "Twist.idl" + +module geometry_msgs { + module msg { + module dds_ { + struct TwistWithCovariance_ { + geometry_msgs::msg::dds_::Twist_ twist; + double covariance[36]; + }; + }; + }; +}; diff --git a/mujoco/idl/geometry_msgs/msg/Vector3.idl b/mujoco/idl/geometry_msgs/msg/Vector3.idl new file mode 100644 index 0000000..7dcbb1c --- /dev/null +++ b/mujoco/idl/geometry_msgs/msg/Vector3.idl @@ -0,0 +1,14 @@ +// geometry_msgs::msg::dds_::Vector3_ — see PROTOCOL.md. +// Field layout verified against include/booster/idl/geometry_msgs/Vector3.h. + +module geometry_msgs { + module msg { + module dds_ { + struct Vector3_ { + double x; + double y; + double z; + }; + }; + }; +}; diff --git a/mujoco/idl/nav_msgs/msg/Odometry.idl b/mujoco/idl/nav_msgs/msg/Odometry.idl new file mode 100644 index 0000000..d7c6cde --- /dev/null +++ b/mujoco/idl/nav_msgs/msg/Odometry.idl @@ -0,0 +1,19 @@ +// nav_msgs::msg::dds_::Odometry_ — see PROTOCOL.md. +// Field layout verified against include/booster/idl/nav_msgs/Odometry.h. + +#include "Header.idl" +#include "PoseWithCovariance.idl" +#include "TwistWithCovariance.idl" + +module nav_msgs { + module msg { + module dds_ { + struct Odometry_ { + std_msgs::msg::dds_::Header_ header; + string child_frame_id; + geometry_msgs::msg::dds_::PoseWithCovariance_ pose; + geometry_msgs::msg::dds_::TwistWithCovariance_ twist; + }; + }; + }; +}; diff --git a/mujoco/idl/regenerate.sh b/mujoco/idl/regenerate.sh index a3e7b8a..2576742 100755 --- a/mujoco/idl/regenerate.sh +++ b/mujoco/idl/regenerate.sh @@ -36,14 +36,24 @@ OUT_DIR="$ROOT/idl_gen" echo "== fastddsgen version ==" "$FASTDDSGEN" -version -rm -rf "$OUT_DIR/booster_interface" "$OUT_DIR/booster_msgs" "$OUT_DIR/geometry_msgs" -mkdir -p "$OUT_DIR/booster_interface" "$OUT_DIR/booster_msgs" "$OUT_DIR/geometry_msgs" +PACKAGES="booster_interface booster_msgs builtin_interfaces std_msgs geometry_msgs nav_msgs" +for pkg in $PACKAGES; do + rm -rf "$OUT_DIR/$pkg" + mkdir -p "$OUT_DIR/$pkg" +done + +# Every package's msg/ directory is on the include path, so an .idl can #include a type from +# another package by file name (nav_msgs/Odometry.idl includes std_msgs' Header.idl). +INCLUDES=() +for pkg in $PACKAGES; do + INCLUDES+=(-I "$IDL_DIR/$pkg/msg") +done gen() { local src_dir="$1" local out_dir="$2" shift 2 - (cd "$src_dir" && "$FASTDDSGEN" -cdr v1 -de final -replace -d "$out_dir" "$@") + (cd "$src_dir" && "$FASTDDSGEN" -cdr v1 -de final -replace "${INCLUDES[@]}" -d "$out_dir" "$@") } # booster_interface::msg — #include paths inside these .idl files are resolved @@ -56,9 +66,15 @@ gen "$IDL_DIR/booster_interface/msg" "$OUT_DIR/booster_interface" \ gen "$IDL_DIR/booster_msgs/msg" "$OUT_DIR/booster_msgs" \ RpcReqMsg.idl RpcRespMsg.idl -# geometry_msgs::msg (rt/head_pose) +# geometry_msgs::msg (rt/head_pose, and the pose/twist halves of rt/odom) gen "$IDL_DIR/geometry_msgs/msg" "$OUT_DIR/geometry_msgs" \ - Point.idl Quaternion.idl Pose.idl + Point.idl Quaternion.idl Pose.idl PoseWithCovariance.idl Vector3.idl Twist.idl \ + TwistWithCovariance.idl + +# builtin_interfaces::msg, std_msgs::msg, nav_msgs::msg (rt/odom) +gen "$IDL_DIR/builtin_interfaces/msg" "$OUT_DIR/builtin_interfaces" Time.idl +gen "$IDL_DIR/std_msgs/msg" "$OUT_DIR/std_msgs" Header.idl +gen "$IDL_DIR/nav_msgs/msg" "$OUT_DIR/nav_msgs" Odometry.idl echo "== Generated into $OUT_DIR. Registered type names: ==" grep -rho 'setName("[^"]*")' "$OUT_DIR" | sort -u diff --git a/mujoco/idl/std_msgs/msg/Header.idl b/mujoco/idl/std_msgs/msg/Header.idl new file mode 100644 index 0000000..bfd9b2b --- /dev/null +++ b/mujoco/idl/std_msgs/msg/Header.idl @@ -0,0 +1,15 @@ +// std_msgs::msg::dds_::Header_ — see PROTOCOL.md. +// Field layout verified against include/booster/idl/std_msgs/Header.h. + +#include "Time.idl" + +module std_msgs { + module msg { + module dds_ { + struct Header_ { + builtin_interfaces::msg::dds_::Time_ stamp; + string frame_id; + }; + }; + }; +}; diff --git a/mujoco/idl_gen/builtin_interfaces/Time.cxx b/mujoco/idl_gen/builtin_interfaces/Time.cxx new file mode 100644 index 0000000..7766fbe --- /dev/null +++ b/mujoco/idl_gen/builtin_interfaces/Time.cxx @@ -0,0 +1,288 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Time.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "Time.h" + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define builtin_interfaces_msg_dds__Time__max_cdr_typesize 8ULL; + + +namespace builtin_interfaces { + +namespace msg { + +namespace dds_ { + + + +Time_::Time_() +{ + // long m_sec + m_sec = 0; + // unsigned long m_nanosec + m_nanosec = 0; + +} + +Time_::~Time_() +{ +} + +Time_::Time_( + const Time_& x) +{ + m_sec = x.m_sec; + + + m_nanosec = x.m_nanosec; + +} + +Time_::Time_( + Time_&& x) noexcept +{ + m_sec = x.m_sec; + + + m_nanosec = x.m_nanosec; + +} + +Time_& Time_::operator =( + const Time_& x) +{ + m_sec = x.m_sec; + + + m_nanosec = x.m_nanosec; + + return *this; +} + +Time_& Time_::operator =( + Time_&& x) noexcept +{ + m_sec = x.m_sec; + + + m_nanosec = x.m_nanosec; + + return *this; +} + +bool Time_::operator ==( + const Time_& x) const +{ + return (m_sec == x.m_sec && + m_nanosec == x.m_nanosec); +} + +bool Time_::operator !=( + const Time_& x) const +{ + return !(*this == x); +} + +size_t Time_::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return builtin_interfaces_msg_dds__Time__max_cdr_typesize; +} + +size_t Time_::getCdrSerializedSize( + const Time_& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + + +void Time_::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_sec; + + scdr << m_nanosec; + +} + +void Time_::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_sec; + + + + dcdr >> m_nanosec; + + +} + + +bool Time_::isKeyDefined() +{ + return false; +} + +void Time_::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member sec + * @param _sec New value for member sec + */ +void Time_::sec( + int32_t _sec) +{ + m_sec = _sec; +} + +/*! + * @brief This function returns the value of member sec + * @return Value of member sec + */ +int32_t Time_::sec() const +{ + return m_sec; +} + +/*! + * @brief This function returns a reference to member sec + * @return Reference to member sec + */ +int32_t& Time_::sec() +{ + return m_sec; +} + + +/*! + * @brief This function sets a value in member nanosec + * @param _nanosec New value for member nanosec + */ +void Time_::nanosec( + uint32_t _nanosec) +{ + m_nanosec = _nanosec; +} + +/*! + * @brief This function returns the value of member nanosec + * @return Value of member nanosec + */ +uint32_t Time_::nanosec() const +{ + return m_nanosec; +} + +/*! + * @brief This function returns a reference to member nanosec + * @return Reference to member nanosec + */ +uint32_t& Time_::nanosec() +{ + return m_nanosec; +} + + + + + +} // namespace dds_ + + +} // namespace msg + + +} // namespace builtin_interfaces + diff --git a/mujoco/idl_gen/builtin_interfaces/Time.h b/mujoco/idl_gen/builtin_interfaces/Time.h new file mode 100644 index 0000000..7296ac0 --- /dev/null +++ b/mujoco/idl_gen/builtin_interfaces/Time.h @@ -0,0 +1,237 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Time.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIME_H_ +#define _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIME_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(TIME_SOURCE) +#define TIME_DllAPI __declspec( dllexport ) +#else +#define TIME_DllAPI __declspec( dllimport ) +#endif // TIME_SOURCE +#else +#define TIME_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define TIME_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + +namespace builtin_interfaces { + namespace msg { + namespace dds_ { + + + /*! + * @brief This class represents the structure Time_ defined by the user in the IDL file. + * @ingroup Time + */ + class Time_ + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Time_(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Time_(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object builtin_interfaces::msg::dds_::Time_ that will be copied. + */ + eProsima_user_DllExport Time_( + const Time_& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object builtin_interfaces::msg::dds_::Time_ that will be copied. + */ + eProsima_user_DllExport Time_( + Time_&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object builtin_interfaces::msg::dds_::Time_ that will be copied. + */ + eProsima_user_DllExport Time_& operator =( + const Time_& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object builtin_interfaces::msg::dds_::Time_ that will be copied. + */ + eProsima_user_DllExport Time_& operator =( + Time_&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x builtin_interfaces::msg::dds_::Time_ object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Time_& x) const; + + /*! + * @brief Comparison operator. + * @param x builtin_interfaces::msg::dds_::Time_ object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Time_& x) const; + + /*! + * @brief This function sets a value in member sec + * @param _sec New value for member sec + */ + eProsima_user_DllExport void sec( + int32_t _sec); + + /*! + * @brief This function returns the value of member sec + * @return Value of member sec + */ + eProsima_user_DllExport int32_t sec() const; + + /*! + * @brief This function returns a reference to member sec + * @return Reference to member sec + */ + eProsima_user_DllExport int32_t& sec(); + + + /*! + * @brief This function sets a value in member nanosec + * @param _nanosec New value for member nanosec + */ + eProsima_user_DllExport void nanosec( + uint32_t _nanosec); + + /*! + * @brief This function returns the value of member nanosec + * @return Value of member nanosec + */ + eProsima_user_DllExport uint32_t nanosec() const; + + /*! + * @brief This function returns a reference to member nanosec + * @return Reference to member nanosec + */ + eProsima_user_DllExport uint32_t& nanosec(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const builtin_interfaces::msg::dds_::Time_& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + int32_t m_sec; + uint32_t m_nanosec; + + }; + + } // namespace dds_ + } // namespace msg +} // namespace builtin_interfaces + +#endif // _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIME_H_ + + + diff --git a/mujoco/idl_gen/builtin_interfaces/TimeCdrAux.hpp b/mujoco/idl_gen/builtin_interfaces/TimeCdrAux.hpp new file mode 100644 index 0000000..2f50163 --- /dev/null +++ b/mujoco/idl_gen/builtin_interfaces/TimeCdrAux.hpp @@ -0,0 +1,51 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TimeCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIMECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIMECDRAUX_HPP_ + +#include "Time.h" + +constexpr uint32_t builtin_interfaces_msg_dds__Time__max_cdr_typesize {8UL}; +constexpr uint32_t builtin_interfaces_msg_dds__Time__max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const builtin_interfaces::msg::dds_::Time_& data); + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIMECDRAUX_HPP_ + diff --git a/mujoco/idl_gen/builtin_interfaces/TimeCdrAux.ipp b/mujoco/idl_gen/builtin_interfaces/TimeCdrAux.ipp new file mode 100644 index 0000000..4b1d45b --- /dev/null +++ b/mujoco/idl_gen/builtin_interfaces/TimeCdrAux.ipp @@ -0,0 +1,139 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TimeCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIMECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIMECDRAUX_IPP_ + +#include "TimeCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const builtin_interfaces::msg::dds_::Time_& data, + size_t& current_alignment) +{ + using namespace builtin_interfaces::msg::dds_; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.sec(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.nanosec(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const builtin_interfaces::msg::dds_::Time_& data) +{ + using namespace builtin_interfaces::msg::dds_; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.sec() + << eprosima::fastcdr::MemberId(1) << data.nanosec() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + builtin_interfaces::msg::dds_::Time_& data) +{ + using namespace builtin_interfaces::msg::dds_; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.sec(); + break; + + case 1: + dcdr >> data.nanosec(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const builtin_interfaces::msg::dds_::Time_& data) +{ + using namespace builtin_interfaces::msg::dds_; + + static_cast(scdr); + static_cast(data); +} + + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIMECDRAUX_IPP_ + diff --git a/mujoco/idl_gen/builtin_interfaces/TimePubSubTypes.cxx b/mujoco/idl_gen/builtin_interfaces/TimePubSubTypes.cxx new file mode 100644 index 0000000..e0de1ac --- /dev/null +++ b/mujoco/idl_gen/builtin_interfaces/TimePubSubTypes.cxx @@ -0,0 +1,233 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TimePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#include + +#include "TimePubSubTypes.h" +#include "TimeCdrAux.hpp" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + +namespace builtin_interfaces { + namespace msg { + namespace dds_ { + + + Time_PubSubType::Time_PubSubType() + { + setName("builtin_interfaces::msg::dds_::Time_"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(Time_::getMaxCdrSerializedSize()); + #else + builtin_interfaces_msg_dds__Time__max_cdr_typesize; + #endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; + uint32_t keyLength = builtin_interfaces_msg_dds__Time__max_key_cdr_typesize > 16 ? builtin_interfaces_msg_dds__Time__max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + Time_PubSubType::~Time_PubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool Time_PubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + Time_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else + payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 + return true; + } + + bool Time_PubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + Time_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; + } + + std::function Time_PubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) + { + return [data, data_representation]() -> uint32_t + { + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 + }; + } + + void* Time_PubSubType::createData() + { + return reinterpret_cast(new Time_()); + } + + void Time_PubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool Time_PubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + Time_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + builtin_interfaces_msg_dds__Time__max_key_cdr_typesize); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else + eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 + if (force_md5 || builtin_interfaces_msg_dds__Time__max_key_cdr_typesize > 16) + { + m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace dds_ + + + } //End of namespace msg + + +} //End of namespace builtin_interfaces + diff --git a/mujoco/idl_gen/builtin_interfaces/TimePubSubTypes.h b/mujoco/idl_gen/builtin_interfaces/TimePubSubTypes.h new file mode 100644 index 0000000..ae14992 --- /dev/null +++ b/mujoco/idl_gen/builtin_interfaces/TimePubSubTypes.h @@ -0,0 +1,196 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TimePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#ifndef _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIME_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIME_PUBSUBTYPES_H_ + +#include +#include +#include +#include +#include + +#include "Time.h" + + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated Time is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace builtin_interfaces +{ + namespace msg + { + namespace dds_ + { + + + + #ifndef SWIG + namespace detail { + + template + struct Time__rob + { + friend constexpr typename Tag::type get( + Tag) + { + return M; + } + + }; + + struct Time__f + { + typedef uint32_t Time_::* type; + friend constexpr type get( + Time__f); + }; + + template struct Time__rob; + + template + inline size_t constexpr Time__offset_of() + { + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); + } + + } // namespace detail + #endif // ifndef SWIG + + + /*! + * @brief This class represents the TopicDataType of the type Time_ defined by the user in the IDL file. + * @ingroup Time + */ + class Time_PubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef Time_ type; + + eProsima_user_DllExport Time_PubSubType(); + + eProsima_user_DllExport ~Time_PubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return is_plain_xcdrv1_impl(); + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) + { + return is_plain_xcdrv2_impl(); + } + else + { + return is_plain_xcdrv1_impl(); + } + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) Time_(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + private: + + static constexpr bool is_plain_xcdrv1_impl() + { + return 8ULL == + (detail::Time__offset_of() + + sizeof(uint32_t)); + } + + static constexpr bool is_plain_xcdrv2_impl() + { + return 8ULL == + (detail::Time__offset_of() + + sizeof(uint32_t)); + } + + }; + } + } +} + +#endif // _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIME_PUBSUBTYPES_H_ + diff --git a/mujoco/idl_gen/geometry_msgs/PoseWithCovariance.cxx b/mujoco/idl_gen/geometry_msgs/PoseWithCovariance.cxx new file mode 100644 index 0000000..267c230 --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/PoseWithCovariance.cxx @@ -0,0 +1,313 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PoseWithCovariance.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "PoseWithCovariance.h" + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define geometry_msgs_msg_dds__Quaternion__max_cdr_typesize 32ULL; +#define geometry_msgs_msg_dds__Point__max_cdr_typesize 24ULL; +#define geometry_msgs_msg_dds__Pose__max_cdr_typesize 56ULL; +#define geometry_msgs_msg_dds__PoseWithCovariance__max_cdr_typesize 344ULL; + + +namespace geometry_msgs { + +namespace msg { + +namespace dds_ { + + + +PoseWithCovariance_::PoseWithCovariance_() +{ + // geometry_msgs::msg::dds_::Pose_ m_pose + + // double m_covariance + memset(&m_covariance, 0, ((36)) * 8); + +} + +PoseWithCovariance_::~PoseWithCovariance_() +{ +} + +PoseWithCovariance_::PoseWithCovariance_( + const PoseWithCovariance_& x) +{ + m_pose = x.m_pose; + + + m_covariance = x.m_covariance; + +} + +PoseWithCovariance_::PoseWithCovariance_( + PoseWithCovariance_&& x) noexcept +{ + m_pose = std::move(x.m_pose); + + + m_covariance = std::move(x.m_covariance); + +} + +PoseWithCovariance_& PoseWithCovariance_::operator =( + const PoseWithCovariance_& x) +{ + m_pose = x.m_pose; + + + m_covariance = x.m_covariance; + + return *this; +} + +PoseWithCovariance_& PoseWithCovariance_::operator =( + PoseWithCovariance_&& x) noexcept +{ + m_pose = std::move(x.m_pose); + + + m_covariance = std::move(x.m_covariance); + + return *this; +} + +bool PoseWithCovariance_::operator ==( + const PoseWithCovariance_& x) const +{ + return (m_pose == x.m_pose && + m_covariance == x.m_covariance); +} + +bool PoseWithCovariance_::operator !=( + const PoseWithCovariance_& x) const +{ + return !(*this == x); +} + +size_t PoseWithCovariance_::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return geometry_msgs_msg_dds__PoseWithCovariance__max_cdr_typesize; +} + +size_t PoseWithCovariance_::getCdrSerializedSize( + const PoseWithCovariance_& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += geometry_msgs::msg::dds_::Pose_::getCdrSerializedSize(data.pose(), current_alignment); + + + current_alignment += (((36)) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + + return current_alignment - initial_alignment; +} + + +void PoseWithCovariance_::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_pose; + + scdr << m_covariance; + + +} + +void PoseWithCovariance_::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_pose; + + + + dcdr >> m_covariance; + + +} + + +bool PoseWithCovariance_::isKeyDefined() +{ + return false; +} + +void PoseWithCovariance_::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member pose + * @param _pose New value to be copied in member pose + */ +void PoseWithCovariance_::pose( + const geometry_msgs::msg::dds_::Pose_& _pose) +{ + m_pose = _pose; +} + +/*! + * @brief This function moves the value in member pose + * @param _pose New value to be moved in member pose + */ +void PoseWithCovariance_::pose( + geometry_msgs::msg::dds_::Pose_&& _pose) +{ + m_pose = std::move(_pose); +} + +/*! + * @brief This function returns a constant reference to member pose + * @return Constant reference to member pose + */ +const geometry_msgs::msg::dds_::Pose_& PoseWithCovariance_::pose() const +{ + return m_pose; +} + +/*! + * @brief This function returns a reference to member pose + * @return Reference to member pose + */ +geometry_msgs::msg::dds_::Pose_& PoseWithCovariance_::pose() +{ + return m_pose; +} + + +/*! + * @brief This function copies the value in member covariance + * @param _covariance New value to be copied in member covariance + */ +void PoseWithCovariance_::covariance( + const std::array& _covariance) +{ + m_covariance = _covariance; +} + +/*! + * @brief This function moves the value in member covariance + * @param _covariance New value to be moved in member covariance + */ +void PoseWithCovariance_::covariance( + std::array&& _covariance) +{ + m_covariance = std::move(_covariance); +} + +/*! + * @brief This function returns a constant reference to member covariance + * @return Constant reference to member covariance + */ +const std::array& PoseWithCovariance_::covariance() const +{ + return m_covariance; +} + +/*! + * @brief This function returns a reference to member covariance + * @return Reference to member covariance + */ +std::array& PoseWithCovariance_::covariance() +{ + return m_covariance; +} + + + + + +} // namespace dds_ + + +} // namespace msg + + +} // namespace geometry_msgs + diff --git a/mujoco/idl_gen/geometry_msgs/PoseWithCovariance.h b/mujoco/idl_gen/geometry_msgs/PoseWithCovariance.h new file mode 100644 index 0000000..eefb9fd --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/PoseWithCovariance.h @@ -0,0 +1,252 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PoseWithCovariance.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCE_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCE_H_ + +#include "Pose.h" + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(POSEWITHCOVARIANCE_SOURCE) +#define POSEWITHCOVARIANCE_DllAPI __declspec( dllexport ) +#else +#define POSEWITHCOVARIANCE_DllAPI __declspec( dllimport ) +#endif // POSEWITHCOVARIANCE_SOURCE +#else +#define POSEWITHCOVARIANCE_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define POSEWITHCOVARIANCE_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + +namespace geometry_msgs { + namespace msg { + namespace dds_ { + + + /*! + * @brief This class represents the structure PoseWithCovariance_ defined by the user in the IDL file. + * @ingroup PoseWithCovariance + */ + class PoseWithCovariance_ + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PoseWithCovariance_(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PoseWithCovariance_(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object geometry_msgs::msg::dds_::PoseWithCovariance_ that will be copied. + */ + eProsima_user_DllExport PoseWithCovariance_( + const PoseWithCovariance_& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object geometry_msgs::msg::dds_::PoseWithCovariance_ that will be copied. + */ + eProsima_user_DllExport PoseWithCovariance_( + PoseWithCovariance_&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object geometry_msgs::msg::dds_::PoseWithCovariance_ that will be copied. + */ + eProsima_user_DllExport PoseWithCovariance_& operator =( + const PoseWithCovariance_& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object geometry_msgs::msg::dds_::PoseWithCovariance_ that will be copied. + */ + eProsima_user_DllExport PoseWithCovariance_& operator =( + PoseWithCovariance_&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::dds_::PoseWithCovariance_ object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PoseWithCovariance_& x) const; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::dds_::PoseWithCovariance_ object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PoseWithCovariance_& x) const; + + /*! + * @brief This function copies the value in member pose + * @param _pose New value to be copied in member pose + */ + eProsima_user_DllExport void pose( + const geometry_msgs::msg::dds_::Pose_& _pose); + + /*! + * @brief This function moves the value in member pose + * @param _pose New value to be moved in member pose + */ + eProsima_user_DllExport void pose( + geometry_msgs::msg::dds_::Pose_&& _pose); + + /*! + * @brief This function returns a constant reference to member pose + * @return Constant reference to member pose + */ + eProsima_user_DllExport const geometry_msgs::msg::dds_::Pose_& pose() const; + + /*! + * @brief This function returns a reference to member pose + * @return Reference to member pose + */ + eProsima_user_DllExport geometry_msgs::msg::dds_::Pose_& pose(); + + + /*! + * @brief This function copies the value in member covariance + * @param _covariance New value to be copied in member covariance + */ + eProsima_user_DllExport void covariance( + const std::array& _covariance); + + /*! + * @brief This function moves the value in member covariance + * @param _covariance New value to be moved in member covariance + */ + eProsima_user_DllExport void covariance( + std::array&& _covariance); + + /*! + * @brief This function returns a constant reference to member covariance + * @return Constant reference to member covariance + */ + eProsima_user_DllExport const std::array& covariance() const; + + /*! + * @brief This function returns a reference to member covariance + * @return Reference to member covariance + */ + eProsima_user_DllExport std::array& covariance(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const geometry_msgs::msg::dds_::PoseWithCovariance_& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + geometry_msgs::msg::dds_::Pose_ m_pose; + std::array m_covariance; + + }; + + } // namespace dds_ + } // namespace msg +} // namespace geometry_msgs + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCE_H_ + + + diff --git a/mujoco/idl_gen/geometry_msgs/PoseWithCovarianceCdrAux.hpp b/mujoco/idl_gen/geometry_msgs/PoseWithCovarianceCdrAux.hpp new file mode 100644 index 0000000..77dcabf --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/PoseWithCovarianceCdrAux.hpp @@ -0,0 +1,51 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PoseWithCovarianceCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCECDRAUX_HPP_ + +#include "PoseWithCovariance.h" + +constexpr uint32_t geometry_msgs_msg_dds__PoseWithCovariance__max_cdr_typesize {344UL}; +constexpr uint32_t geometry_msgs_msg_dds__PoseWithCovariance__max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::PoseWithCovariance_& data); + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCECDRAUX_HPP_ + diff --git a/mujoco/idl_gen/geometry_msgs/PoseWithCovarianceCdrAux.ipp b/mujoco/idl_gen/geometry_msgs/PoseWithCovarianceCdrAux.ipp new file mode 100644 index 0000000..b843a05 --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/PoseWithCovarianceCdrAux.ipp @@ -0,0 +1,139 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PoseWithCovarianceCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCECDRAUX_IPP_ + +#include "PoseWithCovarianceCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const geometry_msgs::msg::dds_::PoseWithCovariance_& data, + size_t& current_alignment) +{ + using namespace geometry_msgs::msg::dds_; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.pose(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.covariance(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::PoseWithCovariance_& data) +{ + using namespace geometry_msgs::msg::dds_; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.pose() + << eprosima::fastcdr::MemberId(1) << data.covariance() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + geometry_msgs::msg::dds_::PoseWithCovariance_& data) +{ + using namespace geometry_msgs::msg::dds_; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.pose(); + break; + + case 1: + dcdr >> data.covariance(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::PoseWithCovariance_& data) +{ + using namespace geometry_msgs::msg::dds_; + + static_cast(scdr); + static_cast(data); +} + + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCECDRAUX_IPP_ + diff --git a/mujoco/idl_gen/geometry_msgs/PoseWithCovariancePubSubTypes.cxx b/mujoco/idl_gen/geometry_msgs/PoseWithCovariancePubSubTypes.cxx new file mode 100644 index 0000000..8fd289e --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/PoseWithCovariancePubSubTypes.cxx @@ -0,0 +1,233 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PoseWithCovariancePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#include + +#include "PoseWithCovariancePubSubTypes.h" +#include "PoseWithCovarianceCdrAux.hpp" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + +namespace geometry_msgs { + namespace msg { + namespace dds_ { + + + PoseWithCovariance_PubSubType::PoseWithCovariance_PubSubType() + { + setName("geometry_msgs::msg::dds_::PoseWithCovariance_"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(PoseWithCovariance_::getMaxCdrSerializedSize()); + #else + geometry_msgs_msg_dds__PoseWithCovariance__max_cdr_typesize; + #endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; + uint32_t keyLength = geometry_msgs_msg_dds__PoseWithCovariance__max_key_cdr_typesize > 16 ? geometry_msgs_msg_dds__PoseWithCovariance__max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + PoseWithCovariance_PubSubType::~PoseWithCovariance_PubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool PoseWithCovariance_PubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + PoseWithCovariance_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else + payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 + return true; + } + + bool PoseWithCovariance_PubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + PoseWithCovariance_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; + } + + std::function PoseWithCovariance_PubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) + { + return [data, data_representation]() -> uint32_t + { + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 + }; + } + + void* PoseWithCovariance_PubSubType::createData() + { + return reinterpret_cast(new PoseWithCovariance_()); + } + + void PoseWithCovariance_PubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool PoseWithCovariance_PubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + PoseWithCovariance_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + geometry_msgs_msg_dds__PoseWithCovariance__max_key_cdr_typesize); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else + eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 + if (force_md5 || geometry_msgs_msg_dds__PoseWithCovariance__max_key_cdr_typesize > 16) + { + m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace dds_ + + + } //End of namespace msg + + +} //End of namespace geometry_msgs + diff --git a/mujoco/idl_gen/geometry_msgs/PoseWithCovariancePubSubTypes.h b/mujoco/idl_gen/geometry_msgs/PoseWithCovariancePubSubTypes.h new file mode 100644 index 0000000..9dcd73c --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/PoseWithCovariancePubSubTypes.h @@ -0,0 +1,197 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PoseWithCovariancePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCE_PUBSUBTYPES_H_ + +#include +#include +#include +#include +#include + +#include "PoseWithCovariance.h" + +#include "PosePubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated PoseWithCovariance is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace geometry_msgs +{ + namespace msg + { + namespace dds_ + { + + + + #ifndef SWIG + namespace detail { + + template + struct PoseWithCovariance__rob + { + friend constexpr typename Tag::type get( + Tag) + { + return M; + } + + }; + + struct PoseWithCovariance__f + { + typedef std::array PoseWithCovariance_::* type; + friend constexpr type get( + PoseWithCovariance__f); + }; + + template struct PoseWithCovariance__rob; + + template + inline size_t constexpr PoseWithCovariance__offset_of() + { + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); + } + + } // namespace detail + #endif // ifndef SWIG + + + /*! + * @brief This class represents the TopicDataType of the type PoseWithCovariance_ defined by the user in the IDL file. + * @ingroup PoseWithCovariance + */ + class PoseWithCovariance_PubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef PoseWithCovariance_ type; + + eProsima_user_DllExport PoseWithCovariance_PubSubType(); + + eProsima_user_DllExport ~PoseWithCovariance_PubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return is_plain_xcdrv1_impl(); + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) + { + return is_plain_xcdrv2_impl(); + } + else + { + return is_plain_xcdrv1_impl(); + } + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) PoseWithCovariance_(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + private: + + static constexpr bool is_plain_xcdrv1_impl() + { + return 344ULL == + (detail::PoseWithCovariance__offset_of() + + sizeof(std::array)); + } + + static constexpr bool is_plain_xcdrv2_impl() + { + return 344ULL == + (detail::PoseWithCovariance__offset_of() + + sizeof(std::array)); + } + + }; + } + } +} + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCE_PUBSUBTYPES_H_ + diff --git a/mujoco/idl_gen/geometry_msgs/Twist.cxx b/mujoco/idl_gen/geometry_msgs/Twist.cxx new file mode 100644 index 0000000..d6da739 --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/Twist.cxx @@ -0,0 +1,309 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Twist.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "Twist.h" + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define geometry_msgs_msg_dds__Vector3__max_cdr_typesize 24ULL; +#define geometry_msgs_msg_dds__Twist__max_cdr_typesize 48ULL; + + +namespace geometry_msgs { + +namespace msg { + +namespace dds_ { + + + +Twist_::Twist_() +{ + // geometry_msgs::msg::dds_::Vector3_ m_linear + + // geometry_msgs::msg::dds_::Vector3_ m_angular + + +} + +Twist_::~Twist_() +{ +} + +Twist_::Twist_( + const Twist_& x) +{ + m_linear = x.m_linear; + + + m_angular = x.m_angular; + +} + +Twist_::Twist_( + Twist_&& x) noexcept +{ + m_linear = std::move(x.m_linear); + + + m_angular = std::move(x.m_angular); + +} + +Twist_& Twist_::operator =( + const Twist_& x) +{ + m_linear = x.m_linear; + + + m_angular = x.m_angular; + + return *this; +} + +Twist_& Twist_::operator =( + Twist_&& x) noexcept +{ + m_linear = std::move(x.m_linear); + + + m_angular = std::move(x.m_angular); + + return *this; +} + +bool Twist_::operator ==( + const Twist_& x) const +{ + return (m_linear == x.m_linear && + m_angular == x.m_angular); +} + +bool Twist_::operator !=( + const Twist_& x) const +{ + return !(*this == x); +} + +size_t Twist_::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return geometry_msgs_msg_dds__Twist__max_cdr_typesize; +} + +size_t Twist_::getCdrSerializedSize( + const Twist_& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += geometry_msgs::msg::dds_::Vector3_::getCdrSerializedSize(data.linear(), current_alignment); + + + current_alignment += geometry_msgs::msg::dds_::Vector3_::getCdrSerializedSize(data.angular(), current_alignment); + + + return current_alignment - initial_alignment; +} + + +void Twist_::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_linear; + + scdr << m_angular; + +} + +void Twist_::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_linear; + + + + dcdr >> m_angular; + + +} + + +bool Twist_::isKeyDefined() +{ + return false; +} + +void Twist_::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member linear + * @param _linear New value to be copied in member linear + */ +void Twist_::linear( + const geometry_msgs::msg::dds_::Vector3_& _linear) +{ + m_linear = _linear; +} + +/*! + * @brief This function moves the value in member linear + * @param _linear New value to be moved in member linear + */ +void Twist_::linear( + geometry_msgs::msg::dds_::Vector3_&& _linear) +{ + m_linear = std::move(_linear); +} + +/*! + * @brief This function returns a constant reference to member linear + * @return Constant reference to member linear + */ +const geometry_msgs::msg::dds_::Vector3_& Twist_::linear() const +{ + return m_linear; +} + +/*! + * @brief This function returns a reference to member linear + * @return Reference to member linear + */ +geometry_msgs::msg::dds_::Vector3_& Twist_::linear() +{ + return m_linear; +} + + +/*! + * @brief This function copies the value in member angular + * @param _angular New value to be copied in member angular + */ +void Twist_::angular( + const geometry_msgs::msg::dds_::Vector3_& _angular) +{ + m_angular = _angular; +} + +/*! + * @brief This function moves the value in member angular + * @param _angular New value to be moved in member angular + */ +void Twist_::angular( + geometry_msgs::msg::dds_::Vector3_&& _angular) +{ + m_angular = std::move(_angular); +} + +/*! + * @brief This function returns a constant reference to member angular + * @return Constant reference to member angular + */ +const geometry_msgs::msg::dds_::Vector3_& Twist_::angular() const +{ + return m_angular; +} + +/*! + * @brief This function returns a reference to member angular + * @return Reference to member angular + */ +geometry_msgs::msg::dds_::Vector3_& Twist_::angular() +{ + return m_angular; +} + + + + + +} // namespace dds_ + + +} // namespace msg + + +} // namespace geometry_msgs + diff --git a/mujoco/idl_gen/geometry_msgs/Twist.h b/mujoco/idl_gen/geometry_msgs/Twist.h new file mode 100644 index 0000000..64989d1 --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/Twist.h @@ -0,0 +1,252 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Twist.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWIST_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWIST_H_ + +#include "Vector3.h" + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(TWIST_SOURCE) +#define TWIST_DllAPI __declspec( dllexport ) +#else +#define TWIST_DllAPI __declspec( dllimport ) +#endif // TWIST_SOURCE +#else +#define TWIST_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define TWIST_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + +namespace geometry_msgs { + namespace msg { + namespace dds_ { + + + /*! + * @brief This class represents the structure Twist_ defined by the user in the IDL file. + * @ingroup Twist + */ + class Twist_ + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Twist_(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Twist_(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object geometry_msgs::msg::dds_::Twist_ that will be copied. + */ + eProsima_user_DllExport Twist_( + const Twist_& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object geometry_msgs::msg::dds_::Twist_ that will be copied. + */ + eProsima_user_DllExport Twist_( + Twist_&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object geometry_msgs::msg::dds_::Twist_ that will be copied. + */ + eProsima_user_DllExport Twist_& operator =( + const Twist_& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object geometry_msgs::msg::dds_::Twist_ that will be copied. + */ + eProsima_user_DllExport Twist_& operator =( + Twist_&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::dds_::Twist_ object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Twist_& x) const; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::dds_::Twist_ object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Twist_& x) const; + + /*! + * @brief This function copies the value in member linear + * @param _linear New value to be copied in member linear + */ + eProsima_user_DllExport void linear( + const geometry_msgs::msg::dds_::Vector3_& _linear); + + /*! + * @brief This function moves the value in member linear + * @param _linear New value to be moved in member linear + */ + eProsima_user_DllExport void linear( + geometry_msgs::msg::dds_::Vector3_&& _linear); + + /*! + * @brief This function returns a constant reference to member linear + * @return Constant reference to member linear + */ + eProsima_user_DllExport const geometry_msgs::msg::dds_::Vector3_& linear() const; + + /*! + * @brief This function returns a reference to member linear + * @return Reference to member linear + */ + eProsima_user_DllExport geometry_msgs::msg::dds_::Vector3_& linear(); + + + /*! + * @brief This function copies the value in member angular + * @param _angular New value to be copied in member angular + */ + eProsima_user_DllExport void angular( + const geometry_msgs::msg::dds_::Vector3_& _angular); + + /*! + * @brief This function moves the value in member angular + * @param _angular New value to be moved in member angular + */ + eProsima_user_DllExport void angular( + geometry_msgs::msg::dds_::Vector3_&& _angular); + + /*! + * @brief This function returns a constant reference to member angular + * @return Constant reference to member angular + */ + eProsima_user_DllExport const geometry_msgs::msg::dds_::Vector3_& angular() const; + + /*! + * @brief This function returns a reference to member angular + * @return Reference to member angular + */ + eProsima_user_DllExport geometry_msgs::msg::dds_::Vector3_& angular(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const geometry_msgs::msg::dds_::Twist_& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + geometry_msgs::msg::dds_::Vector3_ m_linear; + geometry_msgs::msg::dds_::Vector3_ m_angular; + + }; + + } // namespace dds_ + } // namespace msg +} // namespace geometry_msgs + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWIST_H_ + + + diff --git a/mujoco/idl_gen/geometry_msgs/TwistCdrAux.hpp b/mujoco/idl_gen/geometry_msgs/TwistCdrAux.hpp new file mode 100644 index 0000000..cff1e80 --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/TwistCdrAux.hpp @@ -0,0 +1,51 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TwistCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTCDRAUX_HPP_ + +#include "Twist.h" + +constexpr uint32_t geometry_msgs_msg_dds__Twist__max_cdr_typesize {48UL}; +constexpr uint32_t geometry_msgs_msg_dds__Twist__max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::Twist_& data); + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTCDRAUX_HPP_ + diff --git a/mujoco/idl_gen/geometry_msgs/TwistCdrAux.ipp b/mujoco/idl_gen/geometry_msgs/TwistCdrAux.ipp new file mode 100644 index 0000000..88c03d1 --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/TwistCdrAux.ipp @@ -0,0 +1,139 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TwistCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTCDRAUX_IPP_ + +#include "TwistCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const geometry_msgs::msg::dds_::Twist_& data, + size_t& current_alignment) +{ + using namespace geometry_msgs::msg::dds_; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.linear(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.angular(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::Twist_& data) +{ + using namespace geometry_msgs::msg::dds_; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.linear() + << eprosima::fastcdr::MemberId(1) << data.angular() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + geometry_msgs::msg::dds_::Twist_& data) +{ + using namespace geometry_msgs::msg::dds_; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.linear(); + break; + + case 1: + dcdr >> data.angular(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::Twist_& data) +{ + using namespace geometry_msgs::msg::dds_; + + static_cast(scdr); + static_cast(data); +} + + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTCDRAUX_IPP_ + diff --git a/mujoco/idl_gen/geometry_msgs/TwistPubSubTypes.cxx b/mujoco/idl_gen/geometry_msgs/TwistPubSubTypes.cxx new file mode 100644 index 0000000..71792a3 --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/TwistPubSubTypes.cxx @@ -0,0 +1,233 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TwistPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#include + +#include "TwistPubSubTypes.h" +#include "TwistCdrAux.hpp" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + +namespace geometry_msgs { + namespace msg { + namespace dds_ { + + + Twist_PubSubType::Twist_PubSubType() + { + setName("geometry_msgs::msg::dds_::Twist_"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(Twist_::getMaxCdrSerializedSize()); + #else + geometry_msgs_msg_dds__Twist__max_cdr_typesize; + #endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; + uint32_t keyLength = geometry_msgs_msg_dds__Twist__max_key_cdr_typesize > 16 ? geometry_msgs_msg_dds__Twist__max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + Twist_PubSubType::~Twist_PubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool Twist_PubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + Twist_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else + payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 + return true; + } + + bool Twist_PubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + Twist_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; + } + + std::function Twist_PubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) + { + return [data, data_representation]() -> uint32_t + { + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 + }; + } + + void* Twist_PubSubType::createData() + { + return reinterpret_cast(new Twist_()); + } + + void Twist_PubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool Twist_PubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + Twist_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + geometry_msgs_msg_dds__Twist__max_key_cdr_typesize); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else + eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 + if (force_md5 || geometry_msgs_msg_dds__Twist__max_key_cdr_typesize > 16) + { + m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace dds_ + + + } //End of namespace msg + + +} //End of namespace geometry_msgs + diff --git a/mujoco/idl_gen/geometry_msgs/TwistPubSubTypes.h b/mujoco/idl_gen/geometry_msgs/TwistPubSubTypes.h new file mode 100644 index 0000000..defb4e8 --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/TwistPubSubTypes.h @@ -0,0 +1,197 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TwistPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWIST_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWIST_PUBSUBTYPES_H_ + +#include +#include +#include +#include +#include + +#include "Twist.h" + +#include "Vector3PubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated Twist is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace geometry_msgs +{ + namespace msg + { + namespace dds_ + { + + + + #ifndef SWIG + namespace detail { + + template + struct Twist__rob + { + friend constexpr typename Tag::type get( + Tag) + { + return M; + } + + }; + + struct Twist__f + { + typedef geometry_msgs::msg::dds_::Vector3_ Twist_::* type; + friend constexpr type get( + Twist__f); + }; + + template struct Twist__rob; + + template + inline size_t constexpr Twist__offset_of() + { + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); + } + + } // namespace detail + #endif // ifndef SWIG + + + /*! + * @brief This class represents the TopicDataType of the type Twist_ defined by the user in the IDL file. + * @ingroup Twist + */ + class Twist_PubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef Twist_ type; + + eProsima_user_DllExport Twist_PubSubType(); + + eProsima_user_DllExport ~Twist_PubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return is_plain_xcdrv1_impl(); + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) + { + return is_plain_xcdrv2_impl(); + } + else + { + return is_plain_xcdrv1_impl(); + } + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) Twist_(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + private: + + static constexpr bool is_plain_xcdrv1_impl() + { + return 48ULL == + (detail::Twist__offset_of() + + sizeof(geometry_msgs::msg::dds_::Vector3_)); + } + + static constexpr bool is_plain_xcdrv2_impl() + { + return 48ULL == + (detail::Twist__offset_of() + + sizeof(geometry_msgs::msg::dds_::Vector3_)); + } + + }; + } + } +} + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWIST_PUBSUBTYPES_H_ + diff --git a/mujoco/idl_gen/geometry_msgs/TwistWithCovariance.cxx b/mujoco/idl_gen/geometry_msgs/TwistWithCovariance.cxx new file mode 100644 index 0000000..462570d --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/TwistWithCovariance.cxx @@ -0,0 +1,312 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TwistWithCovariance.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "TwistWithCovariance.h" + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define geometry_msgs_msg_dds__Vector3__max_cdr_typesize 24ULL; +#define geometry_msgs_msg_dds__TwistWithCovariance__max_cdr_typesize 336ULL; +#define geometry_msgs_msg_dds__Twist__max_cdr_typesize 48ULL; + + +namespace geometry_msgs { + +namespace msg { + +namespace dds_ { + + + +TwistWithCovariance_::TwistWithCovariance_() +{ + // geometry_msgs::msg::dds_::Twist_ m_twist + + // double m_covariance + memset(&m_covariance, 0, ((36)) * 8); + +} + +TwistWithCovariance_::~TwistWithCovariance_() +{ +} + +TwistWithCovariance_::TwistWithCovariance_( + const TwistWithCovariance_& x) +{ + m_twist = x.m_twist; + + + m_covariance = x.m_covariance; + +} + +TwistWithCovariance_::TwistWithCovariance_( + TwistWithCovariance_&& x) noexcept +{ + m_twist = std::move(x.m_twist); + + + m_covariance = std::move(x.m_covariance); + +} + +TwistWithCovariance_& TwistWithCovariance_::operator =( + const TwistWithCovariance_& x) +{ + m_twist = x.m_twist; + + + m_covariance = x.m_covariance; + + return *this; +} + +TwistWithCovariance_& TwistWithCovariance_::operator =( + TwistWithCovariance_&& x) noexcept +{ + m_twist = std::move(x.m_twist); + + + m_covariance = std::move(x.m_covariance); + + return *this; +} + +bool TwistWithCovariance_::operator ==( + const TwistWithCovariance_& x) const +{ + return (m_twist == x.m_twist && + m_covariance == x.m_covariance); +} + +bool TwistWithCovariance_::operator !=( + const TwistWithCovariance_& x) const +{ + return !(*this == x); +} + +size_t TwistWithCovariance_::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return geometry_msgs_msg_dds__TwistWithCovariance__max_cdr_typesize; +} + +size_t TwistWithCovariance_::getCdrSerializedSize( + const TwistWithCovariance_& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += geometry_msgs::msg::dds_::Twist_::getCdrSerializedSize(data.twist(), current_alignment); + + + current_alignment += (((36)) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + + return current_alignment - initial_alignment; +} + + +void TwistWithCovariance_::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_twist; + + scdr << m_covariance; + + +} + +void TwistWithCovariance_::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_twist; + + + + dcdr >> m_covariance; + + +} + + +bool TwistWithCovariance_::isKeyDefined() +{ + return false; +} + +void TwistWithCovariance_::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member twist + * @param _twist New value to be copied in member twist + */ +void TwistWithCovariance_::twist( + const geometry_msgs::msg::dds_::Twist_& _twist) +{ + m_twist = _twist; +} + +/*! + * @brief This function moves the value in member twist + * @param _twist New value to be moved in member twist + */ +void TwistWithCovariance_::twist( + geometry_msgs::msg::dds_::Twist_&& _twist) +{ + m_twist = std::move(_twist); +} + +/*! + * @brief This function returns a constant reference to member twist + * @return Constant reference to member twist + */ +const geometry_msgs::msg::dds_::Twist_& TwistWithCovariance_::twist() const +{ + return m_twist; +} + +/*! + * @brief This function returns a reference to member twist + * @return Reference to member twist + */ +geometry_msgs::msg::dds_::Twist_& TwistWithCovariance_::twist() +{ + return m_twist; +} + + +/*! + * @brief This function copies the value in member covariance + * @param _covariance New value to be copied in member covariance + */ +void TwistWithCovariance_::covariance( + const std::array& _covariance) +{ + m_covariance = _covariance; +} + +/*! + * @brief This function moves the value in member covariance + * @param _covariance New value to be moved in member covariance + */ +void TwistWithCovariance_::covariance( + std::array&& _covariance) +{ + m_covariance = std::move(_covariance); +} + +/*! + * @brief This function returns a constant reference to member covariance + * @return Constant reference to member covariance + */ +const std::array& TwistWithCovariance_::covariance() const +{ + return m_covariance; +} + +/*! + * @brief This function returns a reference to member covariance + * @return Reference to member covariance + */ +std::array& TwistWithCovariance_::covariance() +{ + return m_covariance; +} + + + + + +} // namespace dds_ + + +} // namespace msg + + +} // namespace geometry_msgs + diff --git a/mujoco/idl_gen/geometry_msgs/TwistWithCovariance.h b/mujoco/idl_gen/geometry_msgs/TwistWithCovariance.h new file mode 100644 index 0000000..e263013 --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/TwistWithCovariance.h @@ -0,0 +1,252 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TwistWithCovariance.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCE_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCE_H_ + +#include "Twist.h" + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(TWISTWITHCOVARIANCE_SOURCE) +#define TWISTWITHCOVARIANCE_DllAPI __declspec( dllexport ) +#else +#define TWISTWITHCOVARIANCE_DllAPI __declspec( dllimport ) +#endif // TWISTWITHCOVARIANCE_SOURCE +#else +#define TWISTWITHCOVARIANCE_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define TWISTWITHCOVARIANCE_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + +namespace geometry_msgs { + namespace msg { + namespace dds_ { + + + /*! + * @brief This class represents the structure TwistWithCovariance_ defined by the user in the IDL file. + * @ingroup TwistWithCovariance + */ + class TwistWithCovariance_ + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport TwistWithCovariance_(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~TwistWithCovariance_(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object geometry_msgs::msg::dds_::TwistWithCovariance_ that will be copied. + */ + eProsima_user_DllExport TwistWithCovariance_( + const TwistWithCovariance_& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object geometry_msgs::msg::dds_::TwistWithCovariance_ that will be copied. + */ + eProsima_user_DllExport TwistWithCovariance_( + TwistWithCovariance_&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object geometry_msgs::msg::dds_::TwistWithCovariance_ that will be copied. + */ + eProsima_user_DllExport TwistWithCovariance_& operator =( + const TwistWithCovariance_& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object geometry_msgs::msg::dds_::TwistWithCovariance_ that will be copied. + */ + eProsima_user_DllExport TwistWithCovariance_& operator =( + TwistWithCovariance_&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::dds_::TwistWithCovariance_ object to compare. + */ + eProsima_user_DllExport bool operator ==( + const TwistWithCovariance_& x) const; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::dds_::TwistWithCovariance_ object to compare. + */ + eProsima_user_DllExport bool operator !=( + const TwistWithCovariance_& x) const; + + /*! + * @brief This function copies the value in member twist + * @param _twist New value to be copied in member twist + */ + eProsima_user_DllExport void twist( + const geometry_msgs::msg::dds_::Twist_& _twist); + + /*! + * @brief This function moves the value in member twist + * @param _twist New value to be moved in member twist + */ + eProsima_user_DllExport void twist( + geometry_msgs::msg::dds_::Twist_&& _twist); + + /*! + * @brief This function returns a constant reference to member twist + * @return Constant reference to member twist + */ + eProsima_user_DllExport const geometry_msgs::msg::dds_::Twist_& twist() const; + + /*! + * @brief This function returns a reference to member twist + * @return Reference to member twist + */ + eProsima_user_DllExport geometry_msgs::msg::dds_::Twist_& twist(); + + + /*! + * @brief This function copies the value in member covariance + * @param _covariance New value to be copied in member covariance + */ + eProsima_user_DllExport void covariance( + const std::array& _covariance); + + /*! + * @brief This function moves the value in member covariance + * @param _covariance New value to be moved in member covariance + */ + eProsima_user_DllExport void covariance( + std::array&& _covariance); + + /*! + * @brief This function returns a constant reference to member covariance + * @return Constant reference to member covariance + */ + eProsima_user_DllExport const std::array& covariance() const; + + /*! + * @brief This function returns a reference to member covariance + * @return Reference to member covariance + */ + eProsima_user_DllExport std::array& covariance(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const geometry_msgs::msg::dds_::TwistWithCovariance_& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + geometry_msgs::msg::dds_::Twist_ m_twist; + std::array m_covariance; + + }; + + } // namespace dds_ + } // namespace msg +} // namespace geometry_msgs + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCE_H_ + + + diff --git a/mujoco/idl_gen/geometry_msgs/TwistWithCovarianceCdrAux.hpp b/mujoco/idl_gen/geometry_msgs/TwistWithCovarianceCdrAux.hpp new file mode 100644 index 0000000..297ad3b --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/TwistWithCovarianceCdrAux.hpp @@ -0,0 +1,52 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TwistWithCovarianceCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCECDRAUX_HPP_ + +#include "TwistWithCovariance.h" + +constexpr uint32_t geometry_msgs_msg_dds__TwistWithCovariance__max_cdr_typesize {336UL}; +constexpr uint32_t geometry_msgs_msg_dds__TwistWithCovariance__max_key_cdr_typesize {0UL}; + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::TwistWithCovariance_& data); + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCECDRAUX_HPP_ + diff --git a/mujoco/idl_gen/geometry_msgs/TwistWithCovarianceCdrAux.ipp b/mujoco/idl_gen/geometry_msgs/TwistWithCovarianceCdrAux.ipp new file mode 100644 index 0000000..a3fc729 --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/TwistWithCovarianceCdrAux.ipp @@ -0,0 +1,139 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TwistWithCovarianceCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCECDRAUX_IPP_ + +#include "TwistWithCovarianceCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const geometry_msgs::msg::dds_::TwistWithCovariance_& data, + size_t& current_alignment) +{ + using namespace geometry_msgs::msg::dds_; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.twist(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.covariance(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::TwistWithCovariance_& data) +{ + using namespace geometry_msgs::msg::dds_; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.twist() + << eprosima::fastcdr::MemberId(1) << data.covariance() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + geometry_msgs::msg::dds_::TwistWithCovariance_& data) +{ + using namespace geometry_msgs::msg::dds_; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.twist(); + break; + + case 1: + dcdr >> data.covariance(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::TwistWithCovariance_& data) +{ + using namespace geometry_msgs::msg::dds_; + + static_cast(scdr); + static_cast(data); +} + + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCECDRAUX_IPP_ + diff --git a/mujoco/idl_gen/geometry_msgs/TwistWithCovariancePubSubTypes.cxx b/mujoco/idl_gen/geometry_msgs/TwistWithCovariancePubSubTypes.cxx new file mode 100644 index 0000000..4c24e80 --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/TwistWithCovariancePubSubTypes.cxx @@ -0,0 +1,233 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TwistWithCovariancePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#include + +#include "TwistWithCovariancePubSubTypes.h" +#include "TwistWithCovarianceCdrAux.hpp" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + +namespace geometry_msgs { + namespace msg { + namespace dds_ { + + + TwistWithCovariance_PubSubType::TwistWithCovariance_PubSubType() + { + setName("geometry_msgs::msg::dds_::TwistWithCovariance_"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(TwistWithCovariance_::getMaxCdrSerializedSize()); + #else + geometry_msgs_msg_dds__TwistWithCovariance__max_cdr_typesize; + #endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; + uint32_t keyLength = geometry_msgs_msg_dds__TwistWithCovariance__max_key_cdr_typesize > 16 ? geometry_msgs_msg_dds__TwistWithCovariance__max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + TwistWithCovariance_PubSubType::~TwistWithCovariance_PubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool TwistWithCovariance_PubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + TwistWithCovariance_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else + payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 + return true; + } + + bool TwistWithCovariance_PubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + TwistWithCovariance_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; + } + + std::function TwistWithCovariance_PubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) + { + return [data, data_representation]() -> uint32_t + { + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 + }; + } + + void* TwistWithCovariance_PubSubType::createData() + { + return reinterpret_cast(new TwistWithCovariance_()); + } + + void TwistWithCovariance_PubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool TwistWithCovariance_PubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + TwistWithCovariance_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + geometry_msgs_msg_dds__TwistWithCovariance__max_key_cdr_typesize); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else + eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 + if (force_md5 || geometry_msgs_msg_dds__TwistWithCovariance__max_key_cdr_typesize > 16) + { + m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace dds_ + + + } //End of namespace msg + + +} //End of namespace geometry_msgs + diff --git a/mujoco/idl_gen/geometry_msgs/TwistWithCovariancePubSubTypes.h b/mujoco/idl_gen/geometry_msgs/TwistWithCovariancePubSubTypes.h new file mode 100644 index 0000000..5302fbd --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/TwistWithCovariancePubSubTypes.h @@ -0,0 +1,197 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TwistWithCovariancePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCE_PUBSUBTYPES_H_ + +#include +#include +#include +#include +#include + +#include "TwistWithCovariance.h" + +#include "TwistPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated TwistWithCovariance is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace geometry_msgs +{ + namespace msg + { + namespace dds_ + { + + + + #ifndef SWIG + namespace detail { + + template + struct TwistWithCovariance__rob + { + friend constexpr typename Tag::type get( + Tag) + { + return M; + } + + }; + + struct TwistWithCovariance__f + { + typedef std::array TwistWithCovariance_::* type; + friend constexpr type get( + TwistWithCovariance__f); + }; + + template struct TwistWithCovariance__rob; + + template + inline size_t constexpr TwistWithCovariance__offset_of() + { + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); + } + + } // namespace detail + #endif // ifndef SWIG + + + /*! + * @brief This class represents the TopicDataType of the type TwistWithCovariance_ defined by the user in the IDL file. + * @ingroup TwistWithCovariance + */ + class TwistWithCovariance_PubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef TwistWithCovariance_ type; + + eProsima_user_DllExport TwistWithCovariance_PubSubType(); + + eProsima_user_DllExport ~TwistWithCovariance_PubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return is_plain_xcdrv1_impl(); + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) + { + return is_plain_xcdrv2_impl(); + } + else + { + return is_plain_xcdrv1_impl(); + } + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) TwistWithCovariance_(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + private: + + static constexpr bool is_plain_xcdrv1_impl() + { + return 336ULL == + (detail::TwistWithCovariance__offset_of() + + sizeof(std::array)); + } + + static constexpr bool is_plain_xcdrv2_impl() + { + return 336ULL == + (detail::TwistWithCovariance__offset_of() + + sizeof(std::array)); + } + + }; + } + } +} + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCE_PUBSUBTYPES_H_ + diff --git a/mujoco/idl_gen/geometry_msgs/Vector3.cxx b/mujoco/idl_gen/geometry_msgs/Vector3.cxx new file mode 100644 index 0000000..b9f24b9 --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/Vector3.cxx @@ -0,0 +1,341 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Vector3.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "Vector3.h" + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define geometry_msgs_msg_dds__Vector3__max_cdr_typesize 24ULL; + + +namespace geometry_msgs { + +namespace msg { + +namespace dds_ { + + + +Vector3_::Vector3_() +{ + // double m_x + m_x = 0.0; + // double m_y + m_y = 0.0; + // double m_z + m_z = 0.0; + +} + +Vector3_::~Vector3_() +{ +} + +Vector3_::Vector3_( + const Vector3_& x) +{ + m_x = x.m_x; + + + m_y = x.m_y; + + + m_z = x.m_z; + +} + +Vector3_::Vector3_( + Vector3_&& x) noexcept +{ + m_x = x.m_x; + + + m_y = x.m_y; + + + m_z = x.m_z; + +} + +Vector3_& Vector3_::operator =( + const Vector3_& x) +{ + m_x = x.m_x; + + + m_y = x.m_y; + + + m_z = x.m_z; + + return *this; +} + +Vector3_& Vector3_::operator =( + Vector3_&& x) noexcept +{ + m_x = x.m_x; + + + m_y = x.m_y; + + + m_z = x.m_z; + + return *this; +} + +bool Vector3_::operator ==( + const Vector3_& x) const +{ + return (m_x == x.m_x && + m_y == x.m_y && + m_z == x.m_z); +} + +bool Vector3_::operator !=( + const Vector3_& x) const +{ + return !(*this == x); +} + +size_t Vector3_::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return geometry_msgs_msg_dds__Vector3__max_cdr_typesize; +} + +size_t Vector3_::getCdrSerializedSize( + const Vector3_& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + return current_alignment - initial_alignment; +} + + +void Vector3_::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_x; + + scdr << m_y; + + scdr << m_z; + +} + +void Vector3_::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_x; + + + + dcdr >> m_y; + + + + dcdr >> m_z; + + +} + + +bool Vector3_::isKeyDefined() +{ + return false; +} + +void Vector3_::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member x + * @param _x New value for member x + */ +void Vector3_::x( + double _x) +{ + m_x = _x; +} + +/*! + * @brief This function returns the value of member x + * @return Value of member x + */ +double Vector3_::x() const +{ + return m_x; +} + +/*! + * @brief This function returns a reference to member x + * @return Reference to member x + */ +double& Vector3_::x() +{ + return m_x; +} + + +/*! + * @brief This function sets a value in member y + * @param _y New value for member y + */ +void Vector3_::y( + double _y) +{ + m_y = _y; +} + +/*! + * @brief This function returns the value of member y + * @return Value of member y + */ +double Vector3_::y() const +{ + return m_y; +} + +/*! + * @brief This function returns a reference to member y + * @return Reference to member y + */ +double& Vector3_::y() +{ + return m_y; +} + + +/*! + * @brief This function sets a value in member z + * @param _z New value for member z + */ +void Vector3_::z( + double _z) +{ + m_z = _z; +} + +/*! + * @brief This function returns the value of member z + * @return Value of member z + */ +double Vector3_::z() const +{ + return m_z; +} + +/*! + * @brief This function returns a reference to member z + * @return Reference to member z + */ +double& Vector3_::z() +{ + return m_z; +} + + + + + +} // namespace dds_ + + +} // namespace msg + + +} // namespace geometry_msgs + diff --git a/mujoco/idl_gen/geometry_msgs/Vector3.h b/mujoco/idl_gen/geometry_msgs/Vector3.h new file mode 100644 index 0000000..98a76cf --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/Vector3.h @@ -0,0 +1,258 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Vector3.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(VECTOR3_SOURCE) +#define VECTOR3_DllAPI __declspec( dllexport ) +#else +#define VECTOR3_DllAPI __declspec( dllimport ) +#endif // VECTOR3_SOURCE +#else +#define VECTOR3_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define VECTOR3_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + +namespace geometry_msgs { + namespace msg { + namespace dds_ { + + + /*! + * @brief This class represents the structure Vector3_ defined by the user in the IDL file. + * @ingroup Vector3 + */ + class Vector3_ + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Vector3_(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Vector3_(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object geometry_msgs::msg::dds_::Vector3_ that will be copied. + */ + eProsima_user_DllExport Vector3_( + const Vector3_& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object geometry_msgs::msg::dds_::Vector3_ that will be copied. + */ + eProsima_user_DllExport Vector3_( + Vector3_&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object geometry_msgs::msg::dds_::Vector3_ that will be copied. + */ + eProsima_user_DllExport Vector3_& operator =( + const Vector3_& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object geometry_msgs::msg::dds_::Vector3_ that will be copied. + */ + eProsima_user_DllExport Vector3_& operator =( + Vector3_&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::dds_::Vector3_ object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Vector3_& x) const; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::dds_::Vector3_ object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Vector3_& x) const; + + /*! + * @brief This function sets a value in member x + * @param _x New value for member x + */ + eProsima_user_DllExport void x( + double _x); + + /*! + * @brief This function returns the value of member x + * @return Value of member x + */ + eProsima_user_DllExport double x() const; + + /*! + * @brief This function returns a reference to member x + * @return Reference to member x + */ + eProsima_user_DllExport double& x(); + + + /*! + * @brief This function sets a value in member y + * @param _y New value for member y + */ + eProsima_user_DllExport void y( + double _y); + + /*! + * @brief This function returns the value of member y + * @return Value of member y + */ + eProsima_user_DllExport double y() const; + + /*! + * @brief This function returns a reference to member y + * @return Reference to member y + */ + eProsima_user_DllExport double& y(); + + + /*! + * @brief This function sets a value in member z + * @param _z New value for member z + */ + eProsima_user_DllExport void z( + double _z); + + /*! + * @brief This function returns the value of member z + * @return Value of member z + */ + eProsima_user_DllExport double z() const; + + /*! + * @brief This function returns a reference to member z + * @return Reference to member z + */ + eProsima_user_DllExport double& z(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const geometry_msgs::msg::dds_::Vector3_& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + double m_x; + double m_y; + double m_z; + + }; + + } // namespace dds_ + } // namespace msg +} // namespace geometry_msgs + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3_H_ + + + diff --git a/mujoco/idl_gen/geometry_msgs/Vector3CdrAux.hpp b/mujoco/idl_gen/geometry_msgs/Vector3CdrAux.hpp new file mode 100644 index 0000000..cf1af8c --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/Vector3CdrAux.hpp @@ -0,0 +1,51 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Vector3CdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3CDRAUX_HPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3CDRAUX_HPP_ + +#include "Vector3.h" + +constexpr uint32_t geometry_msgs_msg_dds__Vector3__max_cdr_typesize {24UL}; +constexpr uint32_t geometry_msgs_msg_dds__Vector3__max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::Vector3_& data); + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3CDRAUX_HPP_ + diff --git a/mujoco/idl_gen/geometry_msgs/Vector3CdrAux.ipp b/mujoco/idl_gen/geometry_msgs/Vector3CdrAux.ipp new file mode 100644 index 0000000..9bf2b9a --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/Vector3CdrAux.ipp @@ -0,0 +1,147 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Vector3CdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3CDRAUX_IPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3CDRAUX_IPP_ + +#include "Vector3CdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const geometry_msgs::msg::dds_::Vector3_& data, + size_t& current_alignment) +{ + using namespace geometry_msgs::msg::dds_; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.x(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.y(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.z(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::Vector3_& data) +{ + using namespace geometry_msgs::msg::dds_; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.x() + << eprosima::fastcdr::MemberId(1) << data.y() + << eprosima::fastcdr::MemberId(2) << data.z() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + geometry_msgs::msg::dds_::Vector3_& data) +{ + using namespace geometry_msgs::msg::dds_; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.x(); + break; + + case 1: + dcdr >> data.y(); + break; + + case 2: + dcdr >> data.z(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::Vector3_& data) +{ + using namespace geometry_msgs::msg::dds_; + + static_cast(scdr); + static_cast(data); +} + + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3CDRAUX_IPP_ + diff --git a/mujoco/idl_gen/geometry_msgs/Vector3PubSubTypes.cxx b/mujoco/idl_gen/geometry_msgs/Vector3PubSubTypes.cxx new file mode 100644 index 0000000..a8a59b9 --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/Vector3PubSubTypes.cxx @@ -0,0 +1,233 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Vector3PubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#include + +#include "Vector3PubSubTypes.h" +#include "Vector3CdrAux.hpp" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + +namespace geometry_msgs { + namespace msg { + namespace dds_ { + + + Vector3_PubSubType::Vector3_PubSubType() + { + setName("geometry_msgs::msg::dds_::Vector3_"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(Vector3_::getMaxCdrSerializedSize()); + #else + geometry_msgs_msg_dds__Vector3__max_cdr_typesize; + #endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; + uint32_t keyLength = geometry_msgs_msg_dds__Vector3__max_key_cdr_typesize > 16 ? geometry_msgs_msg_dds__Vector3__max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + Vector3_PubSubType::~Vector3_PubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool Vector3_PubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + Vector3_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else + payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 + return true; + } + + bool Vector3_PubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + Vector3_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; + } + + std::function Vector3_PubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) + { + return [data, data_representation]() -> uint32_t + { + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 + }; + } + + void* Vector3_PubSubType::createData() + { + return reinterpret_cast(new Vector3_()); + } + + void Vector3_PubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool Vector3_PubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + Vector3_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + geometry_msgs_msg_dds__Vector3__max_key_cdr_typesize); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else + eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 + if (force_md5 || geometry_msgs_msg_dds__Vector3__max_key_cdr_typesize > 16) + { + m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace dds_ + + + } //End of namespace msg + + +} //End of namespace geometry_msgs + diff --git a/mujoco/idl_gen/geometry_msgs/Vector3PubSubTypes.h b/mujoco/idl_gen/geometry_msgs/Vector3PubSubTypes.h new file mode 100644 index 0000000..a7045eb --- /dev/null +++ b/mujoco/idl_gen/geometry_msgs/Vector3PubSubTypes.h @@ -0,0 +1,196 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Vector3PubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3_PUBSUBTYPES_H_ + +#include +#include +#include +#include +#include + +#include "Vector3.h" + + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated Vector3 is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace geometry_msgs +{ + namespace msg + { + namespace dds_ + { + + + + #ifndef SWIG + namespace detail { + + template + struct Vector3__rob + { + friend constexpr typename Tag::type get( + Tag) + { + return M; + } + + }; + + struct Vector3__f + { + typedef double Vector3_::* type; + friend constexpr type get( + Vector3__f); + }; + + template struct Vector3__rob; + + template + inline size_t constexpr Vector3__offset_of() + { + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); + } + + } // namespace detail + #endif // ifndef SWIG + + + /*! + * @brief This class represents the TopicDataType of the type Vector3_ defined by the user in the IDL file. + * @ingroup Vector3 + */ + class Vector3_PubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef Vector3_ type; + + eProsima_user_DllExport Vector3_PubSubType(); + + eProsima_user_DllExport ~Vector3_PubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return is_plain_xcdrv1_impl(); + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) + { + return is_plain_xcdrv2_impl(); + } + else + { + return is_plain_xcdrv1_impl(); + } + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) Vector3_(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + private: + + static constexpr bool is_plain_xcdrv1_impl() + { + return 24ULL == + (detail::Vector3__offset_of() + + sizeof(double)); + } + + static constexpr bool is_plain_xcdrv2_impl() + { + return 24ULL == + (detail::Vector3__offset_of() + + sizeof(double)); + } + + }; + } + } +} + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3_PUBSUBTYPES_H_ + diff --git a/mujoco/idl_gen/nav_msgs/Header.cxx b/mujoco/idl_gen/nav_msgs/Header.cxx new file mode 100644 index 0000000..fc56cc5 --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/Header.cxx @@ -0,0 +1,309 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Header.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "Header.h" + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define builtin_interfaces_msg_dds__Time__max_cdr_typesize 8ULL; +#define std_msgs_msg_dds__Header__max_cdr_typesize 268ULL; + + +namespace std_msgs { + +namespace msg { + +namespace dds_ { + + + +Header_::Header_() +{ + // builtin_interfaces::msg::dds_::Time_ m_stamp + + // /type_d() m_frame_id + + +} + +Header_::~Header_() +{ +} + +Header_::Header_( + const Header_& x) +{ + m_stamp = x.m_stamp; + + + m_frame_id = x.m_frame_id; + +} + +Header_::Header_( + Header_&& x) noexcept +{ + m_stamp = std::move(x.m_stamp); + + + m_frame_id = std::move(x.m_frame_id); + +} + +Header_& Header_::operator =( + const Header_& x) +{ + m_stamp = x.m_stamp; + + + m_frame_id = x.m_frame_id; + + return *this; +} + +Header_& Header_::operator =( + Header_&& x) noexcept +{ + m_stamp = std::move(x.m_stamp); + + + m_frame_id = std::move(x.m_frame_id); + + return *this; +} + +bool Header_::operator ==( + const Header_& x) const +{ + return (m_stamp == x.m_stamp && + m_frame_id == x.m_frame_id); +} + +bool Header_::operator !=( + const Header_& x) const +{ + return !(*this == x); +} + +size_t Header_::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return std_msgs_msg_dds__Header__max_cdr_typesize; +} + +size_t Header_::getCdrSerializedSize( + const Header_& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += builtin_interfaces::msg::dds_::Time_::getCdrSerializedSize(data.stamp(), current_alignment); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.frame_id().size() + 1; + + + return current_alignment - initial_alignment; +} + + +void Header_::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_stamp; + + scdr << m_frame_id.c_str(); + +} + +void Header_::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_stamp; + + + + dcdr >> m_frame_id; + + +} + + +bool Header_::isKeyDefined() +{ + return false; +} + +void Header_::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member stamp + * @param _stamp New value to be copied in member stamp + */ +void Header_::stamp( + const builtin_interfaces::msg::dds_::Time_& _stamp) +{ + m_stamp = _stamp; +} + +/*! + * @brief This function moves the value in member stamp + * @param _stamp New value to be moved in member stamp + */ +void Header_::stamp( + builtin_interfaces::msg::dds_::Time_&& _stamp) +{ + m_stamp = std::move(_stamp); +} + +/*! + * @brief This function returns a constant reference to member stamp + * @return Constant reference to member stamp + */ +const builtin_interfaces::msg::dds_::Time_& Header_::stamp() const +{ + return m_stamp; +} + +/*! + * @brief This function returns a reference to member stamp + * @return Reference to member stamp + */ +builtin_interfaces::msg::dds_::Time_& Header_::stamp() +{ + return m_stamp; +} + + +/*! + * @brief This function copies the value in member frame_id + * @param _frame_id New value to be copied in member frame_id + */ +void Header_::frame_id( + const std::string& _frame_id) +{ + m_frame_id = _frame_id; +} + +/*! + * @brief This function moves the value in member frame_id + * @param _frame_id New value to be moved in member frame_id + */ +void Header_::frame_id( + std::string&& _frame_id) +{ + m_frame_id = std::move(_frame_id); +} + +/*! + * @brief This function returns a constant reference to member frame_id + * @return Constant reference to member frame_id + */ +const std::string& Header_::frame_id() const +{ + return m_frame_id; +} + +/*! + * @brief This function returns a reference to member frame_id + * @return Reference to member frame_id + */ +std::string& Header_::frame_id() +{ + return m_frame_id; +} + + + + + +} // namespace dds_ + + +} // namespace msg + + +} // namespace std_msgs + diff --git a/mujoco/idl_gen/nav_msgs/Header.h b/mujoco/idl_gen/nav_msgs/Header.h new file mode 100644 index 0000000..91bdf94 --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/Header.h @@ -0,0 +1,252 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Header.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADER_H_ +#define _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADER_H_ + +#include "Time.h" + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(HEADER_SOURCE) +#define HEADER_DllAPI __declspec( dllexport ) +#else +#define HEADER_DllAPI __declspec( dllimport ) +#endif // HEADER_SOURCE +#else +#define HEADER_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define HEADER_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + +namespace std_msgs { + namespace msg { + namespace dds_ { + + + /*! + * @brief This class represents the structure Header_ defined by the user in the IDL file. + * @ingroup Header + */ + class Header_ + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Header_(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Header_(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object std_msgs::msg::dds_::Header_ that will be copied. + */ + eProsima_user_DllExport Header_( + const Header_& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object std_msgs::msg::dds_::Header_ that will be copied. + */ + eProsima_user_DllExport Header_( + Header_&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object std_msgs::msg::dds_::Header_ that will be copied. + */ + eProsima_user_DllExport Header_& operator =( + const Header_& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object std_msgs::msg::dds_::Header_ that will be copied. + */ + eProsima_user_DllExport Header_& operator =( + Header_&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x std_msgs::msg::dds_::Header_ object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Header_& x) const; + + /*! + * @brief Comparison operator. + * @param x std_msgs::msg::dds_::Header_ object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Header_& x) const; + + /*! + * @brief This function copies the value in member stamp + * @param _stamp New value to be copied in member stamp + */ + eProsima_user_DllExport void stamp( + const builtin_interfaces::msg::dds_::Time_& _stamp); + + /*! + * @brief This function moves the value in member stamp + * @param _stamp New value to be moved in member stamp + */ + eProsima_user_DllExport void stamp( + builtin_interfaces::msg::dds_::Time_&& _stamp); + + /*! + * @brief This function returns a constant reference to member stamp + * @return Constant reference to member stamp + */ + eProsima_user_DllExport const builtin_interfaces::msg::dds_::Time_& stamp() const; + + /*! + * @brief This function returns a reference to member stamp + * @return Reference to member stamp + */ + eProsima_user_DllExport builtin_interfaces::msg::dds_::Time_& stamp(); + + + /*! + * @brief This function copies the value in member frame_id + * @param _frame_id New value to be copied in member frame_id + */ + eProsima_user_DllExport void frame_id( + const std::string& _frame_id); + + /*! + * @brief This function moves the value in member frame_id + * @param _frame_id New value to be moved in member frame_id + */ + eProsima_user_DllExport void frame_id( + std::string&& _frame_id); + + /*! + * @brief This function returns a constant reference to member frame_id + * @return Constant reference to member frame_id + */ + eProsima_user_DllExport const std::string& frame_id() const; + + /*! + * @brief This function returns a reference to member frame_id + * @return Reference to member frame_id + */ + eProsima_user_DllExport std::string& frame_id(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const std_msgs::msg::dds_::Header_& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + builtin_interfaces::msg::dds_::Time_ m_stamp; + std::string m_frame_id; + + }; + + } // namespace dds_ + } // namespace msg +} // namespace std_msgs + +#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADER_H_ + + + diff --git a/mujoco/idl_gen/nav_msgs/HeaderCdrAux.hpp b/mujoco/idl_gen/nav_msgs/HeaderCdrAux.hpp new file mode 100644 index 0000000..f7fed1f --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/HeaderCdrAux.hpp @@ -0,0 +1,51 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HeaderCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADERCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADERCDRAUX_HPP_ + +#include "Header.h" + +constexpr uint32_t std_msgs_msg_dds__Header__max_cdr_typesize {268UL}; +constexpr uint32_t std_msgs_msg_dds__Header__max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const std_msgs::msg::dds_::Header_& data); + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADERCDRAUX_HPP_ + diff --git a/mujoco/idl_gen/nav_msgs/HeaderCdrAux.ipp b/mujoco/idl_gen/nav_msgs/HeaderCdrAux.ipp new file mode 100644 index 0000000..628d73f --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/HeaderCdrAux.ipp @@ -0,0 +1,139 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HeaderCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADERCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADERCDRAUX_IPP_ + +#include "HeaderCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const std_msgs::msg::dds_::Header_& data, + size_t& current_alignment) +{ + using namespace std_msgs::msg::dds_; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.stamp(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.frame_id(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const std_msgs::msg::dds_::Header_& data) +{ + using namespace std_msgs::msg::dds_; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.stamp() + << eprosima::fastcdr::MemberId(1) << data.frame_id() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + std_msgs::msg::dds_::Header_& data) +{ + using namespace std_msgs::msg::dds_; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.stamp(); + break; + + case 1: + dcdr >> data.frame_id(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const std_msgs::msg::dds_::Header_& data) +{ + using namespace std_msgs::msg::dds_; + + static_cast(scdr); + static_cast(data); +} + + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADERCDRAUX_IPP_ + diff --git a/mujoco/idl_gen/nav_msgs/HeaderPubSubTypes.cxx b/mujoco/idl_gen/nav_msgs/HeaderPubSubTypes.cxx new file mode 100644 index 0000000..6c6cfb4 --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/HeaderPubSubTypes.cxx @@ -0,0 +1,233 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HeaderPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#include + +#include "HeaderPubSubTypes.h" +#include "HeaderCdrAux.hpp" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + +namespace std_msgs { + namespace msg { + namespace dds_ { + + + Header_PubSubType::Header_PubSubType() + { + setName("std_msgs::msg::dds_::Header_"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(Header_::getMaxCdrSerializedSize()); + #else + std_msgs_msg_dds__Header__max_cdr_typesize; + #endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; + uint32_t keyLength = std_msgs_msg_dds__Header__max_key_cdr_typesize > 16 ? std_msgs_msg_dds__Header__max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + Header_PubSubType::~Header_PubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool Header_PubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + Header_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else + payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 + return true; + } + + bool Header_PubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + Header_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; + } + + std::function Header_PubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) + { + return [data, data_representation]() -> uint32_t + { + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 + }; + } + + void* Header_PubSubType::createData() + { + return reinterpret_cast(new Header_()); + } + + void Header_PubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool Header_PubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + Header_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + std_msgs_msg_dds__Header__max_key_cdr_typesize); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else + eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 + if (force_md5 || std_msgs_msg_dds__Header__max_key_cdr_typesize > 16) + { + m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace dds_ + + + } //End of namespace msg + + +} //End of namespace std_msgs + diff --git a/mujoco/idl_gen/nav_msgs/HeaderPubSubTypes.h b/mujoco/idl_gen/nav_msgs/HeaderPubSubTypes.h new file mode 100644 index 0000000..20f2d28 --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/HeaderPubSubTypes.h @@ -0,0 +1,142 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HeaderPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADER_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADER_PUBSUBTYPES_H_ + +#include +#include +#include +#include +#include + +#include "Header.h" + +#include "TimePubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated Header is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace std_msgs +{ + namespace msg + { + namespace dds_ + { + + + + /*! + * @brief This class represents the TopicDataType of the type Header_ defined by the user in the IDL file. + * @ingroup Header + */ + class Header_PubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef Header_ type; + + eProsima_user_DllExport Header_PubSubType(); + + eProsima_user_DllExport ~Header_PubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + }; + } + } +} + +#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADER_PUBSUBTYPES_H_ + diff --git a/mujoco/idl_gen/nav_msgs/Odometry.cxx b/mujoco/idl_gen/nav_msgs/Odometry.cxx new file mode 100644 index 0000000..9e7ef5e --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/Odometry.cxx @@ -0,0 +1,443 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Odometry.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "Odometry.h" + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define geometry_msgs_msg_dds__Quaternion__max_cdr_typesize 32ULL; +#define geometry_msgs_msg_dds__Vector3__max_cdr_typesize 24ULL; +#define builtin_interfaces_msg_dds__Time__max_cdr_typesize 8ULL; +#define geometry_msgs_msg_dds__TwistWithCovariance__max_cdr_typesize 336ULL; +#define std_msgs_msg_dds__Header__max_cdr_typesize 268ULL; +#define geometry_msgs_msg_dds__Point__max_cdr_typesize 24ULL; +#define geometry_msgs_msg_dds__Pose__max_cdr_typesize 56ULL; +#define geometry_msgs_msg_dds__Twist__max_cdr_typesize 48ULL; +#define nav_msgs_msg_dds__Odometry__max_cdr_typesize 1208ULL; +#define geometry_msgs_msg_dds__PoseWithCovariance__max_cdr_typesize 344ULL; + + +namespace nav_msgs { + +namespace msg { + +namespace dds_ { + + + +Odometry_::Odometry_() +{ + // std_msgs::msg::dds_::Header_ m_header + + // /type_d() m_child_frame_id + + // geometry_msgs::msg::dds_::PoseWithCovariance_ m_pose + + // geometry_msgs::msg::dds_::TwistWithCovariance_ m_twist + + +} + +Odometry_::~Odometry_() +{ +} + +Odometry_::Odometry_( + const Odometry_& x) +{ + m_header = x.m_header; + + + m_child_frame_id = x.m_child_frame_id; + + + m_pose = x.m_pose; + + + m_twist = x.m_twist; + +} + +Odometry_::Odometry_( + Odometry_&& x) noexcept +{ + m_header = std::move(x.m_header); + + + m_child_frame_id = std::move(x.m_child_frame_id); + + + m_pose = std::move(x.m_pose); + + + m_twist = std::move(x.m_twist); + +} + +Odometry_& Odometry_::operator =( + const Odometry_& x) +{ + m_header = x.m_header; + + + m_child_frame_id = x.m_child_frame_id; + + + m_pose = x.m_pose; + + + m_twist = x.m_twist; + + return *this; +} + +Odometry_& Odometry_::operator =( + Odometry_&& x) noexcept +{ + m_header = std::move(x.m_header); + + + m_child_frame_id = std::move(x.m_child_frame_id); + + + m_pose = std::move(x.m_pose); + + + m_twist = std::move(x.m_twist); + + return *this; +} + +bool Odometry_::operator ==( + const Odometry_& x) const +{ + return (m_header == x.m_header && + m_child_frame_id == x.m_child_frame_id && + m_pose == x.m_pose && + m_twist == x.m_twist); +} + +bool Odometry_::operator !=( + const Odometry_& x) const +{ + return !(*this == x); +} + +size_t Odometry_::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return nav_msgs_msg_dds__Odometry__max_cdr_typesize; +} + +size_t Odometry_::getCdrSerializedSize( + const Odometry_& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += std_msgs::msg::dds_::Header_::getCdrSerializedSize(data.header(), current_alignment); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.child_frame_id().size() + 1; + + + current_alignment += geometry_msgs::msg::dds_::PoseWithCovariance_::getCdrSerializedSize(data.pose(), current_alignment); + + + current_alignment += geometry_msgs::msg::dds_::TwistWithCovariance_::getCdrSerializedSize(data.twist(), current_alignment); + + + return current_alignment - initial_alignment; +} + + +void Odometry_::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_header; + + scdr << m_child_frame_id.c_str(); + + scdr << m_pose; + + scdr << m_twist; + +} + +void Odometry_::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_header; + + + + dcdr >> m_child_frame_id; + + + + dcdr >> m_pose; + + + + dcdr >> m_twist; + + +} + + +bool Odometry_::isKeyDefined() +{ + return false; +} + +void Odometry_::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ +void Odometry_::header( + const std_msgs::msg::dds_::Header_& _header) +{ + m_header = _header; +} + +/*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ +void Odometry_::header( + std_msgs::msg::dds_::Header_&& _header) +{ + m_header = std::move(_header); +} + +/*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ +const std_msgs::msg::dds_::Header_& Odometry_::header() const +{ + return m_header; +} + +/*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ +std_msgs::msg::dds_::Header_& Odometry_::header() +{ + return m_header; +} + + +/*! + * @brief This function copies the value in member child_frame_id + * @param _child_frame_id New value to be copied in member child_frame_id + */ +void Odometry_::child_frame_id( + const std::string& _child_frame_id) +{ + m_child_frame_id = _child_frame_id; +} + +/*! + * @brief This function moves the value in member child_frame_id + * @param _child_frame_id New value to be moved in member child_frame_id + */ +void Odometry_::child_frame_id( + std::string&& _child_frame_id) +{ + m_child_frame_id = std::move(_child_frame_id); +} + +/*! + * @brief This function returns a constant reference to member child_frame_id + * @return Constant reference to member child_frame_id + */ +const std::string& Odometry_::child_frame_id() const +{ + return m_child_frame_id; +} + +/*! + * @brief This function returns a reference to member child_frame_id + * @return Reference to member child_frame_id + */ +std::string& Odometry_::child_frame_id() +{ + return m_child_frame_id; +} + + +/*! + * @brief This function copies the value in member pose + * @param _pose New value to be copied in member pose + */ +void Odometry_::pose( + const geometry_msgs::msg::dds_::PoseWithCovariance_& _pose) +{ + m_pose = _pose; +} + +/*! + * @brief This function moves the value in member pose + * @param _pose New value to be moved in member pose + */ +void Odometry_::pose( + geometry_msgs::msg::dds_::PoseWithCovariance_&& _pose) +{ + m_pose = std::move(_pose); +} + +/*! + * @brief This function returns a constant reference to member pose + * @return Constant reference to member pose + */ +const geometry_msgs::msg::dds_::PoseWithCovariance_& Odometry_::pose() const +{ + return m_pose; +} + +/*! + * @brief This function returns a reference to member pose + * @return Reference to member pose + */ +geometry_msgs::msg::dds_::PoseWithCovariance_& Odometry_::pose() +{ + return m_pose; +} + + +/*! + * @brief This function copies the value in member twist + * @param _twist New value to be copied in member twist + */ +void Odometry_::twist( + const geometry_msgs::msg::dds_::TwistWithCovariance_& _twist) +{ + m_twist = _twist; +} + +/*! + * @brief This function moves the value in member twist + * @param _twist New value to be moved in member twist + */ +void Odometry_::twist( + geometry_msgs::msg::dds_::TwistWithCovariance_&& _twist) +{ + m_twist = std::move(_twist); +} + +/*! + * @brief This function returns a constant reference to member twist + * @return Constant reference to member twist + */ +const geometry_msgs::msg::dds_::TwistWithCovariance_& Odometry_::twist() const +{ + return m_twist; +} + +/*! + * @brief This function returns a reference to member twist + * @return Reference to member twist + */ +geometry_msgs::msg::dds_::TwistWithCovariance_& Odometry_::twist() +{ + return m_twist; +} + + + + + +} // namespace dds_ + + +} // namespace msg + + +} // namespace nav_msgs + diff --git a/mujoco/idl_gen/nav_msgs/Odometry.h b/mujoco/idl_gen/nav_msgs/Odometry.h new file mode 100644 index 0000000..b7a4fb9 --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/Odometry.h @@ -0,0 +1,310 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Odometry.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_NAV_MSGS_MSG_DDS__ODOMETRY_H_ +#define _FAST_DDS_GENERATED_NAV_MSGS_MSG_DDS__ODOMETRY_H_ + +#include "Header.h" +#include "PoseWithCovariance.h" +#include "TwistWithCovariance.h" + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(ODOMETRY_SOURCE) +#define ODOMETRY_DllAPI __declspec( dllexport ) +#else +#define ODOMETRY_DllAPI __declspec( dllimport ) +#endif // ODOMETRY_SOURCE +#else +#define ODOMETRY_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define ODOMETRY_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + +namespace nav_msgs { + namespace msg { + namespace dds_ { + + + /*! + * @brief This class represents the structure Odometry_ defined by the user in the IDL file. + * @ingroup Odometry + */ + class Odometry_ + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Odometry_(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Odometry_(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object nav_msgs::msg::dds_::Odometry_ that will be copied. + */ + eProsima_user_DllExport Odometry_( + const Odometry_& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object nav_msgs::msg::dds_::Odometry_ that will be copied. + */ + eProsima_user_DllExport Odometry_( + Odometry_&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object nav_msgs::msg::dds_::Odometry_ that will be copied. + */ + eProsima_user_DllExport Odometry_& operator =( + const Odometry_& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object nav_msgs::msg::dds_::Odometry_ that will be copied. + */ + eProsima_user_DllExport Odometry_& operator =( + Odometry_&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x nav_msgs::msg::dds_::Odometry_ object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Odometry_& x) const; + + /*! + * @brief Comparison operator. + * @param x nav_msgs::msg::dds_::Odometry_ object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Odometry_& x) const; + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const std_msgs::msg::dds_::Header_& _header); + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + std_msgs::msg::dds_::Header_&& _header); + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const std_msgs::msg::dds_::Header_& header() const; + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport std_msgs::msg::dds_::Header_& header(); + + + /*! + * @brief This function copies the value in member child_frame_id + * @param _child_frame_id New value to be copied in member child_frame_id + */ + eProsima_user_DllExport void child_frame_id( + const std::string& _child_frame_id); + + /*! + * @brief This function moves the value in member child_frame_id + * @param _child_frame_id New value to be moved in member child_frame_id + */ + eProsima_user_DllExport void child_frame_id( + std::string&& _child_frame_id); + + /*! + * @brief This function returns a constant reference to member child_frame_id + * @return Constant reference to member child_frame_id + */ + eProsima_user_DllExport const std::string& child_frame_id() const; + + /*! + * @brief This function returns a reference to member child_frame_id + * @return Reference to member child_frame_id + */ + eProsima_user_DllExport std::string& child_frame_id(); + + + /*! + * @brief This function copies the value in member pose + * @param _pose New value to be copied in member pose + */ + eProsima_user_DllExport void pose( + const geometry_msgs::msg::dds_::PoseWithCovariance_& _pose); + + /*! + * @brief This function moves the value in member pose + * @param _pose New value to be moved in member pose + */ + eProsima_user_DllExport void pose( + geometry_msgs::msg::dds_::PoseWithCovariance_&& _pose); + + /*! + * @brief This function returns a constant reference to member pose + * @return Constant reference to member pose + */ + eProsima_user_DllExport const geometry_msgs::msg::dds_::PoseWithCovariance_& pose() const; + + /*! + * @brief This function returns a reference to member pose + * @return Reference to member pose + */ + eProsima_user_DllExport geometry_msgs::msg::dds_::PoseWithCovariance_& pose(); + + + /*! + * @brief This function copies the value in member twist + * @param _twist New value to be copied in member twist + */ + eProsima_user_DllExport void twist( + const geometry_msgs::msg::dds_::TwistWithCovariance_& _twist); + + /*! + * @brief This function moves the value in member twist + * @param _twist New value to be moved in member twist + */ + eProsima_user_DllExport void twist( + geometry_msgs::msg::dds_::TwistWithCovariance_&& _twist); + + /*! + * @brief This function returns a constant reference to member twist + * @return Constant reference to member twist + */ + eProsima_user_DllExport const geometry_msgs::msg::dds_::TwistWithCovariance_& twist() const; + + /*! + * @brief This function returns a reference to member twist + * @return Reference to member twist + */ + eProsima_user_DllExport geometry_msgs::msg::dds_::TwistWithCovariance_& twist(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const nav_msgs::msg::dds_::Odometry_& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + std_msgs::msg::dds_::Header_ m_header; + std::string m_child_frame_id; + geometry_msgs::msg::dds_::PoseWithCovariance_ m_pose; + geometry_msgs::msg::dds_::TwistWithCovariance_ m_twist; + + }; + + } // namespace dds_ + } // namespace msg +} // namespace nav_msgs + +#endif // _FAST_DDS_GENERATED_NAV_MSGS_MSG_DDS__ODOMETRY_H_ + + + diff --git a/mujoco/idl_gen/nav_msgs/OdometryCdrAux.hpp b/mujoco/idl_gen/nav_msgs/OdometryCdrAux.hpp new file mode 100644 index 0000000..73d078a --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/OdometryCdrAux.hpp @@ -0,0 +1,52 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file OdometryCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_NAV_MSGS_MSG_DDS__ODOMETRYCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_NAV_MSGS_MSG_DDS__ODOMETRYCDRAUX_HPP_ + +#include "Odometry.h" + +constexpr uint32_t nav_msgs_msg_dds__Odometry__max_cdr_typesize {1208UL}; +constexpr uint32_t nav_msgs_msg_dds__Odometry__max_key_cdr_typesize {0UL}; + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const nav_msgs::msg::dds_::Odometry_& data); + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_NAV_MSGS_MSG_DDS__ODOMETRYCDRAUX_HPP_ + diff --git a/mujoco/idl_gen/nav_msgs/OdometryCdrAux.ipp b/mujoco/idl_gen/nav_msgs/OdometryCdrAux.ipp new file mode 100644 index 0000000..9c2acb5 --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/OdometryCdrAux.ipp @@ -0,0 +1,155 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file OdometryCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_NAV_MSGS_MSG_DDS__ODOMETRYCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_NAV_MSGS_MSG_DDS__ODOMETRYCDRAUX_IPP_ + +#include "OdometryCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const nav_msgs::msg::dds_::Odometry_& data, + size_t& current_alignment) +{ + using namespace nav_msgs::msg::dds_; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.child_frame_id(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.pose(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.twist(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const nav_msgs::msg::dds_::Odometry_& data) +{ + using namespace nav_msgs::msg::dds_; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.header() + << eprosima::fastcdr::MemberId(1) << data.child_frame_id() + << eprosima::fastcdr::MemberId(2) << data.pose() + << eprosima::fastcdr::MemberId(3) << data.twist() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + nav_msgs::msg::dds_::Odometry_& data) +{ + using namespace nav_msgs::msg::dds_; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.header(); + break; + + case 1: + dcdr >> data.child_frame_id(); + break; + + case 2: + dcdr >> data.pose(); + break; + + case 3: + dcdr >> data.twist(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const nav_msgs::msg::dds_::Odometry_& data) +{ + using namespace nav_msgs::msg::dds_; + + static_cast(scdr); + static_cast(data); +} + + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_NAV_MSGS_MSG_DDS__ODOMETRYCDRAUX_IPP_ + diff --git a/mujoco/idl_gen/nav_msgs/OdometryPubSubTypes.cxx b/mujoco/idl_gen/nav_msgs/OdometryPubSubTypes.cxx new file mode 100644 index 0000000..2a2e45d --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/OdometryPubSubTypes.cxx @@ -0,0 +1,233 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file OdometryPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#include + +#include "OdometryPubSubTypes.h" +#include "OdometryCdrAux.hpp" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + +namespace nav_msgs { + namespace msg { + namespace dds_ { + + + Odometry_PubSubType::Odometry_PubSubType() + { + setName("nav_msgs::msg::dds_::Odometry_"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(Odometry_::getMaxCdrSerializedSize()); + #else + nav_msgs_msg_dds__Odometry__max_cdr_typesize; + #endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; + uint32_t keyLength = nav_msgs_msg_dds__Odometry__max_key_cdr_typesize > 16 ? nav_msgs_msg_dds__Odometry__max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + Odometry_PubSubType::~Odometry_PubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool Odometry_PubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + Odometry_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else + payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 + return true; + } + + bool Odometry_PubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + Odometry_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; + } + + std::function Odometry_PubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) + { + return [data, data_representation]() -> uint32_t + { + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 + }; + } + + void* Odometry_PubSubType::createData() + { + return reinterpret_cast(new Odometry_()); + } + + void Odometry_PubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool Odometry_PubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + Odometry_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + nav_msgs_msg_dds__Odometry__max_key_cdr_typesize); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else + eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 + if (force_md5 || nav_msgs_msg_dds__Odometry__max_key_cdr_typesize > 16) + { + m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace dds_ + + + } //End of namespace msg + + +} //End of namespace nav_msgs + diff --git a/mujoco/idl_gen/nav_msgs/OdometryPubSubTypes.h b/mujoco/idl_gen/nav_msgs/OdometryPubSubTypes.h new file mode 100644 index 0000000..edce4c8 --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/OdometryPubSubTypes.h @@ -0,0 +1,144 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file OdometryPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#ifndef _FAST_DDS_GENERATED_NAV_MSGS_MSG_DDS__ODOMETRY_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_NAV_MSGS_MSG_DDS__ODOMETRY_PUBSUBTYPES_H_ + +#include +#include +#include +#include +#include + +#include "Odometry.h" + +#include "HeaderPubSubTypes.h" +#include "PoseWithCovariancePubSubTypes.h" +#include "TwistWithCovariancePubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated Odometry is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace nav_msgs +{ + namespace msg + { + namespace dds_ + { + + + + /*! + * @brief This class represents the TopicDataType of the type Odometry_ defined by the user in the IDL file. + * @ingroup Odometry + */ + class Odometry_PubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef Odometry_ type; + + eProsima_user_DllExport Odometry_PubSubType(); + + eProsima_user_DllExport ~Odometry_PubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + }; + } + } +} + +#endif // _FAST_DDS_GENERATED_NAV_MSGS_MSG_DDS__ODOMETRY_PUBSUBTYPES_H_ + diff --git a/mujoco/idl_gen/nav_msgs/Point.cxx b/mujoco/idl_gen/nav_msgs/Point.cxx new file mode 100644 index 0000000..8f0e5d3 --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/Point.cxx @@ -0,0 +1,341 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Point.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "Point.h" + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define geometry_msgs_msg_dds__Point__max_cdr_typesize 24ULL; + + +namespace geometry_msgs { + +namespace msg { + +namespace dds_ { + + + +Point_::Point_() +{ + // double m_x + m_x = 0.0; + // double m_y + m_y = 0.0; + // double m_z + m_z = 0.0; + +} + +Point_::~Point_() +{ +} + +Point_::Point_( + const Point_& x) +{ + m_x = x.m_x; + + + m_y = x.m_y; + + + m_z = x.m_z; + +} + +Point_::Point_( + Point_&& x) noexcept +{ + m_x = x.m_x; + + + m_y = x.m_y; + + + m_z = x.m_z; + +} + +Point_& Point_::operator =( + const Point_& x) +{ + m_x = x.m_x; + + + m_y = x.m_y; + + + m_z = x.m_z; + + return *this; +} + +Point_& Point_::operator =( + Point_&& x) noexcept +{ + m_x = x.m_x; + + + m_y = x.m_y; + + + m_z = x.m_z; + + return *this; +} + +bool Point_::operator ==( + const Point_& x) const +{ + return (m_x == x.m_x && + m_y == x.m_y && + m_z == x.m_z); +} + +bool Point_::operator !=( + const Point_& x) const +{ + return !(*this == x); +} + +size_t Point_::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return geometry_msgs_msg_dds__Point__max_cdr_typesize; +} + +size_t Point_::getCdrSerializedSize( + const Point_& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + return current_alignment - initial_alignment; +} + + +void Point_::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_x; + + scdr << m_y; + + scdr << m_z; + +} + +void Point_::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_x; + + + + dcdr >> m_y; + + + + dcdr >> m_z; + + +} + + +bool Point_::isKeyDefined() +{ + return false; +} + +void Point_::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member x + * @param _x New value for member x + */ +void Point_::x( + double _x) +{ + m_x = _x; +} + +/*! + * @brief This function returns the value of member x + * @return Value of member x + */ +double Point_::x() const +{ + return m_x; +} + +/*! + * @brief This function returns a reference to member x + * @return Reference to member x + */ +double& Point_::x() +{ + return m_x; +} + + +/*! + * @brief This function sets a value in member y + * @param _y New value for member y + */ +void Point_::y( + double _y) +{ + m_y = _y; +} + +/*! + * @brief This function returns the value of member y + * @return Value of member y + */ +double Point_::y() const +{ + return m_y; +} + +/*! + * @brief This function returns a reference to member y + * @return Reference to member y + */ +double& Point_::y() +{ + return m_y; +} + + +/*! + * @brief This function sets a value in member z + * @param _z New value for member z + */ +void Point_::z( + double _z) +{ + m_z = _z; +} + +/*! + * @brief This function returns the value of member z + * @return Value of member z + */ +double Point_::z() const +{ + return m_z; +} + +/*! + * @brief This function returns a reference to member z + * @return Reference to member z + */ +double& Point_::z() +{ + return m_z; +} + + + + + +} // namespace dds_ + + +} // namespace msg + + +} // namespace geometry_msgs + diff --git a/mujoco/idl_gen/nav_msgs/Point.h b/mujoco/idl_gen/nav_msgs/Point.h new file mode 100644 index 0000000..287bf59 --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/Point.h @@ -0,0 +1,258 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Point.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINT_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINT_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(POINT_SOURCE) +#define POINT_DllAPI __declspec( dllexport ) +#else +#define POINT_DllAPI __declspec( dllimport ) +#endif // POINT_SOURCE +#else +#define POINT_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define POINT_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + +namespace geometry_msgs { + namespace msg { + namespace dds_ { + + + /*! + * @brief This class represents the structure Point_ defined by the user in the IDL file. + * @ingroup Point + */ + class Point_ + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Point_(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Point_(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object geometry_msgs::msg::dds_::Point_ that will be copied. + */ + eProsima_user_DllExport Point_( + const Point_& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object geometry_msgs::msg::dds_::Point_ that will be copied. + */ + eProsima_user_DllExport Point_( + Point_&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object geometry_msgs::msg::dds_::Point_ that will be copied. + */ + eProsima_user_DllExport Point_& operator =( + const Point_& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object geometry_msgs::msg::dds_::Point_ that will be copied. + */ + eProsima_user_DllExport Point_& operator =( + Point_&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::dds_::Point_ object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Point_& x) const; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::dds_::Point_ object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Point_& x) const; + + /*! + * @brief This function sets a value in member x + * @param _x New value for member x + */ + eProsima_user_DllExport void x( + double _x); + + /*! + * @brief This function returns the value of member x + * @return Value of member x + */ + eProsima_user_DllExport double x() const; + + /*! + * @brief This function returns a reference to member x + * @return Reference to member x + */ + eProsima_user_DllExport double& x(); + + + /*! + * @brief This function sets a value in member y + * @param _y New value for member y + */ + eProsima_user_DllExport void y( + double _y); + + /*! + * @brief This function returns the value of member y + * @return Value of member y + */ + eProsima_user_DllExport double y() const; + + /*! + * @brief This function returns a reference to member y + * @return Reference to member y + */ + eProsima_user_DllExport double& y(); + + + /*! + * @brief This function sets a value in member z + * @param _z New value for member z + */ + eProsima_user_DllExport void z( + double _z); + + /*! + * @brief This function returns the value of member z + * @return Value of member z + */ + eProsima_user_DllExport double z() const; + + /*! + * @brief This function returns a reference to member z + * @return Reference to member z + */ + eProsima_user_DllExport double& z(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const geometry_msgs::msg::dds_::Point_& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + double m_x; + double m_y; + double m_z; + + }; + + } // namespace dds_ + } // namespace msg +} // namespace geometry_msgs + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINT_H_ + + + diff --git a/mujoco/idl_gen/nav_msgs/PointCdrAux.hpp b/mujoco/idl_gen/nav_msgs/PointCdrAux.hpp new file mode 100644 index 0000000..73ae762 --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/PointCdrAux.hpp @@ -0,0 +1,51 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PointCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINTCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINTCDRAUX_HPP_ + +#include "Point.h" + +constexpr uint32_t geometry_msgs_msg_dds__Point__max_cdr_typesize {24UL}; +constexpr uint32_t geometry_msgs_msg_dds__Point__max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::Point_& data); + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINTCDRAUX_HPP_ + diff --git a/mujoco/idl_gen/nav_msgs/PointCdrAux.ipp b/mujoco/idl_gen/nav_msgs/PointCdrAux.ipp new file mode 100644 index 0000000..787b2fc --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/PointCdrAux.ipp @@ -0,0 +1,147 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PointCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINTCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINTCDRAUX_IPP_ + +#include "PointCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const geometry_msgs::msg::dds_::Point_& data, + size_t& current_alignment) +{ + using namespace geometry_msgs::msg::dds_; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.x(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.y(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.z(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::Point_& data) +{ + using namespace geometry_msgs::msg::dds_; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.x() + << eprosima::fastcdr::MemberId(1) << data.y() + << eprosima::fastcdr::MemberId(2) << data.z() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + geometry_msgs::msg::dds_::Point_& data) +{ + using namespace geometry_msgs::msg::dds_; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.x(); + break; + + case 1: + dcdr >> data.y(); + break; + + case 2: + dcdr >> data.z(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::Point_& data) +{ + using namespace geometry_msgs::msg::dds_; + + static_cast(scdr); + static_cast(data); +} + + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINTCDRAUX_IPP_ + diff --git a/mujoco/idl_gen/nav_msgs/PointPubSubTypes.cxx b/mujoco/idl_gen/nav_msgs/PointPubSubTypes.cxx new file mode 100644 index 0000000..6a8a7f5 --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/PointPubSubTypes.cxx @@ -0,0 +1,233 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PointPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#include + +#include "PointPubSubTypes.h" +#include "PointCdrAux.hpp" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + +namespace geometry_msgs { + namespace msg { + namespace dds_ { + + + Point_PubSubType::Point_PubSubType() + { + setName("geometry_msgs::msg::dds_::Point_"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(Point_::getMaxCdrSerializedSize()); + #else + geometry_msgs_msg_dds__Point__max_cdr_typesize; + #endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; + uint32_t keyLength = geometry_msgs_msg_dds__Point__max_key_cdr_typesize > 16 ? geometry_msgs_msg_dds__Point__max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + Point_PubSubType::~Point_PubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool Point_PubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + Point_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else + payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 + return true; + } + + bool Point_PubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + Point_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; + } + + std::function Point_PubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) + { + return [data, data_representation]() -> uint32_t + { + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 + }; + } + + void* Point_PubSubType::createData() + { + return reinterpret_cast(new Point_()); + } + + void Point_PubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool Point_PubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + Point_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + geometry_msgs_msg_dds__Point__max_key_cdr_typesize); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else + eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 + if (force_md5 || geometry_msgs_msg_dds__Point__max_key_cdr_typesize > 16) + { + m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace dds_ + + + } //End of namespace msg + + +} //End of namespace geometry_msgs + diff --git a/mujoco/idl_gen/nav_msgs/PointPubSubTypes.h b/mujoco/idl_gen/nav_msgs/PointPubSubTypes.h new file mode 100644 index 0000000..467cf6e --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/PointPubSubTypes.h @@ -0,0 +1,196 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PointPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINT_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINT_PUBSUBTYPES_H_ + +#include +#include +#include +#include +#include + +#include "Point.h" + + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated Point is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace geometry_msgs +{ + namespace msg + { + namespace dds_ + { + + + + #ifndef SWIG + namespace detail { + + template + struct Point__rob + { + friend constexpr typename Tag::type get( + Tag) + { + return M; + } + + }; + + struct Point__f + { + typedef double Point_::* type; + friend constexpr type get( + Point__f); + }; + + template struct Point__rob; + + template + inline size_t constexpr Point__offset_of() + { + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); + } + + } // namespace detail + #endif // ifndef SWIG + + + /*! + * @brief This class represents the TopicDataType of the type Point_ defined by the user in the IDL file. + * @ingroup Point + */ + class Point_PubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef Point_ type; + + eProsima_user_DllExport Point_PubSubType(); + + eProsima_user_DllExport ~Point_PubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return is_plain_xcdrv1_impl(); + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) + { + return is_plain_xcdrv2_impl(); + } + else + { + return is_plain_xcdrv1_impl(); + } + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) Point_(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + private: + + static constexpr bool is_plain_xcdrv1_impl() + { + return 24ULL == + (detail::Point__offset_of() + + sizeof(double)); + } + + static constexpr bool is_plain_xcdrv2_impl() + { + return 24ULL == + (detail::Point__offset_of() + + sizeof(double)); + } + + }; + } + } +} + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINT_PUBSUBTYPES_H_ + diff --git a/mujoco/idl_gen/nav_msgs/Pose.cxx b/mujoco/idl_gen/nav_msgs/Pose.cxx new file mode 100644 index 0000000..8e30257 --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/Pose.cxx @@ -0,0 +1,310 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Pose.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "Pose.h" + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define geometry_msgs_msg_dds__Quaternion__max_cdr_typesize 32ULL; +#define geometry_msgs_msg_dds__Point__max_cdr_typesize 24ULL; +#define geometry_msgs_msg_dds__Pose__max_cdr_typesize 56ULL; + + +namespace geometry_msgs { + +namespace msg { + +namespace dds_ { + + + +Pose_::Pose_() +{ + // geometry_msgs::msg::dds_::Point_ m_position + + // geometry_msgs::msg::dds_::Quaternion_ m_orientation + + +} + +Pose_::~Pose_() +{ +} + +Pose_::Pose_( + const Pose_& x) +{ + m_position = x.m_position; + + + m_orientation = x.m_orientation; + +} + +Pose_::Pose_( + Pose_&& x) noexcept +{ + m_position = std::move(x.m_position); + + + m_orientation = std::move(x.m_orientation); + +} + +Pose_& Pose_::operator =( + const Pose_& x) +{ + m_position = x.m_position; + + + m_orientation = x.m_orientation; + + return *this; +} + +Pose_& Pose_::operator =( + Pose_&& x) noexcept +{ + m_position = std::move(x.m_position); + + + m_orientation = std::move(x.m_orientation); + + return *this; +} + +bool Pose_::operator ==( + const Pose_& x) const +{ + return (m_position == x.m_position && + m_orientation == x.m_orientation); +} + +bool Pose_::operator !=( + const Pose_& x) const +{ + return !(*this == x); +} + +size_t Pose_::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return geometry_msgs_msg_dds__Pose__max_cdr_typesize; +} + +size_t Pose_::getCdrSerializedSize( + const Pose_& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += geometry_msgs::msg::dds_::Point_::getCdrSerializedSize(data.position(), current_alignment); + + + current_alignment += geometry_msgs::msg::dds_::Quaternion_::getCdrSerializedSize(data.orientation(), current_alignment); + + + return current_alignment - initial_alignment; +} + + +void Pose_::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_position; + + scdr << m_orientation; + +} + +void Pose_::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_position; + + + + dcdr >> m_orientation; + + +} + + +bool Pose_::isKeyDefined() +{ + return false; +} + +void Pose_::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member position + * @param _position New value to be copied in member position + */ +void Pose_::position( + const geometry_msgs::msg::dds_::Point_& _position) +{ + m_position = _position; +} + +/*! + * @brief This function moves the value in member position + * @param _position New value to be moved in member position + */ +void Pose_::position( + geometry_msgs::msg::dds_::Point_&& _position) +{ + m_position = std::move(_position); +} + +/*! + * @brief This function returns a constant reference to member position + * @return Constant reference to member position + */ +const geometry_msgs::msg::dds_::Point_& Pose_::position() const +{ + return m_position; +} + +/*! + * @brief This function returns a reference to member position + * @return Reference to member position + */ +geometry_msgs::msg::dds_::Point_& Pose_::position() +{ + return m_position; +} + + +/*! + * @brief This function copies the value in member orientation + * @param _orientation New value to be copied in member orientation + */ +void Pose_::orientation( + const geometry_msgs::msg::dds_::Quaternion_& _orientation) +{ + m_orientation = _orientation; +} + +/*! + * @brief This function moves the value in member orientation + * @param _orientation New value to be moved in member orientation + */ +void Pose_::orientation( + geometry_msgs::msg::dds_::Quaternion_&& _orientation) +{ + m_orientation = std::move(_orientation); +} + +/*! + * @brief This function returns a constant reference to member orientation + * @return Constant reference to member orientation + */ +const geometry_msgs::msg::dds_::Quaternion_& Pose_::orientation() const +{ + return m_orientation; +} + +/*! + * @brief This function returns a reference to member orientation + * @return Reference to member orientation + */ +geometry_msgs::msg::dds_::Quaternion_& Pose_::orientation() +{ + return m_orientation; +} + + + + + +} // namespace dds_ + + +} // namespace msg + + +} // namespace geometry_msgs + diff --git a/mujoco/idl_gen/nav_msgs/Pose.h b/mujoco/idl_gen/nav_msgs/Pose.h new file mode 100644 index 0000000..4a01c24 --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/Pose.h @@ -0,0 +1,253 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Pose.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSE_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSE_H_ + +#include "Quaternion.h" +#include "Point.h" + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(POSE_SOURCE) +#define POSE_DllAPI __declspec( dllexport ) +#else +#define POSE_DllAPI __declspec( dllimport ) +#endif // POSE_SOURCE +#else +#define POSE_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define POSE_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + +namespace geometry_msgs { + namespace msg { + namespace dds_ { + + + /*! + * @brief This class represents the structure Pose_ defined by the user in the IDL file. + * @ingroup Pose + */ + class Pose_ + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Pose_(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Pose_(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object geometry_msgs::msg::dds_::Pose_ that will be copied. + */ + eProsima_user_DllExport Pose_( + const Pose_& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object geometry_msgs::msg::dds_::Pose_ that will be copied. + */ + eProsima_user_DllExport Pose_( + Pose_&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object geometry_msgs::msg::dds_::Pose_ that will be copied. + */ + eProsima_user_DllExport Pose_& operator =( + const Pose_& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object geometry_msgs::msg::dds_::Pose_ that will be copied. + */ + eProsima_user_DllExport Pose_& operator =( + Pose_&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::dds_::Pose_ object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Pose_& x) const; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::dds_::Pose_ object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Pose_& x) const; + + /*! + * @brief This function copies the value in member position + * @param _position New value to be copied in member position + */ + eProsima_user_DllExport void position( + const geometry_msgs::msg::dds_::Point_& _position); + + /*! + * @brief This function moves the value in member position + * @param _position New value to be moved in member position + */ + eProsima_user_DllExport void position( + geometry_msgs::msg::dds_::Point_&& _position); + + /*! + * @brief This function returns a constant reference to member position + * @return Constant reference to member position + */ + eProsima_user_DllExport const geometry_msgs::msg::dds_::Point_& position() const; + + /*! + * @brief This function returns a reference to member position + * @return Reference to member position + */ + eProsima_user_DllExport geometry_msgs::msg::dds_::Point_& position(); + + + /*! + * @brief This function copies the value in member orientation + * @param _orientation New value to be copied in member orientation + */ + eProsima_user_DllExport void orientation( + const geometry_msgs::msg::dds_::Quaternion_& _orientation); + + /*! + * @brief This function moves the value in member orientation + * @param _orientation New value to be moved in member orientation + */ + eProsima_user_DllExport void orientation( + geometry_msgs::msg::dds_::Quaternion_&& _orientation); + + /*! + * @brief This function returns a constant reference to member orientation + * @return Constant reference to member orientation + */ + eProsima_user_DllExport const geometry_msgs::msg::dds_::Quaternion_& orientation() const; + + /*! + * @brief This function returns a reference to member orientation + * @return Reference to member orientation + */ + eProsima_user_DllExport geometry_msgs::msg::dds_::Quaternion_& orientation(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const geometry_msgs::msg::dds_::Pose_& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + geometry_msgs::msg::dds_::Point_ m_position; + geometry_msgs::msg::dds_::Quaternion_ m_orientation; + + }; + + } // namespace dds_ + } // namespace msg +} // namespace geometry_msgs + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSE_H_ + + + diff --git a/mujoco/idl_gen/nav_msgs/PoseCdrAux.hpp b/mujoco/idl_gen/nav_msgs/PoseCdrAux.hpp new file mode 100644 index 0000000..a431d3a --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/PoseCdrAux.hpp @@ -0,0 +1,51 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PoseCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSECDRAUX_HPP_ + +#include "Pose.h" + +constexpr uint32_t geometry_msgs_msg_dds__Pose__max_cdr_typesize {56UL}; +constexpr uint32_t geometry_msgs_msg_dds__Pose__max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::Pose_& data); + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSECDRAUX_HPP_ + diff --git a/mujoco/idl_gen/nav_msgs/PoseCdrAux.ipp b/mujoco/idl_gen/nav_msgs/PoseCdrAux.ipp new file mode 100644 index 0000000..ff157bc --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/PoseCdrAux.ipp @@ -0,0 +1,139 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PoseCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSECDRAUX_IPP_ + +#include "PoseCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const geometry_msgs::msg::dds_::Pose_& data, + size_t& current_alignment) +{ + using namespace geometry_msgs::msg::dds_; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.position(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.orientation(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::Pose_& data) +{ + using namespace geometry_msgs::msg::dds_; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.position() + << eprosima::fastcdr::MemberId(1) << data.orientation() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + geometry_msgs::msg::dds_::Pose_& data) +{ + using namespace geometry_msgs::msg::dds_; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.position(); + break; + + case 1: + dcdr >> data.orientation(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::Pose_& data) +{ + using namespace geometry_msgs::msg::dds_; + + static_cast(scdr); + static_cast(data); +} + + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSECDRAUX_IPP_ + diff --git a/mujoco/idl_gen/nav_msgs/PosePubSubTypes.cxx b/mujoco/idl_gen/nav_msgs/PosePubSubTypes.cxx new file mode 100644 index 0000000..abce5e0 --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/PosePubSubTypes.cxx @@ -0,0 +1,233 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PosePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#include + +#include "PosePubSubTypes.h" +#include "PoseCdrAux.hpp" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + +namespace geometry_msgs { + namespace msg { + namespace dds_ { + + + Pose_PubSubType::Pose_PubSubType() + { + setName("geometry_msgs::msg::dds_::Pose_"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(Pose_::getMaxCdrSerializedSize()); + #else + geometry_msgs_msg_dds__Pose__max_cdr_typesize; + #endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; + uint32_t keyLength = geometry_msgs_msg_dds__Pose__max_key_cdr_typesize > 16 ? geometry_msgs_msg_dds__Pose__max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + Pose_PubSubType::~Pose_PubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool Pose_PubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + Pose_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else + payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 + return true; + } + + bool Pose_PubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + Pose_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; + } + + std::function Pose_PubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) + { + return [data, data_representation]() -> uint32_t + { + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 + }; + } + + void* Pose_PubSubType::createData() + { + return reinterpret_cast(new Pose_()); + } + + void Pose_PubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool Pose_PubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + Pose_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + geometry_msgs_msg_dds__Pose__max_key_cdr_typesize); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else + eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 + if (force_md5 || geometry_msgs_msg_dds__Pose__max_key_cdr_typesize > 16) + { + m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace dds_ + + + } //End of namespace msg + + +} //End of namespace geometry_msgs + diff --git a/mujoco/idl_gen/nav_msgs/PosePubSubTypes.h b/mujoco/idl_gen/nav_msgs/PosePubSubTypes.h new file mode 100644 index 0000000..1c11f5f --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/PosePubSubTypes.h @@ -0,0 +1,198 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PosePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSE_PUBSUBTYPES_H_ + +#include +#include +#include +#include +#include + +#include "Pose.h" + +#include "QuaternionPubSubTypes.h" +#include "PointPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated Pose is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace geometry_msgs +{ + namespace msg + { + namespace dds_ + { + + + + #ifndef SWIG + namespace detail { + + template + struct Pose__rob + { + friend constexpr typename Tag::type get( + Tag) + { + return M; + } + + }; + + struct Pose__f + { + typedef geometry_msgs::msg::dds_::Quaternion_ Pose_::* type; + friend constexpr type get( + Pose__f); + }; + + template struct Pose__rob; + + template + inline size_t constexpr Pose__offset_of() + { + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); + } + + } // namespace detail + #endif // ifndef SWIG + + + /*! + * @brief This class represents the TopicDataType of the type Pose_ defined by the user in the IDL file. + * @ingroup Pose + */ + class Pose_PubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef Pose_ type; + + eProsima_user_DllExport Pose_PubSubType(); + + eProsima_user_DllExport ~Pose_PubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return is_plain_xcdrv1_impl(); + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) + { + return is_plain_xcdrv2_impl(); + } + else + { + return is_plain_xcdrv1_impl(); + } + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) Pose_(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + private: + + static constexpr bool is_plain_xcdrv1_impl() + { + return 56ULL == + (detail::Pose__offset_of() + + sizeof(geometry_msgs::msg::dds_::Quaternion_)); + } + + static constexpr bool is_plain_xcdrv2_impl() + { + return 56ULL == + (detail::Pose__offset_of() + + sizeof(geometry_msgs::msg::dds_::Quaternion_)); + } + + }; + } + } +} + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSE_PUBSUBTYPES_H_ + diff --git a/mujoco/idl_gen/nav_msgs/PoseWithCovariance.cxx b/mujoco/idl_gen/nav_msgs/PoseWithCovariance.cxx new file mode 100644 index 0000000..267c230 --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/PoseWithCovariance.cxx @@ -0,0 +1,313 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PoseWithCovariance.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "PoseWithCovariance.h" + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define geometry_msgs_msg_dds__Quaternion__max_cdr_typesize 32ULL; +#define geometry_msgs_msg_dds__Point__max_cdr_typesize 24ULL; +#define geometry_msgs_msg_dds__Pose__max_cdr_typesize 56ULL; +#define geometry_msgs_msg_dds__PoseWithCovariance__max_cdr_typesize 344ULL; + + +namespace geometry_msgs { + +namespace msg { + +namespace dds_ { + + + +PoseWithCovariance_::PoseWithCovariance_() +{ + // geometry_msgs::msg::dds_::Pose_ m_pose + + // double m_covariance + memset(&m_covariance, 0, ((36)) * 8); + +} + +PoseWithCovariance_::~PoseWithCovariance_() +{ +} + +PoseWithCovariance_::PoseWithCovariance_( + const PoseWithCovariance_& x) +{ + m_pose = x.m_pose; + + + m_covariance = x.m_covariance; + +} + +PoseWithCovariance_::PoseWithCovariance_( + PoseWithCovariance_&& x) noexcept +{ + m_pose = std::move(x.m_pose); + + + m_covariance = std::move(x.m_covariance); + +} + +PoseWithCovariance_& PoseWithCovariance_::operator =( + const PoseWithCovariance_& x) +{ + m_pose = x.m_pose; + + + m_covariance = x.m_covariance; + + return *this; +} + +PoseWithCovariance_& PoseWithCovariance_::operator =( + PoseWithCovariance_&& x) noexcept +{ + m_pose = std::move(x.m_pose); + + + m_covariance = std::move(x.m_covariance); + + return *this; +} + +bool PoseWithCovariance_::operator ==( + const PoseWithCovariance_& x) const +{ + return (m_pose == x.m_pose && + m_covariance == x.m_covariance); +} + +bool PoseWithCovariance_::operator !=( + const PoseWithCovariance_& x) const +{ + return !(*this == x); +} + +size_t PoseWithCovariance_::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return geometry_msgs_msg_dds__PoseWithCovariance__max_cdr_typesize; +} + +size_t PoseWithCovariance_::getCdrSerializedSize( + const PoseWithCovariance_& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += geometry_msgs::msg::dds_::Pose_::getCdrSerializedSize(data.pose(), current_alignment); + + + current_alignment += (((36)) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + + return current_alignment - initial_alignment; +} + + +void PoseWithCovariance_::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_pose; + + scdr << m_covariance; + + +} + +void PoseWithCovariance_::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_pose; + + + + dcdr >> m_covariance; + + +} + + +bool PoseWithCovariance_::isKeyDefined() +{ + return false; +} + +void PoseWithCovariance_::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member pose + * @param _pose New value to be copied in member pose + */ +void PoseWithCovariance_::pose( + const geometry_msgs::msg::dds_::Pose_& _pose) +{ + m_pose = _pose; +} + +/*! + * @brief This function moves the value in member pose + * @param _pose New value to be moved in member pose + */ +void PoseWithCovariance_::pose( + geometry_msgs::msg::dds_::Pose_&& _pose) +{ + m_pose = std::move(_pose); +} + +/*! + * @brief This function returns a constant reference to member pose + * @return Constant reference to member pose + */ +const geometry_msgs::msg::dds_::Pose_& PoseWithCovariance_::pose() const +{ + return m_pose; +} + +/*! + * @brief This function returns a reference to member pose + * @return Reference to member pose + */ +geometry_msgs::msg::dds_::Pose_& PoseWithCovariance_::pose() +{ + return m_pose; +} + + +/*! + * @brief This function copies the value in member covariance + * @param _covariance New value to be copied in member covariance + */ +void PoseWithCovariance_::covariance( + const std::array& _covariance) +{ + m_covariance = _covariance; +} + +/*! + * @brief This function moves the value in member covariance + * @param _covariance New value to be moved in member covariance + */ +void PoseWithCovariance_::covariance( + std::array&& _covariance) +{ + m_covariance = std::move(_covariance); +} + +/*! + * @brief This function returns a constant reference to member covariance + * @return Constant reference to member covariance + */ +const std::array& PoseWithCovariance_::covariance() const +{ + return m_covariance; +} + +/*! + * @brief This function returns a reference to member covariance + * @return Reference to member covariance + */ +std::array& PoseWithCovariance_::covariance() +{ + return m_covariance; +} + + + + + +} // namespace dds_ + + +} // namespace msg + + +} // namespace geometry_msgs + diff --git a/mujoco/idl_gen/nav_msgs/PoseWithCovariance.h b/mujoco/idl_gen/nav_msgs/PoseWithCovariance.h new file mode 100644 index 0000000..eefb9fd --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/PoseWithCovariance.h @@ -0,0 +1,252 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PoseWithCovariance.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCE_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCE_H_ + +#include "Pose.h" + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(POSEWITHCOVARIANCE_SOURCE) +#define POSEWITHCOVARIANCE_DllAPI __declspec( dllexport ) +#else +#define POSEWITHCOVARIANCE_DllAPI __declspec( dllimport ) +#endif // POSEWITHCOVARIANCE_SOURCE +#else +#define POSEWITHCOVARIANCE_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define POSEWITHCOVARIANCE_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + +namespace geometry_msgs { + namespace msg { + namespace dds_ { + + + /*! + * @brief This class represents the structure PoseWithCovariance_ defined by the user in the IDL file. + * @ingroup PoseWithCovariance + */ + class PoseWithCovariance_ + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PoseWithCovariance_(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PoseWithCovariance_(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object geometry_msgs::msg::dds_::PoseWithCovariance_ that will be copied. + */ + eProsima_user_DllExport PoseWithCovariance_( + const PoseWithCovariance_& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object geometry_msgs::msg::dds_::PoseWithCovariance_ that will be copied. + */ + eProsima_user_DllExport PoseWithCovariance_( + PoseWithCovariance_&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object geometry_msgs::msg::dds_::PoseWithCovariance_ that will be copied. + */ + eProsima_user_DllExport PoseWithCovariance_& operator =( + const PoseWithCovariance_& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object geometry_msgs::msg::dds_::PoseWithCovariance_ that will be copied. + */ + eProsima_user_DllExport PoseWithCovariance_& operator =( + PoseWithCovariance_&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::dds_::PoseWithCovariance_ object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PoseWithCovariance_& x) const; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::dds_::PoseWithCovariance_ object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PoseWithCovariance_& x) const; + + /*! + * @brief This function copies the value in member pose + * @param _pose New value to be copied in member pose + */ + eProsima_user_DllExport void pose( + const geometry_msgs::msg::dds_::Pose_& _pose); + + /*! + * @brief This function moves the value in member pose + * @param _pose New value to be moved in member pose + */ + eProsima_user_DllExport void pose( + geometry_msgs::msg::dds_::Pose_&& _pose); + + /*! + * @brief This function returns a constant reference to member pose + * @return Constant reference to member pose + */ + eProsima_user_DllExport const geometry_msgs::msg::dds_::Pose_& pose() const; + + /*! + * @brief This function returns a reference to member pose + * @return Reference to member pose + */ + eProsima_user_DllExport geometry_msgs::msg::dds_::Pose_& pose(); + + + /*! + * @brief This function copies the value in member covariance + * @param _covariance New value to be copied in member covariance + */ + eProsima_user_DllExport void covariance( + const std::array& _covariance); + + /*! + * @brief This function moves the value in member covariance + * @param _covariance New value to be moved in member covariance + */ + eProsima_user_DllExport void covariance( + std::array&& _covariance); + + /*! + * @brief This function returns a constant reference to member covariance + * @return Constant reference to member covariance + */ + eProsima_user_DllExport const std::array& covariance() const; + + /*! + * @brief This function returns a reference to member covariance + * @return Reference to member covariance + */ + eProsima_user_DllExport std::array& covariance(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const geometry_msgs::msg::dds_::PoseWithCovariance_& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + geometry_msgs::msg::dds_::Pose_ m_pose; + std::array m_covariance; + + }; + + } // namespace dds_ + } // namespace msg +} // namespace geometry_msgs + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCE_H_ + + + diff --git a/mujoco/idl_gen/nav_msgs/PoseWithCovarianceCdrAux.hpp b/mujoco/idl_gen/nav_msgs/PoseWithCovarianceCdrAux.hpp new file mode 100644 index 0000000..77dcabf --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/PoseWithCovarianceCdrAux.hpp @@ -0,0 +1,51 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PoseWithCovarianceCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCECDRAUX_HPP_ + +#include "PoseWithCovariance.h" + +constexpr uint32_t geometry_msgs_msg_dds__PoseWithCovariance__max_cdr_typesize {344UL}; +constexpr uint32_t geometry_msgs_msg_dds__PoseWithCovariance__max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::PoseWithCovariance_& data); + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCECDRAUX_HPP_ + diff --git a/mujoco/idl_gen/nav_msgs/PoseWithCovarianceCdrAux.ipp b/mujoco/idl_gen/nav_msgs/PoseWithCovarianceCdrAux.ipp new file mode 100644 index 0000000..b843a05 --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/PoseWithCovarianceCdrAux.ipp @@ -0,0 +1,139 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PoseWithCovarianceCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCECDRAUX_IPP_ + +#include "PoseWithCovarianceCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const geometry_msgs::msg::dds_::PoseWithCovariance_& data, + size_t& current_alignment) +{ + using namespace geometry_msgs::msg::dds_; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.pose(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.covariance(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::PoseWithCovariance_& data) +{ + using namespace geometry_msgs::msg::dds_; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.pose() + << eprosima::fastcdr::MemberId(1) << data.covariance() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + geometry_msgs::msg::dds_::PoseWithCovariance_& data) +{ + using namespace geometry_msgs::msg::dds_; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.pose(); + break; + + case 1: + dcdr >> data.covariance(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::PoseWithCovariance_& data) +{ + using namespace geometry_msgs::msg::dds_; + + static_cast(scdr); + static_cast(data); +} + + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCECDRAUX_IPP_ + diff --git a/mujoco/idl_gen/nav_msgs/PoseWithCovariancePubSubTypes.cxx b/mujoco/idl_gen/nav_msgs/PoseWithCovariancePubSubTypes.cxx new file mode 100644 index 0000000..8fd289e --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/PoseWithCovariancePubSubTypes.cxx @@ -0,0 +1,233 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PoseWithCovariancePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#include + +#include "PoseWithCovariancePubSubTypes.h" +#include "PoseWithCovarianceCdrAux.hpp" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + +namespace geometry_msgs { + namespace msg { + namespace dds_ { + + + PoseWithCovariance_PubSubType::PoseWithCovariance_PubSubType() + { + setName("geometry_msgs::msg::dds_::PoseWithCovariance_"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(PoseWithCovariance_::getMaxCdrSerializedSize()); + #else + geometry_msgs_msg_dds__PoseWithCovariance__max_cdr_typesize; + #endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; + uint32_t keyLength = geometry_msgs_msg_dds__PoseWithCovariance__max_key_cdr_typesize > 16 ? geometry_msgs_msg_dds__PoseWithCovariance__max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + PoseWithCovariance_PubSubType::~PoseWithCovariance_PubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool PoseWithCovariance_PubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + PoseWithCovariance_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else + payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 + return true; + } + + bool PoseWithCovariance_PubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + PoseWithCovariance_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; + } + + std::function PoseWithCovariance_PubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) + { + return [data, data_representation]() -> uint32_t + { + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 + }; + } + + void* PoseWithCovariance_PubSubType::createData() + { + return reinterpret_cast(new PoseWithCovariance_()); + } + + void PoseWithCovariance_PubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool PoseWithCovariance_PubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + PoseWithCovariance_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + geometry_msgs_msg_dds__PoseWithCovariance__max_key_cdr_typesize); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else + eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 + if (force_md5 || geometry_msgs_msg_dds__PoseWithCovariance__max_key_cdr_typesize > 16) + { + m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace dds_ + + + } //End of namespace msg + + +} //End of namespace geometry_msgs + diff --git a/mujoco/idl_gen/nav_msgs/PoseWithCovariancePubSubTypes.h b/mujoco/idl_gen/nav_msgs/PoseWithCovariancePubSubTypes.h new file mode 100644 index 0000000..9dcd73c --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/PoseWithCovariancePubSubTypes.h @@ -0,0 +1,197 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PoseWithCovariancePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCE_PUBSUBTYPES_H_ + +#include +#include +#include +#include +#include + +#include "PoseWithCovariance.h" + +#include "PosePubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated PoseWithCovariance is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace geometry_msgs +{ + namespace msg + { + namespace dds_ + { + + + + #ifndef SWIG + namespace detail { + + template + struct PoseWithCovariance__rob + { + friend constexpr typename Tag::type get( + Tag) + { + return M; + } + + }; + + struct PoseWithCovariance__f + { + typedef std::array PoseWithCovariance_::* type; + friend constexpr type get( + PoseWithCovariance__f); + }; + + template struct PoseWithCovariance__rob; + + template + inline size_t constexpr PoseWithCovariance__offset_of() + { + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); + } + + } // namespace detail + #endif // ifndef SWIG + + + /*! + * @brief This class represents the TopicDataType of the type PoseWithCovariance_ defined by the user in the IDL file. + * @ingroup PoseWithCovariance + */ + class PoseWithCovariance_PubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef PoseWithCovariance_ type; + + eProsima_user_DllExport PoseWithCovariance_PubSubType(); + + eProsima_user_DllExport ~PoseWithCovariance_PubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return is_plain_xcdrv1_impl(); + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) + { + return is_plain_xcdrv2_impl(); + } + else + { + return is_plain_xcdrv1_impl(); + } + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) PoseWithCovariance_(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + private: + + static constexpr bool is_plain_xcdrv1_impl() + { + return 344ULL == + (detail::PoseWithCovariance__offset_of() + + sizeof(std::array)); + } + + static constexpr bool is_plain_xcdrv2_impl() + { + return 344ULL == + (detail::PoseWithCovariance__offset_of() + + sizeof(std::array)); + } + + }; + } + } +} + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCE_PUBSUBTYPES_H_ + diff --git a/mujoco/idl_gen/nav_msgs/Quaternion.cxx b/mujoco/idl_gen/nav_msgs/Quaternion.cxx new file mode 100644 index 0000000..a6a9b05 --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/Quaternion.cxx @@ -0,0 +1,394 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Quaternion.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "Quaternion.h" + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define geometry_msgs_msg_dds__Quaternion__max_cdr_typesize 32ULL; + + +namespace geometry_msgs { + +namespace msg { + +namespace dds_ { + + + +Quaternion_::Quaternion_() +{ + // double m_x + m_x = 0.0; + // double m_y + m_y = 0.0; + // double m_z + m_z = 0.0; + // double m_w + m_w = 0.0; + +} + +Quaternion_::~Quaternion_() +{ +} + +Quaternion_::Quaternion_( + const Quaternion_& x) +{ + m_x = x.m_x; + + + m_y = x.m_y; + + + m_z = x.m_z; + + + m_w = x.m_w; + +} + +Quaternion_::Quaternion_( + Quaternion_&& x) noexcept +{ + m_x = x.m_x; + + + m_y = x.m_y; + + + m_z = x.m_z; + + + m_w = x.m_w; + +} + +Quaternion_& Quaternion_::operator =( + const Quaternion_& x) +{ + m_x = x.m_x; + + + m_y = x.m_y; + + + m_z = x.m_z; + + + m_w = x.m_w; + + return *this; +} + +Quaternion_& Quaternion_::operator =( + Quaternion_&& x) noexcept +{ + m_x = x.m_x; + + + m_y = x.m_y; + + + m_z = x.m_z; + + + m_w = x.m_w; + + return *this; +} + +bool Quaternion_::operator ==( + const Quaternion_& x) const +{ + return (m_x == x.m_x && + m_y == x.m_y && + m_z == x.m_z && + m_w == x.m_w); +} + +bool Quaternion_::operator !=( + const Quaternion_& x) const +{ + return !(*this == x); +} + +size_t Quaternion_::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return geometry_msgs_msg_dds__Quaternion__max_cdr_typesize; +} + +size_t Quaternion_::getCdrSerializedSize( + const Quaternion_& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + return current_alignment - initial_alignment; +} + + +void Quaternion_::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_x; + + scdr << m_y; + + scdr << m_z; + + scdr << m_w; + +} + +void Quaternion_::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_x; + + + + dcdr >> m_y; + + + + dcdr >> m_z; + + + + dcdr >> m_w; + + +} + + +bool Quaternion_::isKeyDefined() +{ + return false; +} + +void Quaternion_::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member x + * @param _x New value for member x + */ +void Quaternion_::x( + double _x) +{ + m_x = _x; +} + +/*! + * @brief This function returns the value of member x + * @return Value of member x + */ +double Quaternion_::x() const +{ + return m_x; +} + +/*! + * @brief This function returns a reference to member x + * @return Reference to member x + */ +double& Quaternion_::x() +{ + return m_x; +} + + +/*! + * @brief This function sets a value in member y + * @param _y New value for member y + */ +void Quaternion_::y( + double _y) +{ + m_y = _y; +} + +/*! + * @brief This function returns the value of member y + * @return Value of member y + */ +double Quaternion_::y() const +{ + return m_y; +} + +/*! + * @brief This function returns a reference to member y + * @return Reference to member y + */ +double& Quaternion_::y() +{ + return m_y; +} + + +/*! + * @brief This function sets a value in member z + * @param _z New value for member z + */ +void Quaternion_::z( + double _z) +{ + m_z = _z; +} + +/*! + * @brief This function returns the value of member z + * @return Value of member z + */ +double Quaternion_::z() const +{ + return m_z; +} + +/*! + * @brief This function returns a reference to member z + * @return Reference to member z + */ +double& Quaternion_::z() +{ + return m_z; +} + + +/*! + * @brief This function sets a value in member w + * @param _w New value for member w + */ +void Quaternion_::w( + double _w) +{ + m_w = _w; +} + +/*! + * @brief This function returns the value of member w + * @return Value of member w + */ +double Quaternion_::w() const +{ + return m_w; +} + +/*! + * @brief This function returns a reference to member w + * @return Reference to member w + */ +double& Quaternion_::w() +{ + return m_w; +} + + + + + +} // namespace dds_ + + +} // namespace msg + + +} // namespace geometry_msgs + diff --git a/mujoco/idl_gen/nav_msgs/Quaternion.h b/mujoco/idl_gen/nav_msgs/Quaternion.h new file mode 100644 index 0000000..52ea093 --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/Quaternion.h @@ -0,0 +1,279 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Quaternion.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNION_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNION_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(QUATERNION_SOURCE) +#define QUATERNION_DllAPI __declspec( dllexport ) +#else +#define QUATERNION_DllAPI __declspec( dllimport ) +#endif // QUATERNION_SOURCE +#else +#define QUATERNION_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define QUATERNION_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + +namespace geometry_msgs { + namespace msg { + namespace dds_ { + + + /*! + * @brief This class represents the structure Quaternion_ defined by the user in the IDL file. + * @ingroup Quaternion + */ + class Quaternion_ + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Quaternion_(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Quaternion_(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object geometry_msgs::msg::dds_::Quaternion_ that will be copied. + */ + eProsima_user_DllExport Quaternion_( + const Quaternion_& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object geometry_msgs::msg::dds_::Quaternion_ that will be copied. + */ + eProsima_user_DllExport Quaternion_( + Quaternion_&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object geometry_msgs::msg::dds_::Quaternion_ that will be copied. + */ + eProsima_user_DllExport Quaternion_& operator =( + const Quaternion_& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object geometry_msgs::msg::dds_::Quaternion_ that will be copied. + */ + eProsima_user_DllExport Quaternion_& operator =( + Quaternion_&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::dds_::Quaternion_ object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Quaternion_& x) const; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::dds_::Quaternion_ object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Quaternion_& x) const; + + /*! + * @brief This function sets a value in member x + * @param _x New value for member x + */ + eProsima_user_DllExport void x( + double _x); + + /*! + * @brief This function returns the value of member x + * @return Value of member x + */ + eProsima_user_DllExport double x() const; + + /*! + * @brief This function returns a reference to member x + * @return Reference to member x + */ + eProsima_user_DllExport double& x(); + + + /*! + * @brief This function sets a value in member y + * @param _y New value for member y + */ + eProsima_user_DllExport void y( + double _y); + + /*! + * @brief This function returns the value of member y + * @return Value of member y + */ + eProsima_user_DllExport double y() const; + + /*! + * @brief This function returns a reference to member y + * @return Reference to member y + */ + eProsima_user_DllExport double& y(); + + + /*! + * @brief This function sets a value in member z + * @param _z New value for member z + */ + eProsima_user_DllExport void z( + double _z); + + /*! + * @brief This function returns the value of member z + * @return Value of member z + */ + eProsima_user_DllExport double z() const; + + /*! + * @brief This function returns a reference to member z + * @return Reference to member z + */ + eProsima_user_DllExport double& z(); + + + /*! + * @brief This function sets a value in member w + * @param _w New value for member w + */ + eProsima_user_DllExport void w( + double _w); + + /*! + * @brief This function returns the value of member w + * @return Value of member w + */ + eProsima_user_DllExport double w() const; + + /*! + * @brief This function returns a reference to member w + * @return Reference to member w + */ + eProsima_user_DllExport double& w(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const geometry_msgs::msg::dds_::Quaternion_& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + double m_x; + double m_y; + double m_z; + double m_w; + + }; + + } // namespace dds_ + } // namespace msg +} // namespace geometry_msgs + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNION_H_ + + + diff --git a/mujoco/idl_gen/nav_msgs/QuaternionCdrAux.hpp b/mujoco/idl_gen/nav_msgs/QuaternionCdrAux.hpp new file mode 100644 index 0000000..b284816 --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/QuaternionCdrAux.hpp @@ -0,0 +1,51 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file QuaternionCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNIONCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNIONCDRAUX_HPP_ + +#include "Quaternion.h" + +constexpr uint32_t geometry_msgs_msg_dds__Quaternion__max_cdr_typesize {32UL}; +constexpr uint32_t geometry_msgs_msg_dds__Quaternion__max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::Quaternion_& data); + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNIONCDRAUX_HPP_ + diff --git a/mujoco/idl_gen/nav_msgs/QuaternionCdrAux.ipp b/mujoco/idl_gen/nav_msgs/QuaternionCdrAux.ipp new file mode 100644 index 0000000..8a3b135 --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/QuaternionCdrAux.ipp @@ -0,0 +1,155 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file QuaternionCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNIONCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNIONCDRAUX_IPP_ + +#include "QuaternionCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const geometry_msgs::msg::dds_::Quaternion_& data, + size_t& current_alignment) +{ + using namespace geometry_msgs::msg::dds_; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.x(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.y(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.z(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.w(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::Quaternion_& data) +{ + using namespace geometry_msgs::msg::dds_; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.x() + << eprosima::fastcdr::MemberId(1) << data.y() + << eprosima::fastcdr::MemberId(2) << data.z() + << eprosima::fastcdr::MemberId(3) << data.w() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + geometry_msgs::msg::dds_::Quaternion_& data) +{ + using namespace geometry_msgs::msg::dds_; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.x(); + break; + + case 1: + dcdr >> data.y(); + break; + + case 2: + dcdr >> data.z(); + break; + + case 3: + dcdr >> data.w(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::Quaternion_& data) +{ + using namespace geometry_msgs::msg::dds_; + + static_cast(scdr); + static_cast(data); +} + + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNIONCDRAUX_IPP_ + diff --git a/mujoco/idl_gen/nav_msgs/QuaternionPubSubTypes.cxx b/mujoco/idl_gen/nav_msgs/QuaternionPubSubTypes.cxx new file mode 100644 index 0000000..1a32c96 --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/QuaternionPubSubTypes.cxx @@ -0,0 +1,233 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file QuaternionPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#include + +#include "QuaternionPubSubTypes.h" +#include "QuaternionCdrAux.hpp" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + +namespace geometry_msgs { + namespace msg { + namespace dds_ { + + + Quaternion_PubSubType::Quaternion_PubSubType() + { + setName("geometry_msgs::msg::dds_::Quaternion_"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(Quaternion_::getMaxCdrSerializedSize()); + #else + geometry_msgs_msg_dds__Quaternion__max_cdr_typesize; + #endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; + uint32_t keyLength = geometry_msgs_msg_dds__Quaternion__max_key_cdr_typesize > 16 ? geometry_msgs_msg_dds__Quaternion__max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + Quaternion_PubSubType::~Quaternion_PubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool Quaternion_PubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + Quaternion_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else + payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 + return true; + } + + bool Quaternion_PubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + Quaternion_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; + } + + std::function Quaternion_PubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) + { + return [data, data_representation]() -> uint32_t + { + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 + }; + } + + void* Quaternion_PubSubType::createData() + { + return reinterpret_cast(new Quaternion_()); + } + + void Quaternion_PubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool Quaternion_PubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + Quaternion_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + geometry_msgs_msg_dds__Quaternion__max_key_cdr_typesize); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else + eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 + if (force_md5 || geometry_msgs_msg_dds__Quaternion__max_key_cdr_typesize > 16) + { + m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace dds_ + + + } //End of namespace msg + + +} //End of namespace geometry_msgs + diff --git a/mujoco/idl_gen/nav_msgs/QuaternionPubSubTypes.h b/mujoco/idl_gen/nav_msgs/QuaternionPubSubTypes.h new file mode 100644 index 0000000..9a7dbcd --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/QuaternionPubSubTypes.h @@ -0,0 +1,196 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file QuaternionPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNION_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNION_PUBSUBTYPES_H_ + +#include +#include +#include +#include +#include + +#include "Quaternion.h" + + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated Quaternion is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace geometry_msgs +{ + namespace msg + { + namespace dds_ + { + + + + #ifndef SWIG + namespace detail { + + template + struct Quaternion__rob + { + friend constexpr typename Tag::type get( + Tag) + { + return M; + } + + }; + + struct Quaternion__f + { + typedef double Quaternion_::* type; + friend constexpr type get( + Quaternion__f); + }; + + template struct Quaternion__rob; + + template + inline size_t constexpr Quaternion__offset_of() + { + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); + } + + } // namespace detail + #endif // ifndef SWIG + + + /*! + * @brief This class represents the TopicDataType of the type Quaternion_ defined by the user in the IDL file. + * @ingroup Quaternion + */ + class Quaternion_PubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef Quaternion_ type; + + eProsima_user_DllExport Quaternion_PubSubType(); + + eProsima_user_DllExport ~Quaternion_PubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return is_plain_xcdrv1_impl(); + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) + { + return is_plain_xcdrv2_impl(); + } + else + { + return is_plain_xcdrv1_impl(); + } + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) Quaternion_(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + private: + + static constexpr bool is_plain_xcdrv1_impl() + { + return 32ULL == + (detail::Quaternion__offset_of() + + sizeof(double)); + } + + static constexpr bool is_plain_xcdrv2_impl() + { + return 32ULL == + (detail::Quaternion__offset_of() + + sizeof(double)); + } + + }; + } + } +} + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNION_PUBSUBTYPES_H_ + diff --git a/mujoco/idl_gen/nav_msgs/Time.cxx b/mujoco/idl_gen/nav_msgs/Time.cxx new file mode 100644 index 0000000..7766fbe --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/Time.cxx @@ -0,0 +1,288 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Time.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "Time.h" + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define builtin_interfaces_msg_dds__Time__max_cdr_typesize 8ULL; + + +namespace builtin_interfaces { + +namespace msg { + +namespace dds_ { + + + +Time_::Time_() +{ + // long m_sec + m_sec = 0; + // unsigned long m_nanosec + m_nanosec = 0; + +} + +Time_::~Time_() +{ +} + +Time_::Time_( + const Time_& x) +{ + m_sec = x.m_sec; + + + m_nanosec = x.m_nanosec; + +} + +Time_::Time_( + Time_&& x) noexcept +{ + m_sec = x.m_sec; + + + m_nanosec = x.m_nanosec; + +} + +Time_& Time_::operator =( + const Time_& x) +{ + m_sec = x.m_sec; + + + m_nanosec = x.m_nanosec; + + return *this; +} + +Time_& Time_::operator =( + Time_&& x) noexcept +{ + m_sec = x.m_sec; + + + m_nanosec = x.m_nanosec; + + return *this; +} + +bool Time_::operator ==( + const Time_& x) const +{ + return (m_sec == x.m_sec && + m_nanosec == x.m_nanosec); +} + +bool Time_::operator !=( + const Time_& x) const +{ + return !(*this == x); +} + +size_t Time_::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return builtin_interfaces_msg_dds__Time__max_cdr_typesize; +} + +size_t Time_::getCdrSerializedSize( + const Time_& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + + +void Time_::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_sec; + + scdr << m_nanosec; + +} + +void Time_::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_sec; + + + + dcdr >> m_nanosec; + + +} + + +bool Time_::isKeyDefined() +{ + return false; +} + +void Time_::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member sec + * @param _sec New value for member sec + */ +void Time_::sec( + int32_t _sec) +{ + m_sec = _sec; +} + +/*! + * @brief This function returns the value of member sec + * @return Value of member sec + */ +int32_t Time_::sec() const +{ + return m_sec; +} + +/*! + * @brief This function returns a reference to member sec + * @return Reference to member sec + */ +int32_t& Time_::sec() +{ + return m_sec; +} + + +/*! + * @brief This function sets a value in member nanosec + * @param _nanosec New value for member nanosec + */ +void Time_::nanosec( + uint32_t _nanosec) +{ + m_nanosec = _nanosec; +} + +/*! + * @brief This function returns the value of member nanosec + * @return Value of member nanosec + */ +uint32_t Time_::nanosec() const +{ + return m_nanosec; +} + +/*! + * @brief This function returns a reference to member nanosec + * @return Reference to member nanosec + */ +uint32_t& Time_::nanosec() +{ + return m_nanosec; +} + + + + + +} // namespace dds_ + + +} // namespace msg + + +} // namespace builtin_interfaces + diff --git a/mujoco/idl_gen/nav_msgs/Time.h b/mujoco/idl_gen/nav_msgs/Time.h new file mode 100644 index 0000000..7296ac0 --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/Time.h @@ -0,0 +1,237 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Time.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIME_H_ +#define _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIME_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(TIME_SOURCE) +#define TIME_DllAPI __declspec( dllexport ) +#else +#define TIME_DllAPI __declspec( dllimport ) +#endif // TIME_SOURCE +#else +#define TIME_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define TIME_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + +namespace builtin_interfaces { + namespace msg { + namespace dds_ { + + + /*! + * @brief This class represents the structure Time_ defined by the user in the IDL file. + * @ingroup Time + */ + class Time_ + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Time_(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Time_(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object builtin_interfaces::msg::dds_::Time_ that will be copied. + */ + eProsima_user_DllExport Time_( + const Time_& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object builtin_interfaces::msg::dds_::Time_ that will be copied. + */ + eProsima_user_DllExport Time_( + Time_&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object builtin_interfaces::msg::dds_::Time_ that will be copied. + */ + eProsima_user_DllExport Time_& operator =( + const Time_& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object builtin_interfaces::msg::dds_::Time_ that will be copied. + */ + eProsima_user_DllExport Time_& operator =( + Time_&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x builtin_interfaces::msg::dds_::Time_ object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Time_& x) const; + + /*! + * @brief Comparison operator. + * @param x builtin_interfaces::msg::dds_::Time_ object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Time_& x) const; + + /*! + * @brief This function sets a value in member sec + * @param _sec New value for member sec + */ + eProsima_user_DllExport void sec( + int32_t _sec); + + /*! + * @brief This function returns the value of member sec + * @return Value of member sec + */ + eProsima_user_DllExport int32_t sec() const; + + /*! + * @brief This function returns a reference to member sec + * @return Reference to member sec + */ + eProsima_user_DllExport int32_t& sec(); + + + /*! + * @brief This function sets a value in member nanosec + * @param _nanosec New value for member nanosec + */ + eProsima_user_DllExport void nanosec( + uint32_t _nanosec); + + /*! + * @brief This function returns the value of member nanosec + * @return Value of member nanosec + */ + eProsima_user_DllExport uint32_t nanosec() const; + + /*! + * @brief This function returns a reference to member nanosec + * @return Reference to member nanosec + */ + eProsima_user_DllExport uint32_t& nanosec(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const builtin_interfaces::msg::dds_::Time_& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + int32_t m_sec; + uint32_t m_nanosec; + + }; + + } // namespace dds_ + } // namespace msg +} // namespace builtin_interfaces + +#endif // _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIME_H_ + + + diff --git a/mujoco/idl_gen/nav_msgs/TimeCdrAux.hpp b/mujoco/idl_gen/nav_msgs/TimeCdrAux.hpp new file mode 100644 index 0000000..2f50163 --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/TimeCdrAux.hpp @@ -0,0 +1,51 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TimeCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIMECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIMECDRAUX_HPP_ + +#include "Time.h" + +constexpr uint32_t builtin_interfaces_msg_dds__Time__max_cdr_typesize {8UL}; +constexpr uint32_t builtin_interfaces_msg_dds__Time__max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const builtin_interfaces::msg::dds_::Time_& data); + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIMECDRAUX_HPP_ + diff --git a/mujoco/idl_gen/nav_msgs/TimeCdrAux.ipp b/mujoco/idl_gen/nav_msgs/TimeCdrAux.ipp new file mode 100644 index 0000000..4b1d45b --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/TimeCdrAux.ipp @@ -0,0 +1,139 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TimeCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIMECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIMECDRAUX_IPP_ + +#include "TimeCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const builtin_interfaces::msg::dds_::Time_& data, + size_t& current_alignment) +{ + using namespace builtin_interfaces::msg::dds_; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.sec(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.nanosec(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const builtin_interfaces::msg::dds_::Time_& data) +{ + using namespace builtin_interfaces::msg::dds_; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.sec() + << eprosima::fastcdr::MemberId(1) << data.nanosec() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + builtin_interfaces::msg::dds_::Time_& data) +{ + using namespace builtin_interfaces::msg::dds_; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.sec(); + break; + + case 1: + dcdr >> data.nanosec(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const builtin_interfaces::msg::dds_::Time_& data) +{ + using namespace builtin_interfaces::msg::dds_; + + static_cast(scdr); + static_cast(data); +} + + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIMECDRAUX_IPP_ + diff --git a/mujoco/idl_gen/nav_msgs/TimePubSubTypes.cxx b/mujoco/idl_gen/nav_msgs/TimePubSubTypes.cxx new file mode 100644 index 0000000..e0de1ac --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/TimePubSubTypes.cxx @@ -0,0 +1,233 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TimePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#include + +#include "TimePubSubTypes.h" +#include "TimeCdrAux.hpp" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + +namespace builtin_interfaces { + namespace msg { + namespace dds_ { + + + Time_PubSubType::Time_PubSubType() + { + setName("builtin_interfaces::msg::dds_::Time_"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(Time_::getMaxCdrSerializedSize()); + #else + builtin_interfaces_msg_dds__Time__max_cdr_typesize; + #endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; + uint32_t keyLength = builtin_interfaces_msg_dds__Time__max_key_cdr_typesize > 16 ? builtin_interfaces_msg_dds__Time__max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + Time_PubSubType::~Time_PubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool Time_PubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + Time_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else + payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 + return true; + } + + bool Time_PubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + Time_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; + } + + std::function Time_PubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) + { + return [data, data_representation]() -> uint32_t + { + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 + }; + } + + void* Time_PubSubType::createData() + { + return reinterpret_cast(new Time_()); + } + + void Time_PubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool Time_PubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + Time_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + builtin_interfaces_msg_dds__Time__max_key_cdr_typesize); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else + eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 + if (force_md5 || builtin_interfaces_msg_dds__Time__max_key_cdr_typesize > 16) + { + m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace dds_ + + + } //End of namespace msg + + +} //End of namespace builtin_interfaces + diff --git a/mujoco/idl_gen/nav_msgs/TimePubSubTypes.h b/mujoco/idl_gen/nav_msgs/TimePubSubTypes.h new file mode 100644 index 0000000..ae14992 --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/TimePubSubTypes.h @@ -0,0 +1,196 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TimePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#ifndef _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIME_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIME_PUBSUBTYPES_H_ + +#include +#include +#include +#include +#include + +#include "Time.h" + + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated Time is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace builtin_interfaces +{ + namespace msg + { + namespace dds_ + { + + + + #ifndef SWIG + namespace detail { + + template + struct Time__rob + { + friend constexpr typename Tag::type get( + Tag) + { + return M; + } + + }; + + struct Time__f + { + typedef uint32_t Time_::* type; + friend constexpr type get( + Time__f); + }; + + template struct Time__rob; + + template + inline size_t constexpr Time__offset_of() + { + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); + } + + } // namespace detail + #endif // ifndef SWIG + + + /*! + * @brief This class represents the TopicDataType of the type Time_ defined by the user in the IDL file. + * @ingroup Time + */ + class Time_PubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef Time_ type; + + eProsima_user_DllExport Time_PubSubType(); + + eProsima_user_DllExport ~Time_PubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return is_plain_xcdrv1_impl(); + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) + { + return is_plain_xcdrv2_impl(); + } + else + { + return is_plain_xcdrv1_impl(); + } + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) Time_(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + private: + + static constexpr bool is_plain_xcdrv1_impl() + { + return 8ULL == + (detail::Time__offset_of() + + sizeof(uint32_t)); + } + + static constexpr bool is_plain_xcdrv2_impl() + { + return 8ULL == + (detail::Time__offset_of() + + sizeof(uint32_t)); + } + + }; + } + } +} + +#endif // _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIME_PUBSUBTYPES_H_ + diff --git a/mujoco/idl_gen/nav_msgs/Twist.cxx b/mujoco/idl_gen/nav_msgs/Twist.cxx new file mode 100644 index 0000000..d6da739 --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/Twist.cxx @@ -0,0 +1,309 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Twist.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "Twist.h" + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define geometry_msgs_msg_dds__Vector3__max_cdr_typesize 24ULL; +#define geometry_msgs_msg_dds__Twist__max_cdr_typesize 48ULL; + + +namespace geometry_msgs { + +namespace msg { + +namespace dds_ { + + + +Twist_::Twist_() +{ + // geometry_msgs::msg::dds_::Vector3_ m_linear + + // geometry_msgs::msg::dds_::Vector3_ m_angular + + +} + +Twist_::~Twist_() +{ +} + +Twist_::Twist_( + const Twist_& x) +{ + m_linear = x.m_linear; + + + m_angular = x.m_angular; + +} + +Twist_::Twist_( + Twist_&& x) noexcept +{ + m_linear = std::move(x.m_linear); + + + m_angular = std::move(x.m_angular); + +} + +Twist_& Twist_::operator =( + const Twist_& x) +{ + m_linear = x.m_linear; + + + m_angular = x.m_angular; + + return *this; +} + +Twist_& Twist_::operator =( + Twist_&& x) noexcept +{ + m_linear = std::move(x.m_linear); + + + m_angular = std::move(x.m_angular); + + return *this; +} + +bool Twist_::operator ==( + const Twist_& x) const +{ + return (m_linear == x.m_linear && + m_angular == x.m_angular); +} + +bool Twist_::operator !=( + const Twist_& x) const +{ + return !(*this == x); +} + +size_t Twist_::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return geometry_msgs_msg_dds__Twist__max_cdr_typesize; +} + +size_t Twist_::getCdrSerializedSize( + const Twist_& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += geometry_msgs::msg::dds_::Vector3_::getCdrSerializedSize(data.linear(), current_alignment); + + + current_alignment += geometry_msgs::msg::dds_::Vector3_::getCdrSerializedSize(data.angular(), current_alignment); + + + return current_alignment - initial_alignment; +} + + +void Twist_::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_linear; + + scdr << m_angular; + +} + +void Twist_::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_linear; + + + + dcdr >> m_angular; + + +} + + +bool Twist_::isKeyDefined() +{ + return false; +} + +void Twist_::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member linear + * @param _linear New value to be copied in member linear + */ +void Twist_::linear( + const geometry_msgs::msg::dds_::Vector3_& _linear) +{ + m_linear = _linear; +} + +/*! + * @brief This function moves the value in member linear + * @param _linear New value to be moved in member linear + */ +void Twist_::linear( + geometry_msgs::msg::dds_::Vector3_&& _linear) +{ + m_linear = std::move(_linear); +} + +/*! + * @brief This function returns a constant reference to member linear + * @return Constant reference to member linear + */ +const geometry_msgs::msg::dds_::Vector3_& Twist_::linear() const +{ + return m_linear; +} + +/*! + * @brief This function returns a reference to member linear + * @return Reference to member linear + */ +geometry_msgs::msg::dds_::Vector3_& Twist_::linear() +{ + return m_linear; +} + + +/*! + * @brief This function copies the value in member angular + * @param _angular New value to be copied in member angular + */ +void Twist_::angular( + const geometry_msgs::msg::dds_::Vector3_& _angular) +{ + m_angular = _angular; +} + +/*! + * @brief This function moves the value in member angular + * @param _angular New value to be moved in member angular + */ +void Twist_::angular( + geometry_msgs::msg::dds_::Vector3_&& _angular) +{ + m_angular = std::move(_angular); +} + +/*! + * @brief This function returns a constant reference to member angular + * @return Constant reference to member angular + */ +const geometry_msgs::msg::dds_::Vector3_& Twist_::angular() const +{ + return m_angular; +} + +/*! + * @brief This function returns a reference to member angular + * @return Reference to member angular + */ +geometry_msgs::msg::dds_::Vector3_& Twist_::angular() +{ + return m_angular; +} + + + + + +} // namespace dds_ + + +} // namespace msg + + +} // namespace geometry_msgs + diff --git a/mujoco/idl_gen/nav_msgs/Twist.h b/mujoco/idl_gen/nav_msgs/Twist.h new file mode 100644 index 0000000..64989d1 --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/Twist.h @@ -0,0 +1,252 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Twist.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWIST_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWIST_H_ + +#include "Vector3.h" + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(TWIST_SOURCE) +#define TWIST_DllAPI __declspec( dllexport ) +#else +#define TWIST_DllAPI __declspec( dllimport ) +#endif // TWIST_SOURCE +#else +#define TWIST_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define TWIST_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + +namespace geometry_msgs { + namespace msg { + namespace dds_ { + + + /*! + * @brief This class represents the structure Twist_ defined by the user in the IDL file. + * @ingroup Twist + */ + class Twist_ + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Twist_(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Twist_(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object geometry_msgs::msg::dds_::Twist_ that will be copied. + */ + eProsima_user_DllExport Twist_( + const Twist_& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object geometry_msgs::msg::dds_::Twist_ that will be copied. + */ + eProsima_user_DllExport Twist_( + Twist_&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object geometry_msgs::msg::dds_::Twist_ that will be copied. + */ + eProsima_user_DllExport Twist_& operator =( + const Twist_& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object geometry_msgs::msg::dds_::Twist_ that will be copied. + */ + eProsima_user_DllExport Twist_& operator =( + Twist_&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::dds_::Twist_ object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Twist_& x) const; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::dds_::Twist_ object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Twist_& x) const; + + /*! + * @brief This function copies the value in member linear + * @param _linear New value to be copied in member linear + */ + eProsima_user_DllExport void linear( + const geometry_msgs::msg::dds_::Vector3_& _linear); + + /*! + * @brief This function moves the value in member linear + * @param _linear New value to be moved in member linear + */ + eProsima_user_DllExport void linear( + geometry_msgs::msg::dds_::Vector3_&& _linear); + + /*! + * @brief This function returns a constant reference to member linear + * @return Constant reference to member linear + */ + eProsima_user_DllExport const geometry_msgs::msg::dds_::Vector3_& linear() const; + + /*! + * @brief This function returns a reference to member linear + * @return Reference to member linear + */ + eProsima_user_DllExport geometry_msgs::msg::dds_::Vector3_& linear(); + + + /*! + * @brief This function copies the value in member angular + * @param _angular New value to be copied in member angular + */ + eProsima_user_DllExport void angular( + const geometry_msgs::msg::dds_::Vector3_& _angular); + + /*! + * @brief This function moves the value in member angular + * @param _angular New value to be moved in member angular + */ + eProsima_user_DllExport void angular( + geometry_msgs::msg::dds_::Vector3_&& _angular); + + /*! + * @brief This function returns a constant reference to member angular + * @return Constant reference to member angular + */ + eProsima_user_DllExport const geometry_msgs::msg::dds_::Vector3_& angular() const; + + /*! + * @brief This function returns a reference to member angular + * @return Reference to member angular + */ + eProsima_user_DllExport geometry_msgs::msg::dds_::Vector3_& angular(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const geometry_msgs::msg::dds_::Twist_& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + geometry_msgs::msg::dds_::Vector3_ m_linear; + geometry_msgs::msg::dds_::Vector3_ m_angular; + + }; + + } // namespace dds_ + } // namespace msg +} // namespace geometry_msgs + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWIST_H_ + + + diff --git a/mujoco/idl_gen/nav_msgs/TwistCdrAux.hpp b/mujoco/idl_gen/nav_msgs/TwistCdrAux.hpp new file mode 100644 index 0000000..cff1e80 --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/TwistCdrAux.hpp @@ -0,0 +1,51 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TwistCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTCDRAUX_HPP_ + +#include "Twist.h" + +constexpr uint32_t geometry_msgs_msg_dds__Twist__max_cdr_typesize {48UL}; +constexpr uint32_t geometry_msgs_msg_dds__Twist__max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::Twist_& data); + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTCDRAUX_HPP_ + diff --git a/mujoco/idl_gen/nav_msgs/TwistCdrAux.ipp b/mujoco/idl_gen/nav_msgs/TwistCdrAux.ipp new file mode 100644 index 0000000..88c03d1 --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/TwistCdrAux.ipp @@ -0,0 +1,139 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TwistCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTCDRAUX_IPP_ + +#include "TwistCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const geometry_msgs::msg::dds_::Twist_& data, + size_t& current_alignment) +{ + using namespace geometry_msgs::msg::dds_; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.linear(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.angular(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::Twist_& data) +{ + using namespace geometry_msgs::msg::dds_; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.linear() + << eprosima::fastcdr::MemberId(1) << data.angular() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + geometry_msgs::msg::dds_::Twist_& data) +{ + using namespace geometry_msgs::msg::dds_; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.linear(); + break; + + case 1: + dcdr >> data.angular(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::Twist_& data) +{ + using namespace geometry_msgs::msg::dds_; + + static_cast(scdr); + static_cast(data); +} + + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTCDRAUX_IPP_ + diff --git a/mujoco/idl_gen/nav_msgs/TwistPubSubTypes.cxx b/mujoco/idl_gen/nav_msgs/TwistPubSubTypes.cxx new file mode 100644 index 0000000..71792a3 --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/TwistPubSubTypes.cxx @@ -0,0 +1,233 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TwistPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#include + +#include "TwistPubSubTypes.h" +#include "TwistCdrAux.hpp" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + +namespace geometry_msgs { + namespace msg { + namespace dds_ { + + + Twist_PubSubType::Twist_PubSubType() + { + setName("geometry_msgs::msg::dds_::Twist_"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(Twist_::getMaxCdrSerializedSize()); + #else + geometry_msgs_msg_dds__Twist__max_cdr_typesize; + #endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; + uint32_t keyLength = geometry_msgs_msg_dds__Twist__max_key_cdr_typesize > 16 ? geometry_msgs_msg_dds__Twist__max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + Twist_PubSubType::~Twist_PubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool Twist_PubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + Twist_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else + payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 + return true; + } + + bool Twist_PubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + Twist_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; + } + + std::function Twist_PubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) + { + return [data, data_representation]() -> uint32_t + { + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 + }; + } + + void* Twist_PubSubType::createData() + { + return reinterpret_cast(new Twist_()); + } + + void Twist_PubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool Twist_PubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + Twist_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + geometry_msgs_msg_dds__Twist__max_key_cdr_typesize); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else + eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 + if (force_md5 || geometry_msgs_msg_dds__Twist__max_key_cdr_typesize > 16) + { + m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace dds_ + + + } //End of namespace msg + + +} //End of namespace geometry_msgs + diff --git a/mujoco/idl_gen/nav_msgs/TwistPubSubTypes.h b/mujoco/idl_gen/nav_msgs/TwistPubSubTypes.h new file mode 100644 index 0000000..defb4e8 --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/TwistPubSubTypes.h @@ -0,0 +1,197 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TwistPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWIST_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWIST_PUBSUBTYPES_H_ + +#include +#include +#include +#include +#include + +#include "Twist.h" + +#include "Vector3PubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated Twist is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace geometry_msgs +{ + namespace msg + { + namespace dds_ + { + + + + #ifndef SWIG + namespace detail { + + template + struct Twist__rob + { + friend constexpr typename Tag::type get( + Tag) + { + return M; + } + + }; + + struct Twist__f + { + typedef geometry_msgs::msg::dds_::Vector3_ Twist_::* type; + friend constexpr type get( + Twist__f); + }; + + template struct Twist__rob; + + template + inline size_t constexpr Twist__offset_of() + { + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); + } + + } // namespace detail + #endif // ifndef SWIG + + + /*! + * @brief This class represents the TopicDataType of the type Twist_ defined by the user in the IDL file. + * @ingroup Twist + */ + class Twist_PubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef Twist_ type; + + eProsima_user_DllExport Twist_PubSubType(); + + eProsima_user_DllExport ~Twist_PubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return is_plain_xcdrv1_impl(); + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) + { + return is_plain_xcdrv2_impl(); + } + else + { + return is_plain_xcdrv1_impl(); + } + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) Twist_(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + private: + + static constexpr bool is_plain_xcdrv1_impl() + { + return 48ULL == + (detail::Twist__offset_of() + + sizeof(geometry_msgs::msg::dds_::Vector3_)); + } + + static constexpr bool is_plain_xcdrv2_impl() + { + return 48ULL == + (detail::Twist__offset_of() + + sizeof(geometry_msgs::msg::dds_::Vector3_)); + } + + }; + } + } +} + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWIST_PUBSUBTYPES_H_ + diff --git a/mujoco/idl_gen/nav_msgs/TwistWithCovariance.cxx b/mujoco/idl_gen/nav_msgs/TwistWithCovariance.cxx new file mode 100644 index 0000000..462570d --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/TwistWithCovariance.cxx @@ -0,0 +1,312 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TwistWithCovariance.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "TwistWithCovariance.h" + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define geometry_msgs_msg_dds__Vector3__max_cdr_typesize 24ULL; +#define geometry_msgs_msg_dds__TwistWithCovariance__max_cdr_typesize 336ULL; +#define geometry_msgs_msg_dds__Twist__max_cdr_typesize 48ULL; + + +namespace geometry_msgs { + +namespace msg { + +namespace dds_ { + + + +TwistWithCovariance_::TwistWithCovariance_() +{ + // geometry_msgs::msg::dds_::Twist_ m_twist + + // double m_covariance + memset(&m_covariance, 0, ((36)) * 8); + +} + +TwistWithCovariance_::~TwistWithCovariance_() +{ +} + +TwistWithCovariance_::TwistWithCovariance_( + const TwistWithCovariance_& x) +{ + m_twist = x.m_twist; + + + m_covariance = x.m_covariance; + +} + +TwistWithCovariance_::TwistWithCovariance_( + TwistWithCovariance_&& x) noexcept +{ + m_twist = std::move(x.m_twist); + + + m_covariance = std::move(x.m_covariance); + +} + +TwistWithCovariance_& TwistWithCovariance_::operator =( + const TwistWithCovariance_& x) +{ + m_twist = x.m_twist; + + + m_covariance = x.m_covariance; + + return *this; +} + +TwistWithCovariance_& TwistWithCovariance_::operator =( + TwistWithCovariance_&& x) noexcept +{ + m_twist = std::move(x.m_twist); + + + m_covariance = std::move(x.m_covariance); + + return *this; +} + +bool TwistWithCovariance_::operator ==( + const TwistWithCovariance_& x) const +{ + return (m_twist == x.m_twist && + m_covariance == x.m_covariance); +} + +bool TwistWithCovariance_::operator !=( + const TwistWithCovariance_& x) const +{ + return !(*this == x); +} + +size_t TwistWithCovariance_::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return geometry_msgs_msg_dds__TwistWithCovariance__max_cdr_typesize; +} + +size_t TwistWithCovariance_::getCdrSerializedSize( + const TwistWithCovariance_& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += geometry_msgs::msg::dds_::Twist_::getCdrSerializedSize(data.twist(), current_alignment); + + + current_alignment += (((36)) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + + return current_alignment - initial_alignment; +} + + +void TwistWithCovariance_::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_twist; + + scdr << m_covariance; + + +} + +void TwistWithCovariance_::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_twist; + + + + dcdr >> m_covariance; + + +} + + +bool TwistWithCovariance_::isKeyDefined() +{ + return false; +} + +void TwistWithCovariance_::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member twist + * @param _twist New value to be copied in member twist + */ +void TwistWithCovariance_::twist( + const geometry_msgs::msg::dds_::Twist_& _twist) +{ + m_twist = _twist; +} + +/*! + * @brief This function moves the value in member twist + * @param _twist New value to be moved in member twist + */ +void TwistWithCovariance_::twist( + geometry_msgs::msg::dds_::Twist_&& _twist) +{ + m_twist = std::move(_twist); +} + +/*! + * @brief This function returns a constant reference to member twist + * @return Constant reference to member twist + */ +const geometry_msgs::msg::dds_::Twist_& TwistWithCovariance_::twist() const +{ + return m_twist; +} + +/*! + * @brief This function returns a reference to member twist + * @return Reference to member twist + */ +geometry_msgs::msg::dds_::Twist_& TwistWithCovariance_::twist() +{ + return m_twist; +} + + +/*! + * @brief This function copies the value in member covariance + * @param _covariance New value to be copied in member covariance + */ +void TwistWithCovariance_::covariance( + const std::array& _covariance) +{ + m_covariance = _covariance; +} + +/*! + * @brief This function moves the value in member covariance + * @param _covariance New value to be moved in member covariance + */ +void TwistWithCovariance_::covariance( + std::array&& _covariance) +{ + m_covariance = std::move(_covariance); +} + +/*! + * @brief This function returns a constant reference to member covariance + * @return Constant reference to member covariance + */ +const std::array& TwistWithCovariance_::covariance() const +{ + return m_covariance; +} + +/*! + * @brief This function returns a reference to member covariance + * @return Reference to member covariance + */ +std::array& TwistWithCovariance_::covariance() +{ + return m_covariance; +} + + + + + +} // namespace dds_ + + +} // namespace msg + + +} // namespace geometry_msgs + diff --git a/mujoco/idl_gen/nav_msgs/TwistWithCovariance.h b/mujoco/idl_gen/nav_msgs/TwistWithCovariance.h new file mode 100644 index 0000000..e263013 --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/TwistWithCovariance.h @@ -0,0 +1,252 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TwistWithCovariance.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCE_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCE_H_ + +#include "Twist.h" + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(TWISTWITHCOVARIANCE_SOURCE) +#define TWISTWITHCOVARIANCE_DllAPI __declspec( dllexport ) +#else +#define TWISTWITHCOVARIANCE_DllAPI __declspec( dllimport ) +#endif // TWISTWITHCOVARIANCE_SOURCE +#else +#define TWISTWITHCOVARIANCE_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define TWISTWITHCOVARIANCE_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + +namespace geometry_msgs { + namespace msg { + namespace dds_ { + + + /*! + * @brief This class represents the structure TwistWithCovariance_ defined by the user in the IDL file. + * @ingroup TwistWithCovariance + */ + class TwistWithCovariance_ + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport TwistWithCovariance_(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~TwistWithCovariance_(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object geometry_msgs::msg::dds_::TwistWithCovariance_ that will be copied. + */ + eProsima_user_DllExport TwistWithCovariance_( + const TwistWithCovariance_& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object geometry_msgs::msg::dds_::TwistWithCovariance_ that will be copied. + */ + eProsima_user_DllExport TwistWithCovariance_( + TwistWithCovariance_&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object geometry_msgs::msg::dds_::TwistWithCovariance_ that will be copied. + */ + eProsima_user_DllExport TwistWithCovariance_& operator =( + const TwistWithCovariance_& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object geometry_msgs::msg::dds_::TwistWithCovariance_ that will be copied. + */ + eProsima_user_DllExport TwistWithCovariance_& operator =( + TwistWithCovariance_&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::dds_::TwistWithCovariance_ object to compare. + */ + eProsima_user_DllExport bool operator ==( + const TwistWithCovariance_& x) const; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::dds_::TwistWithCovariance_ object to compare. + */ + eProsima_user_DllExport bool operator !=( + const TwistWithCovariance_& x) const; + + /*! + * @brief This function copies the value in member twist + * @param _twist New value to be copied in member twist + */ + eProsima_user_DllExport void twist( + const geometry_msgs::msg::dds_::Twist_& _twist); + + /*! + * @brief This function moves the value in member twist + * @param _twist New value to be moved in member twist + */ + eProsima_user_DllExport void twist( + geometry_msgs::msg::dds_::Twist_&& _twist); + + /*! + * @brief This function returns a constant reference to member twist + * @return Constant reference to member twist + */ + eProsima_user_DllExport const geometry_msgs::msg::dds_::Twist_& twist() const; + + /*! + * @brief This function returns a reference to member twist + * @return Reference to member twist + */ + eProsima_user_DllExport geometry_msgs::msg::dds_::Twist_& twist(); + + + /*! + * @brief This function copies the value in member covariance + * @param _covariance New value to be copied in member covariance + */ + eProsima_user_DllExport void covariance( + const std::array& _covariance); + + /*! + * @brief This function moves the value in member covariance + * @param _covariance New value to be moved in member covariance + */ + eProsima_user_DllExport void covariance( + std::array&& _covariance); + + /*! + * @brief This function returns a constant reference to member covariance + * @return Constant reference to member covariance + */ + eProsima_user_DllExport const std::array& covariance() const; + + /*! + * @brief This function returns a reference to member covariance + * @return Reference to member covariance + */ + eProsima_user_DllExport std::array& covariance(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const geometry_msgs::msg::dds_::TwistWithCovariance_& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + geometry_msgs::msg::dds_::Twist_ m_twist; + std::array m_covariance; + + }; + + } // namespace dds_ + } // namespace msg +} // namespace geometry_msgs + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCE_H_ + + + diff --git a/mujoco/idl_gen/nav_msgs/TwistWithCovarianceCdrAux.hpp b/mujoco/idl_gen/nav_msgs/TwistWithCovarianceCdrAux.hpp new file mode 100644 index 0000000..297ad3b --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/TwistWithCovarianceCdrAux.hpp @@ -0,0 +1,52 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TwistWithCovarianceCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCECDRAUX_HPP_ + +#include "TwistWithCovariance.h" + +constexpr uint32_t geometry_msgs_msg_dds__TwistWithCovariance__max_cdr_typesize {336UL}; +constexpr uint32_t geometry_msgs_msg_dds__TwistWithCovariance__max_key_cdr_typesize {0UL}; + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::TwistWithCovariance_& data); + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCECDRAUX_HPP_ + diff --git a/mujoco/idl_gen/nav_msgs/TwistWithCovarianceCdrAux.ipp b/mujoco/idl_gen/nav_msgs/TwistWithCovarianceCdrAux.ipp new file mode 100644 index 0000000..a3fc729 --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/TwistWithCovarianceCdrAux.ipp @@ -0,0 +1,139 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TwistWithCovarianceCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCECDRAUX_IPP_ + +#include "TwistWithCovarianceCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const geometry_msgs::msg::dds_::TwistWithCovariance_& data, + size_t& current_alignment) +{ + using namespace geometry_msgs::msg::dds_; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.twist(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.covariance(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::TwistWithCovariance_& data) +{ + using namespace geometry_msgs::msg::dds_; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.twist() + << eprosima::fastcdr::MemberId(1) << data.covariance() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + geometry_msgs::msg::dds_::TwistWithCovariance_& data) +{ + using namespace geometry_msgs::msg::dds_; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.twist(); + break; + + case 1: + dcdr >> data.covariance(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::TwistWithCovariance_& data) +{ + using namespace geometry_msgs::msg::dds_; + + static_cast(scdr); + static_cast(data); +} + + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCECDRAUX_IPP_ + diff --git a/mujoco/idl_gen/nav_msgs/TwistWithCovariancePubSubTypes.cxx b/mujoco/idl_gen/nav_msgs/TwistWithCovariancePubSubTypes.cxx new file mode 100644 index 0000000..4c24e80 --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/TwistWithCovariancePubSubTypes.cxx @@ -0,0 +1,233 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TwistWithCovariancePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#include + +#include "TwistWithCovariancePubSubTypes.h" +#include "TwistWithCovarianceCdrAux.hpp" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + +namespace geometry_msgs { + namespace msg { + namespace dds_ { + + + TwistWithCovariance_PubSubType::TwistWithCovariance_PubSubType() + { + setName("geometry_msgs::msg::dds_::TwistWithCovariance_"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(TwistWithCovariance_::getMaxCdrSerializedSize()); + #else + geometry_msgs_msg_dds__TwistWithCovariance__max_cdr_typesize; + #endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; + uint32_t keyLength = geometry_msgs_msg_dds__TwistWithCovariance__max_key_cdr_typesize > 16 ? geometry_msgs_msg_dds__TwistWithCovariance__max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + TwistWithCovariance_PubSubType::~TwistWithCovariance_PubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool TwistWithCovariance_PubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + TwistWithCovariance_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else + payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 + return true; + } + + bool TwistWithCovariance_PubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + TwistWithCovariance_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; + } + + std::function TwistWithCovariance_PubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) + { + return [data, data_representation]() -> uint32_t + { + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 + }; + } + + void* TwistWithCovariance_PubSubType::createData() + { + return reinterpret_cast(new TwistWithCovariance_()); + } + + void TwistWithCovariance_PubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool TwistWithCovariance_PubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + TwistWithCovariance_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + geometry_msgs_msg_dds__TwistWithCovariance__max_key_cdr_typesize); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else + eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 + if (force_md5 || geometry_msgs_msg_dds__TwistWithCovariance__max_key_cdr_typesize > 16) + { + m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace dds_ + + + } //End of namespace msg + + +} //End of namespace geometry_msgs + diff --git a/mujoco/idl_gen/nav_msgs/TwistWithCovariancePubSubTypes.h b/mujoco/idl_gen/nav_msgs/TwistWithCovariancePubSubTypes.h new file mode 100644 index 0000000..5302fbd --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/TwistWithCovariancePubSubTypes.h @@ -0,0 +1,197 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TwistWithCovariancePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCE_PUBSUBTYPES_H_ + +#include +#include +#include +#include +#include + +#include "TwistWithCovariance.h" + +#include "TwistPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated TwistWithCovariance is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace geometry_msgs +{ + namespace msg + { + namespace dds_ + { + + + + #ifndef SWIG + namespace detail { + + template + struct TwistWithCovariance__rob + { + friend constexpr typename Tag::type get( + Tag) + { + return M; + } + + }; + + struct TwistWithCovariance__f + { + typedef std::array TwistWithCovariance_::* type; + friend constexpr type get( + TwistWithCovariance__f); + }; + + template struct TwistWithCovariance__rob; + + template + inline size_t constexpr TwistWithCovariance__offset_of() + { + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); + } + + } // namespace detail + #endif // ifndef SWIG + + + /*! + * @brief This class represents the TopicDataType of the type TwistWithCovariance_ defined by the user in the IDL file. + * @ingroup TwistWithCovariance + */ + class TwistWithCovariance_PubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef TwistWithCovariance_ type; + + eProsima_user_DllExport TwistWithCovariance_PubSubType(); + + eProsima_user_DllExport ~TwistWithCovariance_PubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return is_plain_xcdrv1_impl(); + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) + { + return is_plain_xcdrv2_impl(); + } + else + { + return is_plain_xcdrv1_impl(); + } + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) TwistWithCovariance_(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + private: + + static constexpr bool is_plain_xcdrv1_impl() + { + return 336ULL == + (detail::TwistWithCovariance__offset_of() + + sizeof(std::array)); + } + + static constexpr bool is_plain_xcdrv2_impl() + { + return 336ULL == + (detail::TwistWithCovariance__offset_of() + + sizeof(std::array)); + } + + }; + } + } +} + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCE_PUBSUBTYPES_H_ + diff --git a/mujoco/idl_gen/nav_msgs/Vector3.cxx b/mujoco/idl_gen/nav_msgs/Vector3.cxx new file mode 100644 index 0000000..b9f24b9 --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/Vector3.cxx @@ -0,0 +1,341 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Vector3.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "Vector3.h" + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define geometry_msgs_msg_dds__Vector3__max_cdr_typesize 24ULL; + + +namespace geometry_msgs { + +namespace msg { + +namespace dds_ { + + + +Vector3_::Vector3_() +{ + // double m_x + m_x = 0.0; + // double m_y + m_y = 0.0; + // double m_z + m_z = 0.0; + +} + +Vector3_::~Vector3_() +{ +} + +Vector3_::Vector3_( + const Vector3_& x) +{ + m_x = x.m_x; + + + m_y = x.m_y; + + + m_z = x.m_z; + +} + +Vector3_::Vector3_( + Vector3_&& x) noexcept +{ + m_x = x.m_x; + + + m_y = x.m_y; + + + m_z = x.m_z; + +} + +Vector3_& Vector3_::operator =( + const Vector3_& x) +{ + m_x = x.m_x; + + + m_y = x.m_y; + + + m_z = x.m_z; + + return *this; +} + +Vector3_& Vector3_::operator =( + Vector3_&& x) noexcept +{ + m_x = x.m_x; + + + m_y = x.m_y; + + + m_z = x.m_z; + + return *this; +} + +bool Vector3_::operator ==( + const Vector3_& x) const +{ + return (m_x == x.m_x && + m_y == x.m_y && + m_z == x.m_z); +} + +bool Vector3_::operator !=( + const Vector3_& x) const +{ + return !(*this == x); +} + +size_t Vector3_::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return geometry_msgs_msg_dds__Vector3__max_cdr_typesize; +} + +size_t Vector3_::getCdrSerializedSize( + const Vector3_& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + return current_alignment - initial_alignment; +} + + +void Vector3_::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_x; + + scdr << m_y; + + scdr << m_z; + +} + +void Vector3_::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_x; + + + + dcdr >> m_y; + + + + dcdr >> m_z; + + +} + + +bool Vector3_::isKeyDefined() +{ + return false; +} + +void Vector3_::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member x + * @param _x New value for member x + */ +void Vector3_::x( + double _x) +{ + m_x = _x; +} + +/*! + * @brief This function returns the value of member x + * @return Value of member x + */ +double Vector3_::x() const +{ + return m_x; +} + +/*! + * @brief This function returns a reference to member x + * @return Reference to member x + */ +double& Vector3_::x() +{ + return m_x; +} + + +/*! + * @brief This function sets a value in member y + * @param _y New value for member y + */ +void Vector3_::y( + double _y) +{ + m_y = _y; +} + +/*! + * @brief This function returns the value of member y + * @return Value of member y + */ +double Vector3_::y() const +{ + return m_y; +} + +/*! + * @brief This function returns a reference to member y + * @return Reference to member y + */ +double& Vector3_::y() +{ + return m_y; +} + + +/*! + * @brief This function sets a value in member z + * @param _z New value for member z + */ +void Vector3_::z( + double _z) +{ + m_z = _z; +} + +/*! + * @brief This function returns the value of member z + * @return Value of member z + */ +double Vector3_::z() const +{ + return m_z; +} + +/*! + * @brief This function returns a reference to member z + * @return Reference to member z + */ +double& Vector3_::z() +{ + return m_z; +} + + + + + +} // namespace dds_ + + +} // namespace msg + + +} // namespace geometry_msgs + diff --git a/mujoco/idl_gen/nav_msgs/Vector3.h b/mujoco/idl_gen/nav_msgs/Vector3.h new file mode 100644 index 0000000..98a76cf --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/Vector3.h @@ -0,0 +1,258 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Vector3.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(VECTOR3_SOURCE) +#define VECTOR3_DllAPI __declspec( dllexport ) +#else +#define VECTOR3_DllAPI __declspec( dllimport ) +#endif // VECTOR3_SOURCE +#else +#define VECTOR3_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define VECTOR3_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + +namespace geometry_msgs { + namespace msg { + namespace dds_ { + + + /*! + * @brief This class represents the structure Vector3_ defined by the user in the IDL file. + * @ingroup Vector3 + */ + class Vector3_ + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Vector3_(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Vector3_(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object geometry_msgs::msg::dds_::Vector3_ that will be copied. + */ + eProsima_user_DllExport Vector3_( + const Vector3_& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object geometry_msgs::msg::dds_::Vector3_ that will be copied. + */ + eProsima_user_DllExport Vector3_( + Vector3_&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object geometry_msgs::msg::dds_::Vector3_ that will be copied. + */ + eProsima_user_DllExport Vector3_& operator =( + const Vector3_& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object geometry_msgs::msg::dds_::Vector3_ that will be copied. + */ + eProsima_user_DllExport Vector3_& operator =( + Vector3_&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::dds_::Vector3_ object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Vector3_& x) const; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::dds_::Vector3_ object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Vector3_& x) const; + + /*! + * @brief This function sets a value in member x + * @param _x New value for member x + */ + eProsima_user_DllExport void x( + double _x); + + /*! + * @brief This function returns the value of member x + * @return Value of member x + */ + eProsima_user_DllExport double x() const; + + /*! + * @brief This function returns a reference to member x + * @return Reference to member x + */ + eProsima_user_DllExport double& x(); + + + /*! + * @brief This function sets a value in member y + * @param _y New value for member y + */ + eProsima_user_DllExport void y( + double _y); + + /*! + * @brief This function returns the value of member y + * @return Value of member y + */ + eProsima_user_DllExport double y() const; + + /*! + * @brief This function returns a reference to member y + * @return Reference to member y + */ + eProsima_user_DllExport double& y(); + + + /*! + * @brief This function sets a value in member z + * @param _z New value for member z + */ + eProsima_user_DllExport void z( + double _z); + + /*! + * @brief This function returns the value of member z + * @return Value of member z + */ + eProsima_user_DllExport double z() const; + + /*! + * @brief This function returns a reference to member z + * @return Reference to member z + */ + eProsima_user_DllExport double& z(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const geometry_msgs::msg::dds_::Vector3_& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + double m_x; + double m_y; + double m_z; + + }; + + } // namespace dds_ + } // namespace msg +} // namespace geometry_msgs + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3_H_ + + + diff --git a/mujoco/idl_gen/nav_msgs/Vector3CdrAux.hpp b/mujoco/idl_gen/nav_msgs/Vector3CdrAux.hpp new file mode 100644 index 0000000..cf1af8c --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/Vector3CdrAux.hpp @@ -0,0 +1,51 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Vector3CdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3CDRAUX_HPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3CDRAUX_HPP_ + +#include "Vector3.h" + +constexpr uint32_t geometry_msgs_msg_dds__Vector3__max_cdr_typesize {24UL}; +constexpr uint32_t geometry_msgs_msg_dds__Vector3__max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::Vector3_& data); + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3CDRAUX_HPP_ + diff --git a/mujoco/idl_gen/nav_msgs/Vector3CdrAux.ipp b/mujoco/idl_gen/nav_msgs/Vector3CdrAux.ipp new file mode 100644 index 0000000..9bf2b9a --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/Vector3CdrAux.ipp @@ -0,0 +1,147 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Vector3CdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3CDRAUX_IPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3CDRAUX_IPP_ + +#include "Vector3CdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const geometry_msgs::msg::dds_::Vector3_& data, + size_t& current_alignment) +{ + using namespace geometry_msgs::msg::dds_; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.x(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.y(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.z(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::Vector3_& data) +{ + using namespace geometry_msgs::msg::dds_; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.x() + << eprosima::fastcdr::MemberId(1) << data.y() + << eprosima::fastcdr::MemberId(2) << data.z() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + geometry_msgs::msg::dds_::Vector3_& data) +{ + using namespace geometry_msgs::msg::dds_; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.x(); + break; + + case 1: + dcdr >> data.y(); + break; + + case 2: + dcdr >> data.z(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::dds_::Vector3_& data) +{ + using namespace geometry_msgs::msg::dds_; + + static_cast(scdr); + static_cast(data); +} + + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3CDRAUX_IPP_ + diff --git a/mujoco/idl_gen/nav_msgs/Vector3PubSubTypes.cxx b/mujoco/idl_gen/nav_msgs/Vector3PubSubTypes.cxx new file mode 100644 index 0000000..a8a59b9 --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/Vector3PubSubTypes.cxx @@ -0,0 +1,233 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Vector3PubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#include + +#include "Vector3PubSubTypes.h" +#include "Vector3CdrAux.hpp" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + +namespace geometry_msgs { + namespace msg { + namespace dds_ { + + + Vector3_PubSubType::Vector3_PubSubType() + { + setName("geometry_msgs::msg::dds_::Vector3_"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(Vector3_::getMaxCdrSerializedSize()); + #else + geometry_msgs_msg_dds__Vector3__max_cdr_typesize; + #endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; + uint32_t keyLength = geometry_msgs_msg_dds__Vector3__max_key_cdr_typesize > 16 ? geometry_msgs_msg_dds__Vector3__max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + Vector3_PubSubType::~Vector3_PubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool Vector3_PubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + Vector3_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else + payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 + return true; + } + + bool Vector3_PubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + Vector3_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; + } + + std::function Vector3_PubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) + { + return [data, data_representation]() -> uint32_t + { + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 + }; + } + + void* Vector3_PubSubType::createData() + { + return reinterpret_cast(new Vector3_()); + } + + void Vector3_PubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool Vector3_PubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + Vector3_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + geometry_msgs_msg_dds__Vector3__max_key_cdr_typesize); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else + eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 + if (force_md5 || geometry_msgs_msg_dds__Vector3__max_key_cdr_typesize > 16) + { + m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace dds_ + + + } //End of namespace msg + + +} //End of namespace geometry_msgs + diff --git a/mujoco/idl_gen/nav_msgs/Vector3PubSubTypes.h b/mujoco/idl_gen/nav_msgs/Vector3PubSubTypes.h new file mode 100644 index 0000000..a7045eb --- /dev/null +++ b/mujoco/idl_gen/nav_msgs/Vector3PubSubTypes.h @@ -0,0 +1,196 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Vector3PubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3_PUBSUBTYPES_H_ + +#include +#include +#include +#include +#include + +#include "Vector3.h" + + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated Vector3 is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace geometry_msgs +{ + namespace msg + { + namespace dds_ + { + + + + #ifndef SWIG + namespace detail { + + template + struct Vector3__rob + { + friend constexpr typename Tag::type get( + Tag) + { + return M; + } + + }; + + struct Vector3__f + { + typedef double Vector3_::* type; + friend constexpr type get( + Vector3__f); + }; + + template struct Vector3__rob; + + template + inline size_t constexpr Vector3__offset_of() + { + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); + } + + } // namespace detail + #endif // ifndef SWIG + + + /*! + * @brief This class represents the TopicDataType of the type Vector3_ defined by the user in the IDL file. + * @ingroup Vector3 + */ + class Vector3_PubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef Vector3_ type; + + eProsima_user_DllExport Vector3_PubSubType(); + + eProsima_user_DllExport ~Vector3_PubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return is_plain_xcdrv1_impl(); + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) + { + return is_plain_xcdrv2_impl(); + } + else + { + return is_plain_xcdrv1_impl(); + } + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) Vector3_(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + private: + + static constexpr bool is_plain_xcdrv1_impl() + { + return 24ULL == + (detail::Vector3__offset_of() + + sizeof(double)); + } + + static constexpr bool is_plain_xcdrv2_impl() + { + return 24ULL == + (detail::Vector3__offset_of() + + sizeof(double)); + } + + }; + } + } +} + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3_PUBSUBTYPES_H_ + diff --git a/mujoco/idl_gen/std_msgs/Header.cxx b/mujoco/idl_gen/std_msgs/Header.cxx new file mode 100644 index 0000000..fc56cc5 --- /dev/null +++ b/mujoco/idl_gen/std_msgs/Header.cxx @@ -0,0 +1,309 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Header.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "Header.h" + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define builtin_interfaces_msg_dds__Time__max_cdr_typesize 8ULL; +#define std_msgs_msg_dds__Header__max_cdr_typesize 268ULL; + + +namespace std_msgs { + +namespace msg { + +namespace dds_ { + + + +Header_::Header_() +{ + // builtin_interfaces::msg::dds_::Time_ m_stamp + + // /type_d() m_frame_id + + +} + +Header_::~Header_() +{ +} + +Header_::Header_( + const Header_& x) +{ + m_stamp = x.m_stamp; + + + m_frame_id = x.m_frame_id; + +} + +Header_::Header_( + Header_&& x) noexcept +{ + m_stamp = std::move(x.m_stamp); + + + m_frame_id = std::move(x.m_frame_id); + +} + +Header_& Header_::operator =( + const Header_& x) +{ + m_stamp = x.m_stamp; + + + m_frame_id = x.m_frame_id; + + return *this; +} + +Header_& Header_::operator =( + Header_&& x) noexcept +{ + m_stamp = std::move(x.m_stamp); + + + m_frame_id = std::move(x.m_frame_id); + + return *this; +} + +bool Header_::operator ==( + const Header_& x) const +{ + return (m_stamp == x.m_stamp && + m_frame_id == x.m_frame_id); +} + +bool Header_::operator !=( + const Header_& x) const +{ + return !(*this == x); +} + +size_t Header_::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return std_msgs_msg_dds__Header__max_cdr_typesize; +} + +size_t Header_::getCdrSerializedSize( + const Header_& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += builtin_interfaces::msg::dds_::Time_::getCdrSerializedSize(data.stamp(), current_alignment); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.frame_id().size() + 1; + + + return current_alignment - initial_alignment; +} + + +void Header_::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_stamp; + + scdr << m_frame_id.c_str(); + +} + +void Header_::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_stamp; + + + + dcdr >> m_frame_id; + + +} + + +bool Header_::isKeyDefined() +{ + return false; +} + +void Header_::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member stamp + * @param _stamp New value to be copied in member stamp + */ +void Header_::stamp( + const builtin_interfaces::msg::dds_::Time_& _stamp) +{ + m_stamp = _stamp; +} + +/*! + * @brief This function moves the value in member stamp + * @param _stamp New value to be moved in member stamp + */ +void Header_::stamp( + builtin_interfaces::msg::dds_::Time_&& _stamp) +{ + m_stamp = std::move(_stamp); +} + +/*! + * @brief This function returns a constant reference to member stamp + * @return Constant reference to member stamp + */ +const builtin_interfaces::msg::dds_::Time_& Header_::stamp() const +{ + return m_stamp; +} + +/*! + * @brief This function returns a reference to member stamp + * @return Reference to member stamp + */ +builtin_interfaces::msg::dds_::Time_& Header_::stamp() +{ + return m_stamp; +} + + +/*! + * @brief This function copies the value in member frame_id + * @param _frame_id New value to be copied in member frame_id + */ +void Header_::frame_id( + const std::string& _frame_id) +{ + m_frame_id = _frame_id; +} + +/*! + * @brief This function moves the value in member frame_id + * @param _frame_id New value to be moved in member frame_id + */ +void Header_::frame_id( + std::string&& _frame_id) +{ + m_frame_id = std::move(_frame_id); +} + +/*! + * @brief This function returns a constant reference to member frame_id + * @return Constant reference to member frame_id + */ +const std::string& Header_::frame_id() const +{ + return m_frame_id; +} + +/*! + * @brief This function returns a reference to member frame_id + * @return Reference to member frame_id + */ +std::string& Header_::frame_id() +{ + return m_frame_id; +} + + + + + +} // namespace dds_ + + +} // namespace msg + + +} // namespace std_msgs + diff --git a/mujoco/idl_gen/std_msgs/Header.h b/mujoco/idl_gen/std_msgs/Header.h new file mode 100644 index 0000000..91bdf94 --- /dev/null +++ b/mujoco/idl_gen/std_msgs/Header.h @@ -0,0 +1,252 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Header.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADER_H_ +#define _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADER_H_ + +#include "Time.h" + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(HEADER_SOURCE) +#define HEADER_DllAPI __declspec( dllexport ) +#else +#define HEADER_DllAPI __declspec( dllimport ) +#endif // HEADER_SOURCE +#else +#define HEADER_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define HEADER_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + +namespace std_msgs { + namespace msg { + namespace dds_ { + + + /*! + * @brief This class represents the structure Header_ defined by the user in the IDL file. + * @ingroup Header + */ + class Header_ + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Header_(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Header_(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object std_msgs::msg::dds_::Header_ that will be copied. + */ + eProsima_user_DllExport Header_( + const Header_& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object std_msgs::msg::dds_::Header_ that will be copied. + */ + eProsima_user_DllExport Header_( + Header_&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object std_msgs::msg::dds_::Header_ that will be copied. + */ + eProsima_user_DllExport Header_& operator =( + const Header_& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object std_msgs::msg::dds_::Header_ that will be copied. + */ + eProsima_user_DllExport Header_& operator =( + Header_&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x std_msgs::msg::dds_::Header_ object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Header_& x) const; + + /*! + * @brief Comparison operator. + * @param x std_msgs::msg::dds_::Header_ object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Header_& x) const; + + /*! + * @brief This function copies the value in member stamp + * @param _stamp New value to be copied in member stamp + */ + eProsima_user_DllExport void stamp( + const builtin_interfaces::msg::dds_::Time_& _stamp); + + /*! + * @brief This function moves the value in member stamp + * @param _stamp New value to be moved in member stamp + */ + eProsima_user_DllExport void stamp( + builtin_interfaces::msg::dds_::Time_&& _stamp); + + /*! + * @brief This function returns a constant reference to member stamp + * @return Constant reference to member stamp + */ + eProsima_user_DllExport const builtin_interfaces::msg::dds_::Time_& stamp() const; + + /*! + * @brief This function returns a reference to member stamp + * @return Reference to member stamp + */ + eProsima_user_DllExport builtin_interfaces::msg::dds_::Time_& stamp(); + + + /*! + * @brief This function copies the value in member frame_id + * @param _frame_id New value to be copied in member frame_id + */ + eProsima_user_DllExport void frame_id( + const std::string& _frame_id); + + /*! + * @brief This function moves the value in member frame_id + * @param _frame_id New value to be moved in member frame_id + */ + eProsima_user_DllExport void frame_id( + std::string&& _frame_id); + + /*! + * @brief This function returns a constant reference to member frame_id + * @return Constant reference to member frame_id + */ + eProsima_user_DllExport const std::string& frame_id() const; + + /*! + * @brief This function returns a reference to member frame_id + * @return Reference to member frame_id + */ + eProsima_user_DllExport std::string& frame_id(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const std_msgs::msg::dds_::Header_& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + builtin_interfaces::msg::dds_::Time_ m_stamp; + std::string m_frame_id; + + }; + + } // namespace dds_ + } // namespace msg +} // namespace std_msgs + +#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADER_H_ + + + diff --git a/mujoco/idl_gen/std_msgs/HeaderCdrAux.hpp b/mujoco/idl_gen/std_msgs/HeaderCdrAux.hpp new file mode 100644 index 0000000..f7fed1f --- /dev/null +++ b/mujoco/idl_gen/std_msgs/HeaderCdrAux.hpp @@ -0,0 +1,51 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HeaderCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADERCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADERCDRAUX_HPP_ + +#include "Header.h" + +constexpr uint32_t std_msgs_msg_dds__Header__max_cdr_typesize {268UL}; +constexpr uint32_t std_msgs_msg_dds__Header__max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const std_msgs::msg::dds_::Header_& data); + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADERCDRAUX_HPP_ + diff --git a/mujoco/idl_gen/std_msgs/HeaderCdrAux.ipp b/mujoco/idl_gen/std_msgs/HeaderCdrAux.ipp new file mode 100644 index 0000000..628d73f --- /dev/null +++ b/mujoco/idl_gen/std_msgs/HeaderCdrAux.ipp @@ -0,0 +1,139 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HeaderCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADERCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADERCDRAUX_IPP_ + +#include "HeaderCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const std_msgs::msg::dds_::Header_& data, + size_t& current_alignment) +{ + using namespace std_msgs::msg::dds_; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.stamp(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.frame_id(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const std_msgs::msg::dds_::Header_& data) +{ + using namespace std_msgs::msg::dds_; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.stamp() + << eprosima::fastcdr::MemberId(1) << data.frame_id() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + std_msgs::msg::dds_::Header_& data) +{ + using namespace std_msgs::msg::dds_; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.stamp(); + break; + + case 1: + dcdr >> data.frame_id(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const std_msgs::msg::dds_::Header_& data) +{ + using namespace std_msgs::msg::dds_; + + static_cast(scdr); + static_cast(data); +} + + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADERCDRAUX_IPP_ + diff --git a/mujoco/idl_gen/std_msgs/HeaderPubSubTypes.cxx b/mujoco/idl_gen/std_msgs/HeaderPubSubTypes.cxx new file mode 100644 index 0000000..6c6cfb4 --- /dev/null +++ b/mujoco/idl_gen/std_msgs/HeaderPubSubTypes.cxx @@ -0,0 +1,233 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HeaderPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#include + +#include "HeaderPubSubTypes.h" +#include "HeaderCdrAux.hpp" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + +namespace std_msgs { + namespace msg { + namespace dds_ { + + + Header_PubSubType::Header_PubSubType() + { + setName("std_msgs::msg::dds_::Header_"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(Header_::getMaxCdrSerializedSize()); + #else + std_msgs_msg_dds__Header__max_cdr_typesize; + #endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; + uint32_t keyLength = std_msgs_msg_dds__Header__max_key_cdr_typesize > 16 ? std_msgs_msg_dds__Header__max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + Header_PubSubType::~Header_PubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool Header_PubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + Header_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else + payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 + return true; + } + + bool Header_PubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + Header_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; + } + + std::function Header_PubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) + { + return [data, data_representation]() -> uint32_t + { + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 + }; + } + + void* Header_PubSubType::createData() + { + return reinterpret_cast(new Header_()); + } + + void Header_PubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool Header_PubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + Header_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + std_msgs_msg_dds__Header__max_key_cdr_typesize); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else + eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 + if (force_md5 || std_msgs_msg_dds__Header__max_key_cdr_typesize > 16) + { + m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace dds_ + + + } //End of namespace msg + + +} //End of namespace std_msgs + diff --git a/mujoco/idl_gen/std_msgs/HeaderPubSubTypes.h b/mujoco/idl_gen/std_msgs/HeaderPubSubTypes.h new file mode 100644 index 0000000..20f2d28 --- /dev/null +++ b/mujoco/idl_gen/std_msgs/HeaderPubSubTypes.h @@ -0,0 +1,142 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HeaderPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADER_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADER_PUBSUBTYPES_H_ + +#include +#include +#include +#include +#include + +#include "Header.h" + +#include "TimePubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated Header is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace std_msgs +{ + namespace msg + { + namespace dds_ + { + + + + /*! + * @brief This class represents the TopicDataType of the type Header_ defined by the user in the IDL file. + * @ingroup Header + */ + class Header_PubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef Header_ type; + + eProsima_user_DllExport Header_PubSubType(); + + eProsima_user_DllExport ~Header_PubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + }; + } + } +} + +#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADER_PUBSUBTYPES_H_ + diff --git a/mujoco/idl_gen/std_msgs/Time.cxx b/mujoco/idl_gen/std_msgs/Time.cxx new file mode 100644 index 0000000..7766fbe --- /dev/null +++ b/mujoco/idl_gen/std_msgs/Time.cxx @@ -0,0 +1,288 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Time.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "Time.h" + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define builtin_interfaces_msg_dds__Time__max_cdr_typesize 8ULL; + + +namespace builtin_interfaces { + +namespace msg { + +namespace dds_ { + + + +Time_::Time_() +{ + // long m_sec + m_sec = 0; + // unsigned long m_nanosec + m_nanosec = 0; + +} + +Time_::~Time_() +{ +} + +Time_::Time_( + const Time_& x) +{ + m_sec = x.m_sec; + + + m_nanosec = x.m_nanosec; + +} + +Time_::Time_( + Time_&& x) noexcept +{ + m_sec = x.m_sec; + + + m_nanosec = x.m_nanosec; + +} + +Time_& Time_::operator =( + const Time_& x) +{ + m_sec = x.m_sec; + + + m_nanosec = x.m_nanosec; + + return *this; +} + +Time_& Time_::operator =( + Time_&& x) noexcept +{ + m_sec = x.m_sec; + + + m_nanosec = x.m_nanosec; + + return *this; +} + +bool Time_::operator ==( + const Time_& x) const +{ + return (m_sec == x.m_sec && + m_nanosec == x.m_nanosec); +} + +bool Time_::operator !=( + const Time_& x) const +{ + return !(*this == x); +} + +size_t Time_::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return builtin_interfaces_msg_dds__Time__max_cdr_typesize; +} + +size_t Time_::getCdrSerializedSize( + const Time_& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + + +void Time_::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_sec; + + scdr << m_nanosec; + +} + +void Time_::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_sec; + + + + dcdr >> m_nanosec; + + +} + + +bool Time_::isKeyDefined() +{ + return false; +} + +void Time_::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member sec + * @param _sec New value for member sec + */ +void Time_::sec( + int32_t _sec) +{ + m_sec = _sec; +} + +/*! + * @brief This function returns the value of member sec + * @return Value of member sec + */ +int32_t Time_::sec() const +{ + return m_sec; +} + +/*! + * @brief This function returns a reference to member sec + * @return Reference to member sec + */ +int32_t& Time_::sec() +{ + return m_sec; +} + + +/*! + * @brief This function sets a value in member nanosec + * @param _nanosec New value for member nanosec + */ +void Time_::nanosec( + uint32_t _nanosec) +{ + m_nanosec = _nanosec; +} + +/*! + * @brief This function returns the value of member nanosec + * @return Value of member nanosec + */ +uint32_t Time_::nanosec() const +{ + return m_nanosec; +} + +/*! + * @brief This function returns a reference to member nanosec + * @return Reference to member nanosec + */ +uint32_t& Time_::nanosec() +{ + return m_nanosec; +} + + + + + +} // namespace dds_ + + +} // namespace msg + + +} // namespace builtin_interfaces + diff --git a/mujoco/idl_gen/std_msgs/Time.h b/mujoco/idl_gen/std_msgs/Time.h new file mode 100644 index 0000000..7296ac0 --- /dev/null +++ b/mujoco/idl_gen/std_msgs/Time.h @@ -0,0 +1,237 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Time.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIME_H_ +#define _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIME_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(TIME_SOURCE) +#define TIME_DllAPI __declspec( dllexport ) +#else +#define TIME_DllAPI __declspec( dllimport ) +#endif // TIME_SOURCE +#else +#define TIME_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define TIME_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + +namespace builtin_interfaces { + namespace msg { + namespace dds_ { + + + /*! + * @brief This class represents the structure Time_ defined by the user in the IDL file. + * @ingroup Time + */ + class Time_ + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Time_(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Time_(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object builtin_interfaces::msg::dds_::Time_ that will be copied. + */ + eProsima_user_DllExport Time_( + const Time_& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object builtin_interfaces::msg::dds_::Time_ that will be copied. + */ + eProsima_user_DllExport Time_( + Time_&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object builtin_interfaces::msg::dds_::Time_ that will be copied. + */ + eProsima_user_DllExport Time_& operator =( + const Time_& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object builtin_interfaces::msg::dds_::Time_ that will be copied. + */ + eProsima_user_DllExport Time_& operator =( + Time_&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x builtin_interfaces::msg::dds_::Time_ object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Time_& x) const; + + /*! + * @brief Comparison operator. + * @param x builtin_interfaces::msg::dds_::Time_ object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Time_& x) const; + + /*! + * @brief This function sets a value in member sec + * @param _sec New value for member sec + */ + eProsima_user_DllExport void sec( + int32_t _sec); + + /*! + * @brief This function returns the value of member sec + * @return Value of member sec + */ + eProsima_user_DllExport int32_t sec() const; + + /*! + * @brief This function returns a reference to member sec + * @return Reference to member sec + */ + eProsima_user_DllExport int32_t& sec(); + + + /*! + * @brief This function sets a value in member nanosec + * @param _nanosec New value for member nanosec + */ + eProsima_user_DllExport void nanosec( + uint32_t _nanosec); + + /*! + * @brief This function returns the value of member nanosec + * @return Value of member nanosec + */ + eProsima_user_DllExport uint32_t nanosec() const; + + /*! + * @brief This function returns a reference to member nanosec + * @return Reference to member nanosec + */ + eProsima_user_DllExport uint32_t& nanosec(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const builtin_interfaces::msg::dds_::Time_& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + int32_t m_sec; + uint32_t m_nanosec; + + }; + + } // namespace dds_ + } // namespace msg +} // namespace builtin_interfaces + +#endif // _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIME_H_ + + + diff --git a/mujoco/idl_gen/std_msgs/TimeCdrAux.hpp b/mujoco/idl_gen/std_msgs/TimeCdrAux.hpp new file mode 100644 index 0000000..2f50163 --- /dev/null +++ b/mujoco/idl_gen/std_msgs/TimeCdrAux.hpp @@ -0,0 +1,51 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TimeCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIMECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIMECDRAUX_HPP_ + +#include "Time.h" + +constexpr uint32_t builtin_interfaces_msg_dds__Time__max_cdr_typesize {8UL}; +constexpr uint32_t builtin_interfaces_msg_dds__Time__max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const builtin_interfaces::msg::dds_::Time_& data); + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIMECDRAUX_HPP_ + diff --git a/mujoco/idl_gen/std_msgs/TimeCdrAux.ipp b/mujoco/idl_gen/std_msgs/TimeCdrAux.ipp new file mode 100644 index 0000000..4b1d45b --- /dev/null +++ b/mujoco/idl_gen/std_msgs/TimeCdrAux.ipp @@ -0,0 +1,139 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TimeCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIMECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIMECDRAUX_IPP_ + +#include "TimeCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const builtin_interfaces::msg::dds_::Time_& data, + size_t& current_alignment) +{ + using namespace builtin_interfaces::msg::dds_; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.sec(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.nanosec(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const builtin_interfaces::msg::dds_::Time_& data) +{ + using namespace builtin_interfaces::msg::dds_; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.sec() + << eprosima::fastcdr::MemberId(1) << data.nanosec() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + builtin_interfaces::msg::dds_::Time_& data) +{ + using namespace builtin_interfaces::msg::dds_; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.sec(); + break; + + case 1: + dcdr >> data.nanosec(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const builtin_interfaces::msg::dds_::Time_& data) +{ + using namespace builtin_interfaces::msg::dds_; + + static_cast(scdr); + static_cast(data); +} + + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIMECDRAUX_IPP_ + diff --git a/mujoco/idl_gen/std_msgs/TimePubSubTypes.cxx b/mujoco/idl_gen/std_msgs/TimePubSubTypes.cxx new file mode 100644 index 0000000..e0de1ac --- /dev/null +++ b/mujoco/idl_gen/std_msgs/TimePubSubTypes.cxx @@ -0,0 +1,233 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TimePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#include + +#include "TimePubSubTypes.h" +#include "TimeCdrAux.hpp" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + +namespace builtin_interfaces { + namespace msg { + namespace dds_ { + + + Time_PubSubType::Time_PubSubType() + { + setName("builtin_interfaces::msg::dds_::Time_"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(Time_::getMaxCdrSerializedSize()); + #else + builtin_interfaces_msg_dds__Time__max_cdr_typesize; + #endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; + uint32_t keyLength = builtin_interfaces_msg_dds__Time__max_key_cdr_typesize > 16 ? builtin_interfaces_msg_dds__Time__max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + Time_PubSubType::~Time_PubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool Time_PubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + Time_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else + payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 + return true; + } + + bool Time_PubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + Time_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; + } + + std::function Time_PubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) + { + return [data, data_representation]() -> uint32_t + { + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 + }; + } + + void* Time_PubSubType::createData() + { + return reinterpret_cast(new Time_()); + } + + void Time_PubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool Time_PubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + Time_* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + builtin_interfaces_msg_dds__Time__max_key_cdr_typesize); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else + eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 + if (force_md5 || builtin_interfaces_msg_dds__Time__max_key_cdr_typesize > 16) + { + m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace dds_ + + + } //End of namespace msg + + +} //End of namespace builtin_interfaces + diff --git a/mujoco/idl_gen/std_msgs/TimePubSubTypes.h b/mujoco/idl_gen/std_msgs/TimePubSubTypes.h new file mode 100644 index 0000000..ae14992 --- /dev/null +++ b/mujoco/idl_gen/std_msgs/TimePubSubTypes.h @@ -0,0 +1,196 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TimePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#ifndef _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIME_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIME_PUBSUBTYPES_H_ + +#include +#include +#include +#include +#include + +#include "Time.h" + + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated Time is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace builtin_interfaces +{ + namespace msg + { + namespace dds_ + { + + + + #ifndef SWIG + namespace detail { + + template + struct Time__rob + { + friend constexpr typename Tag::type get( + Tag) + { + return M; + } + + }; + + struct Time__f + { + typedef uint32_t Time_::* type; + friend constexpr type get( + Time__f); + }; + + template struct Time__rob; + + template + inline size_t constexpr Time__offset_of() + { + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); + } + + } // namespace detail + #endif // ifndef SWIG + + + /*! + * @brief This class represents the TopicDataType of the type Time_ defined by the user in the IDL file. + * @ingroup Time + */ + class Time_PubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef Time_ type; + + eProsima_user_DllExport Time_PubSubType(); + + eProsima_user_DllExport ~Time_PubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return is_plain_xcdrv1_impl(); + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) + { + return is_plain_xcdrv2_impl(); + } + else + { + return is_plain_xcdrv1_impl(); + } + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) Time_(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + private: + + static constexpr bool is_plain_xcdrv1_impl() + { + return 8ULL == + (detail::Time__offset_of() + + sizeof(uint32_t)); + } + + static constexpr bool is_plain_xcdrv2_impl() + { + return 8ULL == + (detail::Time__offset_of() + + sizeof(uint32_t)); + } + + }; + } + } +} + +#endif // _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIME_PUBSUBTYPES_H_ + diff --git a/mujoco/module/SdkBridge/CMakeLists.txt b/mujoco/module/SdkBridge/CMakeLists.txt index 9ff18da..cc81828 100644 --- a/mujoco/module/SdkBridge/CMakeLists.txt +++ b/mujoco/module/SdkBridge/CMakeLists.txt @@ -6,11 +6,17 @@ file(GLOB k1sim_idl_srcs CONFIGURE_DEPENDS ${K1SIM_IDL_GEN_DIR}/booster_interface/*.cxx ${K1SIM_IDL_GEN_DIR}/booster_msgs/*.cxx ${K1SIM_IDL_GEN_DIR}/geometry_msgs/*.cxx + ${K1SIM_IDL_GEN_DIR}/builtin_interfaces/*.cxx + ${K1SIM_IDL_GEN_DIR}/std_msgs/*.cxx + ${K1SIM_IDL_GEN_DIR}/nav_msgs/*.cxx ) file(GLOB k1sim_idl_ipp CONFIGURE_DEPENDS ${K1SIM_IDL_GEN_DIR}/booster_interface/*.ipp ${K1SIM_IDL_GEN_DIR}/booster_msgs/*.ipp ${K1SIM_IDL_GEN_DIR}/geometry_msgs/*.ipp + ${K1SIM_IDL_GEN_DIR}/builtin_interfaces/*.ipp + ${K1SIM_IDL_GEN_DIR}/std_msgs/*.ipp + ${K1SIM_IDL_GEN_DIR}/nav_msgs/*.ipp ) # Each CdrAux.ipp holds explicit fastcdr template specializations # (calculate_serialized_size/serialize/deserialize/serialize_key for that exact @@ -25,7 +31,8 @@ add_library(k1sim_idl STATIC ${k1sim_idl_srcs} ${k1sim_idl_ipp}) target_include_directories( k1sim_idl PUBLIC ${K1SIM_IDL_GEN_DIR}/booster_interface ${K1SIM_IDL_GEN_DIR}/booster_msgs - ${K1SIM_IDL_GEN_DIR}/geometry_msgs + ${K1SIM_IDL_GEN_DIR}/geometry_msgs ${K1SIM_IDL_GEN_DIR}/builtin_interfaces + ${K1SIM_IDL_GEN_DIR}/std_msgs ${K1SIM_IDL_GEN_DIR}/nav_msgs ) target_link_libraries(k1sim_idl PUBLIC fastrtps fastcdr) diff --git a/mujoco/module/SdkBridge/PROTOCOL.md b/mujoco/module/SdkBridge/PROTOCOL.md index c74354b..07451ab 100644 --- a/mujoco/module/SdkBridge/PROTOCOL.md +++ b/mujoco/module/SdkBridge/PROTOCOL.md @@ -98,9 +98,27 @@ Topic `rt/head_pose`. Not an SDK API topic: it is what NUbots_K1's `input::K1Sen subscribes to (reliable) for the head pose in the yaw-only base footprint frame, which it composes with `rt/odometer_state` to place the camera and torso in the world. The head frame is the robot's, 0.08 m above the `Head_pitch` joint along the head z-axis, not the -`Head_2` body origin: K1Sensors' `Hhp` removes that offset (see `shared/sim/HeadPose.hpp`). Layout and registered name verified against the SDK NUbots_K1 builds against -(`d5d8f7ae`): `geometry_msgs::msg::Pose().getName()` returns -`geometry_msgs::msg::dds_::Pose_`. +`Head_2` body origin: K1Sensors' `Hhp` removes that offset (see `shared/sim/HeadPose.hpp`). +Layout and registered name verified against the SDK NUbots_K1 builds against (`d5d8f7ae`): +`geometry_msgs::msg::Pose().getName()` returns `geometry_msgs::msg::dds_::Pose_`. + +### `nav_msgs::msg::dds_::Odometry_` (nav_msgs/Odometry.h) +| # | field | type | +|---|---|---| +| 1 | `header` | `std_msgs::msg::dds_::Header_` (`stamp` : `builtin_interfaces::msg::dds_::Time_` {`sec` : `int32`, `nanosec` : `uint32`}, `frame_id` : `string`) | +| 2 | `child_frame_id` | `string` | +| 3 | `pose` | `geometry_msgs::msg::dds_::PoseWithCovariance_` (`pose` : `Pose_`, `covariance` : `double[36]`) | +| 4 | `twist` | `geometry_msgs::msg::dds_::TwistWithCovariance_` (`twist` : `Twist_` {`linear`, `angular` : `Vector3_` {`x`, `y`, `z` : `double`}}, `covariance` : `double[36]`) | + +Topic `rt/odom` (`kTopicRosOdometer`, in the SDK from the 1.7.0 firmware). The controller's +full ROS odometry: `rt/odometer_state` carries only its planar pose, this adds the velocity, +which NUbots_K1's `platform::Booster::HardwareIO` subscribes to for `Sensors.vTw`. Booster +does not document the frames; the sim follows the ROS nav_msgs convention: pose in +`frame_id` "odom" (the world), twist in `child_frame_id` "base_link" (the root body's frame, +rotated from MuJoCo's world-frame velocities), header stamped with wall-clock time, +covariances zero (the sim's base state is ground truth). HardwareIO logs the frames of the +first message it receives, which shows which convention the real robot uses. Layouts and +registered names verified against the SDK (`d5d8f7ae`) with `getName()`, as for `Pose_`. ### `booster_interface::msg::dds_::FallDownState_` (FallDownState.h) Enum `FallDownStateType : unsigned long` (C++ `uint32_t`) = `{IS_READY=0, IS_FALLING=1, @@ -199,6 +217,9 @@ booster_interface::msg::dds_::MotorCmd_ booster_msgs::msg::dds_::RpcReqMsg_ booster_msgs::msg::dds_::RpcRespMsg_ geometry_msgs::msg::dds_::Pose_ (+ nested Point_, Quaternion_; rt/head_pose) +nav_msgs::msg::dds_::Odometry_ (+ nested std_msgs Header_, builtin_interfaces Time_, + geometry_msgs PoseWithCovariance_, TwistWithCovariance_, + Twist_, Vector3_; rt/odom) ``` Also present (not used by us): `booster_interface::msg::dds_::RemoteControllerState_`, @@ -309,7 +330,7 @@ Per the lead's explicit spec (de-risks RPC correctness over squeezing out best-e UDP savings — reliability never hurts a loopback/`--network host` transport, and the SDK's own defaults would silently degrade to best-effort which is a *safe* superset to widen, not narrow), `module::SdkBridge` uses: -- **State writers** (`low_state`, `odometer_state`, `head_pose`, `fall_down`, +- **State writers** (`low_state`, `odometer_state`, `odom`, `head_pose`, `fall_down`, `battery_state`, `button_event`): `RELIABLE` + `VOLATILE` durability + `KEEP_LAST(5)` history. `head_pose` must be `RELIABLE`: K1Sensors creates its reader with `reliable = true`, which a best-effort writer would not match. diff --git a/mujoco/module/SdkBridge/src/StatePublisher.cpp b/mujoco/module/SdkBridge/src/StatePublisher.cpp index 0a45989..e161cfc 100644 --- a/mujoco/module/SdkBridge/src/StatePublisher.cpp +++ b/mujoco/module/SdkBridge/src/StatePublisher.cpp @@ -1,5 +1,6 @@ #include "module/SdkBridge/src/StatePublisher.hpp" +#include #include #include @@ -13,6 +14,8 @@ #include "LowStatePubSubTypes.h" #include "Odometer.h" #include "OdometerPubSubTypes.h" +#include "Odometry.h" +#include "OdometryPubSubTypes.h" #include "Pose.h" #include "PosePubSubTypes.h" @@ -30,6 +33,18 @@ double yaw_from_quat(const std::array& q) { return std::atan2(2.0 * (w * z + x * y), 1.0 - 2.0 * (y * y + z * z)); } +// A world-frame vector expressed in the body frame of the {w, x, y, z} orientation q: R(q)^T v. +std::array world_to_body(const std::array& q, const std::array& v) { + const double w = q[0], x = q[1], y = q[2], z = q[3]; + // Rows of R^T are the columns of R + const double r[3][3] = {{1 - 2 * (y * y + z * z), 2 * (x * y + w * z), 2 * (x * z - w * y)}, + {2 * (x * y - w * z), 1 - 2 * (x * x + z * z), 2 * (y * z + w * x)}, + {2 * (x * z + w * y), 2 * (y * z - w * x), 1 - 2 * (x * x + y * y)}}; + return {r[0][0] * v[0] + r[0][1] * v[1] + r[0][2] * v[2], + r[1][0] * v[0] + r[1][1] * v[1] + r[1][2] * v[2], + r[2][0] * v[0] + r[2][1] * v[1] + r[2][2] * v[2]}; +} + booster_interface::msg::dds_::MotorState_ to_motor_state(const k1sim::message::JointState& joint) { booster_interface::msg::dds_::MotorState_ m; m.mode(1); @@ -52,11 +67,14 @@ StatePublisher::StatePublisher(DdsParticipant& dds, double battery_soc) : batter using booster_interface::msg::dds_::LowState_PubSubType; using booster_interface::msg::dds_::Odometer_PubSubType; using geometry_msgs::msg::dds_::Pose_PubSubType; + using nav_msgs::msg::dds_::Odometry_PubSubType; low_state_writer_ = dds.create_writer(k1sim::booster::TOPIC_LOW_STATE, DdsParticipant::state_writer_qos()); odometer_writer_ = dds.create_writer(k1sim::booster::TOPIC_ODOMETER_STATE, DdsParticipant::state_writer_qos()); + ros_odometry_writer_ = dds.create_writer(k1sim::booster::TOPIC_ROS_ODOMETER, + DdsParticipant::state_writer_qos()); head_pose_writer_ = dds.create_writer(k1sim::booster::TOPIC_HEAD_POSE, DdsParticipant::state_writer_qos()); fall_down_writer_ = @@ -102,6 +120,34 @@ void StatePublisher::publish(const k1sim::message::SimStateUpdate& update) { odom.theta(static_cast(yaw_from_quat(update.base.quat))); odometer_writer_->write(&odom); + // --- rt/odom --- The same base odometry with its velocity: pose in "odom" (the world), twist + // in the body frame "base_link", per the ROS nav_msgs convention (twist in child_frame_id). + // The sim's base state is ground truth, so the covariances are left zero. + nav_msgs::msg::dds_::Odometry_ ros_odom; + const auto stamp = std::chrono::system_clock::now().time_since_epoch(); + const auto sec = std::chrono::duration_cast(stamp); + ros_odom.header().stamp().sec(static_cast(sec.count())); + ros_odom.header().stamp().nanosec( + static_cast(std::chrono::duration_cast(stamp - sec).count())); + ros_odom.header().frame_id("odom"); + ros_odom.child_frame_id("base_link"); + ros_odom.pose().pose().position().x(update.base.x); + ros_odom.pose().pose().position().y(update.base.y); + ros_odom.pose().pose().position().z(update.base.z); + ros_odom.pose().pose().orientation().w(update.base.quat[0]); + ros_odom.pose().pose().orientation().x(update.base.quat[1]); + ros_odom.pose().pose().orientation().y(update.base.quat[2]); + ros_odom.pose().pose().orientation().z(update.base.quat[3]); + const auto linear = world_to_body(update.base.quat, update.base.lin_vel); + const auto angular = world_to_body(update.base.quat, update.base.ang_vel); + ros_odom.twist().twist().linear().x(linear[0]); + ros_odom.twist().twist().linear().y(linear[1]); + ros_odom.twist().twist().linear().z(linear[2]); + ros_odom.twist().twist().angular().x(angular[0]); + ros_odom.twist().twist().angular().y(angular[1]); + ros_odom.twist().twist().angular().z(angular[2]); + ros_odometry_writer_->write(&ros_odom); + // --- rt/head_pose --- The head frame in the yaw-only base footprint frame, which // K1Sensors composes with the odometry above to place the camera and torso in the world. if (update.head.valid) { diff --git a/mujoco/module/SdkBridge/src/StatePublisher.hpp b/mujoco/module/SdkBridge/src/StatePublisher.hpp index ac3253a..8dd7f99 100644 --- a/mujoco/module/SdkBridge/src/StatePublisher.hpp +++ b/mujoco/module/SdkBridge/src/StatePublisher.hpp @@ -17,7 +17,7 @@ class StatePublisher { StatePublisher(DdsParticipant& dds, double battery_soc); // Called at the LowState cadence (50 Hz, on>): writes - // rt/low_state, rt/odometer_state and rt/head_pose every call, and rt/fall_down + // rt/low_state, rt/odometer_state, rt/odom and rt/head_pose every call, and rt/fall_down // whenever fall_state changes or >=1s has elapsed since the last publish (keepalive). void publish(const k1sim::message::SimStateUpdate& update); @@ -27,6 +27,7 @@ class StatePublisher { private: eprosima::fastdds::dds::DataWriter* low_state_writer_ = nullptr; eprosima::fastdds::dds::DataWriter* odometer_writer_ = nullptr; + eprosima::fastdds::dds::DataWriter* ros_odometry_writer_ = nullptr; eprosima::fastdds::dds::DataWriter* head_pose_writer_ = nullptr; eprosima::fastdds::dds::DataWriter* fall_down_writer_ = nullptr; eprosima::fastdds::dds::DataWriter* battery_writer_ = nullptr; diff --git a/mujoco/module/SdkBridge/test_support/SyntheticState.cpp b/mujoco/module/SdkBridge/test_support/SyntheticState.cpp index cb158b5..f47f4a9 100644 --- a/mujoco/module/SdkBridge/test_support/SyntheticState.cpp +++ b/mujoco/module/SdkBridge/test_support/SyntheticState.cpp @@ -85,6 +85,9 @@ SyntheticState::SyntheticState(std::unique_ptr environment update->base.z = 0.53; const double half = yaw_ * 0.5; update->base.quat = {std::cos(half), 0.0, 0.0, std::sin(half)}; + // World-frame velocity of the commanded body-frame walk + update->base.lin_vel = {vx_ * cos_yaw - vy_ * sin_yaw, vx_ * sin_yaw + vy_ * cos_yaw, 0.0}; + update->base.ang_vel = {0.0, 0.0, vyaw_}; // Standing head frame in the footprint frame: 0.33 m above the base (the Head_pitch // joint 0.248 m above the Trunk plus the 0.08 m head frame offset, see diff --git a/mujoco/shared/k1/BoosterApi.hpp b/mujoco/shared/k1/BoosterApi.hpp index 8205653..2d668fd 100644 --- a/mujoco/shared/k1/BoosterApi.hpp +++ b/mujoco/shared/k1/BoosterApi.hpp @@ -16,6 +16,9 @@ inline constexpr const char* TOPIC_BATTERY_STATE = "rt/battery_state"; inline constexpr const char* TOPIC_BUTTON_EVENT = "rt/button_event"; inline constexpr const char* TOPIC_RPC_REQUEST = "rt/LocoApiTopicReq"; inline constexpr const char* TOPIC_RPC_RESPONSE = "rt/LocoApiTopicResp"; +// The controller's full ROS odometry (nav_msgs Odometry: pose and twist), kTopicRosOdometer. Only +// in the SDK from the 1.7.0 firmware (booster_robotics_sdk @ d5d8f7ae). +inline constexpr const char* TOPIC_ROS_ODOMETER = "rt/odom"; // Not an SDK constant: the robot's head pose (geometry_msgs Pose), the topic NUbots' // K1Sensors subscribes to (K1Sensors.yaml head_pose.topic). inline constexpr const char* TOPIC_HEAD_POSE = "rt/head_pose"; diff --git a/mujoco/test/contract/host_client/sdk_client_check.cpp b/mujoco/test/contract/host_client/sdk_client_check.cpp index 9526669..5576cfd 100644 --- a/mujoco/test/contract/host_client/sdk_client_check.cpp +++ b/mujoco/test/contract/host_client/sdk_client_check.cpp @@ -13,6 +13,9 @@ // - rt/head_pose received at least once with a finite, standing-height pose (the // topic NUbots' K1Sensors places the camera and torso from). Only when the SDK // ships booster/idl/geometry_msgs/Pose.h; SKIP printed otherwise. +// - rt/odom (nav_msgs Odometry, the source of NUbots' Sensors.vTw) received at +// least once with finite pose and twist, reporting its frames. Only when the SDK +// ships booster/idl/nav_msgs/Odometry.h (1.7.0 firmware); SKIP printed otherwise. // - rt/battery_state received at least once during the 5s window (published at // 1 Hz via NUClear on>) with soc in (0, 100]. // Only when the SDK being built against ships booster/idl/b1/BatteryState.h — @@ -49,6 +52,10 @@ #include #define K1SIM_CHECK_HEAD_POSE 1 #endif +#if __has_include() + #include + #define K1SIM_CHECK_ROS_ODOMETRY 1 +#endif #include #include #include @@ -105,6 +112,27 @@ void HeadPoseHandler(const void* msg) { } #endif +#ifdef K1SIM_CHECK_ROS_ODOMETRY +std::atomic g_ros_odom_count{0}; +std::atomic g_ros_odom_finite{true}; +std::string g_ros_odom_frames; // written once, before the count is first incremented +void RosOdometryHandler(const void* msg) { + const auto* odom = static_cast(msg); + const auto& p = odom->pose().pose().position(); + const auto& twist = odom->twist().twist(); + if (g_ros_odom_count.load() == 0) { + g_ros_odom_frames = "'" + odom->header().frame_id() + "' -> '" + odom->child_frame_id() + "'"; + } + for (double v : {p.x(), p.y(), p.z(), twist.linear().x(), twist.linear().y(), twist.linear().z(), + twist.angular().x(), twist.angular().y(), twist.angular().z()}) { + if (!std::isfinite(v)) { + g_ros_odom_finite.store(false, std::memory_order_relaxed); + } + } + g_ros_odom_count.fetch_add(1, std::memory_order_relaxed); +} +#endif + #ifdef K1SIM_CHECK_BATTERY std::atomic g_battery_count{0}; std::atomic g_battery_soc{-1.0f}; @@ -153,6 +181,10 @@ int main() { ChannelSubscriber head_pose_sub("rt/head_pose", HeadPoseHandler); head_pose_sub.InitChannel(); #endif +#ifdef K1SIM_CHECK_ROS_ODOMETRY + ChannelSubscriber ros_odom_sub(booster::robot::b1::kTopicRosOdometer, RosOdometryHandler); + ros_odom_sub.InitChannel(); +#endif #ifdef K1SIM_CHECK_BATTERY ChannelSubscriber battery_sub("rt/battery_state", BatteryHandler); battery_sub.InitChannel(); @@ -191,6 +223,15 @@ int main() { #else std::printf("[SKIP] rt/head_pose checks (SDK build lacks booster/idl/geometry_msgs/Pose.h)\n"); #endif +#ifdef K1SIM_CHECK_ROS_ODOMETRY + std::printf("odom: %llu samples in window, frames %s\n", + static_cast(g_ros_odom_count.load()), + g_ros_odom_frames.c_str()); + check(g_ros_odom_count.load() > 0, "rt/odom received at least once"); + check(g_ros_odom_finite.load(), "rt/odom pose and twist are finite"); +#else + std::printf("[SKIP] rt/odom checks (SDK build lacks booster/idl/nav_msgs/Odometry.h)\n"); +#endif #ifdef K1SIM_CHECK_BATTERY std::printf("battery_state: %llu samples in window, last soc=%.1f\n", static_cast(g_battery_count.load()), From 90e34b2e946cea318f810404db2a73133147bb83 Mon Sep 17 00:00:00 2001 From: Vincent Tumminello Date: Sun, 13 Sep 2026 09:43:30 +1000 Subject: [PATCH 3/7] delete duplicate idl_gen files (new regenerate.sh) --- mujoco/idl_gen/nav_msgs/Header.cxx | 309 -------------- mujoco/idl_gen/nav_msgs/Header.h | 252 ----------- mujoco/idl_gen/nav_msgs/HeaderCdrAux.hpp | 51 --- mujoco/idl_gen/nav_msgs/HeaderCdrAux.ipp | 139 ------ mujoco/idl_gen/nav_msgs/HeaderPubSubTypes.cxx | 233 ----------- mujoco/idl_gen/nav_msgs/HeaderPubSubTypes.h | 142 ------- mujoco/idl_gen/nav_msgs/Point.cxx | 341 --------------- mujoco/idl_gen/nav_msgs/Point.h | 258 ------------ mujoco/idl_gen/nav_msgs/PointCdrAux.hpp | 51 --- mujoco/idl_gen/nav_msgs/PointCdrAux.ipp | 147 ------- mujoco/idl_gen/nav_msgs/PointPubSubTypes.cxx | 233 ----------- mujoco/idl_gen/nav_msgs/PointPubSubTypes.h | 196 --------- mujoco/idl_gen/nav_msgs/Pose.cxx | 310 -------------- mujoco/idl_gen/nav_msgs/Pose.h | 253 ----------- mujoco/idl_gen/nav_msgs/PoseCdrAux.hpp | 51 --- mujoco/idl_gen/nav_msgs/PoseCdrAux.ipp | 139 ------ mujoco/idl_gen/nav_msgs/PosePubSubTypes.cxx | 233 ----------- mujoco/idl_gen/nav_msgs/PosePubSubTypes.h | 198 --------- .../idl_gen/nav_msgs/PoseWithCovariance.cxx | 313 -------------- mujoco/idl_gen/nav_msgs/PoseWithCovariance.h | 252 ----------- .../nav_msgs/PoseWithCovarianceCdrAux.hpp | 51 --- .../nav_msgs/PoseWithCovarianceCdrAux.ipp | 139 ------ .../PoseWithCovariancePubSubTypes.cxx | 233 ----------- .../nav_msgs/PoseWithCovariancePubSubTypes.h | 197 --------- mujoco/idl_gen/nav_msgs/Quaternion.cxx | 394 ------------------ mujoco/idl_gen/nav_msgs/Quaternion.h | 279 ------------- mujoco/idl_gen/nav_msgs/QuaternionCdrAux.hpp | 51 --- mujoco/idl_gen/nav_msgs/QuaternionCdrAux.ipp | 155 ------- .../nav_msgs/QuaternionPubSubTypes.cxx | 233 ----------- .../idl_gen/nav_msgs/QuaternionPubSubTypes.h | 196 --------- mujoco/idl_gen/nav_msgs/Time.cxx | 288 ------------- mujoco/idl_gen/nav_msgs/Time.h | 237 ----------- mujoco/idl_gen/nav_msgs/TimeCdrAux.hpp | 51 --- mujoco/idl_gen/nav_msgs/TimeCdrAux.ipp | 139 ------ mujoco/idl_gen/nav_msgs/TimePubSubTypes.cxx | 233 ----------- mujoco/idl_gen/nav_msgs/TimePubSubTypes.h | 196 --------- mujoco/idl_gen/nav_msgs/Twist.cxx | 309 -------------- mujoco/idl_gen/nav_msgs/Twist.h | 252 ----------- mujoco/idl_gen/nav_msgs/TwistCdrAux.hpp | 51 --- mujoco/idl_gen/nav_msgs/TwistCdrAux.ipp | 139 ------ mujoco/idl_gen/nav_msgs/TwistPubSubTypes.cxx | 233 ----------- mujoco/idl_gen/nav_msgs/TwistPubSubTypes.h | 197 --------- .../idl_gen/nav_msgs/TwistWithCovariance.cxx | 312 -------------- mujoco/idl_gen/nav_msgs/TwistWithCovariance.h | 252 ----------- .../nav_msgs/TwistWithCovarianceCdrAux.hpp | 52 --- .../nav_msgs/TwistWithCovarianceCdrAux.ipp | 139 ------ .../TwistWithCovariancePubSubTypes.cxx | 233 ----------- .../nav_msgs/TwistWithCovariancePubSubTypes.h | 197 --------- mujoco/idl_gen/nav_msgs/Vector3.cxx | 341 --------------- mujoco/idl_gen/nav_msgs/Vector3.h | 258 ------------ mujoco/idl_gen/nav_msgs/Vector3CdrAux.hpp | 51 --- mujoco/idl_gen/nav_msgs/Vector3CdrAux.ipp | 147 ------- .../idl_gen/nav_msgs/Vector3PubSubTypes.cxx | 233 ----------- mujoco/idl_gen/nav_msgs/Vector3PubSubTypes.h | 196 --------- mujoco/idl_gen/std_msgs/Time.cxx | 288 ------------- mujoco/idl_gen/std_msgs/Time.h | 237 ----------- mujoco/idl_gen/std_msgs/TimeCdrAux.hpp | 51 --- mujoco/idl_gen/std_msgs/TimeCdrAux.ipp | 139 ------ mujoco/idl_gen/std_msgs/TimePubSubTypes.cxx | 233 ----------- mujoco/idl_gen/std_msgs/TimePubSubTypes.h | 196 --------- 60 files changed, 11909 deletions(-) delete mode 100644 mujoco/idl_gen/nav_msgs/Header.cxx delete mode 100644 mujoco/idl_gen/nav_msgs/Header.h delete mode 100644 mujoco/idl_gen/nav_msgs/HeaderCdrAux.hpp delete mode 100644 mujoco/idl_gen/nav_msgs/HeaderCdrAux.ipp delete mode 100644 mujoco/idl_gen/nav_msgs/HeaderPubSubTypes.cxx delete mode 100644 mujoco/idl_gen/nav_msgs/HeaderPubSubTypes.h delete mode 100644 mujoco/idl_gen/nav_msgs/Point.cxx delete mode 100644 mujoco/idl_gen/nav_msgs/Point.h delete mode 100644 mujoco/idl_gen/nav_msgs/PointCdrAux.hpp delete mode 100644 mujoco/idl_gen/nav_msgs/PointCdrAux.ipp delete mode 100644 mujoco/idl_gen/nav_msgs/PointPubSubTypes.cxx delete mode 100644 mujoco/idl_gen/nav_msgs/PointPubSubTypes.h delete mode 100644 mujoco/idl_gen/nav_msgs/Pose.cxx delete mode 100644 mujoco/idl_gen/nav_msgs/Pose.h delete mode 100644 mujoco/idl_gen/nav_msgs/PoseCdrAux.hpp delete mode 100644 mujoco/idl_gen/nav_msgs/PoseCdrAux.ipp delete mode 100644 mujoco/idl_gen/nav_msgs/PosePubSubTypes.cxx delete mode 100644 mujoco/idl_gen/nav_msgs/PosePubSubTypes.h delete mode 100644 mujoco/idl_gen/nav_msgs/PoseWithCovariance.cxx delete mode 100644 mujoco/idl_gen/nav_msgs/PoseWithCovariance.h delete mode 100644 mujoco/idl_gen/nav_msgs/PoseWithCovarianceCdrAux.hpp delete mode 100644 mujoco/idl_gen/nav_msgs/PoseWithCovarianceCdrAux.ipp delete mode 100644 mujoco/idl_gen/nav_msgs/PoseWithCovariancePubSubTypes.cxx delete mode 100644 mujoco/idl_gen/nav_msgs/PoseWithCovariancePubSubTypes.h delete mode 100644 mujoco/idl_gen/nav_msgs/Quaternion.cxx delete mode 100644 mujoco/idl_gen/nav_msgs/Quaternion.h delete mode 100644 mujoco/idl_gen/nav_msgs/QuaternionCdrAux.hpp delete mode 100644 mujoco/idl_gen/nav_msgs/QuaternionCdrAux.ipp delete mode 100644 mujoco/idl_gen/nav_msgs/QuaternionPubSubTypes.cxx delete mode 100644 mujoco/idl_gen/nav_msgs/QuaternionPubSubTypes.h delete mode 100644 mujoco/idl_gen/nav_msgs/Time.cxx delete mode 100644 mujoco/idl_gen/nav_msgs/Time.h delete mode 100644 mujoco/idl_gen/nav_msgs/TimeCdrAux.hpp delete mode 100644 mujoco/idl_gen/nav_msgs/TimeCdrAux.ipp delete mode 100644 mujoco/idl_gen/nav_msgs/TimePubSubTypes.cxx delete mode 100644 mujoco/idl_gen/nav_msgs/TimePubSubTypes.h delete mode 100644 mujoco/idl_gen/nav_msgs/Twist.cxx delete mode 100644 mujoco/idl_gen/nav_msgs/Twist.h delete mode 100644 mujoco/idl_gen/nav_msgs/TwistCdrAux.hpp delete mode 100644 mujoco/idl_gen/nav_msgs/TwistCdrAux.ipp delete mode 100644 mujoco/idl_gen/nav_msgs/TwistPubSubTypes.cxx delete mode 100644 mujoco/idl_gen/nav_msgs/TwistPubSubTypes.h delete mode 100644 mujoco/idl_gen/nav_msgs/TwistWithCovariance.cxx delete mode 100644 mujoco/idl_gen/nav_msgs/TwistWithCovariance.h delete mode 100644 mujoco/idl_gen/nav_msgs/TwistWithCovarianceCdrAux.hpp delete mode 100644 mujoco/idl_gen/nav_msgs/TwistWithCovarianceCdrAux.ipp delete mode 100644 mujoco/idl_gen/nav_msgs/TwistWithCovariancePubSubTypes.cxx delete mode 100644 mujoco/idl_gen/nav_msgs/TwistWithCovariancePubSubTypes.h delete mode 100644 mujoco/idl_gen/nav_msgs/Vector3.cxx delete mode 100644 mujoco/idl_gen/nav_msgs/Vector3.h delete mode 100644 mujoco/idl_gen/nav_msgs/Vector3CdrAux.hpp delete mode 100644 mujoco/idl_gen/nav_msgs/Vector3CdrAux.ipp delete mode 100644 mujoco/idl_gen/nav_msgs/Vector3PubSubTypes.cxx delete mode 100644 mujoco/idl_gen/nav_msgs/Vector3PubSubTypes.h delete mode 100644 mujoco/idl_gen/std_msgs/Time.cxx delete mode 100644 mujoco/idl_gen/std_msgs/Time.h delete mode 100644 mujoco/idl_gen/std_msgs/TimeCdrAux.hpp delete mode 100644 mujoco/idl_gen/std_msgs/TimeCdrAux.ipp delete mode 100644 mujoco/idl_gen/std_msgs/TimePubSubTypes.cxx delete mode 100644 mujoco/idl_gen/std_msgs/TimePubSubTypes.h diff --git a/mujoco/idl_gen/nav_msgs/Header.cxx b/mujoco/idl_gen/nav_msgs/Header.cxx deleted file mode 100644 index fc56cc5..0000000 --- a/mujoco/idl_gen/nav_msgs/Header.cxx +++ /dev/null @@ -1,309 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Header.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Header.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define builtin_interfaces_msg_dds__Time__max_cdr_typesize 8ULL; -#define std_msgs_msg_dds__Header__max_cdr_typesize 268ULL; - - -namespace std_msgs { - -namespace msg { - -namespace dds_ { - - - -Header_::Header_() -{ - // builtin_interfaces::msg::dds_::Time_ m_stamp - - // /type_d() m_frame_id - - -} - -Header_::~Header_() -{ -} - -Header_::Header_( - const Header_& x) -{ - m_stamp = x.m_stamp; - - - m_frame_id = x.m_frame_id; - -} - -Header_::Header_( - Header_&& x) noexcept -{ - m_stamp = std::move(x.m_stamp); - - - m_frame_id = std::move(x.m_frame_id); - -} - -Header_& Header_::operator =( - const Header_& x) -{ - m_stamp = x.m_stamp; - - - m_frame_id = x.m_frame_id; - - return *this; -} - -Header_& Header_::operator =( - Header_&& x) noexcept -{ - m_stamp = std::move(x.m_stamp); - - - m_frame_id = std::move(x.m_frame_id); - - return *this; -} - -bool Header_::operator ==( - const Header_& x) const -{ - return (m_stamp == x.m_stamp && - m_frame_id == x.m_frame_id); -} - -bool Header_::operator !=( - const Header_& x) const -{ - return !(*this == x); -} - -size_t Header_::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return std_msgs_msg_dds__Header__max_cdr_typesize; -} - -size_t Header_::getCdrSerializedSize( - const Header_& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += builtin_interfaces::msg::dds_::Time_::getCdrSerializedSize(data.stamp(), current_alignment); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.frame_id().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void Header_::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_stamp; - - scdr << m_frame_id.c_str(); - -} - -void Header_::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_stamp; - - - - dcdr >> m_frame_id; - - -} - - -bool Header_::isKeyDefined() -{ - return false; -} - -void Header_::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member stamp - * @param _stamp New value to be copied in member stamp - */ -void Header_::stamp( - const builtin_interfaces::msg::dds_::Time_& _stamp) -{ - m_stamp = _stamp; -} - -/*! - * @brief This function moves the value in member stamp - * @param _stamp New value to be moved in member stamp - */ -void Header_::stamp( - builtin_interfaces::msg::dds_::Time_&& _stamp) -{ - m_stamp = std::move(_stamp); -} - -/*! - * @brief This function returns a constant reference to member stamp - * @return Constant reference to member stamp - */ -const builtin_interfaces::msg::dds_::Time_& Header_::stamp() const -{ - return m_stamp; -} - -/*! - * @brief This function returns a reference to member stamp - * @return Reference to member stamp - */ -builtin_interfaces::msg::dds_::Time_& Header_::stamp() -{ - return m_stamp; -} - - -/*! - * @brief This function copies the value in member frame_id - * @param _frame_id New value to be copied in member frame_id - */ -void Header_::frame_id( - const std::string& _frame_id) -{ - m_frame_id = _frame_id; -} - -/*! - * @brief This function moves the value in member frame_id - * @param _frame_id New value to be moved in member frame_id - */ -void Header_::frame_id( - std::string&& _frame_id) -{ - m_frame_id = std::move(_frame_id); -} - -/*! - * @brief This function returns a constant reference to member frame_id - * @return Constant reference to member frame_id - */ -const std::string& Header_::frame_id() const -{ - return m_frame_id; -} - -/*! - * @brief This function returns a reference to member frame_id - * @return Reference to member frame_id - */ -std::string& Header_::frame_id() -{ - return m_frame_id; -} - - - - - -} // namespace dds_ - - -} // namespace msg - - -} // namespace std_msgs - diff --git a/mujoco/idl_gen/nav_msgs/Header.h b/mujoco/idl_gen/nav_msgs/Header.h deleted file mode 100644 index 91bdf94..0000000 --- a/mujoco/idl_gen/nav_msgs/Header.h +++ /dev/null @@ -1,252 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Header.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADER_H_ -#define _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADER_H_ - -#include "Time.h" - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(HEADER_SOURCE) -#define HEADER_DllAPI __declspec( dllexport ) -#else -#define HEADER_DllAPI __declspec( dllimport ) -#endif // HEADER_SOURCE -#else -#define HEADER_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define HEADER_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -namespace std_msgs { - namespace msg { - namespace dds_ { - - - /*! - * @brief This class represents the structure Header_ defined by the user in the IDL file. - * @ingroup Header - */ - class Header_ - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Header_(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Header_(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object std_msgs::msg::dds_::Header_ that will be copied. - */ - eProsima_user_DllExport Header_( - const Header_& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object std_msgs::msg::dds_::Header_ that will be copied. - */ - eProsima_user_DllExport Header_( - Header_&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object std_msgs::msg::dds_::Header_ that will be copied. - */ - eProsima_user_DllExport Header_& operator =( - const Header_& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object std_msgs::msg::dds_::Header_ that will be copied. - */ - eProsima_user_DllExport Header_& operator =( - Header_&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x std_msgs::msg::dds_::Header_ object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Header_& x) const; - - /*! - * @brief Comparison operator. - * @param x std_msgs::msg::dds_::Header_ object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Header_& x) const; - - /*! - * @brief This function copies the value in member stamp - * @param _stamp New value to be copied in member stamp - */ - eProsima_user_DllExport void stamp( - const builtin_interfaces::msg::dds_::Time_& _stamp); - - /*! - * @brief This function moves the value in member stamp - * @param _stamp New value to be moved in member stamp - */ - eProsima_user_DllExport void stamp( - builtin_interfaces::msg::dds_::Time_&& _stamp); - - /*! - * @brief This function returns a constant reference to member stamp - * @return Constant reference to member stamp - */ - eProsima_user_DllExport const builtin_interfaces::msg::dds_::Time_& stamp() const; - - /*! - * @brief This function returns a reference to member stamp - * @return Reference to member stamp - */ - eProsima_user_DllExport builtin_interfaces::msg::dds_::Time_& stamp(); - - - /*! - * @brief This function copies the value in member frame_id - * @param _frame_id New value to be copied in member frame_id - */ - eProsima_user_DllExport void frame_id( - const std::string& _frame_id); - - /*! - * @brief This function moves the value in member frame_id - * @param _frame_id New value to be moved in member frame_id - */ - eProsima_user_DllExport void frame_id( - std::string&& _frame_id); - - /*! - * @brief This function returns a constant reference to member frame_id - * @return Constant reference to member frame_id - */ - eProsima_user_DllExport const std::string& frame_id() const; - - /*! - * @brief This function returns a reference to member frame_id - * @return Reference to member frame_id - */ - eProsima_user_DllExport std::string& frame_id(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const std_msgs::msg::dds_::Header_& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - builtin_interfaces::msg::dds_::Time_ m_stamp; - std::string m_frame_id; - - }; - - } // namespace dds_ - } // namespace msg -} // namespace std_msgs - -#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADER_H_ - - - diff --git a/mujoco/idl_gen/nav_msgs/HeaderCdrAux.hpp b/mujoco/idl_gen/nav_msgs/HeaderCdrAux.hpp deleted file mode 100644 index f7fed1f..0000000 --- a/mujoco/idl_gen/nav_msgs/HeaderCdrAux.hpp +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HeaderCdrAux.hpp - * This source file contains some definitions of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADERCDRAUX_HPP_ -#define _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADERCDRAUX_HPP_ - -#include "Header.h" - -constexpr uint32_t std_msgs_msg_dds__Header__max_cdr_typesize {268UL}; -constexpr uint32_t std_msgs_msg_dds__Header__max_key_cdr_typesize {0UL}; - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const std_msgs::msg::dds_::Header_& data); - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADERCDRAUX_HPP_ - diff --git a/mujoco/idl_gen/nav_msgs/HeaderCdrAux.ipp b/mujoco/idl_gen/nav_msgs/HeaderCdrAux.ipp deleted file mode 100644 index 628d73f..0000000 --- a/mujoco/idl_gen/nav_msgs/HeaderCdrAux.ipp +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HeaderCdrAux.ipp - * This source file contains some declarations of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADERCDRAUX_IPP_ -#define _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADERCDRAUX_IPP_ - -#include "HeaderCdrAux.hpp" - -#include -#include - - -#include -using namespace eprosima::fastcdr::exception; - -namespace eprosima { -namespace fastcdr { - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const std_msgs::msg::dds_::Header_& data, - size_t& current_alignment) -{ - using namespace std_msgs::msg::dds_; - - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.stamp(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.frame_id(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const std_msgs::msg::dds_::Header_& data) -{ - using namespace std_msgs::msg::dds_; - - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.stamp() - << eprosima::fastcdr::MemberId(1) << data.frame_id() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - std_msgs::msg::dds_::Header_& data) -{ - using namespace std_msgs::msg::dds_; - - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.stamp(); - break; - - case 1: - dcdr >> data.frame_id(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const std_msgs::msg::dds_::Header_& data) -{ - using namespace std_msgs::msg::dds_; - - static_cast(scdr); - static_cast(data); -} - - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADERCDRAUX_IPP_ - diff --git a/mujoco/idl_gen/nav_msgs/HeaderPubSubTypes.cxx b/mujoco/idl_gen/nav_msgs/HeaderPubSubTypes.cxx deleted file mode 100644 index 6c6cfb4..0000000 --- a/mujoco/idl_gen/nav_msgs/HeaderPubSubTypes.cxx +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HeaderPubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#include - -#include "HeaderPubSubTypes.h" -#include "HeaderCdrAux.hpp" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; -using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - -namespace std_msgs { - namespace msg { - namespace dds_ { - - - Header_PubSubType::Header_PubSubType() - { - setName("std_msgs::msg::dds_::Header_"); - uint32_t type_size = - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(Header_::getMaxCdrSerializedSize()); - #else - std_msgs_msg_dds__Header__max_cdr_typesize; - #endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = std_msgs_msg_dds__Header__max_key_cdr_typesize > 16 ? std_msgs_msg_dds__Header__max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - Header_PubSubType::~Header_PubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool Header_PubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) - { - Header_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - #if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - #endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length - #if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); - #else - payload->length = static_cast(ser.get_serialized_data_length()); - #endif // FASTCDR_VERSION_MAJOR == 1 - return true; - } - - bool Header_PubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - Header_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN - #if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR - #endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; - } - - std::function Header_PubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) - { - return [data, data_representation]() -> uint32_t - { - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - #else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } - #endif // FASTCDR_VERSION_MAJOR == 1 - }; - } - - void* Header_PubSubType::createData() - { - return reinterpret_cast(new Header_()); - } - - void Header_PubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool Header_PubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - Header_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - std_msgs_msg_dds__Header__max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); - #if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); - #else - eprosima::fastcdr::serialize_key(ser, *p_type); - #endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || std_msgs_msg_dds__Header__max_key_cdr_typesize > 16) - { - m_md5.init(); - #if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - #else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); - #endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace dds_ - - - } //End of namespace msg - - -} //End of namespace std_msgs - diff --git a/mujoco/idl_gen/nav_msgs/HeaderPubSubTypes.h b/mujoco/idl_gen/nav_msgs/HeaderPubSubTypes.h deleted file mode 100644 index 20f2d28..0000000 --- a/mujoco/idl_gen/nav_msgs/HeaderPubSubTypes.h +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HeaderPubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADER_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADER_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "Header.h" - -#include "TimePubSubTypes.h" - -#if !defined(GEN_API_VER) || (GEN_API_VER != 2) -#error \ - Generated Header is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace std_msgs -{ - namespace msg - { - namespace dds_ - { - - - - /*! - * @brief This class represents the TopicDataType of the type Header_ defined by the user in the IDL file. - * @ingroup Header - */ - class Header_PubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef Header_ type; - - eProsima_user_DllExport Header_PubSubType(); - - eProsima_user_DllExport ~Header_PubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - - }; - } - } -} - -#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADER_PUBSUBTYPES_H_ - diff --git a/mujoco/idl_gen/nav_msgs/Point.cxx b/mujoco/idl_gen/nav_msgs/Point.cxx deleted file mode 100644 index 8f0e5d3..0000000 --- a/mujoco/idl_gen/nav_msgs/Point.cxx +++ /dev/null @@ -1,341 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Point.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Point.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define geometry_msgs_msg_dds__Point__max_cdr_typesize 24ULL; - - -namespace geometry_msgs { - -namespace msg { - -namespace dds_ { - - - -Point_::Point_() -{ - // double m_x - m_x = 0.0; - // double m_y - m_y = 0.0; - // double m_z - m_z = 0.0; - -} - -Point_::~Point_() -{ -} - -Point_::Point_( - const Point_& x) -{ - m_x = x.m_x; - - - m_y = x.m_y; - - - m_z = x.m_z; - -} - -Point_::Point_( - Point_&& x) noexcept -{ - m_x = x.m_x; - - - m_y = x.m_y; - - - m_z = x.m_z; - -} - -Point_& Point_::operator =( - const Point_& x) -{ - m_x = x.m_x; - - - m_y = x.m_y; - - - m_z = x.m_z; - - return *this; -} - -Point_& Point_::operator =( - Point_&& x) noexcept -{ - m_x = x.m_x; - - - m_y = x.m_y; - - - m_z = x.m_z; - - return *this; -} - -bool Point_::operator ==( - const Point_& x) const -{ - return (m_x == x.m_x && - m_y == x.m_y && - m_z == x.m_z); -} - -bool Point_::operator !=( - const Point_& x) const -{ - return !(*this == x); -} - -size_t Point_::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return geometry_msgs_msg_dds__Point__max_cdr_typesize; -} - -size_t Point_::getCdrSerializedSize( - const Point_& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - return current_alignment - initial_alignment; -} - - -void Point_::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_x; - - scdr << m_y; - - scdr << m_z; - -} - -void Point_::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_x; - - - - dcdr >> m_y; - - - - dcdr >> m_z; - - -} - - -bool Point_::isKeyDefined() -{ - return false; -} - -void Point_::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member x - * @param _x New value for member x - */ -void Point_::x( - double _x) -{ - m_x = _x; -} - -/*! - * @brief This function returns the value of member x - * @return Value of member x - */ -double Point_::x() const -{ - return m_x; -} - -/*! - * @brief This function returns a reference to member x - * @return Reference to member x - */ -double& Point_::x() -{ - return m_x; -} - - -/*! - * @brief This function sets a value in member y - * @param _y New value for member y - */ -void Point_::y( - double _y) -{ - m_y = _y; -} - -/*! - * @brief This function returns the value of member y - * @return Value of member y - */ -double Point_::y() const -{ - return m_y; -} - -/*! - * @brief This function returns a reference to member y - * @return Reference to member y - */ -double& Point_::y() -{ - return m_y; -} - - -/*! - * @brief This function sets a value in member z - * @param _z New value for member z - */ -void Point_::z( - double _z) -{ - m_z = _z; -} - -/*! - * @brief This function returns the value of member z - * @return Value of member z - */ -double Point_::z() const -{ - return m_z; -} - -/*! - * @brief This function returns a reference to member z - * @return Reference to member z - */ -double& Point_::z() -{ - return m_z; -} - - - - - -} // namespace dds_ - - -} // namespace msg - - -} // namespace geometry_msgs - diff --git a/mujoco/idl_gen/nav_msgs/Point.h b/mujoco/idl_gen/nav_msgs/Point.h deleted file mode 100644 index 287bf59..0000000 --- a/mujoco/idl_gen/nav_msgs/Point.h +++ /dev/null @@ -1,258 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Point.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINT_H_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINT_H_ - - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(POINT_SOURCE) -#define POINT_DllAPI __declspec( dllexport ) -#else -#define POINT_DllAPI __declspec( dllimport ) -#endif // POINT_SOURCE -#else -#define POINT_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define POINT_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -namespace geometry_msgs { - namespace msg { - namespace dds_ { - - - /*! - * @brief This class represents the structure Point_ defined by the user in the IDL file. - * @ingroup Point - */ - class Point_ - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Point_(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Point_(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object geometry_msgs::msg::dds_::Point_ that will be copied. - */ - eProsima_user_DllExport Point_( - const Point_& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object geometry_msgs::msg::dds_::Point_ that will be copied. - */ - eProsima_user_DllExport Point_( - Point_&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object geometry_msgs::msg::dds_::Point_ that will be copied. - */ - eProsima_user_DllExport Point_& operator =( - const Point_& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object geometry_msgs::msg::dds_::Point_ that will be copied. - */ - eProsima_user_DllExport Point_& operator =( - Point_&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::dds_::Point_ object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Point_& x) const; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::dds_::Point_ object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Point_& x) const; - - /*! - * @brief This function sets a value in member x - * @param _x New value for member x - */ - eProsima_user_DllExport void x( - double _x); - - /*! - * @brief This function returns the value of member x - * @return Value of member x - */ - eProsima_user_DllExport double x() const; - - /*! - * @brief This function returns a reference to member x - * @return Reference to member x - */ - eProsima_user_DllExport double& x(); - - - /*! - * @brief This function sets a value in member y - * @param _y New value for member y - */ - eProsima_user_DllExport void y( - double _y); - - /*! - * @brief This function returns the value of member y - * @return Value of member y - */ - eProsima_user_DllExport double y() const; - - /*! - * @brief This function returns a reference to member y - * @return Reference to member y - */ - eProsima_user_DllExport double& y(); - - - /*! - * @brief This function sets a value in member z - * @param _z New value for member z - */ - eProsima_user_DllExport void z( - double _z); - - /*! - * @brief This function returns the value of member z - * @return Value of member z - */ - eProsima_user_DllExport double z() const; - - /*! - * @brief This function returns a reference to member z - * @return Reference to member z - */ - eProsima_user_DllExport double& z(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const geometry_msgs::msg::dds_::Point_& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - double m_x; - double m_y; - double m_z; - - }; - - } // namespace dds_ - } // namespace msg -} // namespace geometry_msgs - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINT_H_ - - - diff --git a/mujoco/idl_gen/nav_msgs/PointCdrAux.hpp b/mujoco/idl_gen/nav_msgs/PointCdrAux.hpp deleted file mode 100644 index 73ae762..0000000 --- a/mujoco/idl_gen/nav_msgs/PointCdrAux.hpp +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file PointCdrAux.hpp - * This source file contains some definitions of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINTCDRAUX_HPP_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINTCDRAUX_HPP_ - -#include "Point.h" - -constexpr uint32_t geometry_msgs_msg_dds__Point__max_cdr_typesize {24UL}; -constexpr uint32_t geometry_msgs_msg_dds__Point__max_key_cdr_typesize {0UL}; - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::Point_& data); - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINTCDRAUX_HPP_ - diff --git a/mujoco/idl_gen/nav_msgs/PointCdrAux.ipp b/mujoco/idl_gen/nav_msgs/PointCdrAux.ipp deleted file mode 100644 index 787b2fc..0000000 --- a/mujoco/idl_gen/nav_msgs/PointCdrAux.ipp +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file PointCdrAux.ipp - * This source file contains some declarations of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINTCDRAUX_IPP_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINTCDRAUX_IPP_ - -#include "PointCdrAux.hpp" - -#include -#include - - -#include -using namespace eprosima::fastcdr::exception; - -namespace eprosima { -namespace fastcdr { - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const geometry_msgs::msg::dds_::Point_& data, - size_t& current_alignment) -{ - using namespace geometry_msgs::msg::dds_; - - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.x(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.y(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.z(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::Point_& data) -{ - using namespace geometry_msgs::msg::dds_; - - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.x() - << eprosima::fastcdr::MemberId(1) << data.y() - << eprosima::fastcdr::MemberId(2) << data.z() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - geometry_msgs::msg::dds_::Point_& data) -{ - using namespace geometry_msgs::msg::dds_; - - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.x(); - break; - - case 1: - dcdr >> data.y(); - break; - - case 2: - dcdr >> data.z(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::Point_& data) -{ - using namespace geometry_msgs::msg::dds_; - - static_cast(scdr); - static_cast(data); -} - - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINTCDRAUX_IPP_ - diff --git a/mujoco/idl_gen/nav_msgs/PointPubSubTypes.cxx b/mujoco/idl_gen/nav_msgs/PointPubSubTypes.cxx deleted file mode 100644 index 6a8a7f5..0000000 --- a/mujoco/idl_gen/nav_msgs/PointPubSubTypes.cxx +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file PointPubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#include - -#include "PointPubSubTypes.h" -#include "PointCdrAux.hpp" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; -using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - -namespace geometry_msgs { - namespace msg { - namespace dds_ { - - - Point_PubSubType::Point_PubSubType() - { - setName("geometry_msgs::msg::dds_::Point_"); - uint32_t type_size = - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(Point_::getMaxCdrSerializedSize()); - #else - geometry_msgs_msg_dds__Point__max_cdr_typesize; - #endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = geometry_msgs_msg_dds__Point__max_key_cdr_typesize > 16 ? geometry_msgs_msg_dds__Point__max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - Point_PubSubType::~Point_PubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool Point_PubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) - { - Point_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - #if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - #endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length - #if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); - #else - payload->length = static_cast(ser.get_serialized_data_length()); - #endif // FASTCDR_VERSION_MAJOR == 1 - return true; - } - - bool Point_PubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - Point_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN - #if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR - #endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; - } - - std::function Point_PubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) - { - return [data, data_representation]() -> uint32_t - { - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - #else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } - #endif // FASTCDR_VERSION_MAJOR == 1 - }; - } - - void* Point_PubSubType::createData() - { - return reinterpret_cast(new Point_()); - } - - void Point_PubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool Point_PubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - Point_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - geometry_msgs_msg_dds__Point__max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); - #if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); - #else - eprosima::fastcdr::serialize_key(ser, *p_type); - #endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || geometry_msgs_msg_dds__Point__max_key_cdr_typesize > 16) - { - m_md5.init(); - #if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - #else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); - #endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace dds_ - - - } //End of namespace msg - - -} //End of namespace geometry_msgs - diff --git a/mujoco/idl_gen/nav_msgs/PointPubSubTypes.h b/mujoco/idl_gen/nav_msgs/PointPubSubTypes.h deleted file mode 100644 index 467cf6e..0000000 --- a/mujoco/idl_gen/nav_msgs/PointPubSubTypes.h +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file PointPubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINT_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINT_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "Point.h" - - -#if !defined(GEN_API_VER) || (GEN_API_VER != 2) -#error \ - Generated Point is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace geometry_msgs -{ - namespace msg - { - namespace dds_ - { - - - - #ifndef SWIG - namespace detail { - - template - struct Point__rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - - }; - - struct Point__f - { - typedef double Point_::* type; - friend constexpr type get( - Point__f); - }; - - template struct Point__rob; - - template - inline size_t constexpr Point__offset_of() - { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } - - } // namespace detail - #endif // ifndef SWIG - - - /*! - * @brief This class represents the TopicDataType of the type Point_ defined by the user in the IDL file. - * @ingroup Point - */ - class Point_PubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef Point_ type; - - eProsima_user_DllExport Point_PubSubType(); - - eProsima_user_DllExport ~Point_PubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return is_plain_xcdrv1_impl(); - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) - { - return is_plain_xcdrv2_impl(); - } - else - { - return is_plain_xcdrv1_impl(); - } - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) Point_(); - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - - private: - - static constexpr bool is_plain_xcdrv1_impl() - { - return 24ULL == - (detail::Point__offset_of() + - sizeof(double)); - } - - static constexpr bool is_plain_xcdrv2_impl() - { - return 24ULL == - (detail::Point__offset_of() + - sizeof(double)); - } - - }; - } - } -} - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINT_PUBSUBTYPES_H_ - diff --git a/mujoco/idl_gen/nav_msgs/Pose.cxx b/mujoco/idl_gen/nav_msgs/Pose.cxx deleted file mode 100644 index 8e30257..0000000 --- a/mujoco/idl_gen/nav_msgs/Pose.cxx +++ /dev/null @@ -1,310 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Pose.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Pose.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define geometry_msgs_msg_dds__Quaternion__max_cdr_typesize 32ULL; -#define geometry_msgs_msg_dds__Point__max_cdr_typesize 24ULL; -#define geometry_msgs_msg_dds__Pose__max_cdr_typesize 56ULL; - - -namespace geometry_msgs { - -namespace msg { - -namespace dds_ { - - - -Pose_::Pose_() -{ - // geometry_msgs::msg::dds_::Point_ m_position - - // geometry_msgs::msg::dds_::Quaternion_ m_orientation - - -} - -Pose_::~Pose_() -{ -} - -Pose_::Pose_( - const Pose_& x) -{ - m_position = x.m_position; - - - m_orientation = x.m_orientation; - -} - -Pose_::Pose_( - Pose_&& x) noexcept -{ - m_position = std::move(x.m_position); - - - m_orientation = std::move(x.m_orientation); - -} - -Pose_& Pose_::operator =( - const Pose_& x) -{ - m_position = x.m_position; - - - m_orientation = x.m_orientation; - - return *this; -} - -Pose_& Pose_::operator =( - Pose_&& x) noexcept -{ - m_position = std::move(x.m_position); - - - m_orientation = std::move(x.m_orientation); - - return *this; -} - -bool Pose_::operator ==( - const Pose_& x) const -{ - return (m_position == x.m_position && - m_orientation == x.m_orientation); -} - -bool Pose_::operator !=( - const Pose_& x) const -{ - return !(*this == x); -} - -size_t Pose_::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return geometry_msgs_msg_dds__Pose__max_cdr_typesize; -} - -size_t Pose_::getCdrSerializedSize( - const Pose_& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += geometry_msgs::msg::dds_::Point_::getCdrSerializedSize(data.position(), current_alignment); - - - current_alignment += geometry_msgs::msg::dds_::Quaternion_::getCdrSerializedSize(data.orientation(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void Pose_::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_position; - - scdr << m_orientation; - -} - -void Pose_::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_position; - - - - dcdr >> m_orientation; - - -} - - -bool Pose_::isKeyDefined() -{ - return false; -} - -void Pose_::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member position - * @param _position New value to be copied in member position - */ -void Pose_::position( - const geometry_msgs::msg::dds_::Point_& _position) -{ - m_position = _position; -} - -/*! - * @brief This function moves the value in member position - * @param _position New value to be moved in member position - */ -void Pose_::position( - geometry_msgs::msg::dds_::Point_&& _position) -{ - m_position = std::move(_position); -} - -/*! - * @brief This function returns a constant reference to member position - * @return Constant reference to member position - */ -const geometry_msgs::msg::dds_::Point_& Pose_::position() const -{ - return m_position; -} - -/*! - * @brief This function returns a reference to member position - * @return Reference to member position - */ -geometry_msgs::msg::dds_::Point_& Pose_::position() -{ - return m_position; -} - - -/*! - * @brief This function copies the value in member orientation - * @param _orientation New value to be copied in member orientation - */ -void Pose_::orientation( - const geometry_msgs::msg::dds_::Quaternion_& _orientation) -{ - m_orientation = _orientation; -} - -/*! - * @brief This function moves the value in member orientation - * @param _orientation New value to be moved in member orientation - */ -void Pose_::orientation( - geometry_msgs::msg::dds_::Quaternion_&& _orientation) -{ - m_orientation = std::move(_orientation); -} - -/*! - * @brief This function returns a constant reference to member orientation - * @return Constant reference to member orientation - */ -const geometry_msgs::msg::dds_::Quaternion_& Pose_::orientation() const -{ - return m_orientation; -} - -/*! - * @brief This function returns a reference to member orientation - * @return Reference to member orientation - */ -geometry_msgs::msg::dds_::Quaternion_& Pose_::orientation() -{ - return m_orientation; -} - - - - - -} // namespace dds_ - - -} // namespace msg - - -} // namespace geometry_msgs - diff --git a/mujoco/idl_gen/nav_msgs/Pose.h b/mujoco/idl_gen/nav_msgs/Pose.h deleted file mode 100644 index 4a01c24..0000000 --- a/mujoco/idl_gen/nav_msgs/Pose.h +++ /dev/null @@ -1,253 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Pose.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSE_H_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSE_H_ - -#include "Quaternion.h" -#include "Point.h" - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(POSE_SOURCE) -#define POSE_DllAPI __declspec( dllexport ) -#else -#define POSE_DllAPI __declspec( dllimport ) -#endif // POSE_SOURCE -#else -#define POSE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define POSE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -namespace geometry_msgs { - namespace msg { - namespace dds_ { - - - /*! - * @brief This class represents the structure Pose_ defined by the user in the IDL file. - * @ingroup Pose - */ - class Pose_ - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Pose_(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Pose_(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object geometry_msgs::msg::dds_::Pose_ that will be copied. - */ - eProsima_user_DllExport Pose_( - const Pose_& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object geometry_msgs::msg::dds_::Pose_ that will be copied. - */ - eProsima_user_DllExport Pose_( - Pose_&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object geometry_msgs::msg::dds_::Pose_ that will be copied. - */ - eProsima_user_DllExport Pose_& operator =( - const Pose_& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object geometry_msgs::msg::dds_::Pose_ that will be copied. - */ - eProsima_user_DllExport Pose_& operator =( - Pose_&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::dds_::Pose_ object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Pose_& x) const; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::dds_::Pose_ object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Pose_& x) const; - - /*! - * @brief This function copies the value in member position - * @param _position New value to be copied in member position - */ - eProsima_user_DllExport void position( - const geometry_msgs::msg::dds_::Point_& _position); - - /*! - * @brief This function moves the value in member position - * @param _position New value to be moved in member position - */ - eProsima_user_DllExport void position( - geometry_msgs::msg::dds_::Point_&& _position); - - /*! - * @brief This function returns a constant reference to member position - * @return Constant reference to member position - */ - eProsima_user_DllExport const geometry_msgs::msg::dds_::Point_& position() const; - - /*! - * @brief This function returns a reference to member position - * @return Reference to member position - */ - eProsima_user_DllExport geometry_msgs::msg::dds_::Point_& position(); - - - /*! - * @brief This function copies the value in member orientation - * @param _orientation New value to be copied in member orientation - */ - eProsima_user_DllExport void orientation( - const geometry_msgs::msg::dds_::Quaternion_& _orientation); - - /*! - * @brief This function moves the value in member orientation - * @param _orientation New value to be moved in member orientation - */ - eProsima_user_DllExport void orientation( - geometry_msgs::msg::dds_::Quaternion_&& _orientation); - - /*! - * @brief This function returns a constant reference to member orientation - * @return Constant reference to member orientation - */ - eProsima_user_DllExport const geometry_msgs::msg::dds_::Quaternion_& orientation() const; - - /*! - * @brief This function returns a reference to member orientation - * @return Reference to member orientation - */ - eProsima_user_DllExport geometry_msgs::msg::dds_::Quaternion_& orientation(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const geometry_msgs::msg::dds_::Pose_& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - geometry_msgs::msg::dds_::Point_ m_position; - geometry_msgs::msg::dds_::Quaternion_ m_orientation; - - }; - - } // namespace dds_ - } // namespace msg -} // namespace geometry_msgs - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSE_H_ - - - diff --git a/mujoco/idl_gen/nav_msgs/PoseCdrAux.hpp b/mujoco/idl_gen/nav_msgs/PoseCdrAux.hpp deleted file mode 100644 index a431d3a..0000000 --- a/mujoco/idl_gen/nav_msgs/PoseCdrAux.hpp +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file PoseCdrAux.hpp - * This source file contains some definitions of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSECDRAUX_HPP_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSECDRAUX_HPP_ - -#include "Pose.h" - -constexpr uint32_t geometry_msgs_msg_dds__Pose__max_cdr_typesize {56UL}; -constexpr uint32_t geometry_msgs_msg_dds__Pose__max_key_cdr_typesize {0UL}; - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::Pose_& data); - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSECDRAUX_HPP_ - diff --git a/mujoco/idl_gen/nav_msgs/PoseCdrAux.ipp b/mujoco/idl_gen/nav_msgs/PoseCdrAux.ipp deleted file mode 100644 index ff157bc..0000000 --- a/mujoco/idl_gen/nav_msgs/PoseCdrAux.ipp +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file PoseCdrAux.ipp - * This source file contains some declarations of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSECDRAUX_IPP_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSECDRAUX_IPP_ - -#include "PoseCdrAux.hpp" - -#include -#include - - -#include -using namespace eprosima::fastcdr::exception; - -namespace eprosima { -namespace fastcdr { - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const geometry_msgs::msg::dds_::Pose_& data, - size_t& current_alignment) -{ - using namespace geometry_msgs::msg::dds_; - - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.position(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.orientation(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::Pose_& data) -{ - using namespace geometry_msgs::msg::dds_; - - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.position() - << eprosima::fastcdr::MemberId(1) << data.orientation() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - geometry_msgs::msg::dds_::Pose_& data) -{ - using namespace geometry_msgs::msg::dds_; - - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.position(); - break; - - case 1: - dcdr >> data.orientation(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::Pose_& data) -{ - using namespace geometry_msgs::msg::dds_; - - static_cast(scdr); - static_cast(data); -} - - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSECDRAUX_IPP_ - diff --git a/mujoco/idl_gen/nav_msgs/PosePubSubTypes.cxx b/mujoco/idl_gen/nav_msgs/PosePubSubTypes.cxx deleted file mode 100644 index abce5e0..0000000 --- a/mujoco/idl_gen/nav_msgs/PosePubSubTypes.cxx +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file PosePubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#include - -#include "PosePubSubTypes.h" -#include "PoseCdrAux.hpp" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; -using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - -namespace geometry_msgs { - namespace msg { - namespace dds_ { - - - Pose_PubSubType::Pose_PubSubType() - { - setName("geometry_msgs::msg::dds_::Pose_"); - uint32_t type_size = - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(Pose_::getMaxCdrSerializedSize()); - #else - geometry_msgs_msg_dds__Pose__max_cdr_typesize; - #endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = geometry_msgs_msg_dds__Pose__max_key_cdr_typesize > 16 ? geometry_msgs_msg_dds__Pose__max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - Pose_PubSubType::~Pose_PubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool Pose_PubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) - { - Pose_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - #if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - #endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length - #if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); - #else - payload->length = static_cast(ser.get_serialized_data_length()); - #endif // FASTCDR_VERSION_MAJOR == 1 - return true; - } - - bool Pose_PubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - Pose_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN - #if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR - #endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; - } - - std::function Pose_PubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) - { - return [data, data_representation]() -> uint32_t - { - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - #else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } - #endif // FASTCDR_VERSION_MAJOR == 1 - }; - } - - void* Pose_PubSubType::createData() - { - return reinterpret_cast(new Pose_()); - } - - void Pose_PubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool Pose_PubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - Pose_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - geometry_msgs_msg_dds__Pose__max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); - #if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); - #else - eprosima::fastcdr::serialize_key(ser, *p_type); - #endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || geometry_msgs_msg_dds__Pose__max_key_cdr_typesize > 16) - { - m_md5.init(); - #if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - #else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); - #endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace dds_ - - - } //End of namespace msg - - -} //End of namespace geometry_msgs - diff --git a/mujoco/idl_gen/nav_msgs/PosePubSubTypes.h b/mujoco/idl_gen/nav_msgs/PosePubSubTypes.h deleted file mode 100644 index 1c11f5f..0000000 --- a/mujoco/idl_gen/nav_msgs/PosePubSubTypes.h +++ /dev/null @@ -1,198 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file PosePubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSE_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSE_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "Pose.h" - -#include "QuaternionPubSubTypes.h" -#include "PointPubSubTypes.h" - -#if !defined(GEN_API_VER) || (GEN_API_VER != 2) -#error \ - Generated Pose is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace geometry_msgs -{ - namespace msg - { - namespace dds_ - { - - - - #ifndef SWIG - namespace detail { - - template - struct Pose__rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - - }; - - struct Pose__f - { - typedef geometry_msgs::msg::dds_::Quaternion_ Pose_::* type; - friend constexpr type get( - Pose__f); - }; - - template struct Pose__rob; - - template - inline size_t constexpr Pose__offset_of() - { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } - - } // namespace detail - #endif // ifndef SWIG - - - /*! - * @brief This class represents the TopicDataType of the type Pose_ defined by the user in the IDL file. - * @ingroup Pose - */ - class Pose_PubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef Pose_ type; - - eProsima_user_DllExport Pose_PubSubType(); - - eProsima_user_DllExport ~Pose_PubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return is_plain_xcdrv1_impl(); - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) - { - return is_plain_xcdrv2_impl(); - } - else - { - return is_plain_xcdrv1_impl(); - } - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) Pose_(); - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - - private: - - static constexpr bool is_plain_xcdrv1_impl() - { - return 56ULL == - (detail::Pose__offset_of() + - sizeof(geometry_msgs::msg::dds_::Quaternion_)); - } - - static constexpr bool is_plain_xcdrv2_impl() - { - return 56ULL == - (detail::Pose__offset_of() + - sizeof(geometry_msgs::msg::dds_::Quaternion_)); - } - - }; - } - } -} - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSE_PUBSUBTYPES_H_ - diff --git a/mujoco/idl_gen/nav_msgs/PoseWithCovariance.cxx b/mujoco/idl_gen/nav_msgs/PoseWithCovariance.cxx deleted file mode 100644 index 267c230..0000000 --- a/mujoco/idl_gen/nav_msgs/PoseWithCovariance.cxx +++ /dev/null @@ -1,313 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file PoseWithCovariance.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "PoseWithCovariance.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define geometry_msgs_msg_dds__Quaternion__max_cdr_typesize 32ULL; -#define geometry_msgs_msg_dds__Point__max_cdr_typesize 24ULL; -#define geometry_msgs_msg_dds__Pose__max_cdr_typesize 56ULL; -#define geometry_msgs_msg_dds__PoseWithCovariance__max_cdr_typesize 344ULL; - - -namespace geometry_msgs { - -namespace msg { - -namespace dds_ { - - - -PoseWithCovariance_::PoseWithCovariance_() -{ - // geometry_msgs::msg::dds_::Pose_ m_pose - - // double m_covariance - memset(&m_covariance, 0, ((36)) * 8); - -} - -PoseWithCovariance_::~PoseWithCovariance_() -{ -} - -PoseWithCovariance_::PoseWithCovariance_( - const PoseWithCovariance_& x) -{ - m_pose = x.m_pose; - - - m_covariance = x.m_covariance; - -} - -PoseWithCovariance_::PoseWithCovariance_( - PoseWithCovariance_&& x) noexcept -{ - m_pose = std::move(x.m_pose); - - - m_covariance = std::move(x.m_covariance); - -} - -PoseWithCovariance_& PoseWithCovariance_::operator =( - const PoseWithCovariance_& x) -{ - m_pose = x.m_pose; - - - m_covariance = x.m_covariance; - - return *this; -} - -PoseWithCovariance_& PoseWithCovariance_::operator =( - PoseWithCovariance_&& x) noexcept -{ - m_pose = std::move(x.m_pose); - - - m_covariance = std::move(x.m_covariance); - - return *this; -} - -bool PoseWithCovariance_::operator ==( - const PoseWithCovariance_& x) const -{ - return (m_pose == x.m_pose && - m_covariance == x.m_covariance); -} - -bool PoseWithCovariance_::operator !=( - const PoseWithCovariance_& x) const -{ - return !(*this == x); -} - -size_t PoseWithCovariance_::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return geometry_msgs_msg_dds__PoseWithCovariance__max_cdr_typesize; -} - -size_t PoseWithCovariance_::getCdrSerializedSize( - const PoseWithCovariance_& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += geometry_msgs::msg::dds_::Pose_::getCdrSerializedSize(data.pose(), current_alignment); - - - current_alignment += (((36)) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - - return current_alignment - initial_alignment; -} - - -void PoseWithCovariance_::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_pose; - - scdr << m_covariance; - - -} - -void PoseWithCovariance_::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_pose; - - - - dcdr >> m_covariance; - - -} - - -bool PoseWithCovariance_::isKeyDefined() -{ - return false; -} - -void PoseWithCovariance_::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member pose - * @param _pose New value to be copied in member pose - */ -void PoseWithCovariance_::pose( - const geometry_msgs::msg::dds_::Pose_& _pose) -{ - m_pose = _pose; -} - -/*! - * @brief This function moves the value in member pose - * @param _pose New value to be moved in member pose - */ -void PoseWithCovariance_::pose( - geometry_msgs::msg::dds_::Pose_&& _pose) -{ - m_pose = std::move(_pose); -} - -/*! - * @brief This function returns a constant reference to member pose - * @return Constant reference to member pose - */ -const geometry_msgs::msg::dds_::Pose_& PoseWithCovariance_::pose() const -{ - return m_pose; -} - -/*! - * @brief This function returns a reference to member pose - * @return Reference to member pose - */ -geometry_msgs::msg::dds_::Pose_& PoseWithCovariance_::pose() -{ - return m_pose; -} - - -/*! - * @brief This function copies the value in member covariance - * @param _covariance New value to be copied in member covariance - */ -void PoseWithCovariance_::covariance( - const std::array& _covariance) -{ - m_covariance = _covariance; -} - -/*! - * @brief This function moves the value in member covariance - * @param _covariance New value to be moved in member covariance - */ -void PoseWithCovariance_::covariance( - std::array&& _covariance) -{ - m_covariance = std::move(_covariance); -} - -/*! - * @brief This function returns a constant reference to member covariance - * @return Constant reference to member covariance - */ -const std::array& PoseWithCovariance_::covariance() const -{ - return m_covariance; -} - -/*! - * @brief This function returns a reference to member covariance - * @return Reference to member covariance - */ -std::array& PoseWithCovariance_::covariance() -{ - return m_covariance; -} - - - - - -} // namespace dds_ - - -} // namespace msg - - -} // namespace geometry_msgs - diff --git a/mujoco/idl_gen/nav_msgs/PoseWithCovariance.h b/mujoco/idl_gen/nav_msgs/PoseWithCovariance.h deleted file mode 100644 index eefb9fd..0000000 --- a/mujoco/idl_gen/nav_msgs/PoseWithCovariance.h +++ /dev/null @@ -1,252 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file PoseWithCovariance.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCE_H_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCE_H_ - -#include "Pose.h" - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(POSEWITHCOVARIANCE_SOURCE) -#define POSEWITHCOVARIANCE_DllAPI __declspec( dllexport ) -#else -#define POSEWITHCOVARIANCE_DllAPI __declspec( dllimport ) -#endif // POSEWITHCOVARIANCE_SOURCE -#else -#define POSEWITHCOVARIANCE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define POSEWITHCOVARIANCE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -namespace geometry_msgs { - namespace msg { - namespace dds_ { - - - /*! - * @brief This class represents the structure PoseWithCovariance_ defined by the user in the IDL file. - * @ingroup PoseWithCovariance - */ - class PoseWithCovariance_ - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport PoseWithCovariance_(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~PoseWithCovariance_(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object geometry_msgs::msg::dds_::PoseWithCovariance_ that will be copied. - */ - eProsima_user_DllExport PoseWithCovariance_( - const PoseWithCovariance_& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object geometry_msgs::msg::dds_::PoseWithCovariance_ that will be copied. - */ - eProsima_user_DllExport PoseWithCovariance_( - PoseWithCovariance_&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object geometry_msgs::msg::dds_::PoseWithCovariance_ that will be copied. - */ - eProsima_user_DllExport PoseWithCovariance_& operator =( - const PoseWithCovariance_& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object geometry_msgs::msg::dds_::PoseWithCovariance_ that will be copied. - */ - eProsima_user_DllExport PoseWithCovariance_& operator =( - PoseWithCovariance_&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::dds_::PoseWithCovariance_ object to compare. - */ - eProsima_user_DllExport bool operator ==( - const PoseWithCovariance_& x) const; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::dds_::PoseWithCovariance_ object to compare. - */ - eProsima_user_DllExport bool operator !=( - const PoseWithCovariance_& x) const; - - /*! - * @brief This function copies the value in member pose - * @param _pose New value to be copied in member pose - */ - eProsima_user_DllExport void pose( - const geometry_msgs::msg::dds_::Pose_& _pose); - - /*! - * @brief This function moves the value in member pose - * @param _pose New value to be moved in member pose - */ - eProsima_user_DllExport void pose( - geometry_msgs::msg::dds_::Pose_&& _pose); - - /*! - * @brief This function returns a constant reference to member pose - * @return Constant reference to member pose - */ - eProsima_user_DllExport const geometry_msgs::msg::dds_::Pose_& pose() const; - - /*! - * @brief This function returns a reference to member pose - * @return Reference to member pose - */ - eProsima_user_DllExport geometry_msgs::msg::dds_::Pose_& pose(); - - - /*! - * @brief This function copies the value in member covariance - * @param _covariance New value to be copied in member covariance - */ - eProsima_user_DllExport void covariance( - const std::array& _covariance); - - /*! - * @brief This function moves the value in member covariance - * @param _covariance New value to be moved in member covariance - */ - eProsima_user_DllExport void covariance( - std::array&& _covariance); - - /*! - * @brief This function returns a constant reference to member covariance - * @return Constant reference to member covariance - */ - eProsima_user_DllExport const std::array& covariance() const; - - /*! - * @brief This function returns a reference to member covariance - * @return Reference to member covariance - */ - eProsima_user_DllExport std::array& covariance(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const geometry_msgs::msg::dds_::PoseWithCovariance_& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - geometry_msgs::msg::dds_::Pose_ m_pose; - std::array m_covariance; - - }; - - } // namespace dds_ - } // namespace msg -} // namespace geometry_msgs - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCE_H_ - - - diff --git a/mujoco/idl_gen/nav_msgs/PoseWithCovarianceCdrAux.hpp b/mujoco/idl_gen/nav_msgs/PoseWithCovarianceCdrAux.hpp deleted file mode 100644 index 77dcabf..0000000 --- a/mujoco/idl_gen/nav_msgs/PoseWithCovarianceCdrAux.hpp +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file PoseWithCovarianceCdrAux.hpp - * This source file contains some definitions of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCECDRAUX_HPP_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCECDRAUX_HPP_ - -#include "PoseWithCovariance.h" - -constexpr uint32_t geometry_msgs_msg_dds__PoseWithCovariance__max_cdr_typesize {344UL}; -constexpr uint32_t geometry_msgs_msg_dds__PoseWithCovariance__max_key_cdr_typesize {0UL}; - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::PoseWithCovariance_& data); - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCECDRAUX_HPP_ - diff --git a/mujoco/idl_gen/nav_msgs/PoseWithCovarianceCdrAux.ipp b/mujoco/idl_gen/nav_msgs/PoseWithCovarianceCdrAux.ipp deleted file mode 100644 index b843a05..0000000 --- a/mujoco/idl_gen/nav_msgs/PoseWithCovarianceCdrAux.ipp +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file PoseWithCovarianceCdrAux.ipp - * This source file contains some declarations of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCECDRAUX_IPP_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCECDRAUX_IPP_ - -#include "PoseWithCovarianceCdrAux.hpp" - -#include -#include - - -#include -using namespace eprosima::fastcdr::exception; - -namespace eprosima { -namespace fastcdr { - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const geometry_msgs::msg::dds_::PoseWithCovariance_& data, - size_t& current_alignment) -{ - using namespace geometry_msgs::msg::dds_; - - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.pose(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.covariance(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::PoseWithCovariance_& data) -{ - using namespace geometry_msgs::msg::dds_; - - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.pose() - << eprosima::fastcdr::MemberId(1) << data.covariance() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - geometry_msgs::msg::dds_::PoseWithCovariance_& data) -{ - using namespace geometry_msgs::msg::dds_; - - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.pose(); - break; - - case 1: - dcdr >> data.covariance(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::PoseWithCovariance_& data) -{ - using namespace geometry_msgs::msg::dds_; - - static_cast(scdr); - static_cast(data); -} - - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCECDRAUX_IPP_ - diff --git a/mujoco/idl_gen/nav_msgs/PoseWithCovariancePubSubTypes.cxx b/mujoco/idl_gen/nav_msgs/PoseWithCovariancePubSubTypes.cxx deleted file mode 100644 index 8fd289e..0000000 --- a/mujoco/idl_gen/nav_msgs/PoseWithCovariancePubSubTypes.cxx +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file PoseWithCovariancePubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#include - -#include "PoseWithCovariancePubSubTypes.h" -#include "PoseWithCovarianceCdrAux.hpp" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; -using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - -namespace geometry_msgs { - namespace msg { - namespace dds_ { - - - PoseWithCovariance_PubSubType::PoseWithCovariance_PubSubType() - { - setName("geometry_msgs::msg::dds_::PoseWithCovariance_"); - uint32_t type_size = - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(PoseWithCovariance_::getMaxCdrSerializedSize()); - #else - geometry_msgs_msg_dds__PoseWithCovariance__max_cdr_typesize; - #endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = geometry_msgs_msg_dds__PoseWithCovariance__max_key_cdr_typesize > 16 ? geometry_msgs_msg_dds__PoseWithCovariance__max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - PoseWithCovariance_PubSubType::~PoseWithCovariance_PubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool PoseWithCovariance_PubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) - { - PoseWithCovariance_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - #if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - #endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length - #if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); - #else - payload->length = static_cast(ser.get_serialized_data_length()); - #endif // FASTCDR_VERSION_MAJOR == 1 - return true; - } - - bool PoseWithCovariance_PubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - PoseWithCovariance_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN - #if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR - #endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; - } - - std::function PoseWithCovariance_PubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) - { - return [data, data_representation]() -> uint32_t - { - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - #else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } - #endif // FASTCDR_VERSION_MAJOR == 1 - }; - } - - void* PoseWithCovariance_PubSubType::createData() - { - return reinterpret_cast(new PoseWithCovariance_()); - } - - void PoseWithCovariance_PubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool PoseWithCovariance_PubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - PoseWithCovariance_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - geometry_msgs_msg_dds__PoseWithCovariance__max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); - #if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); - #else - eprosima::fastcdr::serialize_key(ser, *p_type); - #endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || geometry_msgs_msg_dds__PoseWithCovariance__max_key_cdr_typesize > 16) - { - m_md5.init(); - #if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - #else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); - #endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace dds_ - - - } //End of namespace msg - - -} //End of namespace geometry_msgs - diff --git a/mujoco/idl_gen/nav_msgs/PoseWithCovariancePubSubTypes.h b/mujoco/idl_gen/nav_msgs/PoseWithCovariancePubSubTypes.h deleted file mode 100644 index 9dcd73c..0000000 --- a/mujoco/idl_gen/nav_msgs/PoseWithCovariancePubSubTypes.h +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file PoseWithCovariancePubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCE_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCE_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "PoseWithCovariance.h" - -#include "PosePubSubTypes.h" - -#if !defined(GEN_API_VER) || (GEN_API_VER != 2) -#error \ - Generated PoseWithCovariance is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace geometry_msgs -{ - namespace msg - { - namespace dds_ - { - - - - #ifndef SWIG - namespace detail { - - template - struct PoseWithCovariance__rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - - }; - - struct PoseWithCovariance__f - { - typedef std::array PoseWithCovariance_::* type; - friend constexpr type get( - PoseWithCovariance__f); - }; - - template struct PoseWithCovariance__rob; - - template - inline size_t constexpr PoseWithCovariance__offset_of() - { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } - - } // namespace detail - #endif // ifndef SWIG - - - /*! - * @brief This class represents the TopicDataType of the type PoseWithCovariance_ defined by the user in the IDL file. - * @ingroup PoseWithCovariance - */ - class PoseWithCovariance_PubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef PoseWithCovariance_ type; - - eProsima_user_DllExport PoseWithCovariance_PubSubType(); - - eProsima_user_DllExport ~PoseWithCovariance_PubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return is_plain_xcdrv1_impl(); - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) - { - return is_plain_xcdrv2_impl(); - } - else - { - return is_plain_xcdrv1_impl(); - } - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) PoseWithCovariance_(); - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - - private: - - static constexpr bool is_plain_xcdrv1_impl() - { - return 344ULL == - (detail::PoseWithCovariance__offset_of() + - sizeof(std::array)); - } - - static constexpr bool is_plain_xcdrv2_impl() - { - return 344ULL == - (detail::PoseWithCovariance__offset_of() + - sizeof(std::array)); - } - - }; - } - } -} - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCE_PUBSUBTYPES_H_ - diff --git a/mujoco/idl_gen/nav_msgs/Quaternion.cxx b/mujoco/idl_gen/nav_msgs/Quaternion.cxx deleted file mode 100644 index a6a9b05..0000000 --- a/mujoco/idl_gen/nav_msgs/Quaternion.cxx +++ /dev/null @@ -1,394 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Quaternion.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Quaternion.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define geometry_msgs_msg_dds__Quaternion__max_cdr_typesize 32ULL; - - -namespace geometry_msgs { - -namespace msg { - -namespace dds_ { - - - -Quaternion_::Quaternion_() -{ - // double m_x - m_x = 0.0; - // double m_y - m_y = 0.0; - // double m_z - m_z = 0.0; - // double m_w - m_w = 0.0; - -} - -Quaternion_::~Quaternion_() -{ -} - -Quaternion_::Quaternion_( - const Quaternion_& x) -{ - m_x = x.m_x; - - - m_y = x.m_y; - - - m_z = x.m_z; - - - m_w = x.m_w; - -} - -Quaternion_::Quaternion_( - Quaternion_&& x) noexcept -{ - m_x = x.m_x; - - - m_y = x.m_y; - - - m_z = x.m_z; - - - m_w = x.m_w; - -} - -Quaternion_& Quaternion_::operator =( - const Quaternion_& x) -{ - m_x = x.m_x; - - - m_y = x.m_y; - - - m_z = x.m_z; - - - m_w = x.m_w; - - return *this; -} - -Quaternion_& Quaternion_::operator =( - Quaternion_&& x) noexcept -{ - m_x = x.m_x; - - - m_y = x.m_y; - - - m_z = x.m_z; - - - m_w = x.m_w; - - return *this; -} - -bool Quaternion_::operator ==( - const Quaternion_& x) const -{ - return (m_x == x.m_x && - m_y == x.m_y && - m_z == x.m_z && - m_w == x.m_w); -} - -bool Quaternion_::operator !=( - const Quaternion_& x) const -{ - return !(*this == x); -} - -size_t Quaternion_::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return geometry_msgs_msg_dds__Quaternion__max_cdr_typesize; -} - -size_t Quaternion_::getCdrSerializedSize( - const Quaternion_& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - return current_alignment - initial_alignment; -} - - -void Quaternion_::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_x; - - scdr << m_y; - - scdr << m_z; - - scdr << m_w; - -} - -void Quaternion_::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_x; - - - - dcdr >> m_y; - - - - dcdr >> m_z; - - - - dcdr >> m_w; - - -} - - -bool Quaternion_::isKeyDefined() -{ - return false; -} - -void Quaternion_::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member x - * @param _x New value for member x - */ -void Quaternion_::x( - double _x) -{ - m_x = _x; -} - -/*! - * @brief This function returns the value of member x - * @return Value of member x - */ -double Quaternion_::x() const -{ - return m_x; -} - -/*! - * @brief This function returns a reference to member x - * @return Reference to member x - */ -double& Quaternion_::x() -{ - return m_x; -} - - -/*! - * @brief This function sets a value in member y - * @param _y New value for member y - */ -void Quaternion_::y( - double _y) -{ - m_y = _y; -} - -/*! - * @brief This function returns the value of member y - * @return Value of member y - */ -double Quaternion_::y() const -{ - return m_y; -} - -/*! - * @brief This function returns a reference to member y - * @return Reference to member y - */ -double& Quaternion_::y() -{ - return m_y; -} - - -/*! - * @brief This function sets a value in member z - * @param _z New value for member z - */ -void Quaternion_::z( - double _z) -{ - m_z = _z; -} - -/*! - * @brief This function returns the value of member z - * @return Value of member z - */ -double Quaternion_::z() const -{ - return m_z; -} - -/*! - * @brief This function returns a reference to member z - * @return Reference to member z - */ -double& Quaternion_::z() -{ - return m_z; -} - - -/*! - * @brief This function sets a value in member w - * @param _w New value for member w - */ -void Quaternion_::w( - double _w) -{ - m_w = _w; -} - -/*! - * @brief This function returns the value of member w - * @return Value of member w - */ -double Quaternion_::w() const -{ - return m_w; -} - -/*! - * @brief This function returns a reference to member w - * @return Reference to member w - */ -double& Quaternion_::w() -{ - return m_w; -} - - - - - -} // namespace dds_ - - -} // namespace msg - - -} // namespace geometry_msgs - diff --git a/mujoco/idl_gen/nav_msgs/Quaternion.h b/mujoco/idl_gen/nav_msgs/Quaternion.h deleted file mode 100644 index 52ea093..0000000 --- a/mujoco/idl_gen/nav_msgs/Quaternion.h +++ /dev/null @@ -1,279 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Quaternion.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNION_H_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNION_H_ - - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(QUATERNION_SOURCE) -#define QUATERNION_DllAPI __declspec( dllexport ) -#else -#define QUATERNION_DllAPI __declspec( dllimport ) -#endif // QUATERNION_SOURCE -#else -#define QUATERNION_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define QUATERNION_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -namespace geometry_msgs { - namespace msg { - namespace dds_ { - - - /*! - * @brief This class represents the structure Quaternion_ defined by the user in the IDL file. - * @ingroup Quaternion - */ - class Quaternion_ - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Quaternion_(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Quaternion_(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object geometry_msgs::msg::dds_::Quaternion_ that will be copied. - */ - eProsima_user_DllExport Quaternion_( - const Quaternion_& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object geometry_msgs::msg::dds_::Quaternion_ that will be copied. - */ - eProsima_user_DllExport Quaternion_( - Quaternion_&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object geometry_msgs::msg::dds_::Quaternion_ that will be copied. - */ - eProsima_user_DllExport Quaternion_& operator =( - const Quaternion_& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object geometry_msgs::msg::dds_::Quaternion_ that will be copied. - */ - eProsima_user_DllExport Quaternion_& operator =( - Quaternion_&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::dds_::Quaternion_ object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Quaternion_& x) const; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::dds_::Quaternion_ object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Quaternion_& x) const; - - /*! - * @brief This function sets a value in member x - * @param _x New value for member x - */ - eProsima_user_DllExport void x( - double _x); - - /*! - * @brief This function returns the value of member x - * @return Value of member x - */ - eProsima_user_DllExport double x() const; - - /*! - * @brief This function returns a reference to member x - * @return Reference to member x - */ - eProsima_user_DllExport double& x(); - - - /*! - * @brief This function sets a value in member y - * @param _y New value for member y - */ - eProsima_user_DllExport void y( - double _y); - - /*! - * @brief This function returns the value of member y - * @return Value of member y - */ - eProsima_user_DllExport double y() const; - - /*! - * @brief This function returns a reference to member y - * @return Reference to member y - */ - eProsima_user_DllExport double& y(); - - - /*! - * @brief This function sets a value in member z - * @param _z New value for member z - */ - eProsima_user_DllExport void z( - double _z); - - /*! - * @brief This function returns the value of member z - * @return Value of member z - */ - eProsima_user_DllExport double z() const; - - /*! - * @brief This function returns a reference to member z - * @return Reference to member z - */ - eProsima_user_DllExport double& z(); - - - /*! - * @brief This function sets a value in member w - * @param _w New value for member w - */ - eProsima_user_DllExport void w( - double _w); - - /*! - * @brief This function returns the value of member w - * @return Value of member w - */ - eProsima_user_DllExport double w() const; - - /*! - * @brief This function returns a reference to member w - * @return Reference to member w - */ - eProsima_user_DllExport double& w(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const geometry_msgs::msg::dds_::Quaternion_& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - double m_x; - double m_y; - double m_z; - double m_w; - - }; - - } // namespace dds_ - } // namespace msg -} // namespace geometry_msgs - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNION_H_ - - - diff --git a/mujoco/idl_gen/nav_msgs/QuaternionCdrAux.hpp b/mujoco/idl_gen/nav_msgs/QuaternionCdrAux.hpp deleted file mode 100644 index b284816..0000000 --- a/mujoco/idl_gen/nav_msgs/QuaternionCdrAux.hpp +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file QuaternionCdrAux.hpp - * This source file contains some definitions of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNIONCDRAUX_HPP_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNIONCDRAUX_HPP_ - -#include "Quaternion.h" - -constexpr uint32_t geometry_msgs_msg_dds__Quaternion__max_cdr_typesize {32UL}; -constexpr uint32_t geometry_msgs_msg_dds__Quaternion__max_key_cdr_typesize {0UL}; - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::Quaternion_& data); - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNIONCDRAUX_HPP_ - diff --git a/mujoco/idl_gen/nav_msgs/QuaternionCdrAux.ipp b/mujoco/idl_gen/nav_msgs/QuaternionCdrAux.ipp deleted file mode 100644 index 8a3b135..0000000 --- a/mujoco/idl_gen/nav_msgs/QuaternionCdrAux.ipp +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file QuaternionCdrAux.ipp - * This source file contains some declarations of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNIONCDRAUX_IPP_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNIONCDRAUX_IPP_ - -#include "QuaternionCdrAux.hpp" - -#include -#include - - -#include -using namespace eprosima::fastcdr::exception; - -namespace eprosima { -namespace fastcdr { - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const geometry_msgs::msg::dds_::Quaternion_& data, - size_t& current_alignment) -{ - using namespace geometry_msgs::msg::dds_; - - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.x(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.y(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.z(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), - data.w(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::Quaternion_& data) -{ - using namespace geometry_msgs::msg::dds_; - - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.x() - << eprosima::fastcdr::MemberId(1) << data.y() - << eprosima::fastcdr::MemberId(2) << data.z() - << eprosima::fastcdr::MemberId(3) << data.w() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - geometry_msgs::msg::dds_::Quaternion_& data) -{ - using namespace geometry_msgs::msg::dds_; - - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.x(); - break; - - case 1: - dcdr >> data.y(); - break; - - case 2: - dcdr >> data.z(); - break; - - case 3: - dcdr >> data.w(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::Quaternion_& data) -{ - using namespace geometry_msgs::msg::dds_; - - static_cast(scdr); - static_cast(data); -} - - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNIONCDRAUX_IPP_ - diff --git a/mujoco/idl_gen/nav_msgs/QuaternionPubSubTypes.cxx b/mujoco/idl_gen/nav_msgs/QuaternionPubSubTypes.cxx deleted file mode 100644 index 1a32c96..0000000 --- a/mujoco/idl_gen/nav_msgs/QuaternionPubSubTypes.cxx +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file QuaternionPubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#include - -#include "QuaternionPubSubTypes.h" -#include "QuaternionCdrAux.hpp" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; -using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - -namespace geometry_msgs { - namespace msg { - namespace dds_ { - - - Quaternion_PubSubType::Quaternion_PubSubType() - { - setName("geometry_msgs::msg::dds_::Quaternion_"); - uint32_t type_size = - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(Quaternion_::getMaxCdrSerializedSize()); - #else - geometry_msgs_msg_dds__Quaternion__max_cdr_typesize; - #endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = geometry_msgs_msg_dds__Quaternion__max_key_cdr_typesize > 16 ? geometry_msgs_msg_dds__Quaternion__max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - Quaternion_PubSubType::~Quaternion_PubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool Quaternion_PubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) - { - Quaternion_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - #if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - #endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length - #if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); - #else - payload->length = static_cast(ser.get_serialized_data_length()); - #endif // FASTCDR_VERSION_MAJOR == 1 - return true; - } - - bool Quaternion_PubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - Quaternion_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN - #if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR - #endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; - } - - std::function Quaternion_PubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) - { - return [data, data_representation]() -> uint32_t - { - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - #else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } - #endif // FASTCDR_VERSION_MAJOR == 1 - }; - } - - void* Quaternion_PubSubType::createData() - { - return reinterpret_cast(new Quaternion_()); - } - - void Quaternion_PubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool Quaternion_PubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - Quaternion_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - geometry_msgs_msg_dds__Quaternion__max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); - #if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); - #else - eprosima::fastcdr::serialize_key(ser, *p_type); - #endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || geometry_msgs_msg_dds__Quaternion__max_key_cdr_typesize > 16) - { - m_md5.init(); - #if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - #else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); - #endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace dds_ - - - } //End of namespace msg - - -} //End of namespace geometry_msgs - diff --git a/mujoco/idl_gen/nav_msgs/QuaternionPubSubTypes.h b/mujoco/idl_gen/nav_msgs/QuaternionPubSubTypes.h deleted file mode 100644 index 9a7dbcd..0000000 --- a/mujoco/idl_gen/nav_msgs/QuaternionPubSubTypes.h +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file QuaternionPubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNION_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNION_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "Quaternion.h" - - -#if !defined(GEN_API_VER) || (GEN_API_VER != 2) -#error \ - Generated Quaternion is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace geometry_msgs -{ - namespace msg - { - namespace dds_ - { - - - - #ifndef SWIG - namespace detail { - - template - struct Quaternion__rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - - }; - - struct Quaternion__f - { - typedef double Quaternion_::* type; - friend constexpr type get( - Quaternion__f); - }; - - template struct Quaternion__rob; - - template - inline size_t constexpr Quaternion__offset_of() - { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } - - } // namespace detail - #endif // ifndef SWIG - - - /*! - * @brief This class represents the TopicDataType of the type Quaternion_ defined by the user in the IDL file. - * @ingroup Quaternion - */ - class Quaternion_PubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef Quaternion_ type; - - eProsima_user_DllExport Quaternion_PubSubType(); - - eProsima_user_DllExport ~Quaternion_PubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return is_plain_xcdrv1_impl(); - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) - { - return is_plain_xcdrv2_impl(); - } - else - { - return is_plain_xcdrv1_impl(); - } - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) Quaternion_(); - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - - private: - - static constexpr bool is_plain_xcdrv1_impl() - { - return 32ULL == - (detail::Quaternion__offset_of() + - sizeof(double)); - } - - static constexpr bool is_plain_xcdrv2_impl() - { - return 32ULL == - (detail::Quaternion__offset_of() + - sizeof(double)); - } - - }; - } - } -} - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNION_PUBSUBTYPES_H_ - diff --git a/mujoco/idl_gen/nav_msgs/Time.cxx b/mujoco/idl_gen/nav_msgs/Time.cxx deleted file mode 100644 index 7766fbe..0000000 --- a/mujoco/idl_gen/nav_msgs/Time.cxx +++ /dev/null @@ -1,288 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Time.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Time.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define builtin_interfaces_msg_dds__Time__max_cdr_typesize 8ULL; - - -namespace builtin_interfaces { - -namespace msg { - -namespace dds_ { - - - -Time_::Time_() -{ - // long m_sec - m_sec = 0; - // unsigned long m_nanosec - m_nanosec = 0; - -} - -Time_::~Time_() -{ -} - -Time_::Time_( - const Time_& x) -{ - m_sec = x.m_sec; - - - m_nanosec = x.m_nanosec; - -} - -Time_::Time_( - Time_&& x) noexcept -{ - m_sec = x.m_sec; - - - m_nanosec = x.m_nanosec; - -} - -Time_& Time_::operator =( - const Time_& x) -{ - m_sec = x.m_sec; - - - m_nanosec = x.m_nanosec; - - return *this; -} - -Time_& Time_::operator =( - Time_&& x) noexcept -{ - m_sec = x.m_sec; - - - m_nanosec = x.m_nanosec; - - return *this; -} - -bool Time_::operator ==( - const Time_& x) const -{ - return (m_sec == x.m_sec && - m_nanosec == x.m_nanosec); -} - -bool Time_::operator !=( - const Time_& x) const -{ - return !(*this == x); -} - -size_t Time_::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return builtin_interfaces_msg_dds__Time__max_cdr_typesize; -} - -size_t Time_::getCdrSerializedSize( - const Time_& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void Time_::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_sec; - - scdr << m_nanosec; - -} - -void Time_::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_sec; - - - - dcdr >> m_nanosec; - - -} - - -bool Time_::isKeyDefined() -{ - return false; -} - -void Time_::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member sec - * @param _sec New value for member sec - */ -void Time_::sec( - int32_t _sec) -{ - m_sec = _sec; -} - -/*! - * @brief This function returns the value of member sec - * @return Value of member sec - */ -int32_t Time_::sec() const -{ - return m_sec; -} - -/*! - * @brief This function returns a reference to member sec - * @return Reference to member sec - */ -int32_t& Time_::sec() -{ - return m_sec; -} - - -/*! - * @brief This function sets a value in member nanosec - * @param _nanosec New value for member nanosec - */ -void Time_::nanosec( - uint32_t _nanosec) -{ - m_nanosec = _nanosec; -} - -/*! - * @brief This function returns the value of member nanosec - * @return Value of member nanosec - */ -uint32_t Time_::nanosec() const -{ - return m_nanosec; -} - -/*! - * @brief This function returns a reference to member nanosec - * @return Reference to member nanosec - */ -uint32_t& Time_::nanosec() -{ - return m_nanosec; -} - - - - - -} // namespace dds_ - - -} // namespace msg - - -} // namespace builtin_interfaces - diff --git a/mujoco/idl_gen/nav_msgs/Time.h b/mujoco/idl_gen/nav_msgs/Time.h deleted file mode 100644 index 7296ac0..0000000 --- a/mujoco/idl_gen/nav_msgs/Time.h +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Time.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIME_H_ -#define _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIME_H_ - - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TIME_SOURCE) -#define TIME_DllAPI __declspec( dllexport ) -#else -#define TIME_DllAPI __declspec( dllimport ) -#endif // TIME_SOURCE -#else -#define TIME_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define TIME_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -namespace builtin_interfaces { - namespace msg { - namespace dds_ { - - - /*! - * @brief This class represents the structure Time_ defined by the user in the IDL file. - * @ingroup Time - */ - class Time_ - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Time_(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Time_(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object builtin_interfaces::msg::dds_::Time_ that will be copied. - */ - eProsima_user_DllExport Time_( - const Time_& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object builtin_interfaces::msg::dds_::Time_ that will be copied. - */ - eProsima_user_DllExport Time_( - Time_&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object builtin_interfaces::msg::dds_::Time_ that will be copied. - */ - eProsima_user_DllExport Time_& operator =( - const Time_& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object builtin_interfaces::msg::dds_::Time_ that will be copied. - */ - eProsima_user_DllExport Time_& operator =( - Time_&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x builtin_interfaces::msg::dds_::Time_ object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Time_& x) const; - - /*! - * @brief Comparison operator. - * @param x builtin_interfaces::msg::dds_::Time_ object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Time_& x) const; - - /*! - * @brief This function sets a value in member sec - * @param _sec New value for member sec - */ - eProsima_user_DllExport void sec( - int32_t _sec); - - /*! - * @brief This function returns the value of member sec - * @return Value of member sec - */ - eProsima_user_DllExport int32_t sec() const; - - /*! - * @brief This function returns a reference to member sec - * @return Reference to member sec - */ - eProsima_user_DllExport int32_t& sec(); - - - /*! - * @brief This function sets a value in member nanosec - * @param _nanosec New value for member nanosec - */ - eProsima_user_DllExport void nanosec( - uint32_t _nanosec); - - /*! - * @brief This function returns the value of member nanosec - * @return Value of member nanosec - */ - eProsima_user_DllExport uint32_t nanosec() const; - - /*! - * @brief This function returns a reference to member nanosec - * @return Reference to member nanosec - */ - eProsima_user_DllExport uint32_t& nanosec(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const builtin_interfaces::msg::dds_::Time_& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - int32_t m_sec; - uint32_t m_nanosec; - - }; - - } // namespace dds_ - } // namespace msg -} // namespace builtin_interfaces - -#endif // _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIME_H_ - - - diff --git a/mujoco/idl_gen/nav_msgs/TimeCdrAux.hpp b/mujoco/idl_gen/nav_msgs/TimeCdrAux.hpp deleted file mode 100644 index 2f50163..0000000 --- a/mujoco/idl_gen/nav_msgs/TimeCdrAux.hpp +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TimeCdrAux.hpp - * This source file contains some definitions of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIMECDRAUX_HPP_ -#define _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIMECDRAUX_HPP_ - -#include "Time.h" - -constexpr uint32_t builtin_interfaces_msg_dds__Time__max_cdr_typesize {8UL}; -constexpr uint32_t builtin_interfaces_msg_dds__Time__max_key_cdr_typesize {0UL}; - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const builtin_interfaces::msg::dds_::Time_& data); - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIMECDRAUX_HPP_ - diff --git a/mujoco/idl_gen/nav_msgs/TimeCdrAux.ipp b/mujoco/idl_gen/nav_msgs/TimeCdrAux.ipp deleted file mode 100644 index 4b1d45b..0000000 --- a/mujoco/idl_gen/nav_msgs/TimeCdrAux.ipp +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TimeCdrAux.ipp - * This source file contains some declarations of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIMECDRAUX_IPP_ -#define _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIMECDRAUX_IPP_ - -#include "TimeCdrAux.hpp" - -#include -#include - - -#include -using namespace eprosima::fastcdr::exception; - -namespace eprosima { -namespace fastcdr { - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const builtin_interfaces::msg::dds_::Time_& data, - size_t& current_alignment) -{ - using namespace builtin_interfaces::msg::dds_; - - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.sec(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.nanosec(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const builtin_interfaces::msg::dds_::Time_& data) -{ - using namespace builtin_interfaces::msg::dds_; - - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.sec() - << eprosima::fastcdr::MemberId(1) << data.nanosec() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - builtin_interfaces::msg::dds_::Time_& data) -{ - using namespace builtin_interfaces::msg::dds_; - - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.sec(); - break; - - case 1: - dcdr >> data.nanosec(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const builtin_interfaces::msg::dds_::Time_& data) -{ - using namespace builtin_interfaces::msg::dds_; - - static_cast(scdr); - static_cast(data); -} - - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIMECDRAUX_IPP_ - diff --git a/mujoco/idl_gen/nav_msgs/TimePubSubTypes.cxx b/mujoco/idl_gen/nav_msgs/TimePubSubTypes.cxx deleted file mode 100644 index e0de1ac..0000000 --- a/mujoco/idl_gen/nav_msgs/TimePubSubTypes.cxx +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TimePubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#include - -#include "TimePubSubTypes.h" -#include "TimeCdrAux.hpp" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; -using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - -namespace builtin_interfaces { - namespace msg { - namespace dds_ { - - - Time_PubSubType::Time_PubSubType() - { - setName("builtin_interfaces::msg::dds_::Time_"); - uint32_t type_size = - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(Time_::getMaxCdrSerializedSize()); - #else - builtin_interfaces_msg_dds__Time__max_cdr_typesize; - #endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = builtin_interfaces_msg_dds__Time__max_key_cdr_typesize > 16 ? builtin_interfaces_msg_dds__Time__max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - Time_PubSubType::~Time_PubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool Time_PubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) - { - Time_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - #if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - #endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length - #if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); - #else - payload->length = static_cast(ser.get_serialized_data_length()); - #endif // FASTCDR_VERSION_MAJOR == 1 - return true; - } - - bool Time_PubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - Time_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN - #if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR - #endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; - } - - std::function Time_PubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) - { - return [data, data_representation]() -> uint32_t - { - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - #else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } - #endif // FASTCDR_VERSION_MAJOR == 1 - }; - } - - void* Time_PubSubType::createData() - { - return reinterpret_cast(new Time_()); - } - - void Time_PubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool Time_PubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - Time_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - builtin_interfaces_msg_dds__Time__max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); - #if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); - #else - eprosima::fastcdr::serialize_key(ser, *p_type); - #endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || builtin_interfaces_msg_dds__Time__max_key_cdr_typesize > 16) - { - m_md5.init(); - #if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - #else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); - #endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace dds_ - - - } //End of namespace msg - - -} //End of namespace builtin_interfaces - diff --git a/mujoco/idl_gen/nav_msgs/TimePubSubTypes.h b/mujoco/idl_gen/nav_msgs/TimePubSubTypes.h deleted file mode 100644 index ae14992..0000000 --- a/mujoco/idl_gen/nav_msgs/TimePubSubTypes.h +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TimePubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIME_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIME_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "Time.h" - - -#if !defined(GEN_API_VER) || (GEN_API_VER != 2) -#error \ - Generated Time is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace builtin_interfaces -{ - namespace msg - { - namespace dds_ - { - - - - #ifndef SWIG - namespace detail { - - template - struct Time__rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - - }; - - struct Time__f - { - typedef uint32_t Time_::* type; - friend constexpr type get( - Time__f); - }; - - template struct Time__rob; - - template - inline size_t constexpr Time__offset_of() - { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } - - } // namespace detail - #endif // ifndef SWIG - - - /*! - * @brief This class represents the TopicDataType of the type Time_ defined by the user in the IDL file. - * @ingroup Time - */ - class Time_PubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef Time_ type; - - eProsima_user_DllExport Time_PubSubType(); - - eProsima_user_DllExport ~Time_PubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return is_plain_xcdrv1_impl(); - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) - { - return is_plain_xcdrv2_impl(); - } - else - { - return is_plain_xcdrv1_impl(); - } - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) Time_(); - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - - private: - - static constexpr bool is_plain_xcdrv1_impl() - { - return 8ULL == - (detail::Time__offset_of() + - sizeof(uint32_t)); - } - - static constexpr bool is_plain_xcdrv2_impl() - { - return 8ULL == - (detail::Time__offset_of() + - sizeof(uint32_t)); - } - - }; - } - } -} - -#endif // _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIME_PUBSUBTYPES_H_ - diff --git a/mujoco/idl_gen/nav_msgs/Twist.cxx b/mujoco/idl_gen/nav_msgs/Twist.cxx deleted file mode 100644 index d6da739..0000000 --- a/mujoco/idl_gen/nav_msgs/Twist.cxx +++ /dev/null @@ -1,309 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Twist.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Twist.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define geometry_msgs_msg_dds__Vector3__max_cdr_typesize 24ULL; -#define geometry_msgs_msg_dds__Twist__max_cdr_typesize 48ULL; - - -namespace geometry_msgs { - -namespace msg { - -namespace dds_ { - - - -Twist_::Twist_() -{ - // geometry_msgs::msg::dds_::Vector3_ m_linear - - // geometry_msgs::msg::dds_::Vector3_ m_angular - - -} - -Twist_::~Twist_() -{ -} - -Twist_::Twist_( - const Twist_& x) -{ - m_linear = x.m_linear; - - - m_angular = x.m_angular; - -} - -Twist_::Twist_( - Twist_&& x) noexcept -{ - m_linear = std::move(x.m_linear); - - - m_angular = std::move(x.m_angular); - -} - -Twist_& Twist_::operator =( - const Twist_& x) -{ - m_linear = x.m_linear; - - - m_angular = x.m_angular; - - return *this; -} - -Twist_& Twist_::operator =( - Twist_&& x) noexcept -{ - m_linear = std::move(x.m_linear); - - - m_angular = std::move(x.m_angular); - - return *this; -} - -bool Twist_::operator ==( - const Twist_& x) const -{ - return (m_linear == x.m_linear && - m_angular == x.m_angular); -} - -bool Twist_::operator !=( - const Twist_& x) const -{ - return !(*this == x); -} - -size_t Twist_::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return geometry_msgs_msg_dds__Twist__max_cdr_typesize; -} - -size_t Twist_::getCdrSerializedSize( - const Twist_& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += geometry_msgs::msg::dds_::Vector3_::getCdrSerializedSize(data.linear(), current_alignment); - - - current_alignment += geometry_msgs::msg::dds_::Vector3_::getCdrSerializedSize(data.angular(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void Twist_::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_linear; - - scdr << m_angular; - -} - -void Twist_::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_linear; - - - - dcdr >> m_angular; - - -} - - -bool Twist_::isKeyDefined() -{ - return false; -} - -void Twist_::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member linear - * @param _linear New value to be copied in member linear - */ -void Twist_::linear( - const geometry_msgs::msg::dds_::Vector3_& _linear) -{ - m_linear = _linear; -} - -/*! - * @brief This function moves the value in member linear - * @param _linear New value to be moved in member linear - */ -void Twist_::linear( - geometry_msgs::msg::dds_::Vector3_&& _linear) -{ - m_linear = std::move(_linear); -} - -/*! - * @brief This function returns a constant reference to member linear - * @return Constant reference to member linear - */ -const geometry_msgs::msg::dds_::Vector3_& Twist_::linear() const -{ - return m_linear; -} - -/*! - * @brief This function returns a reference to member linear - * @return Reference to member linear - */ -geometry_msgs::msg::dds_::Vector3_& Twist_::linear() -{ - return m_linear; -} - - -/*! - * @brief This function copies the value in member angular - * @param _angular New value to be copied in member angular - */ -void Twist_::angular( - const geometry_msgs::msg::dds_::Vector3_& _angular) -{ - m_angular = _angular; -} - -/*! - * @brief This function moves the value in member angular - * @param _angular New value to be moved in member angular - */ -void Twist_::angular( - geometry_msgs::msg::dds_::Vector3_&& _angular) -{ - m_angular = std::move(_angular); -} - -/*! - * @brief This function returns a constant reference to member angular - * @return Constant reference to member angular - */ -const geometry_msgs::msg::dds_::Vector3_& Twist_::angular() const -{ - return m_angular; -} - -/*! - * @brief This function returns a reference to member angular - * @return Reference to member angular - */ -geometry_msgs::msg::dds_::Vector3_& Twist_::angular() -{ - return m_angular; -} - - - - - -} // namespace dds_ - - -} // namespace msg - - -} // namespace geometry_msgs - diff --git a/mujoco/idl_gen/nav_msgs/Twist.h b/mujoco/idl_gen/nav_msgs/Twist.h deleted file mode 100644 index 64989d1..0000000 --- a/mujoco/idl_gen/nav_msgs/Twist.h +++ /dev/null @@ -1,252 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Twist.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWIST_H_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWIST_H_ - -#include "Vector3.h" - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TWIST_SOURCE) -#define TWIST_DllAPI __declspec( dllexport ) -#else -#define TWIST_DllAPI __declspec( dllimport ) -#endif // TWIST_SOURCE -#else -#define TWIST_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define TWIST_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -namespace geometry_msgs { - namespace msg { - namespace dds_ { - - - /*! - * @brief This class represents the structure Twist_ defined by the user in the IDL file. - * @ingroup Twist - */ - class Twist_ - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Twist_(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Twist_(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object geometry_msgs::msg::dds_::Twist_ that will be copied. - */ - eProsima_user_DllExport Twist_( - const Twist_& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object geometry_msgs::msg::dds_::Twist_ that will be copied. - */ - eProsima_user_DllExport Twist_( - Twist_&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object geometry_msgs::msg::dds_::Twist_ that will be copied. - */ - eProsima_user_DllExport Twist_& operator =( - const Twist_& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object geometry_msgs::msg::dds_::Twist_ that will be copied. - */ - eProsima_user_DllExport Twist_& operator =( - Twist_&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::dds_::Twist_ object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Twist_& x) const; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::dds_::Twist_ object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Twist_& x) const; - - /*! - * @brief This function copies the value in member linear - * @param _linear New value to be copied in member linear - */ - eProsima_user_DllExport void linear( - const geometry_msgs::msg::dds_::Vector3_& _linear); - - /*! - * @brief This function moves the value in member linear - * @param _linear New value to be moved in member linear - */ - eProsima_user_DllExport void linear( - geometry_msgs::msg::dds_::Vector3_&& _linear); - - /*! - * @brief This function returns a constant reference to member linear - * @return Constant reference to member linear - */ - eProsima_user_DllExport const geometry_msgs::msg::dds_::Vector3_& linear() const; - - /*! - * @brief This function returns a reference to member linear - * @return Reference to member linear - */ - eProsima_user_DllExport geometry_msgs::msg::dds_::Vector3_& linear(); - - - /*! - * @brief This function copies the value in member angular - * @param _angular New value to be copied in member angular - */ - eProsima_user_DllExport void angular( - const geometry_msgs::msg::dds_::Vector3_& _angular); - - /*! - * @brief This function moves the value in member angular - * @param _angular New value to be moved in member angular - */ - eProsima_user_DllExport void angular( - geometry_msgs::msg::dds_::Vector3_&& _angular); - - /*! - * @brief This function returns a constant reference to member angular - * @return Constant reference to member angular - */ - eProsima_user_DllExport const geometry_msgs::msg::dds_::Vector3_& angular() const; - - /*! - * @brief This function returns a reference to member angular - * @return Reference to member angular - */ - eProsima_user_DllExport geometry_msgs::msg::dds_::Vector3_& angular(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const geometry_msgs::msg::dds_::Twist_& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - geometry_msgs::msg::dds_::Vector3_ m_linear; - geometry_msgs::msg::dds_::Vector3_ m_angular; - - }; - - } // namespace dds_ - } // namespace msg -} // namespace geometry_msgs - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWIST_H_ - - - diff --git a/mujoco/idl_gen/nav_msgs/TwistCdrAux.hpp b/mujoco/idl_gen/nav_msgs/TwistCdrAux.hpp deleted file mode 100644 index cff1e80..0000000 --- a/mujoco/idl_gen/nav_msgs/TwistCdrAux.hpp +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TwistCdrAux.hpp - * This source file contains some definitions of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTCDRAUX_HPP_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTCDRAUX_HPP_ - -#include "Twist.h" - -constexpr uint32_t geometry_msgs_msg_dds__Twist__max_cdr_typesize {48UL}; -constexpr uint32_t geometry_msgs_msg_dds__Twist__max_key_cdr_typesize {0UL}; - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::Twist_& data); - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTCDRAUX_HPP_ - diff --git a/mujoco/idl_gen/nav_msgs/TwistCdrAux.ipp b/mujoco/idl_gen/nav_msgs/TwistCdrAux.ipp deleted file mode 100644 index 88c03d1..0000000 --- a/mujoco/idl_gen/nav_msgs/TwistCdrAux.ipp +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TwistCdrAux.ipp - * This source file contains some declarations of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTCDRAUX_IPP_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTCDRAUX_IPP_ - -#include "TwistCdrAux.hpp" - -#include -#include - - -#include -using namespace eprosima::fastcdr::exception; - -namespace eprosima { -namespace fastcdr { - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const geometry_msgs::msg::dds_::Twist_& data, - size_t& current_alignment) -{ - using namespace geometry_msgs::msg::dds_; - - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.linear(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.angular(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::Twist_& data) -{ - using namespace geometry_msgs::msg::dds_; - - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.linear() - << eprosima::fastcdr::MemberId(1) << data.angular() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - geometry_msgs::msg::dds_::Twist_& data) -{ - using namespace geometry_msgs::msg::dds_; - - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.linear(); - break; - - case 1: - dcdr >> data.angular(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::Twist_& data) -{ - using namespace geometry_msgs::msg::dds_; - - static_cast(scdr); - static_cast(data); -} - - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTCDRAUX_IPP_ - diff --git a/mujoco/idl_gen/nav_msgs/TwistPubSubTypes.cxx b/mujoco/idl_gen/nav_msgs/TwistPubSubTypes.cxx deleted file mode 100644 index 71792a3..0000000 --- a/mujoco/idl_gen/nav_msgs/TwistPubSubTypes.cxx +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TwistPubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#include - -#include "TwistPubSubTypes.h" -#include "TwistCdrAux.hpp" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; -using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - -namespace geometry_msgs { - namespace msg { - namespace dds_ { - - - Twist_PubSubType::Twist_PubSubType() - { - setName("geometry_msgs::msg::dds_::Twist_"); - uint32_t type_size = - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(Twist_::getMaxCdrSerializedSize()); - #else - geometry_msgs_msg_dds__Twist__max_cdr_typesize; - #endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = geometry_msgs_msg_dds__Twist__max_key_cdr_typesize > 16 ? geometry_msgs_msg_dds__Twist__max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - Twist_PubSubType::~Twist_PubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool Twist_PubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) - { - Twist_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - #if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - #endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length - #if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); - #else - payload->length = static_cast(ser.get_serialized_data_length()); - #endif // FASTCDR_VERSION_MAJOR == 1 - return true; - } - - bool Twist_PubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - Twist_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN - #if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR - #endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; - } - - std::function Twist_PubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) - { - return [data, data_representation]() -> uint32_t - { - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - #else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } - #endif // FASTCDR_VERSION_MAJOR == 1 - }; - } - - void* Twist_PubSubType::createData() - { - return reinterpret_cast(new Twist_()); - } - - void Twist_PubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool Twist_PubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - Twist_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - geometry_msgs_msg_dds__Twist__max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); - #if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); - #else - eprosima::fastcdr::serialize_key(ser, *p_type); - #endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || geometry_msgs_msg_dds__Twist__max_key_cdr_typesize > 16) - { - m_md5.init(); - #if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - #else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); - #endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace dds_ - - - } //End of namespace msg - - -} //End of namespace geometry_msgs - diff --git a/mujoco/idl_gen/nav_msgs/TwistPubSubTypes.h b/mujoco/idl_gen/nav_msgs/TwistPubSubTypes.h deleted file mode 100644 index defb4e8..0000000 --- a/mujoco/idl_gen/nav_msgs/TwistPubSubTypes.h +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TwistPubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWIST_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWIST_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "Twist.h" - -#include "Vector3PubSubTypes.h" - -#if !defined(GEN_API_VER) || (GEN_API_VER != 2) -#error \ - Generated Twist is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace geometry_msgs -{ - namespace msg - { - namespace dds_ - { - - - - #ifndef SWIG - namespace detail { - - template - struct Twist__rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - - }; - - struct Twist__f - { - typedef geometry_msgs::msg::dds_::Vector3_ Twist_::* type; - friend constexpr type get( - Twist__f); - }; - - template struct Twist__rob; - - template - inline size_t constexpr Twist__offset_of() - { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } - - } // namespace detail - #endif // ifndef SWIG - - - /*! - * @brief This class represents the TopicDataType of the type Twist_ defined by the user in the IDL file. - * @ingroup Twist - */ - class Twist_PubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef Twist_ type; - - eProsima_user_DllExport Twist_PubSubType(); - - eProsima_user_DllExport ~Twist_PubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return is_plain_xcdrv1_impl(); - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) - { - return is_plain_xcdrv2_impl(); - } - else - { - return is_plain_xcdrv1_impl(); - } - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) Twist_(); - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - - private: - - static constexpr bool is_plain_xcdrv1_impl() - { - return 48ULL == - (detail::Twist__offset_of() + - sizeof(geometry_msgs::msg::dds_::Vector3_)); - } - - static constexpr bool is_plain_xcdrv2_impl() - { - return 48ULL == - (detail::Twist__offset_of() + - sizeof(geometry_msgs::msg::dds_::Vector3_)); - } - - }; - } - } -} - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWIST_PUBSUBTYPES_H_ - diff --git a/mujoco/idl_gen/nav_msgs/TwistWithCovariance.cxx b/mujoco/idl_gen/nav_msgs/TwistWithCovariance.cxx deleted file mode 100644 index 462570d..0000000 --- a/mujoco/idl_gen/nav_msgs/TwistWithCovariance.cxx +++ /dev/null @@ -1,312 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TwistWithCovariance.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "TwistWithCovariance.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define geometry_msgs_msg_dds__Vector3__max_cdr_typesize 24ULL; -#define geometry_msgs_msg_dds__TwistWithCovariance__max_cdr_typesize 336ULL; -#define geometry_msgs_msg_dds__Twist__max_cdr_typesize 48ULL; - - -namespace geometry_msgs { - -namespace msg { - -namespace dds_ { - - - -TwistWithCovariance_::TwistWithCovariance_() -{ - // geometry_msgs::msg::dds_::Twist_ m_twist - - // double m_covariance - memset(&m_covariance, 0, ((36)) * 8); - -} - -TwistWithCovariance_::~TwistWithCovariance_() -{ -} - -TwistWithCovariance_::TwistWithCovariance_( - const TwistWithCovariance_& x) -{ - m_twist = x.m_twist; - - - m_covariance = x.m_covariance; - -} - -TwistWithCovariance_::TwistWithCovariance_( - TwistWithCovariance_&& x) noexcept -{ - m_twist = std::move(x.m_twist); - - - m_covariance = std::move(x.m_covariance); - -} - -TwistWithCovariance_& TwistWithCovariance_::operator =( - const TwistWithCovariance_& x) -{ - m_twist = x.m_twist; - - - m_covariance = x.m_covariance; - - return *this; -} - -TwistWithCovariance_& TwistWithCovariance_::operator =( - TwistWithCovariance_&& x) noexcept -{ - m_twist = std::move(x.m_twist); - - - m_covariance = std::move(x.m_covariance); - - return *this; -} - -bool TwistWithCovariance_::operator ==( - const TwistWithCovariance_& x) const -{ - return (m_twist == x.m_twist && - m_covariance == x.m_covariance); -} - -bool TwistWithCovariance_::operator !=( - const TwistWithCovariance_& x) const -{ - return !(*this == x); -} - -size_t TwistWithCovariance_::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return geometry_msgs_msg_dds__TwistWithCovariance__max_cdr_typesize; -} - -size_t TwistWithCovariance_::getCdrSerializedSize( - const TwistWithCovariance_& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += geometry_msgs::msg::dds_::Twist_::getCdrSerializedSize(data.twist(), current_alignment); - - - current_alignment += (((36)) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - - return current_alignment - initial_alignment; -} - - -void TwistWithCovariance_::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_twist; - - scdr << m_covariance; - - -} - -void TwistWithCovariance_::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_twist; - - - - dcdr >> m_covariance; - - -} - - -bool TwistWithCovariance_::isKeyDefined() -{ - return false; -} - -void TwistWithCovariance_::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member twist - * @param _twist New value to be copied in member twist - */ -void TwistWithCovariance_::twist( - const geometry_msgs::msg::dds_::Twist_& _twist) -{ - m_twist = _twist; -} - -/*! - * @brief This function moves the value in member twist - * @param _twist New value to be moved in member twist - */ -void TwistWithCovariance_::twist( - geometry_msgs::msg::dds_::Twist_&& _twist) -{ - m_twist = std::move(_twist); -} - -/*! - * @brief This function returns a constant reference to member twist - * @return Constant reference to member twist - */ -const geometry_msgs::msg::dds_::Twist_& TwistWithCovariance_::twist() const -{ - return m_twist; -} - -/*! - * @brief This function returns a reference to member twist - * @return Reference to member twist - */ -geometry_msgs::msg::dds_::Twist_& TwistWithCovariance_::twist() -{ - return m_twist; -} - - -/*! - * @brief This function copies the value in member covariance - * @param _covariance New value to be copied in member covariance - */ -void TwistWithCovariance_::covariance( - const std::array& _covariance) -{ - m_covariance = _covariance; -} - -/*! - * @brief This function moves the value in member covariance - * @param _covariance New value to be moved in member covariance - */ -void TwistWithCovariance_::covariance( - std::array&& _covariance) -{ - m_covariance = std::move(_covariance); -} - -/*! - * @brief This function returns a constant reference to member covariance - * @return Constant reference to member covariance - */ -const std::array& TwistWithCovariance_::covariance() const -{ - return m_covariance; -} - -/*! - * @brief This function returns a reference to member covariance - * @return Reference to member covariance - */ -std::array& TwistWithCovariance_::covariance() -{ - return m_covariance; -} - - - - - -} // namespace dds_ - - -} // namespace msg - - -} // namespace geometry_msgs - diff --git a/mujoco/idl_gen/nav_msgs/TwistWithCovariance.h b/mujoco/idl_gen/nav_msgs/TwistWithCovariance.h deleted file mode 100644 index e263013..0000000 --- a/mujoco/idl_gen/nav_msgs/TwistWithCovariance.h +++ /dev/null @@ -1,252 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TwistWithCovariance.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCE_H_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCE_H_ - -#include "Twist.h" - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TWISTWITHCOVARIANCE_SOURCE) -#define TWISTWITHCOVARIANCE_DllAPI __declspec( dllexport ) -#else -#define TWISTWITHCOVARIANCE_DllAPI __declspec( dllimport ) -#endif // TWISTWITHCOVARIANCE_SOURCE -#else -#define TWISTWITHCOVARIANCE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define TWISTWITHCOVARIANCE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -namespace geometry_msgs { - namespace msg { - namespace dds_ { - - - /*! - * @brief This class represents the structure TwistWithCovariance_ defined by the user in the IDL file. - * @ingroup TwistWithCovariance - */ - class TwistWithCovariance_ - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport TwistWithCovariance_(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~TwistWithCovariance_(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object geometry_msgs::msg::dds_::TwistWithCovariance_ that will be copied. - */ - eProsima_user_DllExport TwistWithCovariance_( - const TwistWithCovariance_& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object geometry_msgs::msg::dds_::TwistWithCovariance_ that will be copied. - */ - eProsima_user_DllExport TwistWithCovariance_( - TwistWithCovariance_&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object geometry_msgs::msg::dds_::TwistWithCovariance_ that will be copied. - */ - eProsima_user_DllExport TwistWithCovariance_& operator =( - const TwistWithCovariance_& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object geometry_msgs::msg::dds_::TwistWithCovariance_ that will be copied. - */ - eProsima_user_DllExport TwistWithCovariance_& operator =( - TwistWithCovariance_&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::dds_::TwistWithCovariance_ object to compare. - */ - eProsima_user_DllExport bool operator ==( - const TwistWithCovariance_& x) const; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::dds_::TwistWithCovariance_ object to compare. - */ - eProsima_user_DllExport bool operator !=( - const TwistWithCovariance_& x) const; - - /*! - * @brief This function copies the value in member twist - * @param _twist New value to be copied in member twist - */ - eProsima_user_DllExport void twist( - const geometry_msgs::msg::dds_::Twist_& _twist); - - /*! - * @brief This function moves the value in member twist - * @param _twist New value to be moved in member twist - */ - eProsima_user_DllExport void twist( - geometry_msgs::msg::dds_::Twist_&& _twist); - - /*! - * @brief This function returns a constant reference to member twist - * @return Constant reference to member twist - */ - eProsima_user_DllExport const geometry_msgs::msg::dds_::Twist_& twist() const; - - /*! - * @brief This function returns a reference to member twist - * @return Reference to member twist - */ - eProsima_user_DllExport geometry_msgs::msg::dds_::Twist_& twist(); - - - /*! - * @brief This function copies the value in member covariance - * @param _covariance New value to be copied in member covariance - */ - eProsima_user_DllExport void covariance( - const std::array& _covariance); - - /*! - * @brief This function moves the value in member covariance - * @param _covariance New value to be moved in member covariance - */ - eProsima_user_DllExport void covariance( - std::array&& _covariance); - - /*! - * @brief This function returns a constant reference to member covariance - * @return Constant reference to member covariance - */ - eProsima_user_DllExport const std::array& covariance() const; - - /*! - * @brief This function returns a reference to member covariance - * @return Reference to member covariance - */ - eProsima_user_DllExport std::array& covariance(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const geometry_msgs::msg::dds_::TwistWithCovariance_& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - geometry_msgs::msg::dds_::Twist_ m_twist; - std::array m_covariance; - - }; - - } // namespace dds_ - } // namespace msg -} // namespace geometry_msgs - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCE_H_ - - - diff --git a/mujoco/idl_gen/nav_msgs/TwistWithCovarianceCdrAux.hpp b/mujoco/idl_gen/nav_msgs/TwistWithCovarianceCdrAux.hpp deleted file mode 100644 index 297ad3b..0000000 --- a/mujoco/idl_gen/nav_msgs/TwistWithCovarianceCdrAux.hpp +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TwistWithCovarianceCdrAux.hpp - * This source file contains some definitions of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCECDRAUX_HPP_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCECDRAUX_HPP_ - -#include "TwistWithCovariance.h" - -constexpr uint32_t geometry_msgs_msg_dds__TwistWithCovariance__max_cdr_typesize {336UL}; -constexpr uint32_t geometry_msgs_msg_dds__TwistWithCovariance__max_key_cdr_typesize {0UL}; - - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::TwistWithCovariance_& data); - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCECDRAUX_HPP_ - diff --git a/mujoco/idl_gen/nav_msgs/TwistWithCovarianceCdrAux.ipp b/mujoco/idl_gen/nav_msgs/TwistWithCovarianceCdrAux.ipp deleted file mode 100644 index a3fc729..0000000 --- a/mujoco/idl_gen/nav_msgs/TwistWithCovarianceCdrAux.ipp +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TwistWithCovarianceCdrAux.ipp - * This source file contains some declarations of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCECDRAUX_IPP_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCECDRAUX_IPP_ - -#include "TwistWithCovarianceCdrAux.hpp" - -#include -#include - - -#include -using namespace eprosima::fastcdr::exception; - -namespace eprosima { -namespace fastcdr { - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const geometry_msgs::msg::dds_::TwistWithCovariance_& data, - size_t& current_alignment) -{ - using namespace geometry_msgs::msg::dds_; - - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.twist(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.covariance(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::TwistWithCovariance_& data) -{ - using namespace geometry_msgs::msg::dds_; - - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.twist() - << eprosima::fastcdr::MemberId(1) << data.covariance() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - geometry_msgs::msg::dds_::TwistWithCovariance_& data) -{ - using namespace geometry_msgs::msg::dds_; - - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.twist(); - break; - - case 1: - dcdr >> data.covariance(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::TwistWithCovariance_& data) -{ - using namespace geometry_msgs::msg::dds_; - - static_cast(scdr); - static_cast(data); -} - - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCECDRAUX_IPP_ - diff --git a/mujoco/idl_gen/nav_msgs/TwistWithCovariancePubSubTypes.cxx b/mujoco/idl_gen/nav_msgs/TwistWithCovariancePubSubTypes.cxx deleted file mode 100644 index 4c24e80..0000000 --- a/mujoco/idl_gen/nav_msgs/TwistWithCovariancePubSubTypes.cxx +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TwistWithCovariancePubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#include - -#include "TwistWithCovariancePubSubTypes.h" -#include "TwistWithCovarianceCdrAux.hpp" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; -using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - -namespace geometry_msgs { - namespace msg { - namespace dds_ { - - - TwistWithCovariance_PubSubType::TwistWithCovariance_PubSubType() - { - setName("geometry_msgs::msg::dds_::TwistWithCovariance_"); - uint32_t type_size = - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(TwistWithCovariance_::getMaxCdrSerializedSize()); - #else - geometry_msgs_msg_dds__TwistWithCovariance__max_cdr_typesize; - #endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = geometry_msgs_msg_dds__TwistWithCovariance__max_key_cdr_typesize > 16 ? geometry_msgs_msg_dds__TwistWithCovariance__max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - TwistWithCovariance_PubSubType::~TwistWithCovariance_PubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool TwistWithCovariance_PubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) - { - TwistWithCovariance_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - #if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - #endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length - #if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); - #else - payload->length = static_cast(ser.get_serialized_data_length()); - #endif // FASTCDR_VERSION_MAJOR == 1 - return true; - } - - bool TwistWithCovariance_PubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - TwistWithCovariance_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN - #if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR - #endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; - } - - std::function TwistWithCovariance_PubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) - { - return [data, data_representation]() -> uint32_t - { - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - #else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } - #endif // FASTCDR_VERSION_MAJOR == 1 - }; - } - - void* TwistWithCovariance_PubSubType::createData() - { - return reinterpret_cast(new TwistWithCovariance_()); - } - - void TwistWithCovariance_PubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool TwistWithCovariance_PubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - TwistWithCovariance_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - geometry_msgs_msg_dds__TwistWithCovariance__max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); - #if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); - #else - eprosima::fastcdr::serialize_key(ser, *p_type); - #endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || geometry_msgs_msg_dds__TwistWithCovariance__max_key_cdr_typesize > 16) - { - m_md5.init(); - #if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - #else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); - #endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace dds_ - - - } //End of namespace msg - - -} //End of namespace geometry_msgs - diff --git a/mujoco/idl_gen/nav_msgs/TwistWithCovariancePubSubTypes.h b/mujoco/idl_gen/nav_msgs/TwistWithCovariancePubSubTypes.h deleted file mode 100644 index 5302fbd..0000000 --- a/mujoco/idl_gen/nav_msgs/TwistWithCovariancePubSubTypes.h +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TwistWithCovariancePubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCE_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCE_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "TwistWithCovariance.h" - -#include "TwistPubSubTypes.h" - -#if !defined(GEN_API_VER) || (GEN_API_VER != 2) -#error \ - Generated TwistWithCovariance is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace geometry_msgs -{ - namespace msg - { - namespace dds_ - { - - - - #ifndef SWIG - namespace detail { - - template - struct TwistWithCovariance__rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - - }; - - struct TwistWithCovariance__f - { - typedef std::array TwistWithCovariance_::* type; - friend constexpr type get( - TwistWithCovariance__f); - }; - - template struct TwistWithCovariance__rob; - - template - inline size_t constexpr TwistWithCovariance__offset_of() - { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } - - } // namespace detail - #endif // ifndef SWIG - - - /*! - * @brief This class represents the TopicDataType of the type TwistWithCovariance_ defined by the user in the IDL file. - * @ingroup TwistWithCovariance - */ - class TwistWithCovariance_PubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef TwistWithCovariance_ type; - - eProsima_user_DllExport TwistWithCovariance_PubSubType(); - - eProsima_user_DllExport ~TwistWithCovariance_PubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return is_plain_xcdrv1_impl(); - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) - { - return is_plain_xcdrv2_impl(); - } - else - { - return is_plain_xcdrv1_impl(); - } - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) TwistWithCovariance_(); - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - - private: - - static constexpr bool is_plain_xcdrv1_impl() - { - return 336ULL == - (detail::TwistWithCovariance__offset_of() + - sizeof(std::array)); - } - - static constexpr bool is_plain_xcdrv2_impl() - { - return 336ULL == - (detail::TwistWithCovariance__offset_of() + - sizeof(std::array)); - } - - }; - } - } -} - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCE_PUBSUBTYPES_H_ - diff --git a/mujoco/idl_gen/nav_msgs/Vector3.cxx b/mujoco/idl_gen/nav_msgs/Vector3.cxx deleted file mode 100644 index b9f24b9..0000000 --- a/mujoco/idl_gen/nav_msgs/Vector3.cxx +++ /dev/null @@ -1,341 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Vector3.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Vector3.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define geometry_msgs_msg_dds__Vector3__max_cdr_typesize 24ULL; - - -namespace geometry_msgs { - -namespace msg { - -namespace dds_ { - - - -Vector3_::Vector3_() -{ - // double m_x - m_x = 0.0; - // double m_y - m_y = 0.0; - // double m_z - m_z = 0.0; - -} - -Vector3_::~Vector3_() -{ -} - -Vector3_::Vector3_( - const Vector3_& x) -{ - m_x = x.m_x; - - - m_y = x.m_y; - - - m_z = x.m_z; - -} - -Vector3_::Vector3_( - Vector3_&& x) noexcept -{ - m_x = x.m_x; - - - m_y = x.m_y; - - - m_z = x.m_z; - -} - -Vector3_& Vector3_::operator =( - const Vector3_& x) -{ - m_x = x.m_x; - - - m_y = x.m_y; - - - m_z = x.m_z; - - return *this; -} - -Vector3_& Vector3_::operator =( - Vector3_&& x) noexcept -{ - m_x = x.m_x; - - - m_y = x.m_y; - - - m_z = x.m_z; - - return *this; -} - -bool Vector3_::operator ==( - const Vector3_& x) const -{ - return (m_x == x.m_x && - m_y == x.m_y && - m_z == x.m_z); -} - -bool Vector3_::operator !=( - const Vector3_& x) const -{ - return !(*this == x); -} - -size_t Vector3_::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return geometry_msgs_msg_dds__Vector3__max_cdr_typesize; -} - -size_t Vector3_::getCdrSerializedSize( - const Vector3_& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - return current_alignment - initial_alignment; -} - - -void Vector3_::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_x; - - scdr << m_y; - - scdr << m_z; - -} - -void Vector3_::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_x; - - - - dcdr >> m_y; - - - - dcdr >> m_z; - - -} - - -bool Vector3_::isKeyDefined() -{ - return false; -} - -void Vector3_::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member x - * @param _x New value for member x - */ -void Vector3_::x( - double _x) -{ - m_x = _x; -} - -/*! - * @brief This function returns the value of member x - * @return Value of member x - */ -double Vector3_::x() const -{ - return m_x; -} - -/*! - * @brief This function returns a reference to member x - * @return Reference to member x - */ -double& Vector3_::x() -{ - return m_x; -} - - -/*! - * @brief This function sets a value in member y - * @param _y New value for member y - */ -void Vector3_::y( - double _y) -{ - m_y = _y; -} - -/*! - * @brief This function returns the value of member y - * @return Value of member y - */ -double Vector3_::y() const -{ - return m_y; -} - -/*! - * @brief This function returns a reference to member y - * @return Reference to member y - */ -double& Vector3_::y() -{ - return m_y; -} - - -/*! - * @brief This function sets a value in member z - * @param _z New value for member z - */ -void Vector3_::z( - double _z) -{ - m_z = _z; -} - -/*! - * @brief This function returns the value of member z - * @return Value of member z - */ -double Vector3_::z() const -{ - return m_z; -} - -/*! - * @brief This function returns a reference to member z - * @return Reference to member z - */ -double& Vector3_::z() -{ - return m_z; -} - - - - - -} // namespace dds_ - - -} // namespace msg - - -} // namespace geometry_msgs - diff --git a/mujoco/idl_gen/nav_msgs/Vector3.h b/mujoco/idl_gen/nav_msgs/Vector3.h deleted file mode 100644 index 98a76cf..0000000 --- a/mujoco/idl_gen/nav_msgs/Vector3.h +++ /dev/null @@ -1,258 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Vector3.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3_H_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3_H_ - - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(VECTOR3_SOURCE) -#define VECTOR3_DllAPI __declspec( dllexport ) -#else -#define VECTOR3_DllAPI __declspec( dllimport ) -#endif // VECTOR3_SOURCE -#else -#define VECTOR3_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define VECTOR3_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -namespace geometry_msgs { - namespace msg { - namespace dds_ { - - - /*! - * @brief This class represents the structure Vector3_ defined by the user in the IDL file. - * @ingroup Vector3 - */ - class Vector3_ - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Vector3_(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Vector3_(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object geometry_msgs::msg::dds_::Vector3_ that will be copied. - */ - eProsima_user_DllExport Vector3_( - const Vector3_& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object geometry_msgs::msg::dds_::Vector3_ that will be copied. - */ - eProsima_user_DllExport Vector3_( - Vector3_&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object geometry_msgs::msg::dds_::Vector3_ that will be copied. - */ - eProsima_user_DllExport Vector3_& operator =( - const Vector3_& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object geometry_msgs::msg::dds_::Vector3_ that will be copied. - */ - eProsima_user_DllExport Vector3_& operator =( - Vector3_&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::dds_::Vector3_ object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Vector3_& x) const; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::dds_::Vector3_ object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Vector3_& x) const; - - /*! - * @brief This function sets a value in member x - * @param _x New value for member x - */ - eProsima_user_DllExport void x( - double _x); - - /*! - * @brief This function returns the value of member x - * @return Value of member x - */ - eProsima_user_DllExport double x() const; - - /*! - * @brief This function returns a reference to member x - * @return Reference to member x - */ - eProsima_user_DllExport double& x(); - - - /*! - * @brief This function sets a value in member y - * @param _y New value for member y - */ - eProsima_user_DllExport void y( - double _y); - - /*! - * @brief This function returns the value of member y - * @return Value of member y - */ - eProsima_user_DllExport double y() const; - - /*! - * @brief This function returns a reference to member y - * @return Reference to member y - */ - eProsima_user_DllExport double& y(); - - - /*! - * @brief This function sets a value in member z - * @param _z New value for member z - */ - eProsima_user_DllExport void z( - double _z); - - /*! - * @brief This function returns the value of member z - * @return Value of member z - */ - eProsima_user_DllExport double z() const; - - /*! - * @brief This function returns a reference to member z - * @return Reference to member z - */ - eProsima_user_DllExport double& z(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const geometry_msgs::msg::dds_::Vector3_& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - double m_x; - double m_y; - double m_z; - - }; - - } // namespace dds_ - } // namespace msg -} // namespace geometry_msgs - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3_H_ - - - diff --git a/mujoco/idl_gen/nav_msgs/Vector3CdrAux.hpp b/mujoco/idl_gen/nav_msgs/Vector3CdrAux.hpp deleted file mode 100644 index cf1af8c..0000000 --- a/mujoco/idl_gen/nav_msgs/Vector3CdrAux.hpp +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Vector3CdrAux.hpp - * This source file contains some definitions of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3CDRAUX_HPP_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3CDRAUX_HPP_ - -#include "Vector3.h" - -constexpr uint32_t geometry_msgs_msg_dds__Vector3__max_cdr_typesize {24UL}; -constexpr uint32_t geometry_msgs_msg_dds__Vector3__max_key_cdr_typesize {0UL}; - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::Vector3_& data); - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3CDRAUX_HPP_ - diff --git a/mujoco/idl_gen/nav_msgs/Vector3CdrAux.ipp b/mujoco/idl_gen/nav_msgs/Vector3CdrAux.ipp deleted file mode 100644 index 9bf2b9a..0000000 --- a/mujoco/idl_gen/nav_msgs/Vector3CdrAux.ipp +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Vector3CdrAux.ipp - * This source file contains some declarations of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3CDRAUX_IPP_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3CDRAUX_IPP_ - -#include "Vector3CdrAux.hpp" - -#include -#include - - -#include -using namespace eprosima::fastcdr::exception; - -namespace eprosima { -namespace fastcdr { - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const geometry_msgs::msg::dds_::Vector3_& data, - size_t& current_alignment) -{ - using namespace geometry_msgs::msg::dds_; - - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.x(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.y(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.z(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::Vector3_& data) -{ - using namespace geometry_msgs::msg::dds_; - - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.x() - << eprosima::fastcdr::MemberId(1) << data.y() - << eprosima::fastcdr::MemberId(2) << data.z() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - geometry_msgs::msg::dds_::Vector3_& data) -{ - using namespace geometry_msgs::msg::dds_; - - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.x(); - break; - - case 1: - dcdr >> data.y(); - break; - - case 2: - dcdr >> data.z(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::Vector3_& data) -{ - using namespace geometry_msgs::msg::dds_; - - static_cast(scdr); - static_cast(data); -} - - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3CDRAUX_IPP_ - diff --git a/mujoco/idl_gen/nav_msgs/Vector3PubSubTypes.cxx b/mujoco/idl_gen/nav_msgs/Vector3PubSubTypes.cxx deleted file mode 100644 index a8a59b9..0000000 --- a/mujoco/idl_gen/nav_msgs/Vector3PubSubTypes.cxx +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Vector3PubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#include - -#include "Vector3PubSubTypes.h" -#include "Vector3CdrAux.hpp" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; -using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - -namespace geometry_msgs { - namespace msg { - namespace dds_ { - - - Vector3_PubSubType::Vector3_PubSubType() - { - setName("geometry_msgs::msg::dds_::Vector3_"); - uint32_t type_size = - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(Vector3_::getMaxCdrSerializedSize()); - #else - geometry_msgs_msg_dds__Vector3__max_cdr_typesize; - #endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = geometry_msgs_msg_dds__Vector3__max_key_cdr_typesize > 16 ? geometry_msgs_msg_dds__Vector3__max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - Vector3_PubSubType::~Vector3_PubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool Vector3_PubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) - { - Vector3_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - #if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - #endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length - #if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); - #else - payload->length = static_cast(ser.get_serialized_data_length()); - #endif // FASTCDR_VERSION_MAJOR == 1 - return true; - } - - bool Vector3_PubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - Vector3_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN - #if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR - #endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; - } - - std::function Vector3_PubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) - { - return [data, data_representation]() -> uint32_t - { - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - #else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } - #endif // FASTCDR_VERSION_MAJOR == 1 - }; - } - - void* Vector3_PubSubType::createData() - { - return reinterpret_cast(new Vector3_()); - } - - void Vector3_PubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool Vector3_PubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - Vector3_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - geometry_msgs_msg_dds__Vector3__max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); - #if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); - #else - eprosima::fastcdr::serialize_key(ser, *p_type); - #endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || geometry_msgs_msg_dds__Vector3__max_key_cdr_typesize > 16) - { - m_md5.init(); - #if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - #else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); - #endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace dds_ - - - } //End of namespace msg - - -} //End of namespace geometry_msgs - diff --git a/mujoco/idl_gen/nav_msgs/Vector3PubSubTypes.h b/mujoco/idl_gen/nav_msgs/Vector3PubSubTypes.h deleted file mode 100644 index a7045eb..0000000 --- a/mujoco/idl_gen/nav_msgs/Vector3PubSubTypes.h +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Vector3PubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "Vector3.h" - - -#if !defined(GEN_API_VER) || (GEN_API_VER != 2) -#error \ - Generated Vector3 is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace geometry_msgs -{ - namespace msg - { - namespace dds_ - { - - - - #ifndef SWIG - namespace detail { - - template - struct Vector3__rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - - }; - - struct Vector3__f - { - typedef double Vector3_::* type; - friend constexpr type get( - Vector3__f); - }; - - template struct Vector3__rob; - - template - inline size_t constexpr Vector3__offset_of() - { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } - - } // namespace detail - #endif // ifndef SWIG - - - /*! - * @brief This class represents the TopicDataType of the type Vector3_ defined by the user in the IDL file. - * @ingroup Vector3 - */ - class Vector3_PubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef Vector3_ type; - - eProsima_user_DllExport Vector3_PubSubType(); - - eProsima_user_DllExport ~Vector3_PubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return is_plain_xcdrv1_impl(); - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) - { - return is_plain_xcdrv2_impl(); - } - else - { - return is_plain_xcdrv1_impl(); - } - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) Vector3_(); - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - - private: - - static constexpr bool is_plain_xcdrv1_impl() - { - return 24ULL == - (detail::Vector3__offset_of() + - sizeof(double)); - } - - static constexpr bool is_plain_xcdrv2_impl() - { - return 24ULL == - (detail::Vector3__offset_of() + - sizeof(double)); - } - - }; - } - } -} - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3_PUBSUBTYPES_H_ - diff --git a/mujoco/idl_gen/std_msgs/Time.cxx b/mujoco/idl_gen/std_msgs/Time.cxx deleted file mode 100644 index 7766fbe..0000000 --- a/mujoco/idl_gen/std_msgs/Time.cxx +++ /dev/null @@ -1,288 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Time.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Time.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define builtin_interfaces_msg_dds__Time__max_cdr_typesize 8ULL; - - -namespace builtin_interfaces { - -namespace msg { - -namespace dds_ { - - - -Time_::Time_() -{ - // long m_sec - m_sec = 0; - // unsigned long m_nanosec - m_nanosec = 0; - -} - -Time_::~Time_() -{ -} - -Time_::Time_( - const Time_& x) -{ - m_sec = x.m_sec; - - - m_nanosec = x.m_nanosec; - -} - -Time_::Time_( - Time_&& x) noexcept -{ - m_sec = x.m_sec; - - - m_nanosec = x.m_nanosec; - -} - -Time_& Time_::operator =( - const Time_& x) -{ - m_sec = x.m_sec; - - - m_nanosec = x.m_nanosec; - - return *this; -} - -Time_& Time_::operator =( - Time_&& x) noexcept -{ - m_sec = x.m_sec; - - - m_nanosec = x.m_nanosec; - - return *this; -} - -bool Time_::operator ==( - const Time_& x) const -{ - return (m_sec == x.m_sec && - m_nanosec == x.m_nanosec); -} - -bool Time_::operator !=( - const Time_& x) const -{ - return !(*this == x); -} - -size_t Time_::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return builtin_interfaces_msg_dds__Time__max_cdr_typesize; -} - -size_t Time_::getCdrSerializedSize( - const Time_& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void Time_::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_sec; - - scdr << m_nanosec; - -} - -void Time_::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_sec; - - - - dcdr >> m_nanosec; - - -} - - -bool Time_::isKeyDefined() -{ - return false; -} - -void Time_::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member sec - * @param _sec New value for member sec - */ -void Time_::sec( - int32_t _sec) -{ - m_sec = _sec; -} - -/*! - * @brief This function returns the value of member sec - * @return Value of member sec - */ -int32_t Time_::sec() const -{ - return m_sec; -} - -/*! - * @brief This function returns a reference to member sec - * @return Reference to member sec - */ -int32_t& Time_::sec() -{ - return m_sec; -} - - -/*! - * @brief This function sets a value in member nanosec - * @param _nanosec New value for member nanosec - */ -void Time_::nanosec( - uint32_t _nanosec) -{ - m_nanosec = _nanosec; -} - -/*! - * @brief This function returns the value of member nanosec - * @return Value of member nanosec - */ -uint32_t Time_::nanosec() const -{ - return m_nanosec; -} - -/*! - * @brief This function returns a reference to member nanosec - * @return Reference to member nanosec - */ -uint32_t& Time_::nanosec() -{ - return m_nanosec; -} - - - - - -} // namespace dds_ - - -} // namespace msg - - -} // namespace builtin_interfaces - diff --git a/mujoco/idl_gen/std_msgs/Time.h b/mujoco/idl_gen/std_msgs/Time.h deleted file mode 100644 index 7296ac0..0000000 --- a/mujoco/idl_gen/std_msgs/Time.h +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Time.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIME_H_ -#define _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIME_H_ - - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TIME_SOURCE) -#define TIME_DllAPI __declspec( dllexport ) -#else -#define TIME_DllAPI __declspec( dllimport ) -#endif // TIME_SOURCE -#else -#define TIME_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define TIME_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -namespace builtin_interfaces { - namespace msg { - namespace dds_ { - - - /*! - * @brief This class represents the structure Time_ defined by the user in the IDL file. - * @ingroup Time - */ - class Time_ - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Time_(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Time_(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object builtin_interfaces::msg::dds_::Time_ that will be copied. - */ - eProsima_user_DllExport Time_( - const Time_& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object builtin_interfaces::msg::dds_::Time_ that will be copied. - */ - eProsima_user_DllExport Time_( - Time_&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object builtin_interfaces::msg::dds_::Time_ that will be copied. - */ - eProsima_user_DllExport Time_& operator =( - const Time_& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object builtin_interfaces::msg::dds_::Time_ that will be copied. - */ - eProsima_user_DllExport Time_& operator =( - Time_&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x builtin_interfaces::msg::dds_::Time_ object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Time_& x) const; - - /*! - * @brief Comparison operator. - * @param x builtin_interfaces::msg::dds_::Time_ object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Time_& x) const; - - /*! - * @brief This function sets a value in member sec - * @param _sec New value for member sec - */ - eProsima_user_DllExport void sec( - int32_t _sec); - - /*! - * @brief This function returns the value of member sec - * @return Value of member sec - */ - eProsima_user_DllExport int32_t sec() const; - - /*! - * @brief This function returns a reference to member sec - * @return Reference to member sec - */ - eProsima_user_DllExport int32_t& sec(); - - - /*! - * @brief This function sets a value in member nanosec - * @param _nanosec New value for member nanosec - */ - eProsima_user_DllExport void nanosec( - uint32_t _nanosec); - - /*! - * @brief This function returns the value of member nanosec - * @return Value of member nanosec - */ - eProsima_user_DllExport uint32_t nanosec() const; - - /*! - * @brief This function returns a reference to member nanosec - * @return Reference to member nanosec - */ - eProsima_user_DllExport uint32_t& nanosec(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const builtin_interfaces::msg::dds_::Time_& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - int32_t m_sec; - uint32_t m_nanosec; - - }; - - } // namespace dds_ - } // namespace msg -} // namespace builtin_interfaces - -#endif // _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIME_H_ - - - diff --git a/mujoco/idl_gen/std_msgs/TimeCdrAux.hpp b/mujoco/idl_gen/std_msgs/TimeCdrAux.hpp deleted file mode 100644 index 2f50163..0000000 --- a/mujoco/idl_gen/std_msgs/TimeCdrAux.hpp +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TimeCdrAux.hpp - * This source file contains some definitions of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIMECDRAUX_HPP_ -#define _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIMECDRAUX_HPP_ - -#include "Time.h" - -constexpr uint32_t builtin_interfaces_msg_dds__Time__max_cdr_typesize {8UL}; -constexpr uint32_t builtin_interfaces_msg_dds__Time__max_key_cdr_typesize {0UL}; - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const builtin_interfaces::msg::dds_::Time_& data); - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIMECDRAUX_HPP_ - diff --git a/mujoco/idl_gen/std_msgs/TimeCdrAux.ipp b/mujoco/idl_gen/std_msgs/TimeCdrAux.ipp deleted file mode 100644 index 4b1d45b..0000000 --- a/mujoco/idl_gen/std_msgs/TimeCdrAux.ipp +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TimeCdrAux.ipp - * This source file contains some declarations of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIMECDRAUX_IPP_ -#define _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIMECDRAUX_IPP_ - -#include "TimeCdrAux.hpp" - -#include -#include - - -#include -using namespace eprosima::fastcdr::exception; - -namespace eprosima { -namespace fastcdr { - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const builtin_interfaces::msg::dds_::Time_& data, - size_t& current_alignment) -{ - using namespace builtin_interfaces::msg::dds_; - - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.sec(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.nanosec(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const builtin_interfaces::msg::dds_::Time_& data) -{ - using namespace builtin_interfaces::msg::dds_; - - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.sec() - << eprosima::fastcdr::MemberId(1) << data.nanosec() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - builtin_interfaces::msg::dds_::Time_& data) -{ - using namespace builtin_interfaces::msg::dds_; - - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.sec(); - break; - - case 1: - dcdr >> data.nanosec(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const builtin_interfaces::msg::dds_::Time_& data) -{ - using namespace builtin_interfaces::msg::dds_; - - static_cast(scdr); - static_cast(data); -} - - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIMECDRAUX_IPP_ - diff --git a/mujoco/idl_gen/std_msgs/TimePubSubTypes.cxx b/mujoco/idl_gen/std_msgs/TimePubSubTypes.cxx deleted file mode 100644 index e0de1ac..0000000 --- a/mujoco/idl_gen/std_msgs/TimePubSubTypes.cxx +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TimePubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#include - -#include "TimePubSubTypes.h" -#include "TimeCdrAux.hpp" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; -using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - -namespace builtin_interfaces { - namespace msg { - namespace dds_ { - - - Time_PubSubType::Time_PubSubType() - { - setName("builtin_interfaces::msg::dds_::Time_"); - uint32_t type_size = - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(Time_::getMaxCdrSerializedSize()); - #else - builtin_interfaces_msg_dds__Time__max_cdr_typesize; - #endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = builtin_interfaces_msg_dds__Time__max_key_cdr_typesize > 16 ? builtin_interfaces_msg_dds__Time__max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - Time_PubSubType::~Time_PubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool Time_PubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) - { - Time_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - #if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - #endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length - #if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); - #else - payload->length = static_cast(ser.get_serialized_data_length()); - #endif // FASTCDR_VERSION_MAJOR == 1 - return true; - } - - bool Time_PubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - Time_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN - #if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR - #endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; - } - - std::function Time_PubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) - { - return [data, data_representation]() -> uint32_t - { - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - #else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } - #endif // FASTCDR_VERSION_MAJOR == 1 - }; - } - - void* Time_PubSubType::createData() - { - return reinterpret_cast(new Time_()); - } - - void Time_PubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool Time_PubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - Time_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - builtin_interfaces_msg_dds__Time__max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); - #if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); - #else - eprosima::fastcdr::serialize_key(ser, *p_type); - #endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || builtin_interfaces_msg_dds__Time__max_key_cdr_typesize > 16) - { - m_md5.init(); - #if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - #else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); - #endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace dds_ - - - } //End of namespace msg - - -} //End of namespace builtin_interfaces - diff --git a/mujoco/idl_gen/std_msgs/TimePubSubTypes.h b/mujoco/idl_gen/std_msgs/TimePubSubTypes.h deleted file mode 100644 index ae14992..0000000 --- a/mujoco/idl_gen/std_msgs/TimePubSubTypes.h +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TimePubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIME_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIME_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "Time.h" - - -#if !defined(GEN_API_VER) || (GEN_API_VER != 2) -#error \ - Generated Time is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace builtin_interfaces -{ - namespace msg - { - namespace dds_ - { - - - - #ifndef SWIG - namespace detail { - - template - struct Time__rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - - }; - - struct Time__f - { - typedef uint32_t Time_::* type; - friend constexpr type get( - Time__f); - }; - - template struct Time__rob; - - template - inline size_t constexpr Time__offset_of() - { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } - - } // namespace detail - #endif // ifndef SWIG - - - /*! - * @brief This class represents the TopicDataType of the type Time_ defined by the user in the IDL file. - * @ingroup Time - */ - class Time_PubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef Time_ type; - - eProsima_user_DllExport Time_PubSubType(); - - eProsima_user_DllExport ~Time_PubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return is_plain_xcdrv1_impl(); - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) - { - return is_plain_xcdrv2_impl(); - } - else - { - return is_plain_xcdrv1_impl(); - } - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) Time_(); - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - - private: - - static constexpr bool is_plain_xcdrv1_impl() - { - return 8ULL == - (detail::Time__offset_of() + - sizeof(uint32_t)); - } - - static constexpr bool is_plain_xcdrv2_impl() - { - return 8ULL == - (detail::Time__offset_of() + - sizeof(uint32_t)); - } - - }; - } - } -} - -#endif // _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIME_PUBSUBTYPES_H_ - From 9e97a674cd0367f82e369b93a5e1be35ff4b15bd Mon Sep 17 00:00:00 2001 From: Vincent Tumminello Date: Sun, 13 Sep 2026 09:45:56 +1000 Subject: [PATCH 4/7] Fix merge issue --- mujoco/idl/regenerate.sh | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/mujoco/idl/regenerate.sh b/mujoco/idl/regenerate.sh index d4e7a13..3eaa821 100755 --- a/mujoco/idl/regenerate.sh +++ b/mujoco/idl/regenerate.sh @@ -80,15 +80,5 @@ if [ -n "$(find "$OUT_DIR" -maxdepth 1 -type f)" ]; then exit 1 fi -# geometry_msgs::msg (rt/head_pose, and the pose/twist halves of rt/odom) -gen "$IDL_DIR/geometry_msgs/msg" "$OUT_DIR/geometry_msgs" \ - Point.idl Quaternion.idl Pose.idl PoseWithCovariance.idl Vector3.idl Twist.idl \ - TwistWithCovariance.idl - -# builtin_interfaces::msg, std_msgs::msg, nav_msgs::msg (rt/odom) -gen "$IDL_DIR/builtin_interfaces/msg" "$OUT_DIR/builtin_interfaces" Time.idl -gen "$IDL_DIR/std_msgs/msg" "$OUT_DIR/std_msgs" Header.idl -gen "$IDL_DIR/nav_msgs/msg" "$OUT_DIR/nav_msgs" Odometry.idl - echo "== Generated into $OUT_DIR. Registered type names: ==" grep -rho 'setName("[^"]*")' "$OUT_DIR" | sort -u From 91ea8b96c800b92e9a4444de1073211bb0400c92 Mon Sep 17 00:00:00 2001 From: Vincent Tumminello Date: Sun, 13 Sep 2026 09:50:47 +1000 Subject: [PATCH 5/7] remove duplicated declarations --- mujoco/module/SdkBridge/test_support/SyntheticState.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/mujoco/module/SdkBridge/test_support/SyntheticState.cpp b/mujoco/module/SdkBridge/test_support/SyntheticState.cpp index 05656ef..f47f4a9 100644 --- a/mujoco/module/SdkBridge/test_support/SyntheticState.cpp +++ b/mujoco/module/SdkBridge/test_support/SyntheticState.cpp @@ -98,15 +98,6 @@ SyntheticState::SyntheticState(std::unique_ptr environment update->head.position = {0.0, 0.0, update->base.z + 0.33}; update->head.quat = {cy * cp, -sy * sp, cy * sp, sy * cp}; - // Standing head frame in the footprint frame: 0.33 m above the base (the Head_pitch - // joint 0.248 m above the Trunk plus the 0.08 m head frame offset, see - // shared/sim/HeadPose.hpp), turned by the commanded head yaw then pitch. - const double cy = std::cos(head_yaw_ * 0.5), sy = std::sin(head_yaw_ * 0.5); - const double cp = std::cos(head_pitch_ * 0.5), sp = std::sin(head_pitch_ * 0.5); - update->head.valid = true; - update->head.position = {0.0, 0.0, update->base.z + 0.33}; - update->head.quat = {cy * cp, -sy * sp, cy * sp, sy * cp}; - update->mode = mode_; update->fall_state = fall_state_; update->getting_up = false; From b4984099dbbb40a5531ccc22722044072e60bdb5 Mon Sep 17 00:00:00 2001 From: jpptm Date: Sun, 13 Sep 2026 12:14:18 +1000 Subject: [PATCH 6/7] Generate idl messages during build time --- docs/K1_MUJOCO_SETUP.md | 22 +- mujoco/.gitignore | 4 + mujoco/cmake/IdlGen.cmake | 77 +++ mujoco/idl/regenerate.sh | 38 +- .../booster_interface/BatteryState.cxx | 394 ----------- .../idl_gen/booster_interface/BatteryState.h | 279 -------- .../booster_interface/BatteryStateCdrAux.hpp | 51 -- .../booster_interface/BatteryStateCdrAux.ipp | 155 ----- .../BatteryStatePubSubTypes.cxx | 233 ------- .../BatteryStatePubSubTypes.h | 196 ------ .../idl_gen/booster_interface/ButtonEvent.cxx | 293 --------- .../idl_gen/booster_interface/ButtonEvent.h | 252 ------- .../booster_interface/ButtonEventCdrAux.hpp | 52 -- .../booster_interface/ButtonEventCdrAux.ipp | 139 ---- .../ButtonEventPubSubTypes.cxx | 233 ------- .../ButtonEventPubSubTypes.h | 141 ---- .../booster_interface/FallDownState.cxx | 292 --------- .../idl_gen/booster_interface/FallDownState.h | 248 ------- .../booster_interface/FallDownStateCdrAux.hpp | 51 -- .../booster_interface/FallDownStateCdrAux.ipp | 139 ---- .../FallDownStatePubSubTypes.cxx | 233 ------- .../FallDownStatePubSubTypes.h | 141 ---- mujoco/idl_gen/booster_interface/ImuState.cxx | 377 ----------- mujoco/idl_gen/booster_interface/ImuState.h | 279 -------- .../booster_interface/ImuStateCdrAux.hpp | 51 -- .../booster_interface/ImuStateCdrAux.ipp | 147 ----- .../booster_interface/ImuStatePubSubTypes.cxx | 233 ------- .../booster_interface/ImuStatePubSubTypes.h | 196 ------ mujoco/idl_gen/booster_interface/LowCmd.cxx | 314 --------- mujoco/idl_gen/booster_interface/LowCmd.h | 256 -------- .../booster_interface/LowCmdCdrAux.hpp | 53 -- .../booster_interface/LowCmdCdrAux.ipp | 141 ---- .../booster_interface/LowCmdPubSubTypes.cxx | 235 ------- .../booster_interface/LowCmdPubSubTypes.h | 144 ---- mujoco/idl_gen/booster_interface/LowState.cxx | 391 ----------- mujoco/idl_gen/booster_interface/LowState.h | 283 -------- .../booster_interface/LowStateCdrAux.hpp | 53 -- .../booster_interface/LowStateCdrAux.ipp | 149 ----- .../booster_interface/LowStatePubSubTypes.cxx | 235 ------- .../booster_interface/LowStatePubSubTypes.h | 145 ---- mujoco/idl_gen/booster_interface/MotorCmd.cxx | 553 ---------------- mujoco/idl_gen/booster_interface/MotorCmd.h | 342 ---------- .../booster_interface/MotorCmdCdrAux.hpp | 51 -- .../booster_interface/MotorCmdCdrAux.ipp | 179 ----- .../booster_interface/MotorCmdPubSubTypes.cxx | 233 ------- .../booster_interface/MotorCmdPubSubTypes.h | 196 ------ .../idl_gen/booster_interface/MotorState.cxx | 618 ------------------ mujoco/idl_gen/booster_interface/MotorState.h | 370 ----------- .../booster_interface/MotorStateCdrAux.hpp | 51 -- .../booster_interface/MotorStateCdrAux.ipp | 187 ------ .../MotorStatePubSubTypes.cxx | 233 ------- .../booster_interface/MotorStatePubSubTypes.h | 196 ------ mujoco/idl_gen/booster_interface/Odometer.cxx | 341 ---------- mujoco/idl_gen/booster_interface/Odometer.h | 258 -------- .../booster_interface/OdometerCdrAux.hpp | 51 -- .../booster_interface/OdometerCdrAux.ipp | 147 ----- .../booster_interface/OdometerPubSubTypes.cxx | 233 ------- .../booster_interface/OdometerPubSubTypes.h | 196 ------ mujoco/idl_gen/booster_msgs/RpcReqMsg.cxx | 371 ----------- mujoco/idl_gen/booster_msgs/RpcReqMsg.h | 279 -------- .../idl_gen/booster_msgs/RpcReqMsgCdrAux.hpp | 51 -- .../idl_gen/booster_msgs/RpcReqMsgCdrAux.ipp | 147 ----- .../booster_msgs/RpcReqMsgPubSubTypes.cxx | 233 ------- .../booster_msgs/RpcReqMsgPubSubTypes.h | 141 ---- mujoco/idl_gen/booster_msgs/RpcRespMsg.cxx | 371 ----------- mujoco/idl_gen/booster_msgs/RpcRespMsg.h | 279 -------- .../idl_gen/booster_msgs/RpcRespMsgCdrAux.hpp | 51 -- .../idl_gen/booster_msgs/RpcRespMsgCdrAux.ipp | 147 ----- .../booster_msgs/RpcRespMsgPubSubTypes.cxx | 233 ------- .../booster_msgs/RpcRespMsgPubSubTypes.h | 141 ---- mujoco/idl_gen/builtin_interfaces/Time.cxx | 288 -------- mujoco/idl_gen/builtin_interfaces/Time.h | 237 ------- .../idl_gen/builtin_interfaces/TimeCdrAux.hpp | 51 -- .../idl_gen/builtin_interfaces/TimeCdrAux.ipp | 139 ---- .../builtin_interfaces/TimePubSubTypes.cxx | 233 ------- .../builtin_interfaces/TimePubSubTypes.h | 196 ------ mujoco/idl_gen/geometry_msgs/Point.cxx | 341 ---------- mujoco/idl_gen/geometry_msgs/Point.h | 258 -------- mujoco/idl_gen/geometry_msgs/PointCdrAux.hpp | 51 -- mujoco/idl_gen/geometry_msgs/PointCdrAux.ipp | 147 ----- .../geometry_msgs/PointPubSubTypes.cxx | 233 ------- .../idl_gen/geometry_msgs/PointPubSubTypes.h | 196 ------ mujoco/idl_gen/geometry_msgs/Pose.cxx | 310 --------- mujoco/idl_gen/geometry_msgs/Pose.h | 253 ------- mujoco/idl_gen/geometry_msgs/PoseCdrAux.hpp | 51 -- mujoco/idl_gen/geometry_msgs/PoseCdrAux.ipp | 139 ---- .../idl_gen/geometry_msgs/PosePubSubTypes.cxx | 233 ------- .../idl_gen/geometry_msgs/PosePubSubTypes.h | 198 ------ .../geometry_msgs/PoseWithCovariance.cxx | 313 --------- .../geometry_msgs/PoseWithCovariance.h | 252 ------- .../PoseWithCovarianceCdrAux.hpp | 51 -- .../PoseWithCovarianceCdrAux.ipp | 139 ---- .../PoseWithCovariancePubSubTypes.cxx | 233 ------- .../PoseWithCovariancePubSubTypes.h | 197 ------ mujoco/idl_gen/geometry_msgs/Quaternion.cxx | 394 ----------- mujoco/idl_gen/geometry_msgs/Quaternion.h | 279 -------- .../geometry_msgs/QuaternionCdrAux.hpp | 51 -- .../geometry_msgs/QuaternionCdrAux.ipp | 155 ----- .../geometry_msgs/QuaternionPubSubTypes.cxx | 233 ------- .../geometry_msgs/QuaternionPubSubTypes.h | 196 ------ mujoco/idl_gen/geometry_msgs/Twist.cxx | 309 --------- mujoco/idl_gen/geometry_msgs/Twist.h | 252 ------- mujoco/idl_gen/geometry_msgs/TwistCdrAux.hpp | 51 -- mujoco/idl_gen/geometry_msgs/TwistCdrAux.ipp | 139 ---- .../geometry_msgs/TwistPubSubTypes.cxx | 233 ------- .../idl_gen/geometry_msgs/TwistPubSubTypes.h | 197 ------ .../geometry_msgs/TwistWithCovariance.cxx | 312 --------- .../geometry_msgs/TwistWithCovariance.h | 252 ------- .../TwistWithCovarianceCdrAux.hpp | 52 -- .../TwistWithCovarianceCdrAux.ipp | 139 ---- .../TwistWithCovariancePubSubTypes.cxx | 233 ------- .../TwistWithCovariancePubSubTypes.h | 197 ------ mujoco/idl_gen/geometry_msgs/Vector3.cxx | 341 ---------- mujoco/idl_gen/geometry_msgs/Vector3.h | 258 -------- .../idl_gen/geometry_msgs/Vector3CdrAux.hpp | 51 -- .../idl_gen/geometry_msgs/Vector3CdrAux.ipp | 147 ----- .../geometry_msgs/Vector3PubSubTypes.cxx | 233 ------- .../geometry_msgs/Vector3PubSubTypes.h | 196 ------ mujoco/idl_gen/nav_msgs/Odometry.cxx | 443 ------------- mujoco/idl_gen/nav_msgs/Odometry.h | 310 --------- mujoco/idl_gen/nav_msgs/OdometryCdrAux.hpp | 52 -- mujoco/idl_gen/nav_msgs/OdometryCdrAux.ipp | 155 ----- .../idl_gen/nav_msgs/OdometryPubSubTypes.cxx | 233 ------- mujoco/idl_gen/nav_msgs/OdometryPubSubTypes.h | 144 ---- mujoco/idl_gen/std_msgs/Header.cxx | 309 --------- mujoco/idl_gen/std_msgs/Header.h | 252 ------- mujoco/idl_gen/std_msgs/HeaderCdrAux.hpp | 51 -- mujoco/idl_gen/std_msgs/HeaderCdrAux.ipp | 139 ---- mujoco/idl_gen/std_msgs/HeaderPubSubTypes.cxx | 233 ------- mujoco/idl_gen/std_msgs/HeaderPubSubTypes.h | 142 ---- mujoco/module/SdkBridge/CMakeLists.txt | 44 +- mujoco/module/SdkBridge/PROTOCOL.md | 22 +- mujoco/tools/install_deps.sh | 41 +- 133 files changed, 189 insertions(+), 26244 deletions(-) create mode 100644 mujoco/cmake/IdlGen.cmake delete mode 100644 mujoco/idl_gen/booster_interface/BatteryState.cxx delete mode 100644 mujoco/idl_gen/booster_interface/BatteryState.h delete mode 100644 mujoco/idl_gen/booster_interface/BatteryStateCdrAux.hpp delete mode 100644 mujoco/idl_gen/booster_interface/BatteryStateCdrAux.ipp delete mode 100644 mujoco/idl_gen/booster_interface/BatteryStatePubSubTypes.cxx delete mode 100644 mujoco/idl_gen/booster_interface/BatteryStatePubSubTypes.h delete mode 100644 mujoco/idl_gen/booster_interface/ButtonEvent.cxx delete mode 100644 mujoco/idl_gen/booster_interface/ButtonEvent.h delete mode 100644 mujoco/idl_gen/booster_interface/ButtonEventCdrAux.hpp delete mode 100644 mujoco/idl_gen/booster_interface/ButtonEventCdrAux.ipp delete mode 100644 mujoco/idl_gen/booster_interface/ButtonEventPubSubTypes.cxx delete mode 100644 mujoco/idl_gen/booster_interface/ButtonEventPubSubTypes.h delete mode 100644 mujoco/idl_gen/booster_interface/FallDownState.cxx delete mode 100644 mujoco/idl_gen/booster_interface/FallDownState.h delete mode 100644 mujoco/idl_gen/booster_interface/FallDownStateCdrAux.hpp delete mode 100644 mujoco/idl_gen/booster_interface/FallDownStateCdrAux.ipp delete mode 100644 mujoco/idl_gen/booster_interface/FallDownStatePubSubTypes.cxx delete mode 100644 mujoco/idl_gen/booster_interface/FallDownStatePubSubTypes.h delete mode 100644 mujoco/idl_gen/booster_interface/ImuState.cxx delete mode 100644 mujoco/idl_gen/booster_interface/ImuState.h delete mode 100644 mujoco/idl_gen/booster_interface/ImuStateCdrAux.hpp delete mode 100644 mujoco/idl_gen/booster_interface/ImuStateCdrAux.ipp delete mode 100644 mujoco/idl_gen/booster_interface/ImuStatePubSubTypes.cxx delete mode 100644 mujoco/idl_gen/booster_interface/ImuStatePubSubTypes.h delete mode 100644 mujoco/idl_gen/booster_interface/LowCmd.cxx delete mode 100644 mujoco/idl_gen/booster_interface/LowCmd.h delete mode 100644 mujoco/idl_gen/booster_interface/LowCmdCdrAux.hpp delete mode 100644 mujoco/idl_gen/booster_interface/LowCmdCdrAux.ipp delete mode 100644 mujoco/idl_gen/booster_interface/LowCmdPubSubTypes.cxx delete mode 100644 mujoco/idl_gen/booster_interface/LowCmdPubSubTypes.h delete mode 100644 mujoco/idl_gen/booster_interface/LowState.cxx delete mode 100644 mujoco/idl_gen/booster_interface/LowState.h delete mode 100644 mujoco/idl_gen/booster_interface/LowStateCdrAux.hpp delete mode 100644 mujoco/idl_gen/booster_interface/LowStateCdrAux.ipp delete mode 100644 mujoco/idl_gen/booster_interface/LowStatePubSubTypes.cxx delete mode 100644 mujoco/idl_gen/booster_interface/LowStatePubSubTypes.h delete mode 100644 mujoco/idl_gen/booster_interface/MotorCmd.cxx delete mode 100644 mujoco/idl_gen/booster_interface/MotorCmd.h delete mode 100644 mujoco/idl_gen/booster_interface/MotorCmdCdrAux.hpp delete mode 100644 mujoco/idl_gen/booster_interface/MotorCmdCdrAux.ipp delete mode 100644 mujoco/idl_gen/booster_interface/MotorCmdPubSubTypes.cxx delete mode 100644 mujoco/idl_gen/booster_interface/MotorCmdPubSubTypes.h delete mode 100644 mujoco/idl_gen/booster_interface/MotorState.cxx delete mode 100644 mujoco/idl_gen/booster_interface/MotorState.h delete mode 100644 mujoco/idl_gen/booster_interface/MotorStateCdrAux.hpp delete mode 100644 mujoco/idl_gen/booster_interface/MotorStateCdrAux.ipp delete mode 100644 mujoco/idl_gen/booster_interface/MotorStatePubSubTypes.cxx delete mode 100644 mujoco/idl_gen/booster_interface/MotorStatePubSubTypes.h delete mode 100644 mujoco/idl_gen/booster_interface/Odometer.cxx delete mode 100644 mujoco/idl_gen/booster_interface/Odometer.h delete mode 100644 mujoco/idl_gen/booster_interface/OdometerCdrAux.hpp delete mode 100644 mujoco/idl_gen/booster_interface/OdometerCdrAux.ipp delete mode 100644 mujoco/idl_gen/booster_interface/OdometerPubSubTypes.cxx delete mode 100644 mujoco/idl_gen/booster_interface/OdometerPubSubTypes.h delete mode 100644 mujoco/idl_gen/booster_msgs/RpcReqMsg.cxx delete mode 100644 mujoco/idl_gen/booster_msgs/RpcReqMsg.h delete mode 100644 mujoco/idl_gen/booster_msgs/RpcReqMsgCdrAux.hpp delete mode 100644 mujoco/idl_gen/booster_msgs/RpcReqMsgCdrAux.ipp delete mode 100644 mujoco/idl_gen/booster_msgs/RpcReqMsgPubSubTypes.cxx delete mode 100644 mujoco/idl_gen/booster_msgs/RpcReqMsgPubSubTypes.h delete mode 100644 mujoco/idl_gen/booster_msgs/RpcRespMsg.cxx delete mode 100644 mujoco/idl_gen/booster_msgs/RpcRespMsg.h delete mode 100644 mujoco/idl_gen/booster_msgs/RpcRespMsgCdrAux.hpp delete mode 100644 mujoco/idl_gen/booster_msgs/RpcRespMsgCdrAux.ipp delete mode 100644 mujoco/idl_gen/booster_msgs/RpcRespMsgPubSubTypes.cxx delete mode 100644 mujoco/idl_gen/booster_msgs/RpcRespMsgPubSubTypes.h delete mode 100644 mujoco/idl_gen/builtin_interfaces/Time.cxx delete mode 100644 mujoco/idl_gen/builtin_interfaces/Time.h delete mode 100644 mujoco/idl_gen/builtin_interfaces/TimeCdrAux.hpp delete mode 100644 mujoco/idl_gen/builtin_interfaces/TimeCdrAux.ipp delete mode 100644 mujoco/idl_gen/builtin_interfaces/TimePubSubTypes.cxx delete mode 100644 mujoco/idl_gen/builtin_interfaces/TimePubSubTypes.h delete mode 100644 mujoco/idl_gen/geometry_msgs/Point.cxx delete mode 100644 mujoco/idl_gen/geometry_msgs/Point.h delete mode 100644 mujoco/idl_gen/geometry_msgs/PointCdrAux.hpp delete mode 100644 mujoco/idl_gen/geometry_msgs/PointCdrAux.ipp delete mode 100644 mujoco/idl_gen/geometry_msgs/PointPubSubTypes.cxx delete mode 100644 mujoco/idl_gen/geometry_msgs/PointPubSubTypes.h delete mode 100644 mujoco/idl_gen/geometry_msgs/Pose.cxx delete mode 100644 mujoco/idl_gen/geometry_msgs/Pose.h delete mode 100644 mujoco/idl_gen/geometry_msgs/PoseCdrAux.hpp delete mode 100644 mujoco/idl_gen/geometry_msgs/PoseCdrAux.ipp delete mode 100644 mujoco/idl_gen/geometry_msgs/PosePubSubTypes.cxx delete mode 100644 mujoco/idl_gen/geometry_msgs/PosePubSubTypes.h delete mode 100644 mujoco/idl_gen/geometry_msgs/PoseWithCovariance.cxx delete mode 100644 mujoco/idl_gen/geometry_msgs/PoseWithCovariance.h delete mode 100644 mujoco/idl_gen/geometry_msgs/PoseWithCovarianceCdrAux.hpp delete mode 100644 mujoco/idl_gen/geometry_msgs/PoseWithCovarianceCdrAux.ipp delete mode 100644 mujoco/idl_gen/geometry_msgs/PoseWithCovariancePubSubTypes.cxx delete mode 100644 mujoco/idl_gen/geometry_msgs/PoseWithCovariancePubSubTypes.h delete mode 100644 mujoco/idl_gen/geometry_msgs/Quaternion.cxx delete mode 100644 mujoco/idl_gen/geometry_msgs/Quaternion.h delete mode 100644 mujoco/idl_gen/geometry_msgs/QuaternionCdrAux.hpp delete mode 100644 mujoco/idl_gen/geometry_msgs/QuaternionCdrAux.ipp delete mode 100644 mujoco/idl_gen/geometry_msgs/QuaternionPubSubTypes.cxx delete mode 100644 mujoco/idl_gen/geometry_msgs/QuaternionPubSubTypes.h delete mode 100644 mujoco/idl_gen/geometry_msgs/Twist.cxx delete mode 100644 mujoco/idl_gen/geometry_msgs/Twist.h delete mode 100644 mujoco/idl_gen/geometry_msgs/TwistCdrAux.hpp delete mode 100644 mujoco/idl_gen/geometry_msgs/TwistCdrAux.ipp delete mode 100644 mujoco/idl_gen/geometry_msgs/TwistPubSubTypes.cxx delete mode 100644 mujoco/idl_gen/geometry_msgs/TwistPubSubTypes.h delete mode 100644 mujoco/idl_gen/geometry_msgs/TwistWithCovariance.cxx delete mode 100644 mujoco/idl_gen/geometry_msgs/TwistWithCovariance.h delete mode 100644 mujoco/idl_gen/geometry_msgs/TwistWithCovarianceCdrAux.hpp delete mode 100644 mujoco/idl_gen/geometry_msgs/TwistWithCovarianceCdrAux.ipp delete mode 100644 mujoco/idl_gen/geometry_msgs/TwistWithCovariancePubSubTypes.cxx delete mode 100644 mujoco/idl_gen/geometry_msgs/TwistWithCovariancePubSubTypes.h delete mode 100644 mujoco/idl_gen/geometry_msgs/Vector3.cxx delete mode 100644 mujoco/idl_gen/geometry_msgs/Vector3.h delete mode 100644 mujoco/idl_gen/geometry_msgs/Vector3CdrAux.hpp delete mode 100644 mujoco/idl_gen/geometry_msgs/Vector3CdrAux.ipp delete mode 100644 mujoco/idl_gen/geometry_msgs/Vector3PubSubTypes.cxx delete mode 100644 mujoco/idl_gen/geometry_msgs/Vector3PubSubTypes.h delete mode 100644 mujoco/idl_gen/nav_msgs/Odometry.cxx delete mode 100644 mujoco/idl_gen/nav_msgs/Odometry.h delete mode 100644 mujoco/idl_gen/nav_msgs/OdometryCdrAux.hpp delete mode 100644 mujoco/idl_gen/nav_msgs/OdometryCdrAux.ipp delete mode 100644 mujoco/idl_gen/nav_msgs/OdometryPubSubTypes.cxx delete mode 100644 mujoco/idl_gen/nav_msgs/OdometryPubSubTypes.h delete mode 100644 mujoco/idl_gen/std_msgs/Header.cxx delete mode 100644 mujoco/idl_gen/std_msgs/Header.h delete mode 100644 mujoco/idl_gen/std_msgs/HeaderCdrAux.hpp delete mode 100644 mujoco/idl_gen/std_msgs/HeaderCdrAux.ipp delete mode 100644 mujoco/idl_gen/std_msgs/HeaderPubSubTypes.cxx delete mode 100644 mujoco/idl_gen/std_msgs/HeaderPubSubTypes.h diff --git a/docs/K1_MUJOCO_SETUP.md b/docs/K1_MUJOCO_SETUP.md index f7e3ecf..e999381 100644 --- a/docs/K1_MUJOCO_SETUP.md +++ b/docs/K1_MUJOCO_SETUP.md @@ -46,9 +46,9 @@ sim/soccer (docker container, NUClear) | Display | Optional. Only needed for the GLFW viewer window; `--headless` (or `K1_HEADLESS=1`, see below) skips it entirely — useful for CI or a bare server. | Nothing else to install for the **sim** itself: `mujoco/docker/k1sim.sh` builds the image (Ubuntu 22.04 + -pinned MuJoCo/Fast-DDS/NUClear/GLFW versions — see `mujoco/tools/install_deps.sh`) the first time it's -needed. The host-side `./b` formatters use [uv](https://docs.astral.sh/uv/) — see -[Host tooling & dependencies](#host-tooling--dependencies-uv) below. +pinned MuJoCo/Fast-DDS/fastddsgen/NUClear/GLFW versions, plus the JRE fastddsgen needs — see +`mujoco/tools/install_deps.sh`) the first time it's needed. The host-side `./b` formatters use +[uv](https://docs.astral.sh/uv/) — see [Host tooling & dependencies](#host-tooling--dependencies-uv) below. ## 2. Quick start @@ -166,7 +166,7 @@ There are **two separate environments** — keep them straight: | Environment | Manages | Lives in | Used by | | --- | --- | --- | --- | -| **docker image** | C++ sim toolchain: cmake/ninja, the **MuJoCo C library**, Fast-DDS, NUClear (`tools/install_deps.sh`) | the `k1sim` image | `./b configure` / `build` / `run` | +| **docker image** | C++ sim toolchain: cmake/ninja, the **MuJoCo C library**, Fast-DDS, fastddsgen + a JRE, NUClear (`tools/install_deps.sh`) | the `k1sim` image | `./b configure` / `build` / `run` | | **host uv venv** | Python: the `./b` formatters | repo-root `.venv` (`pyproject.toml` + `uv.lock`) | formatters | The Python dependency manager is [uv](https://docs.astral.sh/uv/) (as in NUbots). From the repo root: @@ -179,6 +179,20 @@ The C++ deploy MuJoCo version is pinned in `cmake/MuJoCoTarget.cmake`, `docker/D `tools/install_deps.sh`. Keep the training side (the mujoco_playground fork, §7) on the same MuJoCo version to avoid a sim2sim gap; bumping one means bumping **all** and rebuilding the image (`./b image`). +`tools/install_deps.sh` **always** installs fastddsgen (pinned v3.2.1); the old +`--with-fastddsgen` flag is still accepted but does nothing. It is part of the standard set now +because the Fast-DDS type support is **generated during the build** from `mujoco/idl/**/*.idl` into +`build-docker/idl_gen/` instead of being committed — the same arrangement NUbots uses for protobuf. +fastddsgen is a Java program, so a **Java 11+ runtime is a hard requirement** for a native +(non-docker) build; the image already installs `default-jre-headless`, so the `./b` workflow needs +nothing extra. + +Adding a message is therefore one step: write the `.idl` under `mujoco/idl//msg/` and +build. No regeneration script to run by hand, no generated files to commit, no CMake edit — CMake +picks a new `.idl` up on its own and re-runs the generator when one changes. The generator flags +are wire-format-critical and live in `mujoco/idl/regenerate.sh`: read +`mujoco/module/SdkBridge/PROTOCOL.md` §5 before changing them. + ### Extra `./b` commands - **`./b image`** — (re)build the docker toolchain image. `./b build` only builds it when it's *missing*, so diff --git a/mujoco/.gitignore b/mujoco/.gitignore index 0f1928a..eeab6ae 100644 --- a/mujoco/.gitignore +++ b/mujoco/.gitignore @@ -2,3 +2,7 @@ build*/ .deps/ .cache/ compile_commands.json + +# Generated at build time by cmake/IdlGen.cmake into the build dir; never committed. +# This entry only catches a stray manual run of idl/regenerate.sh in the source tree. +idl_gen/ diff --git a/mujoco/cmake/IdlGen.cmake b/mujoco/cmake/IdlGen.cmake new file mode 100644 index 0000000..fc2b4af --- /dev/null +++ b/mujoco/cmake/IdlGen.cmake @@ -0,0 +1,77 @@ +# Generates the Fast-DDS type support from mujoco/idl/**/*.idl at build time. +# +# The generated code is a build artifact (${CMAKE_BINARY_DIR}/idl_gen), never committed — +# the same arrangement NUbots uses for protobuf (nuclear/message/Neutron.cmake runs protoc +# over shared/message/**.proto into the build dir). mujoco/idl/**/*.idl is the source of +# truth; see module/SdkBridge/PROTOCOL.md for where those layouts came from. +# +# Include this from the directory that defines the k1sim_idl target, so the GENERATED +# source properties and the target share a directory scope. +# +# Exports: +# k1sim_idl_files the .idl inputs +# k1sim_idl_outputs every generated file (the library's source list) +# k1sim_idl_packages one generated include directory per IDL package + +find_program( + FASTDDSGEN_EXECUTABLE fastddsgen + HINTS $ENV{K1SIM_DEPS_PREFIX}/bin ${PROJECT_SOURCE_DIR}/.deps/install/bin /opt/k1sim-deps/bin + DOC "eProsima Fast-DDS-Gen IDL compiler (installed by tools/install_deps.sh)" +) +if(NOT FASTDDSGEN_EXECUTABLE) + message( + FATAL_ERROR + "fastddsgen not found. It generates the DDS types at build time — run " + "tools/install_deps.sh (needs a Java 11+ runtime), or build in the docker image " + "(docker/k1sim.sh), which bakes it into /opt/k1sim-deps/bin." + ) +endif() + +set(K1SIM_IDL_DIR ${PROJECT_SOURCE_DIR}/idl) +set(K1SIM_IDL_OUT ${CMAKE_BINARY_DIR}/idl_gen) + +# CONFIGURE_DEPENDS: adding a new .idl re-runs cmake on the next build, so a new message +# needs no edit here at all. +file(GLOB k1sim_idl_files CONFIGURE_DEPENDS "${K1SIM_IDL_DIR}/*/msg/*.idl") +if(NOT k1sim_idl_files) + message(FATAL_ERROR "No .idl files found under ${K1SIM_IDL_DIR}/*/msg/") +endif() + +# fastddsgen emits exactly these six files per type, into idl_gen//. idl/regenerate.sh +# asserts that invariant after every run (a type outside its own package directory, or any file +# at the output root, is a hard error there) — which is what makes this list safe to predict. +set(k1sim_idl_outputs "") +set(k1sim_idl_packages "") +foreach(idl ${k1sim_idl_files}) + get_filename_component(type_name ${idl} NAME_WE) + get_filename_component(pkg_dir ${idl} DIRECTORY) # ...//msg + get_filename_component(pkg_dir ${pkg_dir} DIRECTORY) # .../ + get_filename_component(pkg ${pkg_dir} NAME) + foreach(suffix ".cxx" ".h" "CdrAux.hpp" "CdrAux.ipp" "PubSubTypes.cxx" "PubSubTypes.h") + list(APPEND k1sim_idl_outputs "${K1SIM_IDL_OUT}/${pkg}/${type_name}${suffix}") + endforeach() + list(APPEND k1sim_idl_packages "${K1SIM_IDL_OUT}/${pkg}") +endforeach() +list(REMOVE_DUPLICATES k1sim_idl_packages) + +# A manifest of the .idl set, rewritten at configure time only when that set changes. +# Depending the generator on it makes a REMOVED or renamed message re-run generation (which +# wipes OUT_DIR first); without it, ninja sees every remaining output still present and +# up to date, and the deleted type's headers linger in the build tree on the include path. +list(SORT k1sim_idl_files) +string(REPLACE ";" "\n" k1sim_idl_manifest "${k1sim_idl_files}") +file(CONFIGURE OUTPUT ${CMAKE_BINARY_DIR}/idl_manifest.txt CONTENT "${k1sim_idl_manifest}\n") + +# One invocation for every .idl, not one per file: fastddsgen also generates the code for +# every type an .idl #includes (Odometry.idl pulls in Header, Time, PoseWithCovariance, ...), +# so per-file commands would have two rules claiming the same output file, which cmake rejects. +# That also means every .idl is a dependency of the single command — coarse, but a rebuild is +# one JVM start, and it needs no dependency scraping to stay correct. +add_custom_command( + OUTPUT ${k1sim_idl_outputs} + COMMAND ${CMAKE_COMMAND} -E env FASTDDSGEN=${FASTDDSGEN_EXECUTABLE} OUT_DIR=${K1SIM_IDL_OUT} + bash ${K1SIM_IDL_DIR}/regenerate.sh + DEPENDS ${k1sim_idl_files} ${K1SIM_IDL_DIR}/regenerate.sh ${CMAKE_BINARY_DIR}/idl_manifest.txt + COMMENT "Generating Fast-DDS types from mujoco/idl" + VERBATIM +) diff --git a/mujoco/idl/regenerate.sh b/mujoco/idl/regenerate.sh index 3eaa821..24eee0a 100755 --- a/mujoco/idl/regenerate.sh +++ b/mujoco/idl/regenerate.sh @@ -1,12 +1,24 @@ #!/usr/bin/env bash -# Regenerates mujoco/idl_gen/ from mujoco/idl/**/*.idl using the fastddsgen baked -# into the k1sim docker image (/opt/k1sim-deps/bin/fastddsgen). Run via e.g.: +# Generates the Fast-DDS type support from mujoco/idl/**/*.idl using the fastddsgen +# baked into the k1sim docker image (/opt/k1sim-deps/bin/fastddsgen). +# +# CMake is the normal caller: cmake/IdlGen.cmake wires this up as a build step and +# passes OUT_DIR=${CMAKE_BINARY_DIR}/idl_gen, so the generated code is a build +# artifact and is never committed (same arrangement as NUbots generating protobuf +# from shared/message/**.proto). Nothing downstream should ever read a generated +# file from the source tree. +# +# Run it by hand only to inspect the output, and point OUT_DIR somewhere scratch: # # docker run --rm -v $(pwd)/..:/workspace/NUSim \ # -w /workspace/NUSim/mujoco --user $(id -u):$(id -g) \ -# k1sim:latest ./idl/regenerate.sh +# -e OUT_DIR=/tmp/idl_gen k1sim:latest ./idl/regenerate.sh +# +# NOTE: OUT_DIR is wiped (rm -rf) before generating. Never aim it at a source dir. # -# fastddsgen version recorded at last run: "fastddsgen version 3.2.1" (OpenJDK 11.0.31) +# The generator version is asserted below, not just reported: the wire format is +# version- and flag-sensitive, and with the output no longer visible in a diff, +# this assertion is what catches a generator swap. See module/SdkBridge/PROTOCOL.md. # # Flags: # -cdr v1 -de final Force classic CDR (no XCDR2 DELIMIT_CDR2/DHEADER framing), @@ -37,12 +49,24 @@ set -euo pipefail FASTDDSGEN=${FASTDDSGEN:-/opt/k1sim-deps/bin/fastddsgen} +FASTDDSGEN_VERSION=3.2.1 # must match FASTDDSGEN_TAG in tools/install_deps.sh ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" # mujoco/ IDL_DIR="$ROOT/idl" -OUT_DIR="$ROOT/idl_gen" +# Default lands under build/ (gitignored), never in the source tree: a hand run must not +# be able to recreate a committed-looking idl_gen/. CMake always passes OUT_DIR explicitly. +OUT_DIR="${OUT_DIR:-$ROOT/build/idl_gen}" -echo "== fastddsgen version ==" -"$FASTDDSGEN" -version +# Hard-fail on a generator other than the pinned one. fastddsgen 3.2.1 with the flags +# below emits classic CDR; other versions change their defaults (see the -cdr/-de note +# above), which would silently alter the wire format the robot decodes. +version_output="$("$FASTDDSGEN" -version 2>&1 | tr -d '\r')" +echo "== $(echo "$version_output" | grep -i '^fastddsgen' || echo "$version_output")" +if ! grep -qiE "^fastddsgen version $FASTDDSGEN_VERSION\$" <<< "$version_output"; then + echo "error: expected fastddsgen $FASTDDSGEN_VERSION, got:" >&2 + echo "$version_output" >&2 + echo " reinstall with tools/install_deps.sh (FASTDDSGEN_TAG pins v$FASTDDSGEN_VERSION)." >&2 + exit 1 +fi # Where fastddsgen runs: / -> idl//msg VIEW="$(mktemp -d)" diff --git a/mujoco/idl_gen/booster_interface/BatteryState.cxx b/mujoco/idl_gen/booster_interface/BatteryState.cxx deleted file mode 100644 index 5524fea..0000000 --- a/mujoco/idl_gen/booster_interface/BatteryState.cxx +++ /dev/null @@ -1,394 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file BatteryState.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "BatteryState.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define booster_interface_msg_dds__BatteryState__max_cdr_typesize 16ULL; - - -namespace booster_interface { - -namespace msg { - -namespace dds_ { - - - -BatteryState_::BatteryState_() -{ - // float m_voltage - m_voltage = 0.0; - // float m_current - m_current = 0.0; - // float m_soc - m_soc = 0.0; - // float m_average_voltage - m_average_voltage = 0.0; - -} - -BatteryState_::~BatteryState_() -{ -} - -BatteryState_::BatteryState_( - const BatteryState_& x) -{ - m_voltage = x.m_voltage; - - - m_current = x.m_current; - - - m_soc = x.m_soc; - - - m_average_voltage = x.m_average_voltage; - -} - -BatteryState_::BatteryState_( - BatteryState_&& x) noexcept -{ - m_voltage = x.m_voltage; - - - m_current = x.m_current; - - - m_soc = x.m_soc; - - - m_average_voltage = x.m_average_voltage; - -} - -BatteryState_& BatteryState_::operator =( - const BatteryState_& x) -{ - m_voltage = x.m_voltage; - - - m_current = x.m_current; - - - m_soc = x.m_soc; - - - m_average_voltage = x.m_average_voltage; - - return *this; -} - -BatteryState_& BatteryState_::operator =( - BatteryState_&& x) noexcept -{ - m_voltage = x.m_voltage; - - - m_current = x.m_current; - - - m_soc = x.m_soc; - - - m_average_voltage = x.m_average_voltage; - - return *this; -} - -bool BatteryState_::operator ==( - const BatteryState_& x) const -{ - return (m_voltage == x.m_voltage && - m_current == x.m_current && - m_soc == x.m_soc && - m_average_voltage == x.m_average_voltage); -} - -bool BatteryState_::operator !=( - const BatteryState_& x) const -{ - return !(*this == x); -} - -size_t BatteryState_::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return booster_interface_msg_dds__BatteryState__max_cdr_typesize; -} - -size_t BatteryState_::getCdrSerializedSize( - const BatteryState_& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void BatteryState_::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_voltage; - - scdr << m_current; - - scdr << m_soc; - - scdr << m_average_voltage; - -} - -void BatteryState_::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_voltage; - - - - dcdr >> m_current; - - - - dcdr >> m_soc; - - - - dcdr >> m_average_voltage; - - -} - - -bool BatteryState_::isKeyDefined() -{ - return false; -} - -void BatteryState_::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member voltage - * @param _voltage New value for member voltage - */ -void BatteryState_::voltage( - float _voltage) -{ - m_voltage = _voltage; -} - -/*! - * @brief This function returns the value of member voltage - * @return Value of member voltage - */ -float BatteryState_::voltage() const -{ - return m_voltage; -} - -/*! - * @brief This function returns a reference to member voltage - * @return Reference to member voltage - */ -float& BatteryState_::voltage() -{ - return m_voltage; -} - - -/*! - * @brief This function sets a value in member current - * @param _current New value for member current - */ -void BatteryState_::current( - float _current) -{ - m_current = _current; -} - -/*! - * @brief This function returns the value of member current - * @return Value of member current - */ -float BatteryState_::current() const -{ - return m_current; -} - -/*! - * @brief This function returns a reference to member current - * @return Reference to member current - */ -float& BatteryState_::current() -{ - return m_current; -} - - -/*! - * @brief This function sets a value in member soc - * @param _soc New value for member soc - */ -void BatteryState_::soc( - float _soc) -{ - m_soc = _soc; -} - -/*! - * @brief This function returns the value of member soc - * @return Value of member soc - */ -float BatteryState_::soc() const -{ - return m_soc; -} - -/*! - * @brief This function returns a reference to member soc - * @return Reference to member soc - */ -float& BatteryState_::soc() -{ - return m_soc; -} - - -/*! - * @brief This function sets a value in member average_voltage - * @param _average_voltage New value for member average_voltage - */ -void BatteryState_::average_voltage( - float _average_voltage) -{ - m_average_voltage = _average_voltage; -} - -/*! - * @brief This function returns the value of member average_voltage - * @return Value of member average_voltage - */ -float BatteryState_::average_voltage() const -{ - return m_average_voltage; -} - -/*! - * @brief This function returns a reference to member average_voltage - * @return Reference to member average_voltage - */ -float& BatteryState_::average_voltage() -{ - return m_average_voltage; -} - - - - - -} // namespace dds_ - - -} // namespace msg - - -} // namespace booster_interface - diff --git a/mujoco/idl_gen/booster_interface/BatteryState.h b/mujoco/idl_gen/booster_interface/BatteryState.h deleted file mode 100644 index 0d5f1d9..0000000 --- a/mujoco/idl_gen/booster_interface/BatteryState.h +++ /dev/null @@ -1,279 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file BatteryState.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__BATTERYSTATE_H_ -#define _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__BATTERYSTATE_H_ - - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(BATTERYSTATE_SOURCE) -#define BATTERYSTATE_DllAPI __declspec( dllexport ) -#else -#define BATTERYSTATE_DllAPI __declspec( dllimport ) -#endif // BATTERYSTATE_SOURCE -#else -#define BATTERYSTATE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define BATTERYSTATE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -namespace booster_interface { - namespace msg { - namespace dds_ { - - - /*! - * @brief This class represents the structure BatteryState_ defined by the user in the IDL file. - * @ingroup BatteryState - */ - class BatteryState_ - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BatteryState_(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BatteryState_(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object booster_interface::msg::dds_::BatteryState_ that will be copied. - */ - eProsima_user_DllExport BatteryState_( - const BatteryState_& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object booster_interface::msg::dds_::BatteryState_ that will be copied. - */ - eProsima_user_DllExport BatteryState_( - BatteryState_&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object booster_interface::msg::dds_::BatteryState_ that will be copied. - */ - eProsima_user_DllExport BatteryState_& operator =( - const BatteryState_& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object booster_interface::msg::dds_::BatteryState_ that will be copied. - */ - eProsima_user_DllExport BatteryState_& operator =( - BatteryState_&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x booster_interface::msg::dds_::BatteryState_ object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BatteryState_& x) const; - - /*! - * @brief Comparison operator. - * @param x booster_interface::msg::dds_::BatteryState_ object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BatteryState_& x) const; - - /*! - * @brief This function sets a value in member voltage - * @param _voltage New value for member voltage - */ - eProsima_user_DllExport void voltage( - float _voltage); - - /*! - * @brief This function returns the value of member voltage - * @return Value of member voltage - */ - eProsima_user_DllExport float voltage() const; - - /*! - * @brief This function returns a reference to member voltage - * @return Reference to member voltage - */ - eProsima_user_DllExport float& voltage(); - - - /*! - * @brief This function sets a value in member current - * @param _current New value for member current - */ - eProsima_user_DllExport void current( - float _current); - - /*! - * @brief This function returns the value of member current - * @return Value of member current - */ - eProsima_user_DllExport float current() const; - - /*! - * @brief This function returns a reference to member current - * @return Reference to member current - */ - eProsima_user_DllExport float& current(); - - - /*! - * @brief This function sets a value in member soc - * @param _soc New value for member soc - */ - eProsima_user_DllExport void soc( - float _soc); - - /*! - * @brief This function returns the value of member soc - * @return Value of member soc - */ - eProsima_user_DllExport float soc() const; - - /*! - * @brief This function returns a reference to member soc - * @return Reference to member soc - */ - eProsima_user_DllExport float& soc(); - - - /*! - * @brief This function sets a value in member average_voltage - * @param _average_voltage New value for member average_voltage - */ - eProsima_user_DllExport void average_voltage( - float _average_voltage); - - /*! - * @brief This function returns the value of member average_voltage - * @return Value of member average_voltage - */ - eProsima_user_DllExport float average_voltage() const; - - /*! - * @brief This function returns a reference to member average_voltage - * @return Reference to member average_voltage - */ - eProsima_user_DllExport float& average_voltage(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const booster_interface::msg::dds_::BatteryState_& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - float m_voltage; - float m_current; - float m_soc; - float m_average_voltage; - - }; - - } // namespace dds_ - } // namespace msg -} // namespace booster_interface - -#endif // _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__BATTERYSTATE_H_ - - - diff --git a/mujoco/idl_gen/booster_interface/BatteryStateCdrAux.hpp b/mujoco/idl_gen/booster_interface/BatteryStateCdrAux.hpp deleted file mode 100644 index 257387c..0000000 --- a/mujoco/idl_gen/booster_interface/BatteryStateCdrAux.hpp +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file BatteryStateCdrAux.hpp - * This source file contains some definitions of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__BATTERYSTATECDRAUX_HPP_ -#define _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__BATTERYSTATECDRAUX_HPP_ - -#include "BatteryState.h" - -constexpr uint32_t booster_interface_msg_dds__BatteryState__max_cdr_typesize {16UL}; -constexpr uint32_t booster_interface_msg_dds__BatteryState__max_key_cdr_typesize {0UL}; - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const booster_interface::msg::dds_::BatteryState_& data); - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__BATTERYSTATECDRAUX_HPP_ - diff --git a/mujoco/idl_gen/booster_interface/BatteryStateCdrAux.ipp b/mujoco/idl_gen/booster_interface/BatteryStateCdrAux.ipp deleted file mode 100644 index 754325a..0000000 --- a/mujoco/idl_gen/booster_interface/BatteryStateCdrAux.ipp +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file BatteryStateCdrAux.ipp - * This source file contains some declarations of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__BATTERYSTATECDRAUX_IPP_ -#define _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__BATTERYSTATECDRAUX_IPP_ - -#include "BatteryStateCdrAux.hpp" - -#include -#include - - -#include -using namespace eprosima::fastcdr::exception; - -namespace eprosima { -namespace fastcdr { - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const booster_interface::msg::dds_::BatteryState_& data, - size_t& current_alignment) -{ - using namespace booster_interface::msg::dds_; - - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.voltage(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.current(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.soc(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), - data.average_voltage(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const booster_interface::msg::dds_::BatteryState_& data) -{ - using namespace booster_interface::msg::dds_; - - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.voltage() - << eprosima::fastcdr::MemberId(1) << data.current() - << eprosima::fastcdr::MemberId(2) << data.soc() - << eprosima::fastcdr::MemberId(3) << data.average_voltage() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - booster_interface::msg::dds_::BatteryState_& data) -{ - using namespace booster_interface::msg::dds_; - - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.voltage(); - break; - - case 1: - dcdr >> data.current(); - break; - - case 2: - dcdr >> data.soc(); - break; - - case 3: - dcdr >> data.average_voltage(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const booster_interface::msg::dds_::BatteryState_& data) -{ - using namespace booster_interface::msg::dds_; - - static_cast(scdr); - static_cast(data); -} - - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__BATTERYSTATECDRAUX_IPP_ - diff --git a/mujoco/idl_gen/booster_interface/BatteryStatePubSubTypes.cxx b/mujoco/idl_gen/booster_interface/BatteryStatePubSubTypes.cxx deleted file mode 100644 index ed107c1..0000000 --- a/mujoco/idl_gen/booster_interface/BatteryStatePubSubTypes.cxx +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file BatteryStatePubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#include - -#include "BatteryStatePubSubTypes.h" -#include "BatteryStateCdrAux.hpp" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; -using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - -namespace booster_interface { - namespace msg { - namespace dds_ { - - - BatteryState_PubSubType::BatteryState_PubSubType() - { - setName("booster_interface::msg::dds_::BatteryState_"); - uint32_t type_size = - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(BatteryState_::getMaxCdrSerializedSize()); - #else - booster_interface_msg_dds__BatteryState__max_cdr_typesize; - #endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = booster_interface_msg_dds__BatteryState__max_key_cdr_typesize > 16 ? booster_interface_msg_dds__BatteryState__max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - BatteryState_PubSubType::~BatteryState_PubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool BatteryState_PubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) - { - BatteryState_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - #if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - #endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length - #if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); - #else - payload->length = static_cast(ser.get_serialized_data_length()); - #endif // FASTCDR_VERSION_MAJOR == 1 - return true; - } - - bool BatteryState_PubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - BatteryState_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN - #if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR - #endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; - } - - std::function BatteryState_PubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) - { - return [data, data_representation]() -> uint32_t - { - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - #else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } - #endif // FASTCDR_VERSION_MAJOR == 1 - }; - } - - void* BatteryState_PubSubType::createData() - { - return reinterpret_cast(new BatteryState_()); - } - - void BatteryState_PubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool BatteryState_PubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - BatteryState_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - booster_interface_msg_dds__BatteryState__max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); - #if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); - #else - eprosima::fastcdr::serialize_key(ser, *p_type); - #endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || booster_interface_msg_dds__BatteryState__max_key_cdr_typesize > 16) - { - m_md5.init(); - #if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - #else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); - #endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace dds_ - - - } //End of namespace msg - - -} //End of namespace booster_interface - diff --git a/mujoco/idl_gen/booster_interface/BatteryStatePubSubTypes.h b/mujoco/idl_gen/booster_interface/BatteryStatePubSubTypes.h deleted file mode 100644 index 01ee815..0000000 --- a/mujoco/idl_gen/booster_interface/BatteryStatePubSubTypes.h +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file BatteryStatePubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__BATTERYSTATE_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__BATTERYSTATE_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "BatteryState.h" - - -#if !defined(GEN_API_VER) || (GEN_API_VER != 2) -#error \ - Generated BatteryState is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace booster_interface -{ - namespace msg - { - namespace dds_ - { - - - - #ifndef SWIG - namespace detail { - - template - struct BatteryState__rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - - }; - - struct BatteryState__f - { - typedef float BatteryState_::* type; - friend constexpr type get( - BatteryState__f); - }; - - template struct BatteryState__rob; - - template - inline size_t constexpr BatteryState__offset_of() - { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } - - } // namespace detail - #endif // ifndef SWIG - - - /*! - * @brief This class represents the TopicDataType of the type BatteryState_ defined by the user in the IDL file. - * @ingroup BatteryState - */ - class BatteryState_PubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef BatteryState_ type; - - eProsima_user_DllExport BatteryState_PubSubType(); - - eProsima_user_DllExport ~BatteryState_PubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return is_plain_xcdrv1_impl(); - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) - { - return is_plain_xcdrv2_impl(); - } - else - { - return is_plain_xcdrv1_impl(); - } - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) BatteryState_(); - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - - private: - - static constexpr bool is_plain_xcdrv1_impl() - { - return 16ULL == - (detail::BatteryState__offset_of() + - sizeof(float)); - } - - static constexpr bool is_plain_xcdrv2_impl() - { - return 16ULL == - (detail::BatteryState__offset_of() + - sizeof(float)); - } - - }; - } - } -} - -#endif // _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__BATTERYSTATE_PUBSUBTYPES_H_ - diff --git a/mujoco/idl_gen/booster_interface/ButtonEvent.cxx b/mujoco/idl_gen/booster_interface/ButtonEvent.cxx deleted file mode 100644 index 6bc1b48..0000000 --- a/mujoco/idl_gen/booster_interface/ButtonEvent.cxx +++ /dev/null @@ -1,293 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file ButtonEvent.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "ButtonEvent.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define booster_interface_msg_dds__ButtonEventMsg__max_cdr_typesize 8ULL; - - - -namespace booster_interface { - -namespace msg { - -namespace dds_ { - - - -ButtonEventMsg_::ButtonEventMsg_() -{ - // long m_button - m_button = 0; - // booster_interface::msg::dds_::ButtonEventType_ m_event - m_event = booster_interface::msg::dds_::PRESS_DOWN; - -} - -ButtonEventMsg_::~ButtonEventMsg_() -{ -} - -ButtonEventMsg_::ButtonEventMsg_( - const ButtonEventMsg_& x) -{ - m_button = x.m_button; - - - m_event = x.m_event; - -} - -ButtonEventMsg_::ButtonEventMsg_( - ButtonEventMsg_&& x) noexcept -{ - m_button = x.m_button; - - - m_event = x.m_event; - -} - -ButtonEventMsg_& ButtonEventMsg_::operator =( - const ButtonEventMsg_& x) -{ - m_button = x.m_button; - - - m_event = x.m_event; - - return *this; -} - -ButtonEventMsg_& ButtonEventMsg_::operator =( - ButtonEventMsg_&& x) noexcept -{ - m_button = x.m_button; - - - m_event = x.m_event; - - return *this; -} - -bool ButtonEventMsg_::operator ==( - const ButtonEventMsg_& x) const -{ - return (m_button == x.m_button && - m_event == x.m_event); -} - -bool ButtonEventMsg_::operator !=( - const ButtonEventMsg_& x) const -{ - return !(*this == x); -} - -size_t ButtonEventMsg_::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return booster_interface_msg_dds__ButtonEventMsg__max_cdr_typesize; -} - -size_t ButtonEventMsg_::getCdrSerializedSize( - const ButtonEventMsg_& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void ButtonEventMsg_::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_button; - - scdr << (uint32_t)m_event; - -} - -void ButtonEventMsg_::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_button; - - - - { - uint32_t enum_value = 0; - dcdr >> enum_value; - m_event = (booster_interface::msg::dds_::ButtonEventType_)enum_value; - } - - -} - - -bool ButtonEventMsg_::isKeyDefined() -{ - return false; -} - -void ButtonEventMsg_::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member button - * @param _button New value for member button - */ -void ButtonEventMsg_::button( - int32_t _button) -{ - m_button = _button; -} - -/*! - * @brief This function returns the value of member button - * @return Value of member button - */ -int32_t ButtonEventMsg_::button() const -{ - return m_button; -} - -/*! - * @brief This function returns a reference to member button - * @return Reference to member button - */ -int32_t& ButtonEventMsg_::button() -{ - return m_button; -} - - -/*! - * @brief This function sets a value in member event - * @param _event New value for member event - */ -void ButtonEventMsg_::event( - booster_interface::msg::dds_::ButtonEventType_ _event) -{ - m_event = _event; -} - -/*! - * @brief This function returns the value of member event - * @return Value of member event - */ -booster_interface::msg::dds_::ButtonEventType_ ButtonEventMsg_::event() const -{ - return m_event; -} - -/*! - * @brief This function returns a reference to member event - * @return Reference to member event - */ -booster_interface::msg::dds_::ButtonEventType_& ButtonEventMsg_::event() -{ - return m_event; -} - - - - - -} // namespace dds_ - - -} // namespace msg - - -} // namespace booster_interface - diff --git a/mujoco/idl_gen/booster_interface/ButtonEvent.h b/mujoco/idl_gen/booster_interface/ButtonEvent.h deleted file mode 100644 index 183e22d..0000000 --- a/mujoco/idl_gen/booster_interface/ButtonEvent.h +++ /dev/null @@ -1,252 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file ButtonEvent.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__BUTTONEVENT_H_ -#define _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__BUTTONEVENT_H_ - - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(BUTTONEVENT_SOURCE) -#define BUTTONEVENT_DllAPI __declspec( dllexport ) -#else -#define BUTTONEVENT_DllAPI __declspec( dllimport ) -#endif // BUTTONEVENT_SOURCE -#else -#define BUTTONEVENT_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define BUTTONEVENT_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -namespace booster_interface { - namespace msg { - namespace dds_ { - /*! - * @brief This class represents the enumeration ButtonEventType_ defined by the user in the IDL file. - * @ingroup ButtonEvent - */ - enum ButtonEventType_ : uint32_t - { - PRESS_DOWN, - PRESS_UP, - SINGLE_CLICK, - DOUBLE_CLICK, - TRIPLE_CLICK, - LONG_PRESS_START, - LONG_PRESS_HOLD, - LONG_PRESS_END - }; - - - /*! - * @brief This class represents the structure ButtonEventMsg_ defined by the user in the IDL file. - * @ingroup ButtonEvent - */ - class ButtonEventMsg_ - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ButtonEventMsg_(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ButtonEventMsg_(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object booster_interface::msg::dds_::ButtonEventMsg_ that will be copied. - */ - eProsima_user_DllExport ButtonEventMsg_( - const ButtonEventMsg_& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object booster_interface::msg::dds_::ButtonEventMsg_ that will be copied. - */ - eProsima_user_DllExport ButtonEventMsg_( - ButtonEventMsg_&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object booster_interface::msg::dds_::ButtonEventMsg_ that will be copied. - */ - eProsima_user_DllExport ButtonEventMsg_& operator =( - const ButtonEventMsg_& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object booster_interface::msg::dds_::ButtonEventMsg_ that will be copied. - */ - eProsima_user_DllExport ButtonEventMsg_& operator =( - ButtonEventMsg_&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x booster_interface::msg::dds_::ButtonEventMsg_ object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ButtonEventMsg_& x) const; - - /*! - * @brief Comparison operator. - * @param x booster_interface::msg::dds_::ButtonEventMsg_ object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ButtonEventMsg_& x) const; - - /*! - * @brief This function sets a value in member button - * @param _button New value for member button - */ - eProsima_user_DllExport void button( - int32_t _button); - - /*! - * @brief This function returns the value of member button - * @return Value of member button - */ - eProsima_user_DllExport int32_t button() const; - - /*! - * @brief This function returns a reference to member button - * @return Reference to member button - */ - eProsima_user_DllExport int32_t& button(); - - - /*! - * @brief This function sets a value in member event - * @param _event New value for member event - */ - eProsima_user_DllExport void event( - booster_interface::msg::dds_::ButtonEventType_ _event); - - /*! - * @brief This function returns the value of member event - * @return Value of member event - */ - eProsima_user_DllExport booster_interface::msg::dds_::ButtonEventType_ event() const; - - /*! - * @brief This function returns a reference to member event - * @return Reference to member event - */ - eProsima_user_DllExport booster_interface::msg::dds_::ButtonEventType_& event(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const booster_interface::msg::dds_::ButtonEventMsg_& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - int32_t m_button; - booster_interface::msg::dds_::ButtonEventType_ m_event; - - }; - - } // namespace dds_ - } // namespace msg -} // namespace booster_interface - -#endif // _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__BUTTONEVENT_H_ - - - diff --git a/mujoco/idl_gen/booster_interface/ButtonEventCdrAux.hpp b/mujoco/idl_gen/booster_interface/ButtonEventCdrAux.hpp deleted file mode 100644 index 290d9f2..0000000 --- a/mujoco/idl_gen/booster_interface/ButtonEventCdrAux.hpp +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file ButtonEventCdrAux.hpp - * This source file contains some definitions of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__BUTTONEVENTCDRAUX_HPP_ -#define _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__BUTTONEVENTCDRAUX_HPP_ - -#include "ButtonEvent.h" - -constexpr uint32_t booster_interface_msg_dds__ButtonEventMsg__max_cdr_typesize {8UL}; -constexpr uint32_t booster_interface_msg_dds__ButtonEventMsg__max_key_cdr_typesize {0UL}; - - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const booster_interface::msg::dds_::ButtonEventMsg_& data); - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__BUTTONEVENTCDRAUX_HPP_ - diff --git a/mujoco/idl_gen/booster_interface/ButtonEventCdrAux.ipp b/mujoco/idl_gen/booster_interface/ButtonEventCdrAux.ipp deleted file mode 100644 index 160a121..0000000 --- a/mujoco/idl_gen/booster_interface/ButtonEventCdrAux.ipp +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file ButtonEventCdrAux.ipp - * This source file contains some declarations of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__BUTTONEVENTCDRAUX_IPP_ -#define _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__BUTTONEVENTCDRAUX_IPP_ - -#include "ButtonEventCdrAux.hpp" - -#include -#include - - -#include -using namespace eprosima::fastcdr::exception; - -namespace eprosima { -namespace fastcdr { - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const booster_interface::msg::dds_::ButtonEventMsg_& data, - size_t& current_alignment) -{ - using namespace booster_interface::msg::dds_; - - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.button(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.event(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const booster_interface::msg::dds_::ButtonEventMsg_& data) -{ - using namespace booster_interface::msg::dds_; - - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.button() - << eprosima::fastcdr::MemberId(1) << data.event() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - booster_interface::msg::dds_::ButtonEventMsg_& data) -{ - using namespace booster_interface::msg::dds_; - - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.button(); - break; - - case 1: - dcdr >> data.event(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const booster_interface::msg::dds_::ButtonEventMsg_& data) -{ - using namespace booster_interface::msg::dds_; - - static_cast(scdr); - static_cast(data); -} - - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__BUTTONEVENTCDRAUX_IPP_ - diff --git a/mujoco/idl_gen/booster_interface/ButtonEventPubSubTypes.cxx b/mujoco/idl_gen/booster_interface/ButtonEventPubSubTypes.cxx deleted file mode 100644 index 5308c10..0000000 --- a/mujoco/idl_gen/booster_interface/ButtonEventPubSubTypes.cxx +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file ButtonEventPubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#include - -#include "ButtonEventPubSubTypes.h" -#include "ButtonEventCdrAux.hpp" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; -using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - -namespace booster_interface { - namespace msg { - namespace dds_ { - - - ButtonEventMsg_PubSubType::ButtonEventMsg_PubSubType() - { - setName("booster_interface::msg::dds_::ButtonEventMsg_"); - uint32_t type_size = - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(ButtonEventMsg_::getMaxCdrSerializedSize()); - #else - booster_interface_msg_dds__ButtonEventMsg__max_cdr_typesize; - #endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = booster_interface_msg_dds__ButtonEventMsg__max_key_cdr_typesize > 16 ? booster_interface_msg_dds__ButtonEventMsg__max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - ButtonEventMsg_PubSubType::~ButtonEventMsg_PubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool ButtonEventMsg_PubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) - { - ButtonEventMsg_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - #if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - #endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length - #if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); - #else - payload->length = static_cast(ser.get_serialized_data_length()); - #endif // FASTCDR_VERSION_MAJOR == 1 - return true; - } - - bool ButtonEventMsg_PubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - ButtonEventMsg_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN - #if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR - #endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; - } - - std::function ButtonEventMsg_PubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) - { - return [data, data_representation]() -> uint32_t - { - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - #else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } - #endif // FASTCDR_VERSION_MAJOR == 1 - }; - } - - void* ButtonEventMsg_PubSubType::createData() - { - return reinterpret_cast(new ButtonEventMsg_()); - } - - void ButtonEventMsg_PubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool ButtonEventMsg_PubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - ButtonEventMsg_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - booster_interface_msg_dds__ButtonEventMsg__max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); - #if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); - #else - eprosima::fastcdr::serialize_key(ser, *p_type); - #endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || booster_interface_msg_dds__ButtonEventMsg__max_key_cdr_typesize > 16) - { - m_md5.init(); - #if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - #else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); - #endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace dds_ - - - } //End of namespace msg - - -} //End of namespace booster_interface - diff --git a/mujoco/idl_gen/booster_interface/ButtonEventPubSubTypes.h b/mujoco/idl_gen/booster_interface/ButtonEventPubSubTypes.h deleted file mode 100644 index 31a30ad..0000000 --- a/mujoco/idl_gen/booster_interface/ButtonEventPubSubTypes.h +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file ButtonEventPubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__BUTTONEVENT_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__BUTTONEVENT_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "ButtonEvent.h" - - -#if !defined(GEN_API_VER) || (GEN_API_VER != 2) -#error \ - Generated ButtonEvent is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace booster_interface -{ - namespace msg - { - namespace dds_ - { - - - - /*! - * @brief This class represents the TopicDataType of the type ButtonEventMsg_ defined by the user in the IDL file. - * @ingroup ButtonEvent - */ - class ButtonEventMsg_PubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef ButtonEventMsg_ type; - - eProsima_user_DllExport ButtonEventMsg_PubSubType(); - - eProsima_user_DllExport ~ButtonEventMsg_PubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - - }; - } - } -} - -#endif // _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__BUTTONEVENT_PUBSUBTYPES_H_ - diff --git a/mujoco/idl_gen/booster_interface/FallDownState.cxx b/mujoco/idl_gen/booster_interface/FallDownState.cxx deleted file mode 100644 index 50ba355..0000000 --- a/mujoco/idl_gen/booster_interface/FallDownState.cxx +++ /dev/null @@ -1,292 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file FallDownState.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "FallDownState.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define booster_interface_msg_dds__FallDownState__max_cdr_typesize 5ULL; - - -namespace booster_interface { - -namespace msg { - -namespace dds_ { - - - -FallDownState_::FallDownState_() -{ - // booster_interface::msg::dds_::FallDownStateType_ m_fall_down_state - m_fall_down_state = booster_interface::msg::dds_::IS_READY; - // boolean m_is_recovery_available - m_is_recovery_available = false; - -} - -FallDownState_::~FallDownState_() -{ -} - -FallDownState_::FallDownState_( - const FallDownState_& x) -{ - m_fall_down_state = x.m_fall_down_state; - - - m_is_recovery_available = x.m_is_recovery_available; - -} - -FallDownState_::FallDownState_( - FallDownState_&& x) noexcept -{ - m_fall_down_state = x.m_fall_down_state; - - - m_is_recovery_available = x.m_is_recovery_available; - -} - -FallDownState_& FallDownState_::operator =( - const FallDownState_& x) -{ - m_fall_down_state = x.m_fall_down_state; - - - m_is_recovery_available = x.m_is_recovery_available; - - return *this; -} - -FallDownState_& FallDownState_::operator =( - FallDownState_&& x) noexcept -{ - m_fall_down_state = x.m_fall_down_state; - - - m_is_recovery_available = x.m_is_recovery_available; - - return *this; -} - -bool FallDownState_::operator ==( - const FallDownState_& x) const -{ - return (m_fall_down_state == x.m_fall_down_state && - m_is_recovery_available == x.m_is_recovery_available); -} - -bool FallDownState_::operator !=( - const FallDownState_& x) const -{ - return !(*this == x); -} - -size_t FallDownState_::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return booster_interface_msg_dds__FallDownState__max_cdr_typesize; -} - -size_t FallDownState_::getCdrSerializedSize( - const FallDownState_& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - - -void FallDownState_::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << (uint32_t)m_fall_down_state; - - scdr << m_is_recovery_available; - -} - -void FallDownState_::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - { - uint32_t enum_value = 0; - dcdr >> enum_value; - m_fall_down_state = (booster_interface::msg::dds_::FallDownStateType_)enum_value; - } - - - - dcdr >> m_is_recovery_available; - - -} - - -bool FallDownState_::isKeyDefined() -{ - return false; -} - -void FallDownState_::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member fall_down_state - * @param _fall_down_state New value for member fall_down_state - */ -void FallDownState_::fall_down_state( - booster_interface::msg::dds_::FallDownStateType_ _fall_down_state) -{ - m_fall_down_state = _fall_down_state; -} - -/*! - * @brief This function returns the value of member fall_down_state - * @return Value of member fall_down_state - */ -booster_interface::msg::dds_::FallDownStateType_ FallDownState_::fall_down_state() const -{ - return m_fall_down_state; -} - -/*! - * @brief This function returns a reference to member fall_down_state - * @return Reference to member fall_down_state - */ -booster_interface::msg::dds_::FallDownStateType_& FallDownState_::fall_down_state() -{ - return m_fall_down_state; -} - - -/*! - * @brief This function sets a value in member is_recovery_available - * @param _is_recovery_available New value for member is_recovery_available - */ -void FallDownState_::is_recovery_available( - bool _is_recovery_available) -{ - m_is_recovery_available = _is_recovery_available; -} - -/*! - * @brief This function returns the value of member is_recovery_available - * @return Value of member is_recovery_available - */ -bool FallDownState_::is_recovery_available() const -{ - return m_is_recovery_available; -} - -/*! - * @brief This function returns a reference to member is_recovery_available - * @return Reference to member is_recovery_available - */ -bool& FallDownState_::is_recovery_available() -{ - return m_is_recovery_available; -} - - - - - -} // namespace dds_ - - -} // namespace msg - - -} // namespace booster_interface - diff --git a/mujoco/idl_gen/booster_interface/FallDownState.h b/mujoco/idl_gen/booster_interface/FallDownState.h deleted file mode 100644 index c4d5724..0000000 --- a/mujoco/idl_gen/booster_interface/FallDownState.h +++ /dev/null @@ -1,248 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file FallDownState.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__FALLDOWNSTATE_H_ -#define _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__FALLDOWNSTATE_H_ - - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(FALLDOWNSTATE_SOURCE) -#define FALLDOWNSTATE_DllAPI __declspec( dllexport ) -#else -#define FALLDOWNSTATE_DllAPI __declspec( dllimport ) -#endif // FALLDOWNSTATE_SOURCE -#else -#define FALLDOWNSTATE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define FALLDOWNSTATE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -namespace booster_interface { - namespace msg { - namespace dds_ { - /*! - * @brief This class represents the enumeration FallDownStateType_ defined by the user in the IDL file. - * @ingroup FallDownState - */ - enum FallDownStateType_ : uint32_t - { - IS_READY, - IS_FALLING, - HAS_FALLEN, - IS_GETTING_UP - }; - - - /*! - * @brief This class represents the structure FallDownState_ defined by the user in the IDL file. - * @ingroup FallDownState - */ - class FallDownState_ - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport FallDownState_(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~FallDownState_(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object booster_interface::msg::dds_::FallDownState_ that will be copied. - */ - eProsima_user_DllExport FallDownState_( - const FallDownState_& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object booster_interface::msg::dds_::FallDownState_ that will be copied. - */ - eProsima_user_DllExport FallDownState_( - FallDownState_&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object booster_interface::msg::dds_::FallDownState_ that will be copied. - */ - eProsima_user_DllExport FallDownState_& operator =( - const FallDownState_& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object booster_interface::msg::dds_::FallDownState_ that will be copied. - */ - eProsima_user_DllExport FallDownState_& operator =( - FallDownState_&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x booster_interface::msg::dds_::FallDownState_ object to compare. - */ - eProsima_user_DllExport bool operator ==( - const FallDownState_& x) const; - - /*! - * @brief Comparison operator. - * @param x booster_interface::msg::dds_::FallDownState_ object to compare. - */ - eProsima_user_DllExport bool operator !=( - const FallDownState_& x) const; - - /*! - * @brief This function sets a value in member fall_down_state - * @param _fall_down_state New value for member fall_down_state - */ - eProsima_user_DllExport void fall_down_state( - booster_interface::msg::dds_::FallDownStateType_ _fall_down_state); - - /*! - * @brief This function returns the value of member fall_down_state - * @return Value of member fall_down_state - */ - eProsima_user_DllExport booster_interface::msg::dds_::FallDownStateType_ fall_down_state() const; - - /*! - * @brief This function returns a reference to member fall_down_state - * @return Reference to member fall_down_state - */ - eProsima_user_DllExport booster_interface::msg::dds_::FallDownStateType_& fall_down_state(); - - - /*! - * @brief This function sets a value in member is_recovery_available - * @param _is_recovery_available New value for member is_recovery_available - */ - eProsima_user_DllExport void is_recovery_available( - bool _is_recovery_available); - - /*! - * @brief This function returns the value of member is_recovery_available - * @return Value of member is_recovery_available - */ - eProsima_user_DllExport bool is_recovery_available() const; - - /*! - * @brief This function returns a reference to member is_recovery_available - * @return Reference to member is_recovery_available - */ - eProsima_user_DllExport bool& is_recovery_available(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const booster_interface::msg::dds_::FallDownState_& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - booster_interface::msg::dds_::FallDownStateType_ m_fall_down_state; - bool m_is_recovery_available; - - }; - - } // namespace dds_ - } // namespace msg -} // namespace booster_interface - -#endif // _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__FALLDOWNSTATE_H_ - - - diff --git a/mujoco/idl_gen/booster_interface/FallDownStateCdrAux.hpp b/mujoco/idl_gen/booster_interface/FallDownStateCdrAux.hpp deleted file mode 100644 index 530d558..0000000 --- a/mujoco/idl_gen/booster_interface/FallDownStateCdrAux.hpp +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file FallDownStateCdrAux.hpp - * This source file contains some definitions of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__FALLDOWNSTATECDRAUX_HPP_ -#define _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__FALLDOWNSTATECDRAUX_HPP_ - -#include "FallDownState.h" - -constexpr uint32_t booster_interface_msg_dds__FallDownState__max_cdr_typesize {5UL}; -constexpr uint32_t booster_interface_msg_dds__FallDownState__max_key_cdr_typesize {0UL}; - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const booster_interface::msg::dds_::FallDownState_& data); - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__FALLDOWNSTATECDRAUX_HPP_ - diff --git a/mujoco/idl_gen/booster_interface/FallDownStateCdrAux.ipp b/mujoco/idl_gen/booster_interface/FallDownStateCdrAux.ipp deleted file mode 100644 index 24736a6..0000000 --- a/mujoco/idl_gen/booster_interface/FallDownStateCdrAux.ipp +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file FallDownStateCdrAux.ipp - * This source file contains some declarations of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__FALLDOWNSTATECDRAUX_IPP_ -#define _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__FALLDOWNSTATECDRAUX_IPP_ - -#include "FallDownStateCdrAux.hpp" - -#include -#include - - -#include -using namespace eprosima::fastcdr::exception; - -namespace eprosima { -namespace fastcdr { - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const booster_interface::msg::dds_::FallDownState_& data, - size_t& current_alignment) -{ - using namespace booster_interface::msg::dds_; - - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.fall_down_state(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.is_recovery_available(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const booster_interface::msg::dds_::FallDownState_& data) -{ - using namespace booster_interface::msg::dds_; - - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.fall_down_state() - << eprosima::fastcdr::MemberId(1) << data.is_recovery_available() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - booster_interface::msg::dds_::FallDownState_& data) -{ - using namespace booster_interface::msg::dds_; - - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.fall_down_state(); - break; - - case 1: - dcdr >> data.is_recovery_available(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const booster_interface::msg::dds_::FallDownState_& data) -{ - using namespace booster_interface::msg::dds_; - - static_cast(scdr); - static_cast(data); -} - - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__FALLDOWNSTATECDRAUX_IPP_ - diff --git a/mujoco/idl_gen/booster_interface/FallDownStatePubSubTypes.cxx b/mujoco/idl_gen/booster_interface/FallDownStatePubSubTypes.cxx deleted file mode 100644 index 9514fa3..0000000 --- a/mujoco/idl_gen/booster_interface/FallDownStatePubSubTypes.cxx +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file FallDownStatePubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#include - -#include "FallDownStatePubSubTypes.h" -#include "FallDownStateCdrAux.hpp" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; -using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - -namespace booster_interface { - namespace msg { - namespace dds_ { - - - FallDownState_PubSubType::FallDownState_PubSubType() - { - setName("booster_interface::msg::dds_::FallDownState_"); - uint32_t type_size = - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(FallDownState_::getMaxCdrSerializedSize()); - #else - booster_interface_msg_dds__FallDownState__max_cdr_typesize; - #endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = booster_interface_msg_dds__FallDownState__max_key_cdr_typesize > 16 ? booster_interface_msg_dds__FallDownState__max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - FallDownState_PubSubType::~FallDownState_PubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool FallDownState_PubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) - { - FallDownState_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - #if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - #endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length - #if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); - #else - payload->length = static_cast(ser.get_serialized_data_length()); - #endif // FASTCDR_VERSION_MAJOR == 1 - return true; - } - - bool FallDownState_PubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - FallDownState_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN - #if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR - #endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; - } - - std::function FallDownState_PubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) - { - return [data, data_representation]() -> uint32_t - { - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - #else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } - #endif // FASTCDR_VERSION_MAJOR == 1 - }; - } - - void* FallDownState_PubSubType::createData() - { - return reinterpret_cast(new FallDownState_()); - } - - void FallDownState_PubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool FallDownState_PubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - FallDownState_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - booster_interface_msg_dds__FallDownState__max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); - #if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); - #else - eprosima::fastcdr::serialize_key(ser, *p_type); - #endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || booster_interface_msg_dds__FallDownState__max_key_cdr_typesize > 16) - { - m_md5.init(); - #if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - #else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); - #endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace dds_ - - - } //End of namespace msg - - -} //End of namespace booster_interface - diff --git a/mujoco/idl_gen/booster_interface/FallDownStatePubSubTypes.h b/mujoco/idl_gen/booster_interface/FallDownStatePubSubTypes.h deleted file mode 100644 index 13dd92b..0000000 --- a/mujoco/idl_gen/booster_interface/FallDownStatePubSubTypes.h +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file FallDownStatePubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__FALLDOWNSTATE_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__FALLDOWNSTATE_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "FallDownState.h" - - -#if !defined(GEN_API_VER) || (GEN_API_VER != 2) -#error \ - Generated FallDownState is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace booster_interface -{ - namespace msg - { - namespace dds_ - { - - - - /*! - * @brief This class represents the TopicDataType of the type FallDownState_ defined by the user in the IDL file. - * @ingroup FallDownState - */ - class FallDownState_PubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef FallDownState_ type; - - eProsima_user_DllExport FallDownState_PubSubType(); - - eProsima_user_DllExport ~FallDownState_PubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - - }; - } - } -} - -#endif // _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__FALLDOWNSTATE_PUBSUBTYPES_H_ - diff --git a/mujoco/idl_gen/booster_interface/ImuState.cxx b/mujoco/idl_gen/booster_interface/ImuState.cxx deleted file mode 100644 index f736cb8..0000000 --- a/mujoco/idl_gen/booster_interface/ImuState.cxx +++ /dev/null @@ -1,377 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file ImuState.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "ImuState.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define booster_interface_msg_dds__ImuState__max_cdr_typesize 36ULL; - - -namespace booster_interface { - -namespace msg { - -namespace dds_ { - - - -ImuState_::ImuState_() -{ - // float m_rpy - memset(&m_rpy, 0, ((3)) * 4); - // float m_gyro - memset(&m_gyro, 0, ((3)) * 4); - // float m_acc - memset(&m_acc, 0, ((3)) * 4); - -} - -ImuState_::~ImuState_() -{ -} - -ImuState_::ImuState_( - const ImuState_& x) -{ - m_rpy = x.m_rpy; - - - m_gyro = x.m_gyro; - - - m_acc = x.m_acc; - -} - -ImuState_::ImuState_( - ImuState_&& x) noexcept -{ - m_rpy = std::move(x.m_rpy); - - - m_gyro = std::move(x.m_gyro); - - - m_acc = std::move(x.m_acc); - -} - -ImuState_& ImuState_::operator =( - const ImuState_& x) -{ - m_rpy = x.m_rpy; - - - m_gyro = x.m_gyro; - - - m_acc = x.m_acc; - - return *this; -} - -ImuState_& ImuState_::operator =( - ImuState_&& x) noexcept -{ - m_rpy = std::move(x.m_rpy); - - - m_gyro = std::move(x.m_gyro); - - - m_acc = std::move(x.m_acc); - - return *this; -} - -bool ImuState_::operator ==( - const ImuState_& x) const -{ - return (m_rpy == x.m_rpy && - m_gyro == x.m_gyro && - m_acc == x.m_acc); -} - -bool ImuState_::operator !=( - const ImuState_& x) const -{ - return !(*this == x); -} - -size_t ImuState_::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return booster_interface_msg_dds__ImuState__max_cdr_typesize; -} - -size_t ImuState_::getCdrSerializedSize( - const ImuState_& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += (((3)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - current_alignment += (((3)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - current_alignment += (((3)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; -} - - -void ImuState_::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_rpy; - - - scdr << m_gyro; - - - scdr << m_acc; - - -} - -void ImuState_::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_rpy; - - - - dcdr >> m_gyro; - - - - dcdr >> m_acc; - - -} - - -bool ImuState_::isKeyDefined() -{ - return false; -} - -void ImuState_::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member rpy - * @param _rpy New value to be copied in member rpy - */ -void ImuState_::rpy( - const std::array& _rpy) -{ - m_rpy = _rpy; -} - -/*! - * @brief This function moves the value in member rpy - * @param _rpy New value to be moved in member rpy - */ -void ImuState_::rpy( - std::array&& _rpy) -{ - m_rpy = std::move(_rpy); -} - -/*! - * @brief This function returns a constant reference to member rpy - * @return Constant reference to member rpy - */ -const std::array& ImuState_::rpy() const -{ - return m_rpy; -} - -/*! - * @brief This function returns a reference to member rpy - * @return Reference to member rpy - */ -std::array& ImuState_::rpy() -{ - return m_rpy; -} - - -/*! - * @brief This function copies the value in member gyro - * @param _gyro New value to be copied in member gyro - */ -void ImuState_::gyro( - const std::array& _gyro) -{ - m_gyro = _gyro; -} - -/*! - * @brief This function moves the value in member gyro - * @param _gyro New value to be moved in member gyro - */ -void ImuState_::gyro( - std::array&& _gyro) -{ - m_gyro = std::move(_gyro); -} - -/*! - * @brief This function returns a constant reference to member gyro - * @return Constant reference to member gyro - */ -const std::array& ImuState_::gyro() const -{ - return m_gyro; -} - -/*! - * @brief This function returns a reference to member gyro - * @return Reference to member gyro - */ -std::array& ImuState_::gyro() -{ - return m_gyro; -} - - -/*! - * @brief This function copies the value in member acc - * @param _acc New value to be copied in member acc - */ -void ImuState_::acc( - const std::array& _acc) -{ - m_acc = _acc; -} - -/*! - * @brief This function moves the value in member acc - * @param _acc New value to be moved in member acc - */ -void ImuState_::acc( - std::array&& _acc) -{ - m_acc = std::move(_acc); -} - -/*! - * @brief This function returns a constant reference to member acc - * @return Constant reference to member acc - */ -const std::array& ImuState_::acc() const -{ - return m_acc; -} - -/*! - * @brief This function returns a reference to member acc - * @return Reference to member acc - */ -std::array& ImuState_::acc() -{ - return m_acc; -} - - - - - -} // namespace dds_ - - -} // namespace msg - - -} // namespace booster_interface - diff --git a/mujoco/idl_gen/booster_interface/ImuState.h b/mujoco/idl_gen/booster_interface/ImuState.h deleted file mode 100644 index 256a1ae..0000000 --- a/mujoco/idl_gen/booster_interface/ImuState.h +++ /dev/null @@ -1,279 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file ImuState.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__IMUSTATE_H_ -#define _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__IMUSTATE_H_ - - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(IMUSTATE_SOURCE) -#define IMUSTATE_DllAPI __declspec( dllexport ) -#else -#define IMUSTATE_DllAPI __declspec( dllimport ) -#endif // IMUSTATE_SOURCE -#else -#define IMUSTATE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define IMUSTATE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -namespace booster_interface { - namespace msg { - namespace dds_ { - - - /*! - * @brief This class represents the structure ImuState_ defined by the user in the IDL file. - * @ingroup ImuState - */ - class ImuState_ - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ImuState_(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ImuState_(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object booster_interface::msg::dds_::ImuState_ that will be copied. - */ - eProsima_user_DllExport ImuState_( - const ImuState_& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object booster_interface::msg::dds_::ImuState_ that will be copied. - */ - eProsima_user_DllExport ImuState_( - ImuState_&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object booster_interface::msg::dds_::ImuState_ that will be copied. - */ - eProsima_user_DllExport ImuState_& operator =( - const ImuState_& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object booster_interface::msg::dds_::ImuState_ that will be copied. - */ - eProsima_user_DllExport ImuState_& operator =( - ImuState_&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x booster_interface::msg::dds_::ImuState_ object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ImuState_& x) const; - - /*! - * @brief Comparison operator. - * @param x booster_interface::msg::dds_::ImuState_ object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ImuState_& x) const; - - /*! - * @brief This function copies the value in member rpy - * @param _rpy New value to be copied in member rpy - */ - eProsima_user_DllExport void rpy( - const std::array& _rpy); - - /*! - * @brief This function moves the value in member rpy - * @param _rpy New value to be moved in member rpy - */ - eProsima_user_DllExport void rpy( - std::array&& _rpy); - - /*! - * @brief This function returns a constant reference to member rpy - * @return Constant reference to member rpy - */ - eProsima_user_DllExport const std::array& rpy() const; - - /*! - * @brief This function returns a reference to member rpy - * @return Reference to member rpy - */ - eProsima_user_DllExport std::array& rpy(); - - - /*! - * @brief This function copies the value in member gyro - * @param _gyro New value to be copied in member gyro - */ - eProsima_user_DllExport void gyro( - const std::array& _gyro); - - /*! - * @brief This function moves the value in member gyro - * @param _gyro New value to be moved in member gyro - */ - eProsima_user_DllExport void gyro( - std::array&& _gyro); - - /*! - * @brief This function returns a constant reference to member gyro - * @return Constant reference to member gyro - */ - eProsima_user_DllExport const std::array& gyro() const; - - /*! - * @brief This function returns a reference to member gyro - * @return Reference to member gyro - */ - eProsima_user_DllExport std::array& gyro(); - - - /*! - * @brief This function copies the value in member acc - * @param _acc New value to be copied in member acc - */ - eProsima_user_DllExport void acc( - const std::array& _acc); - - /*! - * @brief This function moves the value in member acc - * @param _acc New value to be moved in member acc - */ - eProsima_user_DllExport void acc( - std::array&& _acc); - - /*! - * @brief This function returns a constant reference to member acc - * @return Constant reference to member acc - */ - eProsima_user_DllExport const std::array& acc() const; - - /*! - * @brief This function returns a reference to member acc - * @return Reference to member acc - */ - eProsima_user_DllExport std::array& acc(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const booster_interface::msg::dds_::ImuState_& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - std::array m_rpy; - std::array m_gyro; - std::array m_acc; - - }; - - } // namespace dds_ - } // namespace msg -} // namespace booster_interface - -#endif // _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__IMUSTATE_H_ - - - diff --git a/mujoco/idl_gen/booster_interface/ImuStateCdrAux.hpp b/mujoco/idl_gen/booster_interface/ImuStateCdrAux.hpp deleted file mode 100644 index 029b67f..0000000 --- a/mujoco/idl_gen/booster_interface/ImuStateCdrAux.hpp +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file ImuStateCdrAux.hpp - * This source file contains some definitions of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__IMUSTATECDRAUX_HPP_ -#define _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__IMUSTATECDRAUX_HPP_ - -#include "ImuState.h" - -constexpr uint32_t booster_interface_msg_dds__ImuState__max_cdr_typesize {36UL}; -constexpr uint32_t booster_interface_msg_dds__ImuState__max_key_cdr_typesize {0UL}; - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const booster_interface::msg::dds_::ImuState_& data); - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__IMUSTATECDRAUX_HPP_ - diff --git a/mujoco/idl_gen/booster_interface/ImuStateCdrAux.ipp b/mujoco/idl_gen/booster_interface/ImuStateCdrAux.ipp deleted file mode 100644 index 155fad3..0000000 --- a/mujoco/idl_gen/booster_interface/ImuStateCdrAux.ipp +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file ImuStateCdrAux.ipp - * This source file contains some declarations of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__IMUSTATECDRAUX_IPP_ -#define _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__IMUSTATECDRAUX_IPP_ - -#include "ImuStateCdrAux.hpp" - -#include -#include - - -#include -using namespace eprosima::fastcdr::exception; - -namespace eprosima { -namespace fastcdr { - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const booster_interface::msg::dds_::ImuState_& data, - size_t& current_alignment) -{ - using namespace booster_interface::msg::dds_; - - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.rpy(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.gyro(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.acc(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const booster_interface::msg::dds_::ImuState_& data) -{ - using namespace booster_interface::msg::dds_; - - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.rpy() - << eprosima::fastcdr::MemberId(1) << data.gyro() - << eprosima::fastcdr::MemberId(2) << data.acc() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - booster_interface::msg::dds_::ImuState_& data) -{ - using namespace booster_interface::msg::dds_; - - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.rpy(); - break; - - case 1: - dcdr >> data.gyro(); - break; - - case 2: - dcdr >> data.acc(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const booster_interface::msg::dds_::ImuState_& data) -{ - using namespace booster_interface::msg::dds_; - - static_cast(scdr); - static_cast(data); -} - - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__IMUSTATECDRAUX_IPP_ - diff --git a/mujoco/idl_gen/booster_interface/ImuStatePubSubTypes.cxx b/mujoco/idl_gen/booster_interface/ImuStatePubSubTypes.cxx deleted file mode 100644 index fdba648..0000000 --- a/mujoco/idl_gen/booster_interface/ImuStatePubSubTypes.cxx +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file ImuStatePubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#include - -#include "ImuStatePubSubTypes.h" -#include "ImuStateCdrAux.hpp" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; -using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - -namespace booster_interface { - namespace msg { - namespace dds_ { - - - ImuState_PubSubType::ImuState_PubSubType() - { - setName("booster_interface::msg::dds_::ImuState_"); - uint32_t type_size = - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(ImuState_::getMaxCdrSerializedSize()); - #else - booster_interface_msg_dds__ImuState__max_cdr_typesize; - #endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = booster_interface_msg_dds__ImuState__max_key_cdr_typesize > 16 ? booster_interface_msg_dds__ImuState__max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - ImuState_PubSubType::~ImuState_PubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool ImuState_PubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) - { - ImuState_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - #if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - #endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length - #if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); - #else - payload->length = static_cast(ser.get_serialized_data_length()); - #endif // FASTCDR_VERSION_MAJOR == 1 - return true; - } - - bool ImuState_PubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - ImuState_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN - #if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR - #endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; - } - - std::function ImuState_PubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) - { - return [data, data_representation]() -> uint32_t - { - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - #else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } - #endif // FASTCDR_VERSION_MAJOR == 1 - }; - } - - void* ImuState_PubSubType::createData() - { - return reinterpret_cast(new ImuState_()); - } - - void ImuState_PubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool ImuState_PubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - ImuState_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - booster_interface_msg_dds__ImuState__max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); - #if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); - #else - eprosima::fastcdr::serialize_key(ser, *p_type); - #endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || booster_interface_msg_dds__ImuState__max_key_cdr_typesize > 16) - { - m_md5.init(); - #if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - #else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); - #endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace dds_ - - - } //End of namespace msg - - -} //End of namespace booster_interface - diff --git a/mujoco/idl_gen/booster_interface/ImuStatePubSubTypes.h b/mujoco/idl_gen/booster_interface/ImuStatePubSubTypes.h deleted file mode 100644 index 37e3997..0000000 --- a/mujoco/idl_gen/booster_interface/ImuStatePubSubTypes.h +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file ImuStatePubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__IMUSTATE_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__IMUSTATE_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "ImuState.h" - - -#if !defined(GEN_API_VER) || (GEN_API_VER != 2) -#error \ - Generated ImuState is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace booster_interface -{ - namespace msg - { - namespace dds_ - { - - - - #ifndef SWIG - namespace detail { - - template - struct ImuState__rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - - }; - - struct ImuState__f - { - typedef std::array ImuState_::* type; - friend constexpr type get( - ImuState__f); - }; - - template struct ImuState__rob; - - template - inline size_t constexpr ImuState__offset_of() - { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } - - } // namespace detail - #endif // ifndef SWIG - - - /*! - * @brief This class represents the TopicDataType of the type ImuState_ defined by the user in the IDL file. - * @ingroup ImuState - */ - class ImuState_PubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef ImuState_ type; - - eProsima_user_DllExport ImuState_PubSubType(); - - eProsima_user_DllExport ~ImuState_PubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return is_plain_xcdrv1_impl(); - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) - { - return is_plain_xcdrv2_impl(); - } - else - { - return is_plain_xcdrv1_impl(); - } - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) ImuState_(); - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - - private: - - static constexpr bool is_plain_xcdrv1_impl() - { - return 36ULL == - (detail::ImuState__offset_of() + - sizeof(std::array)); - } - - static constexpr bool is_plain_xcdrv2_impl() - { - return 36ULL == - (detail::ImuState__offset_of() + - sizeof(std::array)); - } - - }; - } - } -} - -#endif // _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__IMUSTATE_PUBSUBTYPES_H_ - diff --git a/mujoco/idl_gen/booster_interface/LowCmd.cxx b/mujoco/idl_gen/booster_interface/LowCmd.cxx deleted file mode 100644 index bdd36d8..0000000 --- a/mujoco/idl_gen/booster_interface/LowCmd.cxx +++ /dev/null @@ -1,314 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file LowCmd.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "LowCmd.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define booster_interface_msg_dds__MotorCmd__max_cdr_typesize 28ULL; - -#define booster_interface_msg_dds__LowCmd__max_cdr_typesize 2812ULL; - - -namespace booster_interface { - -namespace msg { - -namespace dds_ { - - - - - -LowCmd_::LowCmd_() -{ - // booster_interface::msg::dds_::CmdType_ m_cmd_type - m_cmd_type = booster_interface::msg::dds_::PARALLEL; - // sequence m_motor_cmd - - -} - -LowCmd_::~LowCmd_() -{ -} - -LowCmd_::LowCmd_( - const LowCmd_& x) -{ - m_cmd_type = x.m_cmd_type; - - - m_motor_cmd = x.m_motor_cmd; - -} - -LowCmd_::LowCmd_( - LowCmd_&& x) noexcept -{ - m_cmd_type = x.m_cmd_type; - - - m_motor_cmd = std::move(x.m_motor_cmd); - -} - -LowCmd_& LowCmd_::operator =( - const LowCmd_& x) -{ - m_cmd_type = x.m_cmd_type; - - - m_motor_cmd = x.m_motor_cmd; - - return *this; -} - -LowCmd_& LowCmd_::operator =( - LowCmd_&& x) noexcept -{ - m_cmd_type = x.m_cmd_type; - - - m_motor_cmd = std::move(x.m_motor_cmd); - - return *this; -} - -bool LowCmd_::operator ==( - const LowCmd_& x) const -{ - return (m_cmd_type == x.m_cmd_type && - m_motor_cmd == x.m_motor_cmd); -} - -bool LowCmd_::operator !=( - const LowCmd_& x) const -{ - return !(*this == x); -} - -size_t LowCmd_::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return booster_interface_msg_dds__LowCmd__max_cdr_typesize; -} - -size_t LowCmd_::getCdrSerializedSize( - const LowCmd_& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < data.motor_cmd().size(); ++a) - { - current_alignment += booster_interface::msg::dds_::MotorCmd_::getCdrSerializedSize(data.motor_cmd().at(a), current_alignment); - } - - - - return current_alignment - initial_alignment; -} - - -void LowCmd_::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << (uint32_t)m_cmd_type; - - scdr << m_motor_cmd; - - -} - -void LowCmd_::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - { - uint32_t enum_value = 0; - dcdr >> enum_value; - m_cmd_type = (booster_interface::msg::dds_::CmdType_)enum_value; - } - - - - dcdr >> m_motor_cmd; - - -} - - -bool LowCmd_::isKeyDefined() -{ - return false; -} - -void LowCmd_::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member cmd_type - * @param _cmd_type New value for member cmd_type - */ -void LowCmd_::cmd_type( - booster_interface::msg::dds_::CmdType_ _cmd_type) -{ - m_cmd_type = _cmd_type; -} - -/*! - * @brief This function returns the value of member cmd_type - * @return Value of member cmd_type - */ -booster_interface::msg::dds_::CmdType_ LowCmd_::cmd_type() const -{ - return m_cmd_type; -} - -/*! - * @brief This function returns a reference to member cmd_type - * @return Reference to member cmd_type - */ -booster_interface::msg::dds_::CmdType_& LowCmd_::cmd_type() -{ - return m_cmd_type; -} - - -/*! - * @brief This function copies the value in member motor_cmd - * @param _motor_cmd New value to be copied in member motor_cmd - */ -void LowCmd_::motor_cmd( - const std::vector& _motor_cmd) -{ - m_motor_cmd = _motor_cmd; -} - -/*! - * @brief This function moves the value in member motor_cmd - * @param _motor_cmd New value to be moved in member motor_cmd - */ -void LowCmd_::motor_cmd( - std::vector&& _motor_cmd) -{ - m_motor_cmd = std::move(_motor_cmd); -} - -/*! - * @brief This function returns a constant reference to member motor_cmd - * @return Constant reference to member motor_cmd - */ -const std::vector& LowCmd_::motor_cmd() const -{ - return m_motor_cmd; -} - -/*! - * @brief This function returns a reference to member motor_cmd - * @return Reference to member motor_cmd - */ -std::vector& LowCmd_::motor_cmd() -{ - return m_motor_cmd; -} - - - - - -} // namespace dds_ - - -} // namespace msg - - -} // namespace booster_interface - diff --git a/mujoco/idl_gen/booster_interface/LowCmd.h b/mujoco/idl_gen/booster_interface/LowCmd.h deleted file mode 100644 index a64ee8d..0000000 --- a/mujoco/idl_gen/booster_interface/LowCmd.h +++ /dev/null @@ -1,256 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file LowCmd.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__LOWCMD_H_ -#define _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__LOWCMD_H_ - -#include "MotorCmd.h" - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(LOWCMD_SOURCE) -#define LOWCMD_DllAPI __declspec( dllexport ) -#else -#define LOWCMD_DllAPI __declspec( dllimport ) -#endif // LOWCMD_SOURCE -#else -#define LOWCMD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define LOWCMD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -namespace booster_interface { - namespace msg { - namespace dds_ { - /*! - * @brief This class represents the enumeration CmdType_ defined by the user in the IDL file. - * @ingroup LowCmd - */ - enum CmdType_ : uint32_t - { - PARALLEL, - SERIAL - }; - - - - - /*! - * @brief This class represents the structure LowCmd_ defined by the user in the IDL file. - * @ingroup LowCmd - */ - class LowCmd_ - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LowCmd_(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LowCmd_(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object booster_interface::msg::dds_::LowCmd_ that will be copied. - */ - eProsima_user_DllExport LowCmd_( - const LowCmd_& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object booster_interface::msg::dds_::LowCmd_ that will be copied. - */ - eProsima_user_DllExport LowCmd_( - LowCmd_&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object booster_interface::msg::dds_::LowCmd_ that will be copied. - */ - eProsima_user_DllExport LowCmd_& operator =( - const LowCmd_& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object booster_interface::msg::dds_::LowCmd_ that will be copied. - */ - eProsima_user_DllExport LowCmd_& operator =( - LowCmd_&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x booster_interface::msg::dds_::LowCmd_ object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LowCmd_& x) const; - - /*! - * @brief Comparison operator. - * @param x booster_interface::msg::dds_::LowCmd_ object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LowCmd_& x) const; - - /*! - * @brief This function sets a value in member cmd_type - * @param _cmd_type New value for member cmd_type - */ - eProsima_user_DllExport void cmd_type( - booster_interface::msg::dds_::CmdType_ _cmd_type); - - /*! - * @brief This function returns the value of member cmd_type - * @return Value of member cmd_type - */ - eProsima_user_DllExport booster_interface::msg::dds_::CmdType_ cmd_type() const; - - /*! - * @brief This function returns a reference to member cmd_type - * @return Reference to member cmd_type - */ - eProsima_user_DllExport booster_interface::msg::dds_::CmdType_& cmd_type(); - - - /*! - * @brief This function copies the value in member motor_cmd - * @param _motor_cmd New value to be copied in member motor_cmd - */ - eProsima_user_DllExport void motor_cmd( - const std::vector& _motor_cmd); - - /*! - * @brief This function moves the value in member motor_cmd - * @param _motor_cmd New value to be moved in member motor_cmd - */ - eProsima_user_DllExport void motor_cmd( - std::vector&& _motor_cmd); - - /*! - * @brief This function returns a constant reference to member motor_cmd - * @return Constant reference to member motor_cmd - */ - eProsima_user_DllExport const std::vector& motor_cmd() const; - - /*! - * @brief This function returns a reference to member motor_cmd - * @return Reference to member motor_cmd - */ - eProsima_user_DllExport std::vector& motor_cmd(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const booster_interface::msg::dds_::LowCmd_& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - booster_interface::msg::dds_::CmdType_ m_cmd_type; - std::vector m_motor_cmd; - - }; - - } // namespace dds_ - } // namespace msg -} // namespace booster_interface - -#endif // _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__LOWCMD_H_ - - - diff --git a/mujoco/idl_gen/booster_interface/LowCmdCdrAux.hpp b/mujoco/idl_gen/booster_interface/LowCmdCdrAux.hpp deleted file mode 100644 index 7148ef8..0000000 --- a/mujoco/idl_gen/booster_interface/LowCmdCdrAux.hpp +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file LowCmdCdrAux.hpp - * This source file contains some definitions of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__LOWCMDCDRAUX_HPP_ -#define _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__LOWCMDCDRAUX_HPP_ - -#include "LowCmd.h" - -constexpr uint32_t booster_interface_msg_dds__LowCmd__max_cdr_typesize {2812UL}; -constexpr uint32_t booster_interface_msg_dds__LowCmd__max_key_cdr_typesize {0UL}; - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const booster_interface::msg::dds_::LowCmd_& data); - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__LOWCMDCDRAUX_HPP_ - diff --git a/mujoco/idl_gen/booster_interface/LowCmdCdrAux.ipp b/mujoco/idl_gen/booster_interface/LowCmdCdrAux.ipp deleted file mode 100644 index b58023d..0000000 --- a/mujoco/idl_gen/booster_interface/LowCmdCdrAux.ipp +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file LowCmdCdrAux.ipp - * This source file contains some declarations of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__LOWCMDCDRAUX_IPP_ -#define _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__LOWCMDCDRAUX_IPP_ - -#include "LowCmdCdrAux.hpp" - -#include -#include - - -#include -using namespace eprosima::fastcdr::exception; - -namespace eprosima { -namespace fastcdr { - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const booster_interface::msg::dds_::LowCmd_& data, - size_t& current_alignment) -{ - using namespace booster_interface::msg::dds_; - - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.cmd_type(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.motor_cmd(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const booster_interface::msg::dds_::LowCmd_& data) -{ - using namespace booster_interface::msg::dds_; - - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.cmd_type() - << eprosima::fastcdr::MemberId(1) << data.motor_cmd() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - booster_interface::msg::dds_::LowCmd_& data) -{ - using namespace booster_interface::msg::dds_; - - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.cmd_type(); - break; - - case 1: - dcdr >> data.motor_cmd(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const booster_interface::msg::dds_::LowCmd_& data) -{ - using namespace booster_interface::msg::dds_; - - static_cast(scdr); - static_cast(data); -} - - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__LOWCMDCDRAUX_IPP_ - diff --git a/mujoco/idl_gen/booster_interface/LowCmdPubSubTypes.cxx b/mujoco/idl_gen/booster_interface/LowCmdPubSubTypes.cxx deleted file mode 100644 index 31afdbb..0000000 --- a/mujoco/idl_gen/booster_interface/LowCmdPubSubTypes.cxx +++ /dev/null @@ -1,235 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file LowCmdPubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#include - -#include "LowCmdPubSubTypes.h" -#include "LowCmdCdrAux.hpp" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; -using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - -namespace booster_interface { - namespace msg { - namespace dds_ { - - - - - LowCmd_PubSubType::LowCmd_PubSubType() - { - setName("booster_interface::msg::dds_::LowCmd_"); - uint32_t type_size = - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(LowCmd_::getMaxCdrSerializedSize()); - #else - booster_interface_msg_dds__LowCmd__max_cdr_typesize; - #endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = booster_interface_msg_dds__LowCmd__max_key_cdr_typesize > 16 ? booster_interface_msg_dds__LowCmd__max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - LowCmd_PubSubType::~LowCmd_PubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool LowCmd_PubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) - { - LowCmd_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - #if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - #endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length - #if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); - #else - payload->length = static_cast(ser.get_serialized_data_length()); - #endif // FASTCDR_VERSION_MAJOR == 1 - return true; - } - - bool LowCmd_PubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - LowCmd_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN - #if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR - #endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; - } - - std::function LowCmd_PubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) - { - return [data, data_representation]() -> uint32_t - { - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - #else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } - #endif // FASTCDR_VERSION_MAJOR == 1 - }; - } - - void* LowCmd_PubSubType::createData() - { - return reinterpret_cast(new LowCmd_()); - } - - void LowCmd_PubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool LowCmd_PubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - LowCmd_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - booster_interface_msg_dds__LowCmd__max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); - #if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); - #else - eprosima::fastcdr::serialize_key(ser, *p_type); - #endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || booster_interface_msg_dds__LowCmd__max_key_cdr_typesize > 16) - { - m_md5.init(); - #if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - #else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); - #endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace dds_ - - - } //End of namespace msg - - -} //End of namespace booster_interface - diff --git a/mujoco/idl_gen/booster_interface/LowCmdPubSubTypes.h b/mujoco/idl_gen/booster_interface/LowCmdPubSubTypes.h deleted file mode 100644 index 35533a4..0000000 --- a/mujoco/idl_gen/booster_interface/LowCmdPubSubTypes.h +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file LowCmdPubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__LOWCMD_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__LOWCMD_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "LowCmd.h" - -#include "MotorCmdPubSubTypes.h" - -#if !defined(GEN_API_VER) || (GEN_API_VER != 2) -#error \ - Generated LowCmd is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace booster_interface -{ - namespace msg - { - namespace dds_ - { - - - - - - /*! - * @brief This class represents the TopicDataType of the type LowCmd_ defined by the user in the IDL file. - * @ingroup LowCmd - */ - class LowCmd_PubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef LowCmd_ type; - - eProsima_user_DllExport LowCmd_PubSubType(); - - eProsima_user_DllExport ~LowCmd_PubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - - }; - } - } -} - -#endif // _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__LOWCMD_PUBSUBTYPES_H_ - diff --git a/mujoco/idl_gen/booster_interface/LowState.cxx b/mujoco/idl_gen/booster_interface/LowState.cxx deleted file mode 100644 index 0ab4c50..0000000 --- a/mujoco/idl_gen/booster_interface/LowState.cxx +++ /dev/null @@ -1,391 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file LowState.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "LowState.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define booster_interface_msg_dds__MotorState__max_cdr_typesize 36ULL; -#define booster_interface_msg_dds__ImuState__max_cdr_typesize 36ULL; -#define booster_interface_msg_dds__LowState__max_cdr_typesize 7252ULL; - - -namespace booster_interface { - -namespace msg { - -namespace dds_ { - - - - - -LowState_::LowState_() -{ - // booster_interface::msg::dds_::ImuState_ m_imu_state - - // sequence m_motor_state_parallel - - // sequence m_motor_state_serial - - -} - -LowState_::~LowState_() -{ -} - -LowState_::LowState_( - const LowState_& x) -{ - m_imu_state = x.m_imu_state; - - - m_motor_state_parallel = x.m_motor_state_parallel; - - - m_motor_state_serial = x.m_motor_state_serial; - -} - -LowState_::LowState_( - LowState_&& x) noexcept -{ - m_imu_state = std::move(x.m_imu_state); - - - m_motor_state_parallel = std::move(x.m_motor_state_parallel); - - - m_motor_state_serial = std::move(x.m_motor_state_serial); - -} - -LowState_& LowState_::operator =( - const LowState_& x) -{ - m_imu_state = x.m_imu_state; - - - m_motor_state_parallel = x.m_motor_state_parallel; - - - m_motor_state_serial = x.m_motor_state_serial; - - return *this; -} - -LowState_& LowState_::operator =( - LowState_&& x) noexcept -{ - m_imu_state = std::move(x.m_imu_state); - - - m_motor_state_parallel = std::move(x.m_motor_state_parallel); - - - m_motor_state_serial = std::move(x.m_motor_state_serial); - - return *this; -} - -bool LowState_::operator ==( - const LowState_& x) const -{ - return (m_imu_state == x.m_imu_state && - m_motor_state_parallel == x.m_motor_state_parallel && - m_motor_state_serial == x.m_motor_state_serial); -} - -bool LowState_::operator !=( - const LowState_& x) const -{ - return !(*this == x); -} - -size_t LowState_::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return booster_interface_msg_dds__LowState__max_cdr_typesize; -} - -size_t LowState_::getCdrSerializedSize( - const LowState_& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += booster_interface::msg::dds_::ImuState_::getCdrSerializedSize(data.imu_state(), current_alignment); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < data.motor_state_parallel().size(); ++a) - { - current_alignment += booster_interface::msg::dds_::MotorState_::getCdrSerializedSize(data.motor_state_parallel().at(a), current_alignment); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < data.motor_state_serial().size(); ++a) - { - current_alignment += booster_interface::msg::dds_::MotorState_::getCdrSerializedSize(data.motor_state_serial().at(a), current_alignment); - } - - - - return current_alignment - initial_alignment; -} - - -void LowState_::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_imu_state; - - scdr << m_motor_state_parallel; - - - scdr << m_motor_state_serial; - - -} - -void LowState_::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_imu_state; - - - - dcdr >> m_motor_state_parallel; - - - - dcdr >> m_motor_state_serial; - - -} - - -bool LowState_::isKeyDefined() -{ - return false; -} - -void LowState_::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member imu_state - * @param _imu_state New value to be copied in member imu_state - */ -void LowState_::imu_state( - const booster_interface::msg::dds_::ImuState_& _imu_state) -{ - m_imu_state = _imu_state; -} - -/*! - * @brief This function moves the value in member imu_state - * @param _imu_state New value to be moved in member imu_state - */ -void LowState_::imu_state( - booster_interface::msg::dds_::ImuState_&& _imu_state) -{ - m_imu_state = std::move(_imu_state); -} - -/*! - * @brief This function returns a constant reference to member imu_state - * @return Constant reference to member imu_state - */ -const booster_interface::msg::dds_::ImuState_& LowState_::imu_state() const -{ - return m_imu_state; -} - -/*! - * @brief This function returns a reference to member imu_state - * @return Reference to member imu_state - */ -booster_interface::msg::dds_::ImuState_& LowState_::imu_state() -{ - return m_imu_state; -} - - -/*! - * @brief This function copies the value in member motor_state_parallel - * @param _motor_state_parallel New value to be copied in member motor_state_parallel - */ -void LowState_::motor_state_parallel( - const std::vector& _motor_state_parallel) -{ - m_motor_state_parallel = _motor_state_parallel; -} - -/*! - * @brief This function moves the value in member motor_state_parallel - * @param _motor_state_parallel New value to be moved in member motor_state_parallel - */ -void LowState_::motor_state_parallel( - std::vector&& _motor_state_parallel) -{ - m_motor_state_parallel = std::move(_motor_state_parallel); -} - -/*! - * @brief This function returns a constant reference to member motor_state_parallel - * @return Constant reference to member motor_state_parallel - */ -const std::vector& LowState_::motor_state_parallel() const -{ - return m_motor_state_parallel; -} - -/*! - * @brief This function returns a reference to member motor_state_parallel - * @return Reference to member motor_state_parallel - */ -std::vector& LowState_::motor_state_parallel() -{ - return m_motor_state_parallel; -} - - -/*! - * @brief This function copies the value in member motor_state_serial - * @param _motor_state_serial New value to be copied in member motor_state_serial - */ -void LowState_::motor_state_serial( - const std::vector& _motor_state_serial) -{ - m_motor_state_serial = _motor_state_serial; -} - -/*! - * @brief This function moves the value in member motor_state_serial - * @param _motor_state_serial New value to be moved in member motor_state_serial - */ -void LowState_::motor_state_serial( - std::vector&& _motor_state_serial) -{ - m_motor_state_serial = std::move(_motor_state_serial); -} - -/*! - * @brief This function returns a constant reference to member motor_state_serial - * @return Constant reference to member motor_state_serial - */ -const std::vector& LowState_::motor_state_serial() const -{ - return m_motor_state_serial; -} - -/*! - * @brief This function returns a reference to member motor_state_serial - * @return Reference to member motor_state_serial - */ -std::vector& LowState_::motor_state_serial() -{ - return m_motor_state_serial; -} - - - - - -} // namespace dds_ - - -} // namespace msg - - -} // namespace booster_interface - diff --git a/mujoco/idl_gen/booster_interface/LowState.h b/mujoco/idl_gen/booster_interface/LowState.h deleted file mode 100644 index b603764..0000000 --- a/mujoco/idl_gen/booster_interface/LowState.h +++ /dev/null @@ -1,283 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file LowState.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__LOWSTATE_H_ -#define _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__LOWSTATE_H_ - -#include "MotorState.h" -#include "ImuState.h" - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(LOWSTATE_SOURCE) -#define LOWSTATE_DllAPI __declspec( dllexport ) -#else -#define LOWSTATE_DllAPI __declspec( dllimport ) -#endif // LOWSTATE_SOURCE -#else -#define LOWSTATE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define LOWSTATE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -namespace booster_interface { - namespace msg { - namespace dds_ { - - - - - /*! - * @brief This class represents the structure LowState_ defined by the user in the IDL file. - * @ingroup LowState - */ - class LowState_ - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LowState_(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LowState_(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object booster_interface::msg::dds_::LowState_ that will be copied. - */ - eProsima_user_DllExport LowState_( - const LowState_& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object booster_interface::msg::dds_::LowState_ that will be copied. - */ - eProsima_user_DllExport LowState_( - LowState_&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object booster_interface::msg::dds_::LowState_ that will be copied. - */ - eProsima_user_DllExport LowState_& operator =( - const LowState_& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object booster_interface::msg::dds_::LowState_ that will be copied. - */ - eProsima_user_DllExport LowState_& operator =( - LowState_&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x booster_interface::msg::dds_::LowState_ object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LowState_& x) const; - - /*! - * @brief Comparison operator. - * @param x booster_interface::msg::dds_::LowState_ object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LowState_& x) const; - - /*! - * @brief This function copies the value in member imu_state - * @param _imu_state New value to be copied in member imu_state - */ - eProsima_user_DllExport void imu_state( - const booster_interface::msg::dds_::ImuState_& _imu_state); - - /*! - * @brief This function moves the value in member imu_state - * @param _imu_state New value to be moved in member imu_state - */ - eProsima_user_DllExport void imu_state( - booster_interface::msg::dds_::ImuState_&& _imu_state); - - /*! - * @brief This function returns a constant reference to member imu_state - * @return Constant reference to member imu_state - */ - eProsima_user_DllExport const booster_interface::msg::dds_::ImuState_& imu_state() const; - - /*! - * @brief This function returns a reference to member imu_state - * @return Reference to member imu_state - */ - eProsima_user_DllExport booster_interface::msg::dds_::ImuState_& imu_state(); - - - /*! - * @brief This function copies the value in member motor_state_parallel - * @param _motor_state_parallel New value to be copied in member motor_state_parallel - */ - eProsima_user_DllExport void motor_state_parallel( - const std::vector& _motor_state_parallel); - - /*! - * @brief This function moves the value in member motor_state_parallel - * @param _motor_state_parallel New value to be moved in member motor_state_parallel - */ - eProsima_user_DllExport void motor_state_parallel( - std::vector&& _motor_state_parallel); - - /*! - * @brief This function returns a constant reference to member motor_state_parallel - * @return Constant reference to member motor_state_parallel - */ - eProsima_user_DllExport const std::vector& motor_state_parallel() const; - - /*! - * @brief This function returns a reference to member motor_state_parallel - * @return Reference to member motor_state_parallel - */ - eProsima_user_DllExport std::vector& motor_state_parallel(); - - - /*! - * @brief This function copies the value in member motor_state_serial - * @param _motor_state_serial New value to be copied in member motor_state_serial - */ - eProsima_user_DllExport void motor_state_serial( - const std::vector& _motor_state_serial); - - /*! - * @brief This function moves the value in member motor_state_serial - * @param _motor_state_serial New value to be moved in member motor_state_serial - */ - eProsima_user_DllExport void motor_state_serial( - std::vector&& _motor_state_serial); - - /*! - * @brief This function returns a constant reference to member motor_state_serial - * @return Constant reference to member motor_state_serial - */ - eProsima_user_DllExport const std::vector& motor_state_serial() const; - - /*! - * @brief This function returns a reference to member motor_state_serial - * @return Reference to member motor_state_serial - */ - eProsima_user_DllExport std::vector& motor_state_serial(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const booster_interface::msg::dds_::LowState_& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - booster_interface::msg::dds_::ImuState_ m_imu_state; - std::vector m_motor_state_parallel; - std::vector m_motor_state_serial; - - }; - - } // namespace dds_ - } // namespace msg -} // namespace booster_interface - -#endif // _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__LOWSTATE_H_ - - - diff --git a/mujoco/idl_gen/booster_interface/LowStateCdrAux.hpp b/mujoco/idl_gen/booster_interface/LowStateCdrAux.hpp deleted file mode 100644 index eaea7ea..0000000 --- a/mujoco/idl_gen/booster_interface/LowStateCdrAux.hpp +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file LowStateCdrAux.hpp - * This source file contains some definitions of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__LOWSTATECDRAUX_HPP_ -#define _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__LOWSTATECDRAUX_HPP_ - -#include "LowState.h" - -constexpr uint32_t booster_interface_msg_dds__LowState__max_cdr_typesize {7252UL}; -constexpr uint32_t booster_interface_msg_dds__LowState__max_key_cdr_typesize {0UL}; - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const booster_interface::msg::dds_::LowState_& data); - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__LOWSTATECDRAUX_HPP_ - diff --git a/mujoco/idl_gen/booster_interface/LowStateCdrAux.ipp b/mujoco/idl_gen/booster_interface/LowStateCdrAux.ipp deleted file mode 100644 index 880a693..0000000 --- a/mujoco/idl_gen/booster_interface/LowStateCdrAux.ipp +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file LowStateCdrAux.ipp - * This source file contains some declarations of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__LOWSTATECDRAUX_IPP_ -#define _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__LOWSTATECDRAUX_IPP_ - -#include "LowStateCdrAux.hpp" - -#include -#include - - -#include -using namespace eprosima::fastcdr::exception; - -namespace eprosima { -namespace fastcdr { - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const booster_interface::msg::dds_::LowState_& data, - size_t& current_alignment) -{ - using namespace booster_interface::msg::dds_; - - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.imu_state(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.motor_state_parallel(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.motor_state_serial(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const booster_interface::msg::dds_::LowState_& data) -{ - using namespace booster_interface::msg::dds_; - - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.imu_state() - << eprosima::fastcdr::MemberId(1) << data.motor_state_parallel() - << eprosima::fastcdr::MemberId(2) << data.motor_state_serial() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - booster_interface::msg::dds_::LowState_& data) -{ - using namespace booster_interface::msg::dds_; - - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.imu_state(); - break; - - case 1: - dcdr >> data.motor_state_parallel(); - break; - - case 2: - dcdr >> data.motor_state_serial(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const booster_interface::msg::dds_::LowState_& data) -{ - using namespace booster_interface::msg::dds_; - - static_cast(scdr); - static_cast(data); -} - - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__LOWSTATECDRAUX_IPP_ - diff --git a/mujoco/idl_gen/booster_interface/LowStatePubSubTypes.cxx b/mujoco/idl_gen/booster_interface/LowStatePubSubTypes.cxx deleted file mode 100644 index 5ce644c..0000000 --- a/mujoco/idl_gen/booster_interface/LowStatePubSubTypes.cxx +++ /dev/null @@ -1,235 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file LowStatePubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#include - -#include "LowStatePubSubTypes.h" -#include "LowStateCdrAux.hpp" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; -using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - -namespace booster_interface { - namespace msg { - namespace dds_ { - - - - - LowState_PubSubType::LowState_PubSubType() - { - setName("booster_interface::msg::dds_::LowState_"); - uint32_t type_size = - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(LowState_::getMaxCdrSerializedSize()); - #else - booster_interface_msg_dds__LowState__max_cdr_typesize; - #endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = booster_interface_msg_dds__LowState__max_key_cdr_typesize > 16 ? booster_interface_msg_dds__LowState__max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - LowState_PubSubType::~LowState_PubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool LowState_PubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) - { - LowState_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - #if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - #endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length - #if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); - #else - payload->length = static_cast(ser.get_serialized_data_length()); - #endif // FASTCDR_VERSION_MAJOR == 1 - return true; - } - - bool LowState_PubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - LowState_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN - #if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR - #endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; - } - - std::function LowState_PubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) - { - return [data, data_representation]() -> uint32_t - { - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - #else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } - #endif // FASTCDR_VERSION_MAJOR == 1 - }; - } - - void* LowState_PubSubType::createData() - { - return reinterpret_cast(new LowState_()); - } - - void LowState_PubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool LowState_PubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - LowState_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - booster_interface_msg_dds__LowState__max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); - #if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); - #else - eprosima::fastcdr::serialize_key(ser, *p_type); - #endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || booster_interface_msg_dds__LowState__max_key_cdr_typesize > 16) - { - m_md5.init(); - #if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - #else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); - #endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace dds_ - - - } //End of namespace msg - - -} //End of namespace booster_interface - diff --git a/mujoco/idl_gen/booster_interface/LowStatePubSubTypes.h b/mujoco/idl_gen/booster_interface/LowStatePubSubTypes.h deleted file mode 100644 index 0b9c894..0000000 --- a/mujoco/idl_gen/booster_interface/LowStatePubSubTypes.h +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file LowStatePubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__LOWSTATE_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__LOWSTATE_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "LowState.h" - -#include "MotorStatePubSubTypes.h" -#include "ImuStatePubSubTypes.h" - -#if !defined(GEN_API_VER) || (GEN_API_VER != 2) -#error \ - Generated LowState is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace booster_interface -{ - namespace msg - { - namespace dds_ - { - - - - - - /*! - * @brief This class represents the TopicDataType of the type LowState_ defined by the user in the IDL file. - * @ingroup LowState - */ - class LowState_PubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef LowState_ type; - - eProsima_user_DllExport LowState_PubSubType(); - - eProsima_user_DllExport ~LowState_PubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - - }; - } - } -} - -#endif // _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__LOWSTATE_PUBSUBTYPES_H_ - diff --git a/mujoco/idl_gen/booster_interface/MotorCmd.cxx b/mujoco/idl_gen/booster_interface/MotorCmd.cxx deleted file mode 100644 index db86f78..0000000 --- a/mujoco/idl_gen/booster_interface/MotorCmd.cxx +++ /dev/null @@ -1,553 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file MotorCmd.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "MotorCmd.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define booster_interface_msg_dds__MotorCmd__max_cdr_typesize 28ULL; - - -namespace booster_interface { - -namespace msg { - -namespace dds_ { - - - -MotorCmd_::MotorCmd_() -{ - // octet m_mode - m_mode = 0; - // float m_q - m_q = 0.0; - // float m_dq - m_dq = 0.0; - // float m_tau - m_tau = 0.0; - // float m_kp - m_kp = 0.0; - // float m_kd - m_kd = 0.0; - // float m_weight - m_weight = 0.0; - -} - -MotorCmd_::~MotorCmd_() -{ -} - -MotorCmd_::MotorCmd_( - const MotorCmd_& x) -{ - m_mode = x.m_mode; - - - m_q = x.m_q; - - - m_dq = x.m_dq; - - - m_tau = x.m_tau; - - - m_kp = x.m_kp; - - - m_kd = x.m_kd; - - - m_weight = x.m_weight; - -} - -MotorCmd_::MotorCmd_( - MotorCmd_&& x) noexcept -{ - m_mode = x.m_mode; - - - m_q = x.m_q; - - - m_dq = x.m_dq; - - - m_tau = x.m_tau; - - - m_kp = x.m_kp; - - - m_kd = x.m_kd; - - - m_weight = x.m_weight; - -} - -MotorCmd_& MotorCmd_::operator =( - const MotorCmd_& x) -{ - m_mode = x.m_mode; - - - m_q = x.m_q; - - - m_dq = x.m_dq; - - - m_tau = x.m_tau; - - - m_kp = x.m_kp; - - - m_kd = x.m_kd; - - - m_weight = x.m_weight; - - return *this; -} - -MotorCmd_& MotorCmd_::operator =( - MotorCmd_&& x) noexcept -{ - m_mode = x.m_mode; - - - m_q = x.m_q; - - - m_dq = x.m_dq; - - - m_tau = x.m_tau; - - - m_kp = x.m_kp; - - - m_kd = x.m_kd; - - - m_weight = x.m_weight; - - return *this; -} - -bool MotorCmd_::operator ==( - const MotorCmd_& x) const -{ - return (m_mode == x.m_mode && - m_q == x.m_q && - m_dq == x.m_dq && - m_tau == x.m_tau && - m_kp == x.m_kp && - m_kd == x.m_kd && - m_weight == x.m_weight); -} - -bool MotorCmd_::operator !=( - const MotorCmd_& x) const -{ - return !(*this == x); -} - -size_t MotorCmd_::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return booster_interface_msg_dds__MotorCmd__max_cdr_typesize; -} - -size_t MotorCmd_::getCdrSerializedSize( - const MotorCmd_& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void MotorCmd_::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_mode; - - scdr << m_q; - - scdr << m_dq; - - scdr << m_tau; - - scdr << m_kp; - - scdr << m_kd; - - scdr << m_weight; - -} - -void MotorCmd_::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_mode; - - - - dcdr >> m_q; - - - - dcdr >> m_dq; - - - - dcdr >> m_tau; - - - - dcdr >> m_kp; - - - - dcdr >> m_kd; - - - - dcdr >> m_weight; - - -} - - -bool MotorCmd_::isKeyDefined() -{ - return false; -} - -void MotorCmd_::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member mode - * @param _mode New value for member mode - */ -void MotorCmd_::mode( - uint8_t _mode) -{ - m_mode = _mode; -} - -/*! - * @brief This function returns the value of member mode - * @return Value of member mode - */ -uint8_t MotorCmd_::mode() const -{ - return m_mode; -} - -/*! - * @brief This function returns a reference to member mode - * @return Reference to member mode - */ -uint8_t& MotorCmd_::mode() -{ - return m_mode; -} - - -/*! - * @brief This function sets a value in member q - * @param _q New value for member q - */ -void MotorCmd_::q( - float _q) -{ - m_q = _q; -} - -/*! - * @brief This function returns the value of member q - * @return Value of member q - */ -float MotorCmd_::q() const -{ - return m_q; -} - -/*! - * @brief This function returns a reference to member q - * @return Reference to member q - */ -float& MotorCmd_::q() -{ - return m_q; -} - - -/*! - * @brief This function sets a value in member dq - * @param _dq New value for member dq - */ -void MotorCmd_::dq( - float _dq) -{ - m_dq = _dq; -} - -/*! - * @brief This function returns the value of member dq - * @return Value of member dq - */ -float MotorCmd_::dq() const -{ - return m_dq; -} - -/*! - * @brief This function returns a reference to member dq - * @return Reference to member dq - */ -float& MotorCmd_::dq() -{ - return m_dq; -} - - -/*! - * @brief This function sets a value in member tau - * @param _tau New value for member tau - */ -void MotorCmd_::tau( - float _tau) -{ - m_tau = _tau; -} - -/*! - * @brief This function returns the value of member tau - * @return Value of member tau - */ -float MotorCmd_::tau() const -{ - return m_tau; -} - -/*! - * @brief This function returns a reference to member tau - * @return Reference to member tau - */ -float& MotorCmd_::tau() -{ - return m_tau; -} - - -/*! - * @brief This function sets a value in member kp - * @param _kp New value for member kp - */ -void MotorCmd_::kp( - float _kp) -{ - m_kp = _kp; -} - -/*! - * @brief This function returns the value of member kp - * @return Value of member kp - */ -float MotorCmd_::kp() const -{ - return m_kp; -} - -/*! - * @brief This function returns a reference to member kp - * @return Reference to member kp - */ -float& MotorCmd_::kp() -{ - return m_kp; -} - - -/*! - * @brief This function sets a value in member kd - * @param _kd New value for member kd - */ -void MotorCmd_::kd( - float _kd) -{ - m_kd = _kd; -} - -/*! - * @brief This function returns the value of member kd - * @return Value of member kd - */ -float MotorCmd_::kd() const -{ - return m_kd; -} - -/*! - * @brief This function returns a reference to member kd - * @return Reference to member kd - */ -float& MotorCmd_::kd() -{ - return m_kd; -} - - -/*! - * @brief This function sets a value in member weight - * @param _weight New value for member weight - */ -void MotorCmd_::weight( - float _weight) -{ - m_weight = _weight; -} - -/*! - * @brief This function returns the value of member weight - * @return Value of member weight - */ -float MotorCmd_::weight() const -{ - return m_weight; -} - -/*! - * @brief This function returns a reference to member weight - * @return Reference to member weight - */ -float& MotorCmd_::weight() -{ - return m_weight; -} - - - - - -} // namespace dds_ - - -} // namespace msg - - -} // namespace booster_interface - diff --git a/mujoco/idl_gen/booster_interface/MotorCmd.h b/mujoco/idl_gen/booster_interface/MotorCmd.h deleted file mode 100644 index fcc7522..0000000 --- a/mujoco/idl_gen/booster_interface/MotorCmd.h +++ /dev/null @@ -1,342 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file MotorCmd.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__MOTORCMD_H_ -#define _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__MOTORCMD_H_ - - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(MOTORCMD_SOURCE) -#define MOTORCMD_DllAPI __declspec( dllexport ) -#else -#define MOTORCMD_DllAPI __declspec( dllimport ) -#endif // MOTORCMD_SOURCE -#else -#define MOTORCMD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define MOTORCMD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -namespace booster_interface { - namespace msg { - namespace dds_ { - - - /*! - * @brief This class represents the structure MotorCmd_ defined by the user in the IDL file. - * @ingroup MotorCmd - */ - class MotorCmd_ - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MotorCmd_(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MotorCmd_(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object booster_interface::msg::dds_::MotorCmd_ that will be copied. - */ - eProsima_user_DllExport MotorCmd_( - const MotorCmd_& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object booster_interface::msg::dds_::MotorCmd_ that will be copied. - */ - eProsima_user_DllExport MotorCmd_( - MotorCmd_&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object booster_interface::msg::dds_::MotorCmd_ that will be copied. - */ - eProsima_user_DllExport MotorCmd_& operator =( - const MotorCmd_& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object booster_interface::msg::dds_::MotorCmd_ that will be copied. - */ - eProsima_user_DllExport MotorCmd_& operator =( - MotorCmd_&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x booster_interface::msg::dds_::MotorCmd_ object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MotorCmd_& x) const; - - /*! - * @brief Comparison operator. - * @param x booster_interface::msg::dds_::MotorCmd_ object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MotorCmd_& x) const; - - /*! - * @brief This function sets a value in member mode - * @param _mode New value for member mode - */ - eProsima_user_DllExport void mode( - uint8_t _mode); - - /*! - * @brief This function returns the value of member mode - * @return Value of member mode - */ - eProsima_user_DllExport uint8_t mode() const; - - /*! - * @brief This function returns a reference to member mode - * @return Reference to member mode - */ - eProsima_user_DllExport uint8_t& mode(); - - - /*! - * @brief This function sets a value in member q - * @param _q New value for member q - */ - eProsima_user_DllExport void q( - float _q); - - /*! - * @brief This function returns the value of member q - * @return Value of member q - */ - eProsima_user_DllExport float q() const; - - /*! - * @brief This function returns a reference to member q - * @return Reference to member q - */ - eProsima_user_DllExport float& q(); - - - /*! - * @brief This function sets a value in member dq - * @param _dq New value for member dq - */ - eProsima_user_DllExport void dq( - float _dq); - - /*! - * @brief This function returns the value of member dq - * @return Value of member dq - */ - eProsima_user_DllExport float dq() const; - - /*! - * @brief This function returns a reference to member dq - * @return Reference to member dq - */ - eProsima_user_DllExport float& dq(); - - - /*! - * @brief This function sets a value in member tau - * @param _tau New value for member tau - */ - eProsima_user_DllExport void tau( - float _tau); - - /*! - * @brief This function returns the value of member tau - * @return Value of member tau - */ - eProsima_user_DllExport float tau() const; - - /*! - * @brief This function returns a reference to member tau - * @return Reference to member tau - */ - eProsima_user_DllExport float& tau(); - - - /*! - * @brief This function sets a value in member kp - * @param _kp New value for member kp - */ - eProsima_user_DllExport void kp( - float _kp); - - /*! - * @brief This function returns the value of member kp - * @return Value of member kp - */ - eProsima_user_DllExport float kp() const; - - /*! - * @brief This function returns a reference to member kp - * @return Reference to member kp - */ - eProsima_user_DllExport float& kp(); - - - /*! - * @brief This function sets a value in member kd - * @param _kd New value for member kd - */ - eProsima_user_DllExport void kd( - float _kd); - - /*! - * @brief This function returns the value of member kd - * @return Value of member kd - */ - eProsima_user_DllExport float kd() const; - - /*! - * @brief This function returns a reference to member kd - * @return Reference to member kd - */ - eProsima_user_DllExport float& kd(); - - - /*! - * @brief This function sets a value in member weight - * @param _weight New value for member weight - */ - eProsima_user_DllExport void weight( - float _weight); - - /*! - * @brief This function returns the value of member weight - * @return Value of member weight - */ - eProsima_user_DllExport float weight() const; - - /*! - * @brief This function returns a reference to member weight - * @return Reference to member weight - */ - eProsima_user_DllExport float& weight(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const booster_interface::msg::dds_::MotorCmd_& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - uint8_t m_mode; - float m_q; - float m_dq; - float m_tau; - float m_kp; - float m_kd; - float m_weight; - - }; - - } // namespace dds_ - } // namespace msg -} // namespace booster_interface - -#endif // _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__MOTORCMD_H_ - - - diff --git a/mujoco/idl_gen/booster_interface/MotorCmdCdrAux.hpp b/mujoco/idl_gen/booster_interface/MotorCmdCdrAux.hpp deleted file mode 100644 index d89f3e9..0000000 --- a/mujoco/idl_gen/booster_interface/MotorCmdCdrAux.hpp +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file MotorCmdCdrAux.hpp - * This source file contains some definitions of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__MOTORCMDCDRAUX_HPP_ -#define _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__MOTORCMDCDRAUX_HPP_ - -#include "MotorCmd.h" - -constexpr uint32_t booster_interface_msg_dds__MotorCmd__max_cdr_typesize {28UL}; -constexpr uint32_t booster_interface_msg_dds__MotorCmd__max_key_cdr_typesize {0UL}; - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const booster_interface::msg::dds_::MotorCmd_& data); - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__MOTORCMDCDRAUX_HPP_ - diff --git a/mujoco/idl_gen/booster_interface/MotorCmdCdrAux.ipp b/mujoco/idl_gen/booster_interface/MotorCmdCdrAux.ipp deleted file mode 100644 index 9f30336..0000000 --- a/mujoco/idl_gen/booster_interface/MotorCmdCdrAux.ipp +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file MotorCmdCdrAux.ipp - * This source file contains some declarations of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__MOTORCMDCDRAUX_IPP_ -#define _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__MOTORCMDCDRAUX_IPP_ - -#include "MotorCmdCdrAux.hpp" - -#include -#include - - -#include -using namespace eprosima::fastcdr::exception; - -namespace eprosima { -namespace fastcdr { - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const booster_interface::msg::dds_::MotorCmd_& data, - size_t& current_alignment) -{ - using namespace booster_interface::msg::dds_; - - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.mode(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.q(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.dq(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), - data.tau(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), - data.kp(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), - data.kd(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), - data.weight(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const booster_interface::msg::dds_::MotorCmd_& data) -{ - using namespace booster_interface::msg::dds_; - - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.mode() - << eprosima::fastcdr::MemberId(1) << data.q() - << eprosima::fastcdr::MemberId(2) << data.dq() - << eprosima::fastcdr::MemberId(3) << data.tau() - << eprosima::fastcdr::MemberId(4) << data.kp() - << eprosima::fastcdr::MemberId(5) << data.kd() - << eprosima::fastcdr::MemberId(6) << data.weight() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - booster_interface::msg::dds_::MotorCmd_& data) -{ - using namespace booster_interface::msg::dds_; - - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.mode(); - break; - - case 1: - dcdr >> data.q(); - break; - - case 2: - dcdr >> data.dq(); - break; - - case 3: - dcdr >> data.tau(); - break; - - case 4: - dcdr >> data.kp(); - break; - - case 5: - dcdr >> data.kd(); - break; - - case 6: - dcdr >> data.weight(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const booster_interface::msg::dds_::MotorCmd_& data) -{ - using namespace booster_interface::msg::dds_; - - static_cast(scdr); - static_cast(data); -} - - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__MOTORCMDCDRAUX_IPP_ - diff --git a/mujoco/idl_gen/booster_interface/MotorCmdPubSubTypes.cxx b/mujoco/idl_gen/booster_interface/MotorCmdPubSubTypes.cxx deleted file mode 100644 index e5bc0d5..0000000 --- a/mujoco/idl_gen/booster_interface/MotorCmdPubSubTypes.cxx +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file MotorCmdPubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#include - -#include "MotorCmdPubSubTypes.h" -#include "MotorCmdCdrAux.hpp" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; -using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - -namespace booster_interface { - namespace msg { - namespace dds_ { - - - MotorCmd_PubSubType::MotorCmd_PubSubType() - { - setName("booster_interface::msg::dds_::MotorCmd_"); - uint32_t type_size = - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(MotorCmd_::getMaxCdrSerializedSize()); - #else - booster_interface_msg_dds__MotorCmd__max_cdr_typesize; - #endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = booster_interface_msg_dds__MotorCmd__max_key_cdr_typesize > 16 ? booster_interface_msg_dds__MotorCmd__max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - MotorCmd_PubSubType::~MotorCmd_PubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool MotorCmd_PubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) - { - MotorCmd_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - #if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - #endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length - #if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); - #else - payload->length = static_cast(ser.get_serialized_data_length()); - #endif // FASTCDR_VERSION_MAJOR == 1 - return true; - } - - bool MotorCmd_PubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - MotorCmd_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN - #if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR - #endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; - } - - std::function MotorCmd_PubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) - { - return [data, data_representation]() -> uint32_t - { - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - #else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } - #endif // FASTCDR_VERSION_MAJOR == 1 - }; - } - - void* MotorCmd_PubSubType::createData() - { - return reinterpret_cast(new MotorCmd_()); - } - - void MotorCmd_PubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool MotorCmd_PubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - MotorCmd_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - booster_interface_msg_dds__MotorCmd__max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); - #if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); - #else - eprosima::fastcdr::serialize_key(ser, *p_type); - #endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || booster_interface_msg_dds__MotorCmd__max_key_cdr_typesize > 16) - { - m_md5.init(); - #if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - #else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); - #endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace dds_ - - - } //End of namespace msg - - -} //End of namespace booster_interface - diff --git a/mujoco/idl_gen/booster_interface/MotorCmdPubSubTypes.h b/mujoco/idl_gen/booster_interface/MotorCmdPubSubTypes.h deleted file mode 100644 index 68b64fa..0000000 --- a/mujoco/idl_gen/booster_interface/MotorCmdPubSubTypes.h +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file MotorCmdPubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__MOTORCMD_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__MOTORCMD_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "MotorCmd.h" - - -#if !defined(GEN_API_VER) || (GEN_API_VER != 2) -#error \ - Generated MotorCmd is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace booster_interface -{ - namespace msg - { - namespace dds_ - { - - - - #ifndef SWIG - namespace detail { - - template - struct MotorCmd__rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - - }; - - struct MotorCmd__f - { - typedef float MotorCmd_::* type; - friend constexpr type get( - MotorCmd__f); - }; - - template struct MotorCmd__rob; - - template - inline size_t constexpr MotorCmd__offset_of() - { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } - - } // namespace detail - #endif // ifndef SWIG - - - /*! - * @brief This class represents the TopicDataType of the type MotorCmd_ defined by the user in the IDL file. - * @ingroup MotorCmd - */ - class MotorCmd_PubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef MotorCmd_ type; - - eProsima_user_DllExport MotorCmd_PubSubType(); - - eProsima_user_DllExport ~MotorCmd_PubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return is_plain_xcdrv1_impl(); - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) - { - return is_plain_xcdrv2_impl(); - } - else - { - return is_plain_xcdrv1_impl(); - } - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) MotorCmd_(); - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - - private: - - static constexpr bool is_plain_xcdrv1_impl() - { - return 28ULL == - (detail::MotorCmd__offset_of() + - sizeof(float)); - } - - static constexpr bool is_plain_xcdrv2_impl() - { - return 28ULL == - (detail::MotorCmd__offset_of() + - sizeof(float)); - } - - }; - } - } -} - -#endif // _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__MOTORCMD_PUBSUBTYPES_H_ - diff --git a/mujoco/idl_gen/booster_interface/MotorState.cxx b/mujoco/idl_gen/booster_interface/MotorState.cxx deleted file mode 100644 index 3f12cab..0000000 --- a/mujoco/idl_gen/booster_interface/MotorState.cxx +++ /dev/null @@ -1,618 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file MotorState.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "MotorState.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define booster_interface_msg_dds__MotorState__max_cdr_typesize 36ULL; - - -namespace booster_interface { - -namespace msg { - -namespace dds_ { - - - -MotorState_::MotorState_() -{ - // octet m_mode - m_mode = 0; - // float m_q - m_q = 0.0; - // float m_dq - m_dq = 0.0; - // float m_ddq - m_ddq = 0.0; - // float m_tau_est - m_tau_est = 0.0; - // octet m_temperature - m_temperature = 0; - // unsigned long m_lost - m_lost = 0; - // unsigned long m_reserve - memset(&m_reserve, 0, ((2)) * 4); - -} - -MotorState_::~MotorState_() -{ -} - -MotorState_::MotorState_( - const MotorState_& x) -{ - m_mode = x.m_mode; - - - m_q = x.m_q; - - - m_dq = x.m_dq; - - - m_ddq = x.m_ddq; - - - m_tau_est = x.m_tau_est; - - - m_temperature = x.m_temperature; - - - m_lost = x.m_lost; - - - m_reserve = x.m_reserve; - -} - -MotorState_::MotorState_( - MotorState_&& x) noexcept -{ - m_mode = x.m_mode; - - - m_q = x.m_q; - - - m_dq = x.m_dq; - - - m_ddq = x.m_ddq; - - - m_tau_est = x.m_tau_est; - - - m_temperature = x.m_temperature; - - - m_lost = x.m_lost; - - - m_reserve = std::move(x.m_reserve); - -} - -MotorState_& MotorState_::operator =( - const MotorState_& x) -{ - m_mode = x.m_mode; - - - m_q = x.m_q; - - - m_dq = x.m_dq; - - - m_ddq = x.m_ddq; - - - m_tau_est = x.m_tau_est; - - - m_temperature = x.m_temperature; - - - m_lost = x.m_lost; - - - m_reserve = x.m_reserve; - - return *this; -} - -MotorState_& MotorState_::operator =( - MotorState_&& x) noexcept -{ - m_mode = x.m_mode; - - - m_q = x.m_q; - - - m_dq = x.m_dq; - - - m_ddq = x.m_ddq; - - - m_tau_est = x.m_tau_est; - - - m_temperature = x.m_temperature; - - - m_lost = x.m_lost; - - - m_reserve = std::move(x.m_reserve); - - return *this; -} - -bool MotorState_::operator ==( - const MotorState_& x) const -{ - return (m_mode == x.m_mode && - m_q == x.m_q && - m_dq == x.m_dq && - m_ddq == x.m_ddq && - m_tau_est == x.m_tau_est && - m_temperature == x.m_temperature && - m_lost == x.m_lost && - m_reserve == x.m_reserve); -} - -bool MotorState_::operator !=( - const MotorState_& x) const -{ - return !(*this == x); -} - -size_t MotorState_::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return booster_interface_msg_dds__MotorState__max_cdr_typesize; -} - -size_t MotorState_::getCdrSerializedSize( - const MotorState_& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += (((2)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; -} - - -void MotorState_::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_mode; - - scdr << m_q; - - scdr << m_dq; - - scdr << m_ddq; - - scdr << m_tau_est; - - scdr << m_temperature; - - scdr << m_lost; - - scdr << m_reserve; - - -} - -void MotorState_::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_mode; - - - - dcdr >> m_q; - - - - dcdr >> m_dq; - - - - dcdr >> m_ddq; - - - - dcdr >> m_tau_est; - - - - dcdr >> m_temperature; - - - - dcdr >> m_lost; - - - - dcdr >> m_reserve; - - -} - - -bool MotorState_::isKeyDefined() -{ - return false; -} - -void MotorState_::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member mode - * @param _mode New value for member mode - */ -void MotorState_::mode( - uint8_t _mode) -{ - m_mode = _mode; -} - -/*! - * @brief This function returns the value of member mode - * @return Value of member mode - */ -uint8_t MotorState_::mode() const -{ - return m_mode; -} - -/*! - * @brief This function returns a reference to member mode - * @return Reference to member mode - */ -uint8_t& MotorState_::mode() -{ - return m_mode; -} - - -/*! - * @brief This function sets a value in member q - * @param _q New value for member q - */ -void MotorState_::q( - float _q) -{ - m_q = _q; -} - -/*! - * @brief This function returns the value of member q - * @return Value of member q - */ -float MotorState_::q() const -{ - return m_q; -} - -/*! - * @brief This function returns a reference to member q - * @return Reference to member q - */ -float& MotorState_::q() -{ - return m_q; -} - - -/*! - * @brief This function sets a value in member dq - * @param _dq New value for member dq - */ -void MotorState_::dq( - float _dq) -{ - m_dq = _dq; -} - -/*! - * @brief This function returns the value of member dq - * @return Value of member dq - */ -float MotorState_::dq() const -{ - return m_dq; -} - -/*! - * @brief This function returns a reference to member dq - * @return Reference to member dq - */ -float& MotorState_::dq() -{ - return m_dq; -} - - -/*! - * @brief This function sets a value in member ddq - * @param _ddq New value for member ddq - */ -void MotorState_::ddq( - float _ddq) -{ - m_ddq = _ddq; -} - -/*! - * @brief This function returns the value of member ddq - * @return Value of member ddq - */ -float MotorState_::ddq() const -{ - return m_ddq; -} - -/*! - * @brief This function returns a reference to member ddq - * @return Reference to member ddq - */ -float& MotorState_::ddq() -{ - return m_ddq; -} - - -/*! - * @brief This function sets a value in member tau_est - * @param _tau_est New value for member tau_est - */ -void MotorState_::tau_est( - float _tau_est) -{ - m_tau_est = _tau_est; -} - -/*! - * @brief This function returns the value of member tau_est - * @return Value of member tau_est - */ -float MotorState_::tau_est() const -{ - return m_tau_est; -} - -/*! - * @brief This function returns a reference to member tau_est - * @return Reference to member tau_est - */ -float& MotorState_::tau_est() -{ - return m_tau_est; -} - - -/*! - * @brief This function sets a value in member temperature - * @param _temperature New value for member temperature - */ -void MotorState_::temperature( - uint8_t _temperature) -{ - m_temperature = _temperature; -} - -/*! - * @brief This function returns the value of member temperature - * @return Value of member temperature - */ -uint8_t MotorState_::temperature() const -{ - return m_temperature; -} - -/*! - * @brief This function returns a reference to member temperature - * @return Reference to member temperature - */ -uint8_t& MotorState_::temperature() -{ - return m_temperature; -} - - -/*! - * @brief This function sets a value in member lost - * @param _lost New value for member lost - */ -void MotorState_::lost( - uint32_t _lost) -{ - m_lost = _lost; -} - -/*! - * @brief This function returns the value of member lost - * @return Value of member lost - */ -uint32_t MotorState_::lost() const -{ - return m_lost; -} - -/*! - * @brief This function returns a reference to member lost - * @return Reference to member lost - */ -uint32_t& MotorState_::lost() -{ - return m_lost; -} - - -/*! - * @brief This function copies the value in member reserve - * @param _reserve New value to be copied in member reserve - */ -void MotorState_::reserve( - const std::array& _reserve) -{ - m_reserve = _reserve; -} - -/*! - * @brief This function moves the value in member reserve - * @param _reserve New value to be moved in member reserve - */ -void MotorState_::reserve( - std::array&& _reserve) -{ - m_reserve = std::move(_reserve); -} - -/*! - * @brief This function returns a constant reference to member reserve - * @return Constant reference to member reserve - */ -const std::array& MotorState_::reserve() const -{ - return m_reserve; -} - -/*! - * @brief This function returns a reference to member reserve - * @return Reference to member reserve - */ -std::array& MotorState_::reserve() -{ - return m_reserve; -} - - - - - -} // namespace dds_ - - -} // namespace msg - - -} // namespace booster_interface - diff --git a/mujoco/idl_gen/booster_interface/MotorState.h b/mujoco/idl_gen/booster_interface/MotorState.h deleted file mode 100644 index 31aca30..0000000 --- a/mujoco/idl_gen/booster_interface/MotorState.h +++ /dev/null @@ -1,370 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file MotorState.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__MOTORSTATE_H_ -#define _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__MOTORSTATE_H_ - - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(MOTORSTATE_SOURCE) -#define MOTORSTATE_DllAPI __declspec( dllexport ) -#else -#define MOTORSTATE_DllAPI __declspec( dllimport ) -#endif // MOTORSTATE_SOURCE -#else -#define MOTORSTATE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define MOTORSTATE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -namespace booster_interface { - namespace msg { - namespace dds_ { - - - /*! - * @brief This class represents the structure MotorState_ defined by the user in the IDL file. - * @ingroup MotorState - */ - class MotorState_ - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MotorState_(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MotorState_(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object booster_interface::msg::dds_::MotorState_ that will be copied. - */ - eProsima_user_DllExport MotorState_( - const MotorState_& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object booster_interface::msg::dds_::MotorState_ that will be copied. - */ - eProsima_user_DllExport MotorState_( - MotorState_&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object booster_interface::msg::dds_::MotorState_ that will be copied. - */ - eProsima_user_DllExport MotorState_& operator =( - const MotorState_& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object booster_interface::msg::dds_::MotorState_ that will be copied. - */ - eProsima_user_DllExport MotorState_& operator =( - MotorState_&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x booster_interface::msg::dds_::MotorState_ object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MotorState_& x) const; - - /*! - * @brief Comparison operator. - * @param x booster_interface::msg::dds_::MotorState_ object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MotorState_& x) const; - - /*! - * @brief This function sets a value in member mode - * @param _mode New value for member mode - */ - eProsima_user_DllExport void mode( - uint8_t _mode); - - /*! - * @brief This function returns the value of member mode - * @return Value of member mode - */ - eProsima_user_DllExport uint8_t mode() const; - - /*! - * @brief This function returns a reference to member mode - * @return Reference to member mode - */ - eProsima_user_DllExport uint8_t& mode(); - - - /*! - * @brief This function sets a value in member q - * @param _q New value for member q - */ - eProsima_user_DllExport void q( - float _q); - - /*! - * @brief This function returns the value of member q - * @return Value of member q - */ - eProsima_user_DllExport float q() const; - - /*! - * @brief This function returns a reference to member q - * @return Reference to member q - */ - eProsima_user_DllExport float& q(); - - - /*! - * @brief This function sets a value in member dq - * @param _dq New value for member dq - */ - eProsima_user_DllExport void dq( - float _dq); - - /*! - * @brief This function returns the value of member dq - * @return Value of member dq - */ - eProsima_user_DllExport float dq() const; - - /*! - * @brief This function returns a reference to member dq - * @return Reference to member dq - */ - eProsima_user_DllExport float& dq(); - - - /*! - * @brief This function sets a value in member ddq - * @param _ddq New value for member ddq - */ - eProsima_user_DllExport void ddq( - float _ddq); - - /*! - * @brief This function returns the value of member ddq - * @return Value of member ddq - */ - eProsima_user_DllExport float ddq() const; - - /*! - * @brief This function returns a reference to member ddq - * @return Reference to member ddq - */ - eProsima_user_DllExport float& ddq(); - - - /*! - * @brief This function sets a value in member tau_est - * @param _tau_est New value for member tau_est - */ - eProsima_user_DllExport void tau_est( - float _tau_est); - - /*! - * @brief This function returns the value of member tau_est - * @return Value of member tau_est - */ - eProsima_user_DllExport float tau_est() const; - - /*! - * @brief This function returns a reference to member tau_est - * @return Reference to member tau_est - */ - eProsima_user_DllExport float& tau_est(); - - - /*! - * @brief This function sets a value in member temperature - * @param _temperature New value for member temperature - */ - eProsima_user_DllExport void temperature( - uint8_t _temperature); - - /*! - * @brief This function returns the value of member temperature - * @return Value of member temperature - */ - eProsima_user_DllExport uint8_t temperature() const; - - /*! - * @brief This function returns a reference to member temperature - * @return Reference to member temperature - */ - eProsima_user_DllExport uint8_t& temperature(); - - - /*! - * @brief This function sets a value in member lost - * @param _lost New value for member lost - */ - eProsima_user_DllExport void lost( - uint32_t _lost); - - /*! - * @brief This function returns the value of member lost - * @return Value of member lost - */ - eProsima_user_DllExport uint32_t lost() const; - - /*! - * @brief This function returns a reference to member lost - * @return Reference to member lost - */ - eProsima_user_DllExport uint32_t& lost(); - - - /*! - * @brief This function copies the value in member reserve - * @param _reserve New value to be copied in member reserve - */ - eProsima_user_DllExport void reserve( - const std::array& _reserve); - - /*! - * @brief This function moves the value in member reserve - * @param _reserve New value to be moved in member reserve - */ - eProsima_user_DllExport void reserve( - std::array&& _reserve); - - /*! - * @brief This function returns a constant reference to member reserve - * @return Constant reference to member reserve - */ - eProsima_user_DllExport const std::array& reserve() const; - - /*! - * @brief This function returns a reference to member reserve - * @return Reference to member reserve - */ - eProsima_user_DllExport std::array& reserve(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const booster_interface::msg::dds_::MotorState_& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - uint8_t m_mode; - float m_q; - float m_dq; - float m_ddq; - float m_tau_est; - uint8_t m_temperature; - uint32_t m_lost; - std::array m_reserve; - - }; - - } // namespace dds_ - } // namespace msg -} // namespace booster_interface - -#endif // _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__MOTORSTATE_H_ - - - diff --git a/mujoco/idl_gen/booster_interface/MotorStateCdrAux.hpp b/mujoco/idl_gen/booster_interface/MotorStateCdrAux.hpp deleted file mode 100644 index 1e4d273..0000000 --- a/mujoco/idl_gen/booster_interface/MotorStateCdrAux.hpp +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file MotorStateCdrAux.hpp - * This source file contains some definitions of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__MOTORSTATECDRAUX_HPP_ -#define _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__MOTORSTATECDRAUX_HPP_ - -#include "MotorState.h" - -constexpr uint32_t booster_interface_msg_dds__MotorState__max_cdr_typesize {36UL}; -constexpr uint32_t booster_interface_msg_dds__MotorState__max_key_cdr_typesize {0UL}; - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const booster_interface::msg::dds_::MotorState_& data); - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__MOTORSTATECDRAUX_HPP_ - diff --git a/mujoco/idl_gen/booster_interface/MotorStateCdrAux.ipp b/mujoco/idl_gen/booster_interface/MotorStateCdrAux.ipp deleted file mode 100644 index 313b962..0000000 --- a/mujoco/idl_gen/booster_interface/MotorStateCdrAux.ipp +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file MotorStateCdrAux.ipp - * This source file contains some declarations of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__MOTORSTATECDRAUX_IPP_ -#define _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__MOTORSTATECDRAUX_IPP_ - -#include "MotorStateCdrAux.hpp" - -#include -#include - - -#include -using namespace eprosima::fastcdr::exception; - -namespace eprosima { -namespace fastcdr { - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const booster_interface::msg::dds_::MotorState_& data, - size_t& current_alignment) -{ - using namespace booster_interface::msg::dds_; - - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.mode(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.q(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.dq(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), - data.ddq(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), - data.tau_est(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), - data.temperature(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), - data.lost(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7), - data.reserve(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const booster_interface::msg::dds_::MotorState_& data) -{ - using namespace booster_interface::msg::dds_; - - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.mode() - << eprosima::fastcdr::MemberId(1) << data.q() - << eprosima::fastcdr::MemberId(2) << data.dq() - << eprosima::fastcdr::MemberId(3) << data.ddq() - << eprosima::fastcdr::MemberId(4) << data.tau_est() - << eprosima::fastcdr::MemberId(5) << data.temperature() - << eprosima::fastcdr::MemberId(6) << data.lost() - << eprosima::fastcdr::MemberId(7) << data.reserve() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - booster_interface::msg::dds_::MotorState_& data) -{ - using namespace booster_interface::msg::dds_; - - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.mode(); - break; - - case 1: - dcdr >> data.q(); - break; - - case 2: - dcdr >> data.dq(); - break; - - case 3: - dcdr >> data.ddq(); - break; - - case 4: - dcdr >> data.tau_est(); - break; - - case 5: - dcdr >> data.temperature(); - break; - - case 6: - dcdr >> data.lost(); - break; - - case 7: - dcdr >> data.reserve(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const booster_interface::msg::dds_::MotorState_& data) -{ - using namespace booster_interface::msg::dds_; - - static_cast(scdr); - static_cast(data); -} - - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__MOTORSTATECDRAUX_IPP_ - diff --git a/mujoco/idl_gen/booster_interface/MotorStatePubSubTypes.cxx b/mujoco/idl_gen/booster_interface/MotorStatePubSubTypes.cxx deleted file mode 100644 index 071248b..0000000 --- a/mujoco/idl_gen/booster_interface/MotorStatePubSubTypes.cxx +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file MotorStatePubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#include - -#include "MotorStatePubSubTypes.h" -#include "MotorStateCdrAux.hpp" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; -using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - -namespace booster_interface { - namespace msg { - namespace dds_ { - - - MotorState_PubSubType::MotorState_PubSubType() - { - setName("booster_interface::msg::dds_::MotorState_"); - uint32_t type_size = - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(MotorState_::getMaxCdrSerializedSize()); - #else - booster_interface_msg_dds__MotorState__max_cdr_typesize; - #endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = booster_interface_msg_dds__MotorState__max_key_cdr_typesize > 16 ? booster_interface_msg_dds__MotorState__max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - MotorState_PubSubType::~MotorState_PubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool MotorState_PubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) - { - MotorState_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - #if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - #endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length - #if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); - #else - payload->length = static_cast(ser.get_serialized_data_length()); - #endif // FASTCDR_VERSION_MAJOR == 1 - return true; - } - - bool MotorState_PubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - MotorState_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN - #if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR - #endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; - } - - std::function MotorState_PubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) - { - return [data, data_representation]() -> uint32_t - { - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - #else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } - #endif // FASTCDR_VERSION_MAJOR == 1 - }; - } - - void* MotorState_PubSubType::createData() - { - return reinterpret_cast(new MotorState_()); - } - - void MotorState_PubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool MotorState_PubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - MotorState_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - booster_interface_msg_dds__MotorState__max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); - #if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); - #else - eprosima::fastcdr::serialize_key(ser, *p_type); - #endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || booster_interface_msg_dds__MotorState__max_key_cdr_typesize > 16) - { - m_md5.init(); - #if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - #else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); - #endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace dds_ - - - } //End of namespace msg - - -} //End of namespace booster_interface - diff --git a/mujoco/idl_gen/booster_interface/MotorStatePubSubTypes.h b/mujoco/idl_gen/booster_interface/MotorStatePubSubTypes.h deleted file mode 100644 index ffcb523..0000000 --- a/mujoco/idl_gen/booster_interface/MotorStatePubSubTypes.h +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file MotorStatePubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__MOTORSTATE_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__MOTORSTATE_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "MotorState.h" - - -#if !defined(GEN_API_VER) || (GEN_API_VER != 2) -#error \ - Generated MotorState is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace booster_interface -{ - namespace msg - { - namespace dds_ - { - - - - #ifndef SWIG - namespace detail { - - template - struct MotorState__rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - - }; - - struct MotorState__f - { - typedef std::array MotorState_::* type; - friend constexpr type get( - MotorState__f); - }; - - template struct MotorState__rob; - - template - inline size_t constexpr MotorState__offset_of() - { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } - - } // namespace detail - #endif // ifndef SWIG - - - /*! - * @brief This class represents the TopicDataType of the type MotorState_ defined by the user in the IDL file. - * @ingroup MotorState - */ - class MotorState_PubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef MotorState_ type; - - eProsima_user_DllExport MotorState_PubSubType(); - - eProsima_user_DllExport ~MotorState_PubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return is_plain_xcdrv1_impl(); - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) - { - return is_plain_xcdrv2_impl(); - } - else - { - return is_plain_xcdrv1_impl(); - } - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) MotorState_(); - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - - private: - - static constexpr bool is_plain_xcdrv1_impl() - { - return 36ULL == - (detail::MotorState__offset_of() + - sizeof(std::array)); - } - - static constexpr bool is_plain_xcdrv2_impl() - { - return 36ULL == - (detail::MotorState__offset_of() + - sizeof(std::array)); - } - - }; - } - } -} - -#endif // _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__MOTORSTATE_PUBSUBTYPES_H_ - diff --git a/mujoco/idl_gen/booster_interface/Odometer.cxx b/mujoco/idl_gen/booster_interface/Odometer.cxx deleted file mode 100644 index 8ad0405..0000000 --- a/mujoco/idl_gen/booster_interface/Odometer.cxx +++ /dev/null @@ -1,341 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Odometer.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Odometer.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define booster_interface_msg_dds__Odometer__max_cdr_typesize 12ULL; - - -namespace booster_interface { - -namespace msg { - -namespace dds_ { - - - -Odometer_::Odometer_() -{ - // float m_x - m_x = 0.0; - // float m_y - m_y = 0.0; - // float m_theta - m_theta = 0.0; - -} - -Odometer_::~Odometer_() -{ -} - -Odometer_::Odometer_( - const Odometer_& x) -{ - m_x = x.m_x; - - - m_y = x.m_y; - - - m_theta = x.m_theta; - -} - -Odometer_::Odometer_( - Odometer_&& x) noexcept -{ - m_x = x.m_x; - - - m_y = x.m_y; - - - m_theta = x.m_theta; - -} - -Odometer_& Odometer_::operator =( - const Odometer_& x) -{ - m_x = x.m_x; - - - m_y = x.m_y; - - - m_theta = x.m_theta; - - return *this; -} - -Odometer_& Odometer_::operator =( - Odometer_&& x) noexcept -{ - m_x = x.m_x; - - - m_y = x.m_y; - - - m_theta = x.m_theta; - - return *this; -} - -bool Odometer_::operator ==( - const Odometer_& x) const -{ - return (m_x == x.m_x && - m_y == x.m_y && - m_theta == x.m_theta); -} - -bool Odometer_::operator !=( - const Odometer_& x) const -{ - return !(*this == x); -} - -size_t Odometer_::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return booster_interface_msg_dds__Odometer__max_cdr_typesize; -} - -size_t Odometer_::getCdrSerializedSize( - const Odometer_& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void Odometer_::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_x; - - scdr << m_y; - - scdr << m_theta; - -} - -void Odometer_::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_x; - - - - dcdr >> m_y; - - - - dcdr >> m_theta; - - -} - - -bool Odometer_::isKeyDefined() -{ - return false; -} - -void Odometer_::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member x - * @param _x New value for member x - */ -void Odometer_::x( - float _x) -{ - m_x = _x; -} - -/*! - * @brief This function returns the value of member x - * @return Value of member x - */ -float Odometer_::x() const -{ - return m_x; -} - -/*! - * @brief This function returns a reference to member x - * @return Reference to member x - */ -float& Odometer_::x() -{ - return m_x; -} - - -/*! - * @brief This function sets a value in member y - * @param _y New value for member y - */ -void Odometer_::y( - float _y) -{ - m_y = _y; -} - -/*! - * @brief This function returns the value of member y - * @return Value of member y - */ -float Odometer_::y() const -{ - return m_y; -} - -/*! - * @brief This function returns a reference to member y - * @return Reference to member y - */ -float& Odometer_::y() -{ - return m_y; -} - - -/*! - * @brief This function sets a value in member theta - * @param _theta New value for member theta - */ -void Odometer_::theta( - float _theta) -{ - m_theta = _theta; -} - -/*! - * @brief This function returns the value of member theta - * @return Value of member theta - */ -float Odometer_::theta() const -{ - return m_theta; -} - -/*! - * @brief This function returns a reference to member theta - * @return Reference to member theta - */ -float& Odometer_::theta() -{ - return m_theta; -} - - - - - -} // namespace dds_ - - -} // namespace msg - - -} // namespace booster_interface - diff --git a/mujoco/idl_gen/booster_interface/Odometer.h b/mujoco/idl_gen/booster_interface/Odometer.h deleted file mode 100644 index b16ee88..0000000 --- a/mujoco/idl_gen/booster_interface/Odometer.h +++ /dev/null @@ -1,258 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Odometer.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__ODOMETER_H_ -#define _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__ODOMETER_H_ - - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(ODOMETER_SOURCE) -#define ODOMETER_DllAPI __declspec( dllexport ) -#else -#define ODOMETER_DllAPI __declspec( dllimport ) -#endif // ODOMETER_SOURCE -#else -#define ODOMETER_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define ODOMETER_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -namespace booster_interface { - namespace msg { - namespace dds_ { - - - /*! - * @brief This class represents the structure Odometer_ defined by the user in the IDL file. - * @ingroup Odometer - */ - class Odometer_ - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Odometer_(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Odometer_(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object booster_interface::msg::dds_::Odometer_ that will be copied. - */ - eProsima_user_DllExport Odometer_( - const Odometer_& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object booster_interface::msg::dds_::Odometer_ that will be copied. - */ - eProsima_user_DllExport Odometer_( - Odometer_&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object booster_interface::msg::dds_::Odometer_ that will be copied. - */ - eProsima_user_DllExport Odometer_& operator =( - const Odometer_& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object booster_interface::msg::dds_::Odometer_ that will be copied. - */ - eProsima_user_DllExport Odometer_& operator =( - Odometer_&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x booster_interface::msg::dds_::Odometer_ object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Odometer_& x) const; - - /*! - * @brief Comparison operator. - * @param x booster_interface::msg::dds_::Odometer_ object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Odometer_& x) const; - - /*! - * @brief This function sets a value in member x - * @param _x New value for member x - */ - eProsima_user_DllExport void x( - float _x); - - /*! - * @brief This function returns the value of member x - * @return Value of member x - */ - eProsima_user_DllExport float x() const; - - /*! - * @brief This function returns a reference to member x - * @return Reference to member x - */ - eProsima_user_DllExport float& x(); - - - /*! - * @brief This function sets a value in member y - * @param _y New value for member y - */ - eProsima_user_DllExport void y( - float _y); - - /*! - * @brief This function returns the value of member y - * @return Value of member y - */ - eProsima_user_DllExport float y() const; - - /*! - * @brief This function returns a reference to member y - * @return Reference to member y - */ - eProsima_user_DllExport float& y(); - - - /*! - * @brief This function sets a value in member theta - * @param _theta New value for member theta - */ - eProsima_user_DllExport void theta( - float _theta); - - /*! - * @brief This function returns the value of member theta - * @return Value of member theta - */ - eProsima_user_DllExport float theta() const; - - /*! - * @brief This function returns a reference to member theta - * @return Reference to member theta - */ - eProsima_user_DllExport float& theta(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const booster_interface::msg::dds_::Odometer_& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - float m_x; - float m_y; - float m_theta; - - }; - - } // namespace dds_ - } // namespace msg -} // namespace booster_interface - -#endif // _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__ODOMETER_H_ - - - diff --git a/mujoco/idl_gen/booster_interface/OdometerCdrAux.hpp b/mujoco/idl_gen/booster_interface/OdometerCdrAux.hpp deleted file mode 100644 index abc555e..0000000 --- a/mujoco/idl_gen/booster_interface/OdometerCdrAux.hpp +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file OdometerCdrAux.hpp - * This source file contains some definitions of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__ODOMETERCDRAUX_HPP_ -#define _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__ODOMETERCDRAUX_HPP_ - -#include "Odometer.h" - -constexpr uint32_t booster_interface_msg_dds__Odometer__max_cdr_typesize {12UL}; -constexpr uint32_t booster_interface_msg_dds__Odometer__max_key_cdr_typesize {0UL}; - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const booster_interface::msg::dds_::Odometer_& data); - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__ODOMETERCDRAUX_HPP_ - diff --git a/mujoco/idl_gen/booster_interface/OdometerCdrAux.ipp b/mujoco/idl_gen/booster_interface/OdometerCdrAux.ipp deleted file mode 100644 index 2276fdc..0000000 --- a/mujoco/idl_gen/booster_interface/OdometerCdrAux.ipp +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file OdometerCdrAux.ipp - * This source file contains some declarations of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__ODOMETERCDRAUX_IPP_ -#define _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__ODOMETERCDRAUX_IPP_ - -#include "OdometerCdrAux.hpp" - -#include -#include - - -#include -using namespace eprosima::fastcdr::exception; - -namespace eprosima { -namespace fastcdr { - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const booster_interface::msg::dds_::Odometer_& data, - size_t& current_alignment) -{ - using namespace booster_interface::msg::dds_; - - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.x(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.y(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.theta(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const booster_interface::msg::dds_::Odometer_& data) -{ - using namespace booster_interface::msg::dds_; - - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.x() - << eprosima::fastcdr::MemberId(1) << data.y() - << eprosima::fastcdr::MemberId(2) << data.theta() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - booster_interface::msg::dds_::Odometer_& data) -{ - using namespace booster_interface::msg::dds_; - - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.x(); - break; - - case 1: - dcdr >> data.y(); - break; - - case 2: - dcdr >> data.theta(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const booster_interface::msg::dds_::Odometer_& data) -{ - using namespace booster_interface::msg::dds_; - - static_cast(scdr); - static_cast(data); -} - - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__ODOMETERCDRAUX_IPP_ - diff --git a/mujoco/idl_gen/booster_interface/OdometerPubSubTypes.cxx b/mujoco/idl_gen/booster_interface/OdometerPubSubTypes.cxx deleted file mode 100644 index 8afed31..0000000 --- a/mujoco/idl_gen/booster_interface/OdometerPubSubTypes.cxx +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file OdometerPubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#include - -#include "OdometerPubSubTypes.h" -#include "OdometerCdrAux.hpp" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; -using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - -namespace booster_interface { - namespace msg { - namespace dds_ { - - - Odometer_PubSubType::Odometer_PubSubType() - { - setName("booster_interface::msg::dds_::Odometer_"); - uint32_t type_size = - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(Odometer_::getMaxCdrSerializedSize()); - #else - booster_interface_msg_dds__Odometer__max_cdr_typesize; - #endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = booster_interface_msg_dds__Odometer__max_key_cdr_typesize > 16 ? booster_interface_msg_dds__Odometer__max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - Odometer_PubSubType::~Odometer_PubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool Odometer_PubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) - { - Odometer_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - #if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - #endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length - #if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); - #else - payload->length = static_cast(ser.get_serialized_data_length()); - #endif // FASTCDR_VERSION_MAJOR == 1 - return true; - } - - bool Odometer_PubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - Odometer_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN - #if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR - #endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; - } - - std::function Odometer_PubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) - { - return [data, data_representation]() -> uint32_t - { - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - #else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } - #endif // FASTCDR_VERSION_MAJOR == 1 - }; - } - - void* Odometer_PubSubType::createData() - { - return reinterpret_cast(new Odometer_()); - } - - void Odometer_PubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool Odometer_PubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - Odometer_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - booster_interface_msg_dds__Odometer__max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); - #if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); - #else - eprosima::fastcdr::serialize_key(ser, *p_type); - #endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || booster_interface_msg_dds__Odometer__max_key_cdr_typesize > 16) - { - m_md5.init(); - #if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - #else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); - #endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace dds_ - - - } //End of namespace msg - - -} //End of namespace booster_interface - diff --git a/mujoco/idl_gen/booster_interface/OdometerPubSubTypes.h b/mujoco/idl_gen/booster_interface/OdometerPubSubTypes.h deleted file mode 100644 index 85f24f7..0000000 --- a/mujoco/idl_gen/booster_interface/OdometerPubSubTypes.h +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file OdometerPubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__ODOMETER_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__ODOMETER_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "Odometer.h" - - -#if !defined(GEN_API_VER) || (GEN_API_VER != 2) -#error \ - Generated Odometer is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace booster_interface -{ - namespace msg - { - namespace dds_ - { - - - - #ifndef SWIG - namespace detail { - - template - struct Odometer__rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - - }; - - struct Odometer__f - { - typedef float Odometer_::* type; - friend constexpr type get( - Odometer__f); - }; - - template struct Odometer__rob; - - template - inline size_t constexpr Odometer__offset_of() - { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } - - } // namespace detail - #endif // ifndef SWIG - - - /*! - * @brief This class represents the TopicDataType of the type Odometer_ defined by the user in the IDL file. - * @ingroup Odometer - */ - class Odometer_PubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef Odometer_ type; - - eProsima_user_DllExport Odometer_PubSubType(); - - eProsima_user_DllExport ~Odometer_PubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return is_plain_xcdrv1_impl(); - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) - { - return is_plain_xcdrv2_impl(); - } - else - { - return is_plain_xcdrv1_impl(); - } - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) Odometer_(); - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - - private: - - static constexpr bool is_plain_xcdrv1_impl() - { - return 12ULL == - (detail::Odometer__offset_of() + - sizeof(float)); - } - - static constexpr bool is_plain_xcdrv2_impl() - { - return 12ULL == - (detail::Odometer__offset_of() + - sizeof(float)); - } - - }; - } - } -} - -#endif // _FAST_DDS_GENERATED_BOOSTER_INTERFACE_MSG_DDS__ODOMETER_PUBSUBTYPES_H_ - diff --git a/mujoco/idl_gen/booster_msgs/RpcReqMsg.cxx b/mujoco/idl_gen/booster_msgs/RpcReqMsg.cxx deleted file mode 100644 index dad2eab..0000000 --- a/mujoco/idl_gen/booster_msgs/RpcReqMsg.cxx +++ /dev/null @@ -1,371 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file RpcReqMsg.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "RpcReqMsg.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define booster_msgs_msg_dds__RpcReqMsg__max_cdr_typesize 780ULL; - - -namespace booster_msgs { - -namespace msg { - -namespace dds_ { - - - -RpcReqMsg_::RpcReqMsg_() -{ - // /type_d() m_uuid - - // /type_d() m_header - - // /type_d() m_body - - -} - -RpcReqMsg_::~RpcReqMsg_() -{ -} - -RpcReqMsg_::RpcReqMsg_( - const RpcReqMsg_& x) -{ - m_uuid = x.m_uuid; - - - m_header = x.m_header; - - - m_body = x.m_body; - -} - -RpcReqMsg_::RpcReqMsg_( - RpcReqMsg_&& x) noexcept -{ - m_uuid = std::move(x.m_uuid); - - - m_header = std::move(x.m_header); - - - m_body = std::move(x.m_body); - -} - -RpcReqMsg_& RpcReqMsg_::operator =( - const RpcReqMsg_& x) -{ - m_uuid = x.m_uuid; - - - m_header = x.m_header; - - - m_body = x.m_body; - - return *this; -} - -RpcReqMsg_& RpcReqMsg_::operator =( - RpcReqMsg_&& x) noexcept -{ - m_uuid = std::move(x.m_uuid); - - - m_header = std::move(x.m_header); - - - m_body = std::move(x.m_body); - - return *this; -} - -bool RpcReqMsg_::operator ==( - const RpcReqMsg_& x) const -{ - return (m_uuid == x.m_uuid && - m_header == x.m_header && - m_body == x.m_body); -} - -bool RpcReqMsg_::operator !=( - const RpcReqMsg_& x) const -{ - return !(*this == x); -} - -size_t RpcReqMsg_::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return booster_msgs_msg_dds__RpcReqMsg__max_cdr_typesize; -} - -size_t RpcReqMsg_::getCdrSerializedSize( - const RpcReqMsg_& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.uuid().size() + 1; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.header().size() + 1; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.body().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void RpcReqMsg_::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_uuid.c_str(); - - scdr << m_header.c_str(); - - scdr << m_body.c_str(); - -} - -void RpcReqMsg_::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_uuid; - - - - dcdr >> m_header; - - - - dcdr >> m_body; - - -} - - -bool RpcReqMsg_::isKeyDefined() -{ - return false; -} - -void RpcReqMsg_::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member uuid - * @param _uuid New value to be copied in member uuid - */ -void RpcReqMsg_::uuid( - const std::string& _uuid) -{ - m_uuid = _uuid; -} - -/*! - * @brief This function moves the value in member uuid - * @param _uuid New value to be moved in member uuid - */ -void RpcReqMsg_::uuid( - std::string&& _uuid) -{ - m_uuid = std::move(_uuid); -} - -/*! - * @brief This function returns a constant reference to member uuid - * @return Constant reference to member uuid - */ -const std::string& RpcReqMsg_::uuid() const -{ - return m_uuid; -} - -/*! - * @brief This function returns a reference to member uuid - * @return Reference to member uuid - */ -std::string& RpcReqMsg_::uuid() -{ - return m_uuid; -} - - -/*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ -void RpcReqMsg_::header( - const std::string& _header) -{ - m_header = _header; -} - -/*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ -void RpcReqMsg_::header( - std::string&& _header) -{ - m_header = std::move(_header); -} - -/*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ -const std::string& RpcReqMsg_::header() const -{ - return m_header; -} - -/*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ -std::string& RpcReqMsg_::header() -{ - return m_header; -} - - -/*! - * @brief This function copies the value in member body - * @param _body New value to be copied in member body - */ -void RpcReqMsg_::body( - const std::string& _body) -{ - m_body = _body; -} - -/*! - * @brief This function moves the value in member body - * @param _body New value to be moved in member body - */ -void RpcReqMsg_::body( - std::string&& _body) -{ - m_body = std::move(_body); -} - -/*! - * @brief This function returns a constant reference to member body - * @return Constant reference to member body - */ -const std::string& RpcReqMsg_::body() const -{ - return m_body; -} - -/*! - * @brief This function returns a reference to member body - * @return Reference to member body - */ -std::string& RpcReqMsg_::body() -{ - return m_body; -} - - - - - -} // namespace dds_ - - -} // namespace msg - - -} // namespace booster_msgs - diff --git a/mujoco/idl_gen/booster_msgs/RpcReqMsg.h b/mujoco/idl_gen/booster_msgs/RpcReqMsg.h deleted file mode 100644 index 4434f23..0000000 --- a/mujoco/idl_gen/booster_msgs/RpcReqMsg.h +++ /dev/null @@ -1,279 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file RpcReqMsg.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BOOSTER_MSGS_MSG_DDS__RPCREQMSG_H_ -#define _FAST_DDS_GENERATED_BOOSTER_MSGS_MSG_DDS__RPCREQMSG_H_ - - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(RPCREQMSG_SOURCE) -#define RPCREQMSG_DllAPI __declspec( dllexport ) -#else -#define RPCREQMSG_DllAPI __declspec( dllimport ) -#endif // RPCREQMSG_SOURCE -#else -#define RPCREQMSG_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define RPCREQMSG_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -namespace booster_msgs { - namespace msg { - namespace dds_ { - - - /*! - * @brief This class represents the structure RpcReqMsg_ defined by the user in the IDL file. - * @ingroup RpcReqMsg - */ - class RpcReqMsg_ - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport RpcReqMsg_(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~RpcReqMsg_(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object booster_msgs::msg::dds_::RpcReqMsg_ that will be copied. - */ - eProsima_user_DllExport RpcReqMsg_( - const RpcReqMsg_& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object booster_msgs::msg::dds_::RpcReqMsg_ that will be copied. - */ - eProsima_user_DllExport RpcReqMsg_( - RpcReqMsg_&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object booster_msgs::msg::dds_::RpcReqMsg_ that will be copied. - */ - eProsima_user_DllExport RpcReqMsg_& operator =( - const RpcReqMsg_& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object booster_msgs::msg::dds_::RpcReqMsg_ that will be copied. - */ - eProsima_user_DllExport RpcReqMsg_& operator =( - RpcReqMsg_&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x booster_msgs::msg::dds_::RpcReqMsg_ object to compare. - */ - eProsima_user_DllExport bool operator ==( - const RpcReqMsg_& x) const; - - /*! - * @brief Comparison operator. - * @param x booster_msgs::msg::dds_::RpcReqMsg_ object to compare. - */ - eProsima_user_DllExport bool operator !=( - const RpcReqMsg_& x) const; - - /*! - * @brief This function copies the value in member uuid - * @param _uuid New value to be copied in member uuid - */ - eProsima_user_DllExport void uuid( - const std::string& _uuid); - - /*! - * @brief This function moves the value in member uuid - * @param _uuid New value to be moved in member uuid - */ - eProsima_user_DllExport void uuid( - std::string&& _uuid); - - /*! - * @brief This function returns a constant reference to member uuid - * @return Constant reference to member uuid - */ - eProsima_user_DllExport const std::string& uuid() const; - - /*! - * @brief This function returns a reference to member uuid - * @return Reference to member uuid - */ - eProsima_user_DllExport std::string& uuid(); - - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - eProsima_user_DllExport void header( - const std::string& _header); - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - eProsima_user_DllExport void header( - std::string&& _header); - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - eProsima_user_DllExport const std::string& header() const; - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - eProsima_user_DllExport std::string& header(); - - - /*! - * @brief This function copies the value in member body - * @param _body New value to be copied in member body - */ - eProsima_user_DllExport void body( - const std::string& _body); - - /*! - * @brief This function moves the value in member body - * @param _body New value to be moved in member body - */ - eProsima_user_DllExport void body( - std::string&& _body); - - /*! - * @brief This function returns a constant reference to member body - * @return Constant reference to member body - */ - eProsima_user_DllExport const std::string& body() const; - - /*! - * @brief This function returns a reference to member body - * @return Reference to member body - */ - eProsima_user_DllExport std::string& body(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const booster_msgs::msg::dds_::RpcReqMsg_& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - std::string m_uuid; - std::string m_header; - std::string m_body; - - }; - - } // namespace dds_ - } // namespace msg -} // namespace booster_msgs - -#endif // _FAST_DDS_GENERATED_BOOSTER_MSGS_MSG_DDS__RPCREQMSG_H_ - - - diff --git a/mujoco/idl_gen/booster_msgs/RpcReqMsgCdrAux.hpp b/mujoco/idl_gen/booster_msgs/RpcReqMsgCdrAux.hpp deleted file mode 100644 index 951421e..0000000 --- a/mujoco/idl_gen/booster_msgs/RpcReqMsgCdrAux.hpp +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file RpcReqMsgCdrAux.hpp - * This source file contains some definitions of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BOOSTER_MSGS_MSG_DDS__RPCREQMSGCDRAUX_HPP_ -#define _FAST_DDS_GENERATED_BOOSTER_MSGS_MSG_DDS__RPCREQMSGCDRAUX_HPP_ - -#include "RpcReqMsg.h" - -constexpr uint32_t booster_msgs_msg_dds__RpcReqMsg__max_cdr_typesize {780UL}; -constexpr uint32_t booster_msgs_msg_dds__RpcReqMsg__max_key_cdr_typesize {0UL}; - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const booster_msgs::msg::dds_::RpcReqMsg_& data); - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_BOOSTER_MSGS_MSG_DDS__RPCREQMSGCDRAUX_HPP_ - diff --git a/mujoco/idl_gen/booster_msgs/RpcReqMsgCdrAux.ipp b/mujoco/idl_gen/booster_msgs/RpcReqMsgCdrAux.ipp deleted file mode 100644 index bfb0cdc..0000000 --- a/mujoco/idl_gen/booster_msgs/RpcReqMsgCdrAux.ipp +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file RpcReqMsgCdrAux.ipp - * This source file contains some declarations of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BOOSTER_MSGS_MSG_DDS__RPCREQMSGCDRAUX_IPP_ -#define _FAST_DDS_GENERATED_BOOSTER_MSGS_MSG_DDS__RPCREQMSGCDRAUX_IPP_ - -#include "RpcReqMsgCdrAux.hpp" - -#include -#include - - -#include -using namespace eprosima::fastcdr::exception; - -namespace eprosima { -namespace fastcdr { - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const booster_msgs::msg::dds_::RpcReqMsg_& data, - size_t& current_alignment) -{ - using namespace booster_msgs::msg::dds_; - - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.uuid(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.header(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.body(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const booster_msgs::msg::dds_::RpcReqMsg_& data) -{ - using namespace booster_msgs::msg::dds_; - - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.uuid() - << eprosima::fastcdr::MemberId(1) << data.header() - << eprosima::fastcdr::MemberId(2) << data.body() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - booster_msgs::msg::dds_::RpcReqMsg_& data) -{ - using namespace booster_msgs::msg::dds_; - - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.uuid(); - break; - - case 1: - dcdr >> data.header(); - break; - - case 2: - dcdr >> data.body(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const booster_msgs::msg::dds_::RpcReqMsg_& data) -{ - using namespace booster_msgs::msg::dds_; - - static_cast(scdr); - static_cast(data); -} - - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_BOOSTER_MSGS_MSG_DDS__RPCREQMSGCDRAUX_IPP_ - diff --git a/mujoco/idl_gen/booster_msgs/RpcReqMsgPubSubTypes.cxx b/mujoco/idl_gen/booster_msgs/RpcReqMsgPubSubTypes.cxx deleted file mode 100644 index 9190fc5..0000000 --- a/mujoco/idl_gen/booster_msgs/RpcReqMsgPubSubTypes.cxx +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file RpcReqMsgPubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#include - -#include "RpcReqMsgPubSubTypes.h" -#include "RpcReqMsgCdrAux.hpp" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; -using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - -namespace booster_msgs { - namespace msg { - namespace dds_ { - - - RpcReqMsg_PubSubType::RpcReqMsg_PubSubType() - { - setName("booster_msgs::msg::dds_::RpcReqMsg_"); - uint32_t type_size = - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(RpcReqMsg_::getMaxCdrSerializedSize()); - #else - booster_msgs_msg_dds__RpcReqMsg__max_cdr_typesize; - #endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = booster_msgs_msg_dds__RpcReqMsg__max_key_cdr_typesize > 16 ? booster_msgs_msg_dds__RpcReqMsg__max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - RpcReqMsg_PubSubType::~RpcReqMsg_PubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool RpcReqMsg_PubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) - { - RpcReqMsg_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - #if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - #endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length - #if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); - #else - payload->length = static_cast(ser.get_serialized_data_length()); - #endif // FASTCDR_VERSION_MAJOR == 1 - return true; - } - - bool RpcReqMsg_PubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - RpcReqMsg_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN - #if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR - #endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; - } - - std::function RpcReqMsg_PubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) - { - return [data, data_representation]() -> uint32_t - { - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - #else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } - #endif // FASTCDR_VERSION_MAJOR == 1 - }; - } - - void* RpcReqMsg_PubSubType::createData() - { - return reinterpret_cast(new RpcReqMsg_()); - } - - void RpcReqMsg_PubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool RpcReqMsg_PubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - RpcReqMsg_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - booster_msgs_msg_dds__RpcReqMsg__max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); - #if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); - #else - eprosima::fastcdr::serialize_key(ser, *p_type); - #endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || booster_msgs_msg_dds__RpcReqMsg__max_key_cdr_typesize > 16) - { - m_md5.init(); - #if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - #else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); - #endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace dds_ - - - } //End of namespace msg - - -} //End of namespace booster_msgs - diff --git a/mujoco/idl_gen/booster_msgs/RpcReqMsgPubSubTypes.h b/mujoco/idl_gen/booster_msgs/RpcReqMsgPubSubTypes.h deleted file mode 100644 index 317db97..0000000 --- a/mujoco/idl_gen/booster_msgs/RpcReqMsgPubSubTypes.h +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file RpcReqMsgPubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_BOOSTER_MSGS_MSG_DDS__RPCREQMSG_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_BOOSTER_MSGS_MSG_DDS__RPCREQMSG_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "RpcReqMsg.h" - - -#if !defined(GEN_API_VER) || (GEN_API_VER != 2) -#error \ - Generated RpcReqMsg is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace booster_msgs -{ - namespace msg - { - namespace dds_ - { - - - - /*! - * @brief This class represents the TopicDataType of the type RpcReqMsg_ defined by the user in the IDL file. - * @ingroup RpcReqMsg - */ - class RpcReqMsg_PubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef RpcReqMsg_ type; - - eProsima_user_DllExport RpcReqMsg_PubSubType(); - - eProsima_user_DllExport ~RpcReqMsg_PubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - - }; - } - } -} - -#endif // _FAST_DDS_GENERATED_BOOSTER_MSGS_MSG_DDS__RPCREQMSG_PUBSUBTYPES_H_ - diff --git a/mujoco/idl_gen/booster_msgs/RpcRespMsg.cxx b/mujoco/idl_gen/booster_msgs/RpcRespMsg.cxx deleted file mode 100644 index 5ec4726..0000000 --- a/mujoco/idl_gen/booster_msgs/RpcRespMsg.cxx +++ /dev/null @@ -1,371 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file RpcRespMsg.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "RpcRespMsg.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define booster_msgs_msg_dds__RpcRespMsg__max_cdr_typesize 780ULL; - - -namespace booster_msgs { - -namespace msg { - -namespace dds_ { - - - -RpcRespMsg_::RpcRespMsg_() -{ - // /type_d() m_uuid - - // /type_d() m_header - - // /type_d() m_body - - -} - -RpcRespMsg_::~RpcRespMsg_() -{ -} - -RpcRespMsg_::RpcRespMsg_( - const RpcRespMsg_& x) -{ - m_uuid = x.m_uuid; - - - m_header = x.m_header; - - - m_body = x.m_body; - -} - -RpcRespMsg_::RpcRespMsg_( - RpcRespMsg_&& x) noexcept -{ - m_uuid = std::move(x.m_uuid); - - - m_header = std::move(x.m_header); - - - m_body = std::move(x.m_body); - -} - -RpcRespMsg_& RpcRespMsg_::operator =( - const RpcRespMsg_& x) -{ - m_uuid = x.m_uuid; - - - m_header = x.m_header; - - - m_body = x.m_body; - - return *this; -} - -RpcRespMsg_& RpcRespMsg_::operator =( - RpcRespMsg_&& x) noexcept -{ - m_uuid = std::move(x.m_uuid); - - - m_header = std::move(x.m_header); - - - m_body = std::move(x.m_body); - - return *this; -} - -bool RpcRespMsg_::operator ==( - const RpcRespMsg_& x) const -{ - return (m_uuid == x.m_uuid && - m_header == x.m_header && - m_body == x.m_body); -} - -bool RpcRespMsg_::operator !=( - const RpcRespMsg_& x) const -{ - return !(*this == x); -} - -size_t RpcRespMsg_::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return booster_msgs_msg_dds__RpcRespMsg__max_cdr_typesize; -} - -size_t RpcRespMsg_::getCdrSerializedSize( - const RpcRespMsg_& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.uuid().size() + 1; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.header().size() + 1; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.body().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void RpcRespMsg_::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_uuid.c_str(); - - scdr << m_header.c_str(); - - scdr << m_body.c_str(); - -} - -void RpcRespMsg_::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_uuid; - - - - dcdr >> m_header; - - - - dcdr >> m_body; - - -} - - -bool RpcRespMsg_::isKeyDefined() -{ - return false; -} - -void RpcRespMsg_::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member uuid - * @param _uuid New value to be copied in member uuid - */ -void RpcRespMsg_::uuid( - const std::string& _uuid) -{ - m_uuid = _uuid; -} - -/*! - * @brief This function moves the value in member uuid - * @param _uuid New value to be moved in member uuid - */ -void RpcRespMsg_::uuid( - std::string&& _uuid) -{ - m_uuid = std::move(_uuid); -} - -/*! - * @brief This function returns a constant reference to member uuid - * @return Constant reference to member uuid - */ -const std::string& RpcRespMsg_::uuid() const -{ - return m_uuid; -} - -/*! - * @brief This function returns a reference to member uuid - * @return Reference to member uuid - */ -std::string& RpcRespMsg_::uuid() -{ - return m_uuid; -} - - -/*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ -void RpcRespMsg_::header( - const std::string& _header) -{ - m_header = _header; -} - -/*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ -void RpcRespMsg_::header( - std::string&& _header) -{ - m_header = std::move(_header); -} - -/*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ -const std::string& RpcRespMsg_::header() const -{ - return m_header; -} - -/*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ -std::string& RpcRespMsg_::header() -{ - return m_header; -} - - -/*! - * @brief This function copies the value in member body - * @param _body New value to be copied in member body - */ -void RpcRespMsg_::body( - const std::string& _body) -{ - m_body = _body; -} - -/*! - * @brief This function moves the value in member body - * @param _body New value to be moved in member body - */ -void RpcRespMsg_::body( - std::string&& _body) -{ - m_body = std::move(_body); -} - -/*! - * @brief This function returns a constant reference to member body - * @return Constant reference to member body - */ -const std::string& RpcRespMsg_::body() const -{ - return m_body; -} - -/*! - * @brief This function returns a reference to member body - * @return Reference to member body - */ -std::string& RpcRespMsg_::body() -{ - return m_body; -} - - - - - -} // namespace dds_ - - -} // namespace msg - - -} // namespace booster_msgs - diff --git a/mujoco/idl_gen/booster_msgs/RpcRespMsg.h b/mujoco/idl_gen/booster_msgs/RpcRespMsg.h deleted file mode 100644 index 7c534ca..0000000 --- a/mujoco/idl_gen/booster_msgs/RpcRespMsg.h +++ /dev/null @@ -1,279 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file RpcRespMsg.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BOOSTER_MSGS_MSG_DDS__RPCRESPMSG_H_ -#define _FAST_DDS_GENERATED_BOOSTER_MSGS_MSG_DDS__RPCRESPMSG_H_ - - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(RPCRESPMSG_SOURCE) -#define RPCRESPMSG_DllAPI __declspec( dllexport ) -#else -#define RPCRESPMSG_DllAPI __declspec( dllimport ) -#endif // RPCRESPMSG_SOURCE -#else -#define RPCRESPMSG_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define RPCRESPMSG_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -namespace booster_msgs { - namespace msg { - namespace dds_ { - - - /*! - * @brief This class represents the structure RpcRespMsg_ defined by the user in the IDL file. - * @ingroup RpcRespMsg - */ - class RpcRespMsg_ - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport RpcRespMsg_(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~RpcRespMsg_(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object booster_msgs::msg::dds_::RpcRespMsg_ that will be copied. - */ - eProsima_user_DllExport RpcRespMsg_( - const RpcRespMsg_& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object booster_msgs::msg::dds_::RpcRespMsg_ that will be copied. - */ - eProsima_user_DllExport RpcRespMsg_( - RpcRespMsg_&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object booster_msgs::msg::dds_::RpcRespMsg_ that will be copied. - */ - eProsima_user_DllExport RpcRespMsg_& operator =( - const RpcRespMsg_& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object booster_msgs::msg::dds_::RpcRespMsg_ that will be copied. - */ - eProsima_user_DllExport RpcRespMsg_& operator =( - RpcRespMsg_&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x booster_msgs::msg::dds_::RpcRespMsg_ object to compare. - */ - eProsima_user_DllExport bool operator ==( - const RpcRespMsg_& x) const; - - /*! - * @brief Comparison operator. - * @param x booster_msgs::msg::dds_::RpcRespMsg_ object to compare. - */ - eProsima_user_DllExport bool operator !=( - const RpcRespMsg_& x) const; - - /*! - * @brief This function copies the value in member uuid - * @param _uuid New value to be copied in member uuid - */ - eProsima_user_DllExport void uuid( - const std::string& _uuid); - - /*! - * @brief This function moves the value in member uuid - * @param _uuid New value to be moved in member uuid - */ - eProsima_user_DllExport void uuid( - std::string&& _uuid); - - /*! - * @brief This function returns a constant reference to member uuid - * @return Constant reference to member uuid - */ - eProsima_user_DllExport const std::string& uuid() const; - - /*! - * @brief This function returns a reference to member uuid - * @return Reference to member uuid - */ - eProsima_user_DllExport std::string& uuid(); - - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - eProsima_user_DllExport void header( - const std::string& _header); - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - eProsima_user_DllExport void header( - std::string&& _header); - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - eProsima_user_DllExport const std::string& header() const; - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - eProsima_user_DllExport std::string& header(); - - - /*! - * @brief This function copies the value in member body - * @param _body New value to be copied in member body - */ - eProsima_user_DllExport void body( - const std::string& _body); - - /*! - * @brief This function moves the value in member body - * @param _body New value to be moved in member body - */ - eProsima_user_DllExport void body( - std::string&& _body); - - /*! - * @brief This function returns a constant reference to member body - * @return Constant reference to member body - */ - eProsima_user_DllExport const std::string& body() const; - - /*! - * @brief This function returns a reference to member body - * @return Reference to member body - */ - eProsima_user_DllExport std::string& body(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const booster_msgs::msg::dds_::RpcRespMsg_& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - std::string m_uuid; - std::string m_header; - std::string m_body; - - }; - - } // namespace dds_ - } // namespace msg -} // namespace booster_msgs - -#endif // _FAST_DDS_GENERATED_BOOSTER_MSGS_MSG_DDS__RPCRESPMSG_H_ - - - diff --git a/mujoco/idl_gen/booster_msgs/RpcRespMsgCdrAux.hpp b/mujoco/idl_gen/booster_msgs/RpcRespMsgCdrAux.hpp deleted file mode 100644 index dd2d20b..0000000 --- a/mujoco/idl_gen/booster_msgs/RpcRespMsgCdrAux.hpp +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file RpcRespMsgCdrAux.hpp - * This source file contains some definitions of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BOOSTER_MSGS_MSG_DDS__RPCRESPMSGCDRAUX_HPP_ -#define _FAST_DDS_GENERATED_BOOSTER_MSGS_MSG_DDS__RPCRESPMSGCDRAUX_HPP_ - -#include "RpcRespMsg.h" - -constexpr uint32_t booster_msgs_msg_dds__RpcRespMsg__max_cdr_typesize {780UL}; -constexpr uint32_t booster_msgs_msg_dds__RpcRespMsg__max_key_cdr_typesize {0UL}; - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const booster_msgs::msg::dds_::RpcRespMsg_& data); - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_BOOSTER_MSGS_MSG_DDS__RPCRESPMSGCDRAUX_HPP_ - diff --git a/mujoco/idl_gen/booster_msgs/RpcRespMsgCdrAux.ipp b/mujoco/idl_gen/booster_msgs/RpcRespMsgCdrAux.ipp deleted file mode 100644 index 6e7ca94..0000000 --- a/mujoco/idl_gen/booster_msgs/RpcRespMsgCdrAux.ipp +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file RpcRespMsgCdrAux.ipp - * This source file contains some declarations of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BOOSTER_MSGS_MSG_DDS__RPCRESPMSGCDRAUX_IPP_ -#define _FAST_DDS_GENERATED_BOOSTER_MSGS_MSG_DDS__RPCRESPMSGCDRAUX_IPP_ - -#include "RpcRespMsgCdrAux.hpp" - -#include -#include - - -#include -using namespace eprosima::fastcdr::exception; - -namespace eprosima { -namespace fastcdr { - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const booster_msgs::msg::dds_::RpcRespMsg_& data, - size_t& current_alignment) -{ - using namespace booster_msgs::msg::dds_; - - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.uuid(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.header(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.body(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const booster_msgs::msg::dds_::RpcRespMsg_& data) -{ - using namespace booster_msgs::msg::dds_; - - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.uuid() - << eprosima::fastcdr::MemberId(1) << data.header() - << eprosima::fastcdr::MemberId(2) << data.body() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - booster_msgs::msg::dds_::RpcRespMsg_& data) -{ - using namespace booster_msgs::msg::dds_; - - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.uuid(); - break; - - case 1: - dcdr >> data.header(); - break; - - case 2: - dcdr >> data.body(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const booster_msgs::msg::dds_::RpcRespMsg_& data) -{ - using namespace booster_msgs::msg::dds_; - - static_cast(scdr); - static_cast(data); -} - - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_BOOSTER_MSGS_MSG_DDS__RPCRESPMSGCDRAUX_IPP_ - diff --git a/mujoco/idl_gen/booster_msgs/RpcRespMsgPubSubTypes.cxx b/mujoco/idl_gen/booster_msgs/RpcRespMsgPubSubTypes.cxx deleted file mode 100644 index 2116f79..0000000 --- a/mujoco/idl_gen/booster_msgs/RpcRespMsgPubSubTypes.cxx +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file RpcRespMsgPubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#include - -#include "RpcRespMsgPubSubTypes.h" -#include "RpcRespMsgCdrAux.hpp" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; -using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - -namespace booster_msgs { - namespace msg { - namespace dds_ { - - - RpcRespMsg_PubSubType::RpcRespMsg_PubSubType() - { - setName("booster_msgs::msg::dds_::RpcRespMsg_"); - uint32_t type_size = - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(RpcRespMsg_::getMaxCdrSerializedSize()); - #else - booster_msgs_msg_dds__RpcRespMsg__max_cdr_typesize; - #endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = booster_msgs_msg_dds__RpcRespMsg__max_key_cdr_typesize > 16 ? booster_msgs_msg_dds__RpcRespMsg__max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - RpcRespMsg_PubSubType::~RpcRespMsg_PubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool RpcRespMsg_PubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) - { - RpcRespMsg_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - #if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - #endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length - #if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); - #else - payload->length = static_cast(ser.get_serialized_data_length()); - #endif // FASTCDR_VERSION_MAJOR == 1 - return true; - } - - bool RpcRespMsg_PubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - RpcRespMsg_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN - #if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR - #endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; - } - - std::function RpcRespMsg_PubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) - { - return [data, data_representation]() -> uint32_t - { - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - #else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } - #endif // FASTCDR_VERSION_MAJOR == 1 - }; - } - - void* RpcRespMsg_PubSubType::createData() - { - return reinterpret_cast(new RpcRespMsg_()); - } - - void RpcRespMsg_PubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool RpcRespMsg_PubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - RpcRespMsg_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - booster_msgs_msg_dds__RpcRespMsg__max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); - #if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); - #else - eprosima::fastcdr::serialize_key(ser, *p_type); - #endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || booster_msgs_msg_dds__RpcRespMsg__max_key_cdr_typesize > 16) - { - m_md5.init(); - #if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - #else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); - #endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace dds_ - - - } //End of namespace msg - - -} //End of namespace booster_msgs - diff --git a/mujoco/idl_gen/booster_msgs/RpcRespMsgPubSubTypes.h b/mujoco/idl_gen/booster_msgs/RpcRespMsgPubSubTypes.h deleted file mode 100644 index 41c5634..0000000 --- a/mujoco/idl_gen/booster_msgs/RpcRespMsgPubSubTypes.h +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file RpcRespMsgPubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_BOOSTER_MSGS_MSG_DDS__RPCRESPMSG_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_BOOSTER_MSGS_MSG_DDS__RPCRESPMSG_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "RpcRespMsg.h" - - -#if !defined(GEN_API_VER) || (GEN_API_VER != 2) -#error \ - Generated RpcRespMsg is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace booster_msgs -{ - namespace msg - { - namespace dds_ - { - - - - /*! - * @brief This class represents the TopicDataType of the type RpcRespMsg_ defined by the user in the IDL file. - * @ingroup RpcRespMsg - */ - class RpcRespMsg_PubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef RpcRespMsg_ type; - - eProsima_user_DllExport RpcRespMsg_PubSubType(); - - eProsima_user_DllExport ~RpcRespMsg_PubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - - }; - } - } -} - -#endif // _FAST_DDS_GENERATED_BOOSTER_MSGS_MSG_DDS__RPCRESPMSG_PUBSUBTYPES_H_ - diff --git a/mujoco/idl_gen/builtin_interfaces/Time.cxx b/mujoco/idl_gen/builtin_interfaces/Time.cxx deleted file mode 100644 index 7766fbe..0000000 --- a/mujoco/idl_gen/builtin_interfaces/Time.cxx +++ /dev/null @@ -1,288 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Time.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Time.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define builtin_interfaces_msg_dds__Time__max_cdr_typesize 8ULL; - - -namespace builtin_interfaces { - -namespace msg { - -namespace dds_ { - - - -Time_::Time_() -{ - // long m_sec - m_sec = 0; - // unsigned long m_nanosec - m_nanosec = 0; - -} - -Time_::~Time_() -{ -} - -Time_::Time_( - const Time_& x) -{ - m_sec = x.m_sec; - - - m_nanosec = x.m_nanosec; - -} - -Time_::Time_( - Time_&& x) noexcept -{ - m_sec = x.m_sec; - - - m_nanosec = x.m_nanosec; - -} - -Time_& Time_::operator =( - const Time_& x) -{ - m_sec = x.m_sec; - - - m_nanosec = x.m_nanosec; - - return *this; -} - -Time_& Time_::operator =( - Time_&& x) noexcept -{ - m_sec = x.m_sec; - - - m_nanosec = x.m_nanosec; - - return *this; -} - -bool Time_::operator ==( - const Time_& x) const -{ - return (m_sec == x.m_sec && - m_nanosec == x.m_nanosec); -} - -bool Time_::operator !=( - const Time_& x) const -{ - return !(*this == x); -} - -size_t Time_::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return builtin_interfaces_msg_dds__Time__max_cdr_typesize; -} - -size_t Time_::getCdrSerializedSize( - const Time_& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void Time_::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_sec; - - scdr << m_nanosec; - -} - -void Time_::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_sec; - - - - dcdr >> m_nanosec; - - -} - - -bool Time_::isKeyDefined() -{ - return false; -} - -void Time_::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member sec - * @param _sec New value for member sec - */ -void Time_::sec( - int32_t _sec) -{ - m_sec = _sec; -} - -/*! - * @brief This function returns the value of member sec - * @return Value of member sec - */ -int32_t Time_::sec() const -{ - return m_sec; -} - -/*! - * @brief This function returns a reference to member sec - * @return Reference to member sec - */ -int32_t& Time_::sec() -{ - return m_sec; -} - - -/*! - * @brief This function sets a value in member nanosec - * @param _nanosec New value for member nanosec - */ -void Time_::nanosec( - uint32_t _nanosec) -{ - m_nanosec = _nanosec; -} - -/*! - * @brief This function returns the value of member nanosec - * @return Value of member nanosec - */ -uint32_t Time_::nanosec() const -{ - return m_nanosec; -} - -/*! - * @brief This function returns a reference to member nanosec - * @return Reference to member nanosec - */ -uint32_t& Time_::nanosec() -{ - return m_nanosec; -} - - - - - -} // namespace dds_ - - -} // namespace msg - - -} // namespace builtin_interfaces - diff --git a/mujoco/idl_gen/builtin_interfaces/Time.h b/mujoco/idl_gen/builtin_interfaces/Time.h deleted file mode 100644 index 7296ac0..0000000 --- a/mujoco/idl_gen/builtin_interfaces/Time.h +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Time.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIME_H_ -#define _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIME_H_ - - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TIME_SOURCE) -#define TIME_DllAPI __declspec( dllexport ) -#else -#define TIME_DllAPI __declspec( dllimport ) -#endif // TIME_SOURCE -#else -#define TIME_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define TIME_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -namespace builtin_interfaces { - namespace msg { - namespace dds_ { - - - /*! - * @brief This class represents the structure Time_ defined by the user in the IDL file. - * @ingroup Time - */ - class Time_ - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Time_(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Time_(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object builtin_interfaces::msg::dds_::Time_ that will be copied. - */ - eProsima_user_DllExport Time_( - const Time_& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object builtin_interfaces::msg::dds_::Time_ that will be copied. - */ - eProsima_user_DllExport Time_( - Time_&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object builtin_interfaces::msg::dds_::Time_ that will be copied. - */ - eProsima_user_DllExport Time_& operator =( - const Time_& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object builtin_interfaces::msg::dds_::Time_ that will be copied. - */ - eProsima_user_DllExport Time_& operator =( - Time_&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x builtin_interfaces::msg::dds_::Time_ object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Time_& x) const; - - /*! - * @brief Comparison operator. - * @param x builtin_interfaces::msg::dds_::Time_ object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Time_& x) const; - - /*! - * @brief This function sets a value in member sec - * @param _sec New value for member sec - */ - eProsima_user_DllExport void sec( - int32_t _sec); - - /*! - * @brief This function returns the value of member sec - * @return Value of member sec - */ - eProsima_user_DllExport int32_t sec() const; - - /*! - * @brief This function returns a reference to member sec - * @return Reference to member sec - */ - eProsima_user_DllExport int32_t& sec(); - - - /*! - * @brief This function sets a value in member nanosec - * @param _nanosec New value for member nanosec - */ - eProsima_user_DllExport void nanosec( - uint32_t _nanosec); - - /*! - * @brief This function returns the value of member nanosec - * @return Value of member nanosec - */ - eProsima_user_DllExport uint32_t nanosec() const; - - /*! - * @brief This function returns a reference to member nanosec - * @return Reference to member nanosec - */ - eProsima_user_DllExport uint32_t& nanosec(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const builtin_interfaces::msg::dds_::Time_& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - int32_t m_sec; - uint32_t m_nanosec; - - }; - - } // namespace dds_ - } // namespace msg -} // namespace builtin_interfaces - -#endif // _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIME_H_ - - - diff --git a/mujoco/idl_gen/builtin_interfaces/TimeCdrAux.hpp b/mujoco/idl_gen/builtin_interfaces/TimeCdrAux.hpp deleted file mode 100644 index 2f50163..0000000 --- a/mujoco/idl_gen/builtin_interfaces/TimeCdrAux.hpp +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TimeCdrAux.hpp - * This source file contains some definitions of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIMECDRAUX_HPP_ -#define _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIMECDRAUX_HPP_ - -#include "Time.h" - -constexpr uint32_t builtin_interfaces_msg_dds__Time__max_cdr_typesize {8UL}; -constexpr uint32_t builtin_interfaces_msg_dds__Time__max_key_cdr_typesize {0UL}; - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const builtin_interfaces::msg::dds_::Time_& data); - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIMECDRAUX_HPP_ - diff --git a/mujoco/idl_gen/builtin_interfaces/TimeCdrAux.ipp b/mujoco/idl_gen/builtin_interfaces/TimeCdrAux.ipp deleted file mode 100644 index 4b1d45b..0000000 --- a/mujoco/idl_gen/builtin_interfaces/TimeCdrAux.ipp +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TimeCdrAux.ipp - * This source file contains some declarations of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIMECDRAUX_IPP_ -#define _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIMECDRAUX_IPP_ - -#include "TimeCdrAux.hpp" - -#include -#include - - -#include -using namespace eprosima::fastcdr::exception; - -namespace eprosima { -namespace fastcdr { - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const builtin_interfaces::msg::dds_::Time_& data, - size_t& current_alignment) -{ - using namespace builtin_interfaces::msg::dds_; - - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.sec(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.nanosec(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const builtin_interfaces::msg::dds_::Time_& data) -{ - using namespace builtin_interfaces::msg::dds_; - - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.sec() - << eprosima::fastcdr::MemberId(1) << data.nanosec() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - builtin_interfaces::msg::dds_::Time_& data) -{ - using namespace builtin_interfaces::msg::dds_; - - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.sec(); - break; - - case 1: - dcdr >> data.nanosec(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const builtin_interfaces::msg::dds_::Time_& data) -{ - using namespace builtin_interfaces::msg::dds_; - - static_cast(scdr); - static_cast(data); -} - - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIMECDRAUX_IPP_ - diff --git a/mujoco/idl_gen/builtin_interfaces/TimePubSubTypes.cxx b/mujoco/idl_gen/builtin_interfaces/TimePubSubTypes.cxx deleted file mode 100644 index e0de1ac..0000000 --- a/mujoco/idl_gen/builtin_interfaces/TimePubSubTypes.cxx +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TimePubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#include - -#include "TimePubSubTypes.h" -#include "TimeCdrAux.hpp" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; -using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - -namespace builtin_interfaces { - namespace msg { - namespace dds_ { - - - Time_PubSubType::Time_PubSubType() - { - setName("builtin_interfaces::msg::dds_::Time_"); - uint32_t type_size = - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(Time_::getMaxCdrSerializedSize()); - #else - builtin_interfaces_msg_dds__Time__max_cdr_typesize; - #endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = builtin_interfaces_msg_dds__Time__max_key_cdr_typesize > 16 ? builtin_interfaces_msg_dds__Time__max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - Time_PubSubType::~Time_PubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool Time_PubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) - { - Time_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - #if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - #endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length - #if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); - #else - payload->length = static_cast(ser.get_serialized_data_length()); - #endif // FASTCDR_VERSION_MAJOR == 1 - return true; - } - - bool Time_PubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - Time_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN - #if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR - #endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; - } - - std::function Time_PubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) - { - return [data, data_representation]() -> uint32_t - { - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - #else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } - #endif // FASTCDR_VERSION_MAJOR == 1 - }; - } - - void* Time_PubSubType::createData() - { - return reinterpret_cast(new Time_()); - } - - void Time_PubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool Time_PubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - Time_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - builtin_interfaces_msg_dds__Time__max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); - #if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); - #else - eprosima::fastcdr::serialize_key(ser, *p_type); - #endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || builtin_interfaces_msg_dds__Time__max_key_cdr_typesize > 16) - { - m_md5.init(); - #if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - #else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); - #endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace dds_ - - - } //End of namespace msg - - -} //End of namespace builtin_interfaces - diff --git a/mujoco/idl_gen/builtin_interfaces/TimePubSubTypes.h b/mujoco/idl_gen/builtin_interfaces/TimePubSubTypes.h deleted file mode 100644 index ae14992..0000000 --- a/mujoco/idl_gen/builtin_interfaces/TimePubSubTypes.h +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TimePubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIME_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIME_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "Time.h" - - -#if !defined(GEN_API_VER) || (GEN_API_VER != 2) -#error \ - Generated Time is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace builtin_interfaces -{ - namespace msg - { - namespace dds_ - { - - - - #ifndef SWIG - namespace detail { - - template - struct Time__rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - - }; - - struct Time__f - { - typedef uint32_t Time_::* type; - friend constexpr type get( - Time__f); - }; - - template struct Time__rob; - - template - inline size_t constexpr Time__offset_of() - { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } - - } // namespace detail - #endif // ifndef SWIG - - - /*! - * @brief This class represents the TopicDataType of the type Time_ defined by the user in the IDL file. - * @ingroup Time - */ - class Time_PubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef Time_ type; - - eProsima_user_DllExport Time_PubSubType(); - - eProsima_user_DllExport ~Time_PubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return is_plain_xcdrv1_impl(); - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) - { - return is_plain_xcdrv2_impl(); - } - else - { - return is_plain_xcdrv1_impl(); - } - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) Time_(); - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - - private: - - static constexpr bool is_plain_xcdrv1_impl() - { - return 8ULL == - (detail::Time__offset_of() + - sizeof(uint32_t)); - } - - static constexpr bool is_plain_xcdrv2_impl() - { - return 8ULL == - (detail::Time__offset_of() + - sizeof(uint32_t)); - } - - }; - } - } -} - -#endif // _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_DDS__TIME_PUBSUBTYPES_H_ - diff --git a/mujoco/idl_gen/geometry_msgs/Point.cxx b/mujoco/idl_gen/geometry_msgs/Point.cxx deleted file mode 100644 index 8f0e5d3..0000000 --- a/mujoco/idl_gen/geometry_msgs/Point.cxx +++ /dev/null @@ -1,341 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Point.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Point.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define geometry_msgs_msg_dds__Point__max_cdr_typesize 24ULL; - - -namespace geometry_msgs { - -namespace msg { - -namespace dds_ { - - - -Point_::Point_() -{ - // double m_x - m_x = 0.0; - // double m_y - m_y = 0.0; - // double m_z - m_z = 0.0; - -} - -Point_::~Point_() -{ -} - -Point_::Point_( - const Point_& x) -{ - m_x = x.m_x; - - - m_y = x.m_y; - - - m_z = x.m_z; - -} - -Point_::Point_( - Point_&& x) noexcept -{ - m_x = x.m_x; - - - m_y = x.m_y; - - - m_z = x.m_z; - -} - -Point_& Point_::operator =( - const Point_& x) -{ - m_x = x.m_x; - - - m_y = x.m_y; - - - m_z = x.m_z; - - return *this; -} - -Point_& Point_::operator =( - Point_&& x) noexcept -{ - m_x = x.m_x; - - - m_y = x.m_y; - - - m_z = x.m_z; - - return *this; -} - -bool Point_::operator ==( - const Point_& x) const -{ - return (m_x == x.m_x && - m_y == x.m_y && - m_z == x.m_z); -} - -bool Point_::operator !=( - const Point_& x) const -{ - return !(*this == x); -} - -size_t Point_::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return geometry_msgs_msg_dds__Point__max_cdr_typesize; -} - -size_t Point_::getCdrSerializedSize( - const Point_& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - return current_alignment - initial_alignment; -} - - -void Point_::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_x; - - scdr << m_y; - - scdr << m_z; - -} - -void Point_::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_x; - - - - dcdr >> m_y; - - - - dcdr >> m_z; - - -} - - -bool Point_::isKeyDefined() -{ - return false; -} - -void Point_::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member x - * @param _x New value for member x - */ -void Point_::x( - double _x) -{ - m_x = _x; -} - -/*! - * @brief This function returns the value of member x - * @return Value of member x - */ -double Point_::x() const -{ - return m_x; -} - -/*! - * @brief This function returns a reference to member x - * @return Reference to member x - */ -double& Point_::x() -{ - return m_x; -} - - -/*! - * @brief This function sets a value in member y - * @param _y New value for member y - */ -void Point_::y( - double _y) -{ - m_y = _y; -} - -/*! - * @brief This function returns the value of member y - * @return Value of member y - */ -double Point_::y() const -{ - return m_y; -} - -/*! - * @brief This function returns a reference to member y - * @return Reference to member y - */ -double& Point_::y() -{ - return m_y; -} - - -/*! - * @brief This function sets a value in member z - * @param _z New value for member z - */ -void Point_::z( - double _z) -{ - m_z = _z; -} - -/*! - * @brief This function returns the value of member z - * @return Value of member z - */ -double Point_::z() const -{ - return m_z; -} - -/*! - * @brief This function returns a reference to member z - * @return Reference to member z - */ -double& Point_::z() -{ - return m_z; -} - - - - - -} // namespace dds_ - - -} // namespace msg - - -} // namespace geometry_msgs - diff --git a/mujoco/idl_gen/geometry_msgs/Point.h b/mujoco/idl_gen/geometry_msgs/Point.h deleted file mode 100644 index 287bf59..0000000 --- a/mujoco/idl_gen/geometry_msgs/Point.h +++ /dev/null @@ -1,258 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Point.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINT_H_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINT_H_ - - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(POINT_SOURCE) -#define POINT_DllAPI __declspec( dllexport ) -#else -#define POINT_DllAPI __declspec( dllimport ) -#endif // POINT_SOURCE -#else -#define POINT_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define POINT_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -namespace geometry_msgs { - namespace msg { - namespace dds_ { - - - /*! - * @brief This class represents the structure Point_ defined by the user in the IDL file. - * @ingroup Point - */ - class Point_ - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Point_(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Point_(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object geometry_msgs::msg::dds_::Point_ that will be copied. - */ - eProsima_user_DllExport Point_( - const Point_& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object geometry_msgs::msg::dds_::Point_ that will be copied. - */ - eProsima_user_DllExport Point_( - Point_&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object geometry_msgs::msg::dds_::Point_ that will be copied. - */ - eProsima_user_DllExport Point_& operator =( - const Point_& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object geometry_msgs::msg::dds_::Point_ that will be copied. - */ - eProsima_user_DllExport Point_& operator =( - Point_&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::dds_::Point_ object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Point_& x) const; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::dds_::Point_ object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Point_& x) const; - - /*! - * @brief This function sets a value in member x - * @param _x New value for member x - */ - eProsima_user_DllExport void x( - double _x); - - /*! - * @brief This function returns the value of member x - * @return Value of member x - */ - eProsima_user_DllExport double x() const; - - /*! - * @brief This function returns a reference to member x - * @return Reference to member x - */ - eProsima_user_DllExport double& x(); - - - /*! - * @brief This function sets a value in member y - * @param _y New value for member y - */ - eProsima_user_DllExport void y( - double _y); - - /*! - * @brief This function returns the value of member y - * @return Value of member y - */ - eProsima_user_DllExport double y() const; - - /*! - * @brief This function returns a reference to member y - * @return Reference to member y - */ - eProsima_user_DllExport double& y(); - - - /*! - * @brief This function sets a value in member z - * @param _z New value for member z - */ - eProsima_user_DllExport void z( - double _z); - - /*! - * @brief This function returns the value of member z - * @return Value of member z - */ - eProsima_user_DllExport double z() const; - - /*! - * @brief This function returns a reference to member z - * @return Reference to member z - */ - eProsima_user_DllExport double& z(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const geometry_msgs::msg::dds_::Point_& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - double m_x; - double m_y; - double m_z; - - }; - - } // namespace dds_ - } // namespace msg -} // namespace geometry_msgs - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINT_H_ - - - diff --git a/mujoco/idl_gen/geometry_msgs/PointCdrAux.hpp b/mujoco/idl_gen/geometry_msgs/PointCdrAux.hpp deleted file mode 100644 index 73ae762..0000000 --- a/mujoco/idl_gen/geometry_msgs/PointCdrAux.hpp +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file PointCdrAux.hpp - * This source file contains some definitions of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINTCDRAUX_HPP_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINTCDRAUX_HPP_ - -#include "Point.h" - -constexpr uint32_t geometry_msgs_msg_dds__Point__max_cdr_typesize {24UL}; -constexpr uint32_t geometry_msgs_msg_dds__Point__max_key_cdr_typesize {0UL}; - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::Point_& data); - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINTCDRAUX_HPP_ - diff --git a/mujoco/idl_gen/geometry_msgs/PointCdrAux.ipp b/mujoco/idl_gen/geometry_msgs/PointCdrAux.ipp deleted file mode 100644 index 787b2fc..0000000 --- a/mujoco/idl_gen/geometry_msgs/PointCdrAux.ipp +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file PointCdrAux.ipp - * This source file contains some declarations of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINTCDRAUX_IPP_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINTCDRAUX_IPP_ - -#include "PointCdrAux.hpp" - -#include -#include - - -#include -using namespace eprosima::fastcdr::exception; - -namespace eprosima { -namespace fastcdr { - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const geometry_msgs::msg::dds_::Point_& data, - size_t& current_alignment) -{ - using namespace geometry_msgs::msg::dds_; - - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.x(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.y(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.z(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::Point_& data) -{ - using namespace geometry_msgs::msg::dds_; - - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.x() - << eprosima::fastcdr::MemberId(1) << data.y() - << eprosima::fastcdr::MemberId(2) << data.z() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - geometry_msgs::msg::dds_::Point_& data) -{ - using namespace geometry_msgs::msg::dds_; - - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.x(); - break; - - case 1: - dcdr >> data.y(); - break; - - case 2: - dcdr >> data.z(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::Point_& data) -{ - using namespace geometry_msgs::msg::dds_; - - static_cast(scdr); - static_cast(data); -} - - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINTCDRAUX_IPP_ - diff --git a/mujoco/idl_gen/geometry_msgs/PointPubSubTypes.cxx b/mujoco/idl_gen/geometry_msgs/PointPubSubTypes.cxx deleted file mode 100644 index 6a8a7f5..0000000 --- a/mujoco/idl_gen/geometry_msgs/PointPubSubTypes.cxx +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file PointPubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#include - -#include "PointPubSubTypes.h" -#include "PointCdrAux.hpp" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; -using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - -namespace geometry_msgs { - namespace msg { - namespace dds_ { - - - Point_PubSubType::Point_PubSubType() - { - setName("geometry_msgs::msg::dds_::Point_"); - uint32_t type_size = - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(Point_::getMaxCdrSerializedSize()); - #else - geometry_msgs_msg_dds__Point__max_cdr_typesize; - #endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = geometry_msgs_msg_dds__Point__max_key_cdr_typesize > 16 ? geometry_msgs_msg_dds__Point__max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - Point_PubSubType::~Point_PubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool Point_PubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) - { - Point_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - #if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - #endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length - #if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); - #else - payload->length = static_cast(ser.get_serialized_data_length()); - #endif // FASTCDR_VERSION_MAJOR == 1 - return true; - } - - bool Point_PubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - Point_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN - #if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR - #endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; - } - - std::function Point_PubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) - { - return [data, data_representation]() -> uint32_t - { - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - #else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } - #endif // FASTCDR_VERSION_MAJOR == 1 - }; - } - - void* Point_PubSubType::createData() - { - return reinterpret_cast(new Point_()); - } - - void Point_PubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool Point_PubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - Point_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - geometry_msgs_msg_dds__Point__max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); - #if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); - #else - eprosima::fastcdr::serialize_key(ser, *p_type); - #endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || geometry_msgs_msg_dds__Point__max_key_cdr_typesize > 16) - { - m_md5.init(); - #if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - #else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); - #endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace dds_ - - - } //End of namespace msg - - -} //End of namespace geometry_msgs - diff --git a/mujoco/idl_gen/geometry_msgs/PointPubSubTypes.h b/mujoco/idl_gen/geometry_msgs/PointPubSubTypes.h deleted file mode 100644 index 467cf6e..0000000 --- a/mujoco/idl_gen/geometry_msgs/PointPubSubTypes.h +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file PointPubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINT_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINT_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "Point.h" - - -#if !defined(GEN_API_VER) || (GEN_API_VER != 2) -#error \ - Generated Point is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace geometry_msgs -{ - namespace msg - { - namespace dds_ - { - - - - #ifndef SWIG - namespace detail { - - template - struct Point__rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - - }; - - struct Point__f - { - typedef double Point_::* type; - friend constexpr type get( - Point__f); - }; - - template struct Point__rob; - - template - inline size_t constexpr Point__offset_of() - { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } - - } // namespace detail - #endif // ifndef SWIG - - - /*! - * @brief This class represents the TopicDataType of the type Point_ defined by the user in the IDL file. - * @ingroup Point - */ - class Point_PubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef Point_ type; - - eProsima_user_DllExport Point_PubSubType(); - - eProsima_user_DllExport ~Point_PubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return is_plain_xcdrv1_impl(); - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) - { - return is_plain_xcdrv2_impl(); - } - else - { - return is_plain_xcdrv1_impl(); - } - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) Point_(); - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - - private: - - static constexpr bool is_plain_xcdrv1_impl() - { - return 24ULL == - (detail::Point__offset_of() + - sizeof(double)); - } - - static constexpr bool is_plain_xcdrv2_impl() - { - return 24ULL == - (detail::Point__offset_of() + - sizeof(double)); - } - - }; - } - } -} - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POINT_PUBSUBTYPES_H_ - diff --git a/mujoco/idl_gen/geometry_msgs/Pose.cxx b/mujoco/idl_gen/geometry_msgs/Pose.cxx deleted file mode 100644 index 8e30257..0000000 --- a/mujoco/idl_gen/geometry_msgs/Pose.cxx +++ /dev/null @@ -1,310 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Pose.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Pose.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define geometry_msgs_msg_dds__Quaternion__max_cdr_typesize 32ULL; -#define geometry_msgs_msg_dds__Point__max_cdr_typesize 24ULL; -#define geometry_msgs_msg_dds__Pose__max_cdr_typesize 56ULL; - - -namespace geometry_msgs { - -namespace msg { - -namespace dds_ { - - - -Pose_::Pose_() -{ - // geometry_msgs::msg::dds_::Point_ m_position - - // geometry_msgs::msg::dds_::Quaternion_ m_orientation - - -} - -Pose_::~Pose_() -{ -} - -Pose_::Pose_( - const Pose_& x) -{ - m_position = x.m_position; - - - m_orientation = x.m_orientation; - -} - -Pose_::Pose_( - Pose_&& x) noexcept -{ - m_position = std::move(x.m_position); - - - m_orientation = std::move(x.m_orientation); - -} - -Pose_& Pose_::operator =( - const Pose_& x) -{ - m_position = x.m_position; - - - m_orientation = x.m_orientation; - - return *this; -} - -Pose_& Pose_::operator =( - Pose_&& x) noexcept -{ - m_position = std::move(x.m_position); - - - m_orientation = std::move(x.m_orientation); - - return *this; -} - -bool Pose_::operator ==( - const Pose_& x) const -{ - return (m_position == x.m_position && - m_orientation == x.m_orientation); -} - -bool Pose_::operator !=( - const Pose_& x) const -{ - return !(*this == x); -} - -size_t Pose_::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return geometry_msgs_msg_dds__Pose__max_cdr_typesize; -} - -size_t Pose_::getCdrSerializedSize( - const Pose_& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += geometry_msgs::msg::dds_::Point_::getCdrSerializedSize(data.position(), current_alignment); - - - current_alignment += geometry_msgs::msg::dds_::Quaternion_::getCdrSerializedSize(data.orientation(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void Pose_::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_position; - - scdr << m_orientation; - -} - -void Pose_::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_position; - - - - dcdr >> m_orientation; - - -} - - -bool Pose_::isKeyDefined() -{ - return false; -} - -void Pose_::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member position - * @param _position New value to be copied in member position - */ -void Pose_::position( - const geometry_msgs::msg::dds_::Point_& _position) -{ - m_position = _position; -} - -/*! - * @brief This function moves the value in member position - * @param _position New value to be moved in member position - */ -void Pose_::position( - geometry_msgs::msg::dds_::Point_&& _position) -{ - m_position = std::move(_position); -} - -/*! - * @brief This function returns a constant reference to member position - * @return Constant reference to member position - */ -const geometry_msgs::msg::dds_::Point_& Pose_::position() const -{ - return m_position; -} - -/*! - * @brief This function returns a reference to member position - * @return Reference to member position - */ -geometry_msgs::msg::dds_::Point_& Pose_::position() -{ - return m_position; -} - - -/*! - * @brief This function copies the value in member orientation - * @param _orientation New value to be copied in member orientation - */ -void Pose_::orientation( - const geometry_msgs::msg::dds_::Quaternion_& _orientation) -{ - m_orientation = _orientation; -} - -/*! - * @brief This function moves the value in member orientation - * @param _orientation New value to be moved in member orientation - */ -void Pose_::orientation( - geometry_msgs::msg::dds_::Quaternion_&& _orientation) -{ - m_orientation = std::move(_orientation); -} - -/*! - * @brief This function returns a constant reference to member orientation - * @return Constant reference to member orientation - */ -const geometry_msgs::msg::dds_::Quaternion_& Pose_::orientation() const -{ - return m_orientation; -} - -/*! - * @brief This function returns a reference to member orientation - * @return Reference to member orientation - */ -geometry_msgs::msg::dds_::Quaternion_& Pose_::orientation() -{ - return m_orientation; -} - - - - - -} // namespace dds_ - - -} // namespace msg - - -} // namespace geometry_msgs - diff --git a/mujoco/idl_gen/geometry_msgs/Pose.h b/mujoco/idl_gen/geometry_msgs/Pose.h deleted file mode 100644 index 4a01c24..0000000 --- a/mujoco/idl_gen/geometry_msgs/Pose.h +++ /dev/null @@ -1,253 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Pose.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSE_H_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSE_H_ - -#include "Quaternion.h" -#include "Point.h" - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(POSE_SOURCE) -#define POSE_DllAPI __declspec( dllexport ) -#else -#define POSE_DllAPI __declspec( dllimport ) -#endif // POSE_SOURCE -#else -#define POSE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define POSE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -namespace geometry_msgs { - namespace msg { - namespace dds_ { - - - /*! - * @brief This class represents the structure Pose_ defined by the user in the IDL file. - * @ingroup Pose - */ - class Pose_ - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Pose_(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Pose_(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object geometry_msgs::msg::dds_::Pose_ that will be copied. - */ - eProsima_user_DllExport Pose_( - const Pose_& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object geometry_msgs::msg::dds_::Pose_ that will be copied. - */ - eProsima_user_DllExport Pose_( - Pose_&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object geometry_msgs::msg::dds_::Pose_ that will be copied. - */ - eProsima_user_DllExport Pose_& operator =( - const Pose_& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object geometry_msgs::msg::dds_::Pose_ that will be copied. - */ - eProsima_user_DllExport Pose_& operator =( - Pose_&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::dds_::Pose_ object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Pose_& x) const; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::dds_::Pose_ object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Pose_& x) const; - - /*! - * @brief This function copies the value in member position - * @param _position New value to be copied in member position - */ - eProsima_user_DllExport void position( - const geometry_msgs::msg::dds_::Point_& _position); - - /*! - * @brief This function moves the value in member position - * @param _position New value to be moved in member position - */ - eProsima_user_DllExport void position( - geometry_msgs::msg::dds_::Point_&& _position); - - /*! - * @brief This function returns a constant reference to member position - * @return Constant reference to member position - */ - eProsima_user_DllExport const geometry_msgs::msg::dds_::Point_& position() const; - - /*! - * @brief This function returns a reference to member position - * @return Reference to member position - */ - eProsima_user_DllExport geometry_msgs::msg::dds_::Point_& position(); - - - /*! - * @brief This function copies the value in member orientation - * @param _orientation New value to be copied in member orientation - */ - eProsima_user_DllExport void orientation( - const geometry_msgs::msg::dds_::Quaternion_& _orientation); - - /*! - * @brief This function moves the value in member orientation - * @param _orientation New value to be moved in member orientation - */ - eProsima_user_DllExport void orientation( - geometry_msgs::msg::dds_::Quaternion_&& _orientation); - - /*! - * @brief This function returns a constant reference to member orientation - * @return Constant reference to member orientation - */ - eProsima_user_DllExport const geometry_msgs::msg::dds_::Quaternion_& orientation() const; - - /*! - * @brief This function returns a reference to member orientation - * @return Reference to member orientation - */ - eProsima_user_DllExport geometry_msgs::msg::dds_::Quaternion_& orientation(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const geometry_msgs::msg::dds_::Pose_& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - geometry_msgs::msg::dds_::Point_ m_position; - geometry_msgs::msg::dds_::Quaternion_ m_orientation; - - }; - - } // namespace dds_ - } // namespace msg -} // namespace geometry_msgs - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSE_H_ - - - diff --git a/mujoco/idl_gen/geometry_msgs/PoseCdrAux.hpp b/mujoco/idl_gen/geometry_msgs/PoseCdrAux.hpp deleted file mode 100644 index a431d3a..0000000 --- a/mujoco/idl_gen/geometry_msgs/PoseCdrAux.hpp +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file PoseCdrAux.hpp - * This source file contains some definitions of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSECDRAUX_HPP_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSECDRAUX_HPP_ - -#include "Pose.h" - -constexpr uint32_t geometry_msgs_msg_dds__Pose__max_cdr_typesize {56UL}; -constexpr uint32_t geometry_msgs_msg_dds__Pose__max_key_cdr_typesize {0UL}; - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::Pose_& data); - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSECDRAUX_HPP_ - diff --git a/mujoco/idl_gen/geometry_msgs/PoseCdrAux.ipp b/mujoco/idl_gen/geometry_msgs/PoseCdrAux.ipp deleted file mode 100644 index ff157bc..0000000 --- a/mujoco/idl_gen/geometry_msgs/PoseCdrAux.ipp +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file PoseCdrAux.ipp - * This source file contains some declarations of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSECDRAUX_IPP_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSECDRAUX_IPP_ - -#include "PoseCdrAux.hpp" - -#include -#include - - -#include -using namespace eprosima::fastcdr::exception; - -namespace eprosima { -namespace fastcdr { - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const geometry_msgs::msg::dds_::Pose_& data, - size_t& current_alignment) -{ - using namespace geometry_msgs::msg::dds_; - - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.position(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.orientation(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::Pose_& data) -{ - using namespace geometry_msgs::msg::dds_; - - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.position() - << eprosima::fastcdr::MemberId(1) << data.orientation() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - geometry_msgs::msg::dds_::Pose_& data) -{ - using namespace geometry_msgs::msg::dds_; - - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.position(); - break; - - case 1: - dcdr >> data.orientation(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::Pose_& data) -{ - using namespace geometry_msgs::msg::dds_; - - static_cast(scdr); - static_cast(data); -} - - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSECDRAUX_IPP_ - diff --git a/mujoco/idl_gen/geometry_msgs/PosePubSubTypes.cxx b/mujoco/idl_gen/geometry_msgs/PosePubSubTypes.cxx deleted file mode 100644 index abce5e0..0000000 --- a/mujoco/idl_gen/geometry_msgs/PosePubSubTypes.cxx +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file PosePubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#include - -#include "PosePubSubTypes.h" -#include "PoseCdrAux.hpp" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; -using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - -namespace geometry_msgs { - namespace msg { - namespace dds_ { - - - Pose_PubSubType::Pose_PubSubType() - { - setName("geometry_msgs::msg::dds_::Pose_"); - uint32_t type_size = - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(Pose_::getMaxCdrSerializedSize()); - #else - geometry_msgs_msg_dds__Pose__max_cdr_typesize; - #endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = geometry_msgs_msg_dds__Pose__max_key_cdr_typesize > 16 ? geometry_msgs_msg_dds__Pose__max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - Pose_PubSubType::~Pose_PubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool Pose_PubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) - { - Pose_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - #if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - #endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length - #if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); - #else - payload->length = static_cast(ser.get_serialized_data_length()); - #endif // FASTCDR_VERSION_MAJOR == 1 - return true; - } - - bool Pose_PubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - Pose_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN - #if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR - #endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; - } - - std::function Pose_PubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) - { - return [data, data_representation]() -> uint32_t - { - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - #else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } - #endif // FASTCDR_VERSION_MAJOR == 1 - }; - } - - void* Pose_PubSubType::createData() - { - return reinterpret_cast(new Pose_()); - } - - void Pose_PubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool Pose_PubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - Pose_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - geometry_msgs_msg_dds__Pose__max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); - #if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); - #else - eprosima::fastcdr::serialize_key(ser, *p_type); - #endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || geometry_msgs_msg_dds__Pose__max_key_cdr_typesize > 16) - { - m_md5.init(); - #if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - #else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); - #endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace dds_ - - - } //End of namespace msg - - -} //End of namespace geometry_msgs - diff --git a/mujoco/idl_gen/geometry_msgs/PosePubSubTypes.h b/mujoco/idl_gen/geometry_msgs/PosePubSubTypes.h deleted file mode 100644 index 1c11f5f..0000000 --- a/mujoco/idl_gen/geometry_msgs/PosePubSubTypes.h +++ /dev/null @@ -1,198 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file PosePubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSE_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSE_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "Pose.h" - -#include "QuaternionPubSubTypes.h" -#include "PointPubSubTypes.h" - -#if !defined(GEN_API_VER) || (GEN_API_VER != 2) -#error \ - Generated Pose is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace geometry_msgs -{ - namespace msg - { - namespace dds_ - { - - - - #ifndef SWIG - namespace detail { - - template - struct Pose__rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - - }; - - struct Pose__f - { - typedef geometry_msgs::msg::dds_::Quaternion_ Pose_::* type; - friend constexpr type get( - Pose__f); - }; - - template struct Pose__rob; - - template - inline size_t constexpr Pose__offset_of() - { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } - - } // namespace detail - #endif // ifndef SWIG - - - /*! - * @brief This class represents the TopicDataType of the type Pose_ defined by the user in the IDL file. - * @ingroup Pose - */ - class Pose_PubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef Pose_ type; - - eProsima_user_DllExport Pose_PubSubType(); - - eProsima_user_DllExport ~Pose_PubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return is_plain_xcdrv1_impl(); - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) - { - return is_plain_xcdrv2_impl(); - } - else - { - return is_plain_xcdrv1_impl(); - } - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) Pose_(); - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - - private: - - static constexpr bool is_plain_xcdrv1_impl() - { - return 56ULL == - (detail::Pose__offset_of() + - sizeof(geometry_msgs::msg::dds_::Quaternion_)); - } - - static constexpr bool is_plain_xcdrv2_impl() - { - return 56ULL == - (detail::Pose__offset_of() + - sizeof(geometry_msgs::msg::dds_::Quaternion_)); - } - - }; - } - } -} - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSE_PUBSUBTYPES_H_ - diff --git a/mujoco/idl_gen/geometry_msgs/PoseWithCovariance.cxx b/mujoco/idl_gen/geometry_msgs/PoseWithCovariance.cxx deleted file mode 100644 index 267c230..0000000 --- a/mujoco/idl_gen/geometry_msgs/PoseWithCovariance.cxx +++ /dev/null @@ -1,313 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file PoseWithCovariance.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "PoseWithCovariance.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define geometry_msgs_msg_dds__Quaternion__max_cdr_typesize 32ULL; -#define geometry_msgs_msg_dds__Point__max_cdr_typesize 24ULL; -#define geometry_msgs_msg_dds__Pose__max_cdr_typesize 56ULL; -#define geometry_msgs_msg_dds__PoseWithCovariance__max_cdr_typesize 344ULL; - - -namespace geometry_msgs { - -namespace msg { - -namespace dds_ { - - - -PoseWithCovariance_::PoseWithCovariance_() -{ - // geometry_msgs::msg::dds_::Pose_ m_pose - - // double m_covariance - memset(&m_covariance, 0, ((36)) * 8); - -} - -PoseWithCovariance_::~PoseWithCovariance_() -{ -} - -PoseWithCovariance_::PoseWithCovariance_( - const PoseWithCovariance_& x) -{ - m_pose = x.m_pose; - - - m_covariance = x.m_covariance; - -} - -PoseWithCovariance_::PoseWithCovariance_( - PoseWithCovariance_&& x) noexcept -{ - m_pose = std::move(x.m_pose); - - - m_covariance = std::move(x.m_covariance); - -} - -PoseWithCovariance_& PoseWithCovariance_::operator =( - const PoseWithCovariance_& x) -{ - m_pose = x.m_pose; - - - m_covariance = x.m_covariance; - - return *this; -} - -PoseWithCovariance_& PoseWithCovariance_::operator =( - PoseWithCovariance_&& x) noexcept -{ - m_pose = std::move(x.m_pose); - - - m_covariance = std::move(x.m_covariance); - - return *this; -} - -bool PoseWithCovariance_::operator ==( - const PoseWithCovariance_& x) const -{ - return (m_pose == x.m_pose && - m_covariance == x.m_covariance); -} - -bool PoseWithCovariance_::operator !=( - const PoseWithCovariance_& x) const -{ - return !(*this == x); -} - -size_t PoseWithCovariance_::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return geometry_msgs_msg_dds__PoseWithCovariance__max_cdr_typesize; -} - -size_t PoseWithCovariance_::getCdrSerializedSize( - const PoseWithCovariance_& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += geometry_msgs::msg::dds_::Pose_::getCdrSerializedSize(data.pose(), current_alignment); - - - current_alignment += (((36)) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - - return current_alignment - initial_alignment; -} - - -void PoseWithCovariance_::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_pose; - - scdr << m_covariance; - - -} - -void PoseWithCovariance_::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_pose; - - - - dcdr >> m_covariance; - - -} - - -bool PoseWithCovariance_::isKeyDefined() -{ - return false; -} - -void PoseWithCovariance_::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member pose - * @param _pose New value to be copied in member pose - */ -void PoseWithCovariance_::pose( - const geometry_msgs::msg::dds_::Pose_& _pose) -{ - m_pose = _pose; -} - -/*! - * @brief This function moves the value in member pose - * @param _pose New value to be moved in member pose - */ -void PoseWithCovariance_::pose( - geometry_msgs::msg::dds_::Pose_&& _pose) -{ - m_pose = std::move(_pose); -} - -/*! - * @brief This function returns a constant reference to member pose - * @return Constant reference to member pose - */ -const geometry_msgs::msg::dds_::Pose_& PoseWithCovariance_::pose() const -{ - return m_pose; -} - -/*! - * @brief This function returns a reference to member pose - * @return Reference to member pose - */ -geometry_msgs::msg::dds_::Pose_& PoseWithCovariance_::pose() -{ - return m_pose; -} - - -/*! - * @brief This function copies the value in member covariance - * @param _covariance New value to be copied in member covariance - */ -void PoseWithCovariance_::covariance( - const std::array& _covariance) -{ - m_covariance = _covariance; -} - -/*! - * @brief This function moves the value in member covariance - * @param _covariance New value to be moved in member covariance - */ -void PoseWithCovariance_::covariance( - std::array&& _covariance) -{ - m_covariance = std::move(_covariance); -} - -/*! - * @brief This function returns a constant reference to member covariance - * @return Constant reference to member covariance - */ -const std::array& PoseWithCovariance_::covariance() const -{ - return m_covariance; -} - -/*! - * @brief This function returns a reference to member covariance - * @return Reference to member covariance - */ -std::array& PoseWithCovariance_::covariance() -{ - return m_covariance; -} - - - - - -} // namespace dds_ - - -} // namespace msg - - -} // namespace geometry_msgs - diff --git a/mujoco/idl_gen/geometry_msgs/PoseWithCovariance.h b/mujoco/idl_gen/geometry_msgs/PoseWithCovariance.h deleted file mode 100644 index eefb9fd..0000000 --- a/mujoco/idl_gen/geometry_msgs/PoseWithCovariance.h +++ /dev/null @@ -1,252 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file PoseWithCovariance.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCE_H_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCE_H_ - -#include "Pose.h" - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(POSEWITHCOVARIANCE_SOURCE) -#define POSEWITHCOVARIANCE_DllAPI __declspec( dllexport ) -#else -#define POSEWITHCOVARIANCE_DllAPI __declspec( dllimport ) -#endif // POSEWITHCOVARIANCE_SOURCE -#else -#define POSEWITHCOVARIANCE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define POSEWITHCOVARIANCE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -namespace geometry_msgs { - namespace msg { - namespace dds_ { - - - /*! - * @brief This class represents the structure PoseWithCovariance_ defined by the user in the IDL file. - * @ingroup PoseWithCovariance - */ - class PoseWithCovariance_ - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport PoseWithCovariance_(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~PoseWithCovariance_(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object geometry_msgs::msg::dds_::PoseWithCovariance_ that will be copied. - */ - eProsima_user_DllExport PoseWithCovariance_( - const PoseWithCovariance_& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object geometry_msgs::msg::dds_::PoseWithCovariance_ that will be copied. - */ - eProsima_user_DllExport PoseWithCovariance_( - PoseWithCovariance_&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object geometry_msgs::msg::dds_::PoseWithCovariance_ that will be copied. - */ - eProsima_user_DllExport PoseWithCovariance_& operator =( - const PoseWithCovariance_& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object geometry_msgs::msg::dds_::PoseWithCovariance_ that will be copied. - */ - eProsima_user_DllExport PoseWithCovariance_& operator =( - PoseWithCovariance_&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::dds_::PoseWithCovariance_ object to compare. - */ - eProsima_user_DllExport bool operator ==( - const PoseWithCovariance_& x) const; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::dds_::PoseWithCovariance_ object to compare. - */ - eProsima_user_DllExport bool operator !=( - const PoseWithCovariance_& x) const; - - /*! - * @brief This function copies the value in member pose - * @param _pose New value to be copied in member pose - */ - eProsima_user_DllExport void pose( - const geometry_msgs::msg::dds_::Pose_& _pose); - - /*! - * @brief This function moves the value in member pose - * @param _pose New value to be moved in member pose - */ - eProsima_user_DllExport void pose( - geometry_msgs::msg::dds_::Pose_&& _pose); - - /*! - * @brief This function returns a constant reference to member pose - * @return Constant reference to member pose - */ - eProsima_user_DllExport const geometry_msgs::msg::dds_::Pose_& pose() const; - - /*! - * @brief This function returns a reference to member pose - * @return Reference to member pose - */ - eProsima_user_DllExport geometry_msgs::msg::dds_::Pose_& pose(); - - - /*! - * @brief This function copies the value in member covariance - * @param _covariance New value to be copied in member covariance - */ - eProsima_user_DllExport void covariance( - const std::array& _covariance); - - /*! - * @brief This function moves the value in member covariance - * @param _covariance New value to be moved in member covariance - */ - eProsima_user_DllExport void covariance( - std::array&& _covariance); - - /*! - * @brief This function returns a constant reference to member covariance - * @return Constant reference to member covariance - */ - eProsima_user_DllExport const std::array& covariance() const; - - /*! - * @brief This function returns a reference to member covariance - * @return Reference to member covariance - */ - eProsima_user_DllExport std::array& covariance(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const geometry_msgs::msg::dds_::PoseWithCovariance_& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - geometry_msgs::msg::dds_::Pose_ m_pose; - std::array m_covariance; - - }; - - } // namespace dds_ - } // namespace msg -} // namespace geometry_msgs - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCE_H_ - - - diff --git a/mujoco/idl_gen/geometry_msgs/PoseWithCovarianceCdrAux.hpp b/mujoco/idl_gen/geometry_msgs/PoseWithCovarianceCdrAux.hpp deleted file mode 100644 index 77dcabf..0000000 --- a/mujoco/idl_gen/geometry_msgs/PoseWithCovarianceCdrAux.hpp +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file PoseWithCovarianceCdrAux.hpp - * This source file contains some definitions of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCECDRAUX_HPP_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCECDRAUX_HPP_ - -#include "PoseWithCovariance.h" - -constexpr uint32_t geometry_msgs_msg_dds__PoseWithCovariance__max_cdr_typesize {344UL}; -constexpr uint32_t geometry_msgs_msg_dds__PoseWithCovariance__max_key_cdr_typesize {0UL}; - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::PoseWithCovariance_& data); - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCECDRAUX_HPP_ - diff --git a/mujoco/idl_gen/geometry_msgs/PoseWithCovarianceCdrAux.ipp b/mujoco/idl_gen/geometry_msgs/PoseWithCovarianceCdrAux.ipp deleted file mode 100644 index b843a05..0000000 --- a/mujoco/idl_gen/geometry_msgs/PoseWithCovarianceCdrAux.ipp +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file PoseWithCovarianceCdrAux.ipp - * This source file contains some declarations of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCECDRAUX_IPP_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCECDRAUX_IPP_ - -#include "PoseWithCovarianceCdrAux.hpp" - -#include -#include - - -#include -using namespace eprosima::fastcdr::exception; - -namespace eprosima { -namespace fastcdr { - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const geometry_msgs::msg::dds_::PoseWithCovariance_& data, - size_t& current_alignment) -{ - using namespace geometry_msgs::msg::dds_; - - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.pose(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.covariance(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::PoseWithCovariance_& data) -{ - using namespace geometry_msgs::msg::dds_; - - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.pose() - << eprosima::fastcdr::MemberId(1) << data.covariance() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - geometry_msgs::msg::dds_::PoseWithCovariance_& data) -{ - using namespace geometry_msgs::msg::dds_; - - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.pose(); - break; - - case 1: - dcdr >> data.covariance(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::PoseWithCovariance_& data) -{ - using namespace geometry_msgs::msg::dds_; - - static_cast(scdr); - static_cast(data); -} - - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCECDRAUX_IPP_ - diff --git a/mujoco/idl_gen/geometry_msgs/PoseWithCovariancePubSubTypes.cxx b/mujoco/idl_gen/geometry_msgs/PoseWithCovariancePubSubTypes.cxx deleted file mode 100644 index 8fd289e..0000000 --- a/mujoco/idl_gen/geometry_msgs/PoseWithCovariancePubSubTypes.cxx +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file PoseWithCovariancePubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#include - -#include "PoseWithCovariancePubSubTypes.h" -#include "PoseWithCovarianceCdrAux.hpp" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; -using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - -namespace geometry_msgs { - namespace msg { - namespace dds_ { - - - PoseWithCovariance_PubSubType::PoseWithCovariance_PubSubType() - { - setName("geometry_msgs::msg::dds_::PoseWithCovariance_"); - uint32_t type_size = - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(PoseWithCovariance_::getMaxCdrSerializedSize()); - #else - geometry_msgs_msg_dds__PoseWithCovariance__max_cdr_typesize; - #endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = geometry_msgs_msg_dds__PoseWithCovariance__max_key_cdr_typesize > 16 ? geometry_msgs_msg_dds__PoseWithCovariance__max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - PoseWithCovariance_PubSubType::~PoseWithCovariance_PubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool PoseWithCovariance_PubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) - { - PoseWithCovariance_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - #if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - #endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length - #if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); - #else - payload->length = static_cast(ser.get_serialized_data_length()); - #endif // FASTCDR_VERSION_MAJOR == 1 - return true; - } - - bool PoseWithCovariance_PubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - PoseWithCovariance_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN - #if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR - #endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; - } - - std::function PoseWithCovariance_PubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) - { - return [data, data_representation]() -> uint32_t - { - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - #else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } - #endif // FASTCDR_VERSION_MAJOR == 1 - }; - } - - void* PoseWithCovariance_PubSubType::createData() - { - return reinterpret_cast(new PoseWithCovariance_()); - } - - void PoseWithCovariance_PubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool PoseWithCovariance_PubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - PoseWithCovariance_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - geometry_msgs_msg_dds__PoseWithCovariance__max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); - #if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); - #else - eprosima::fastcdr::serialize_key(ser, *p_type); - #endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || geometry_msgs_msg_dds__PoseWithCovariance__max_key_cdr_typesize > 16) - { - m_md5.init(); - #if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - #else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); - #endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace dds_ - - - } //End of namespace msg - - -} //End of namespace geometry_msgs - diff --git a/mujoco/idl_gen/geometry_msgs/PoseWithCovariancePubSubTypes.h b/mujoco/idl_gen/geometry_msgs/PoseWithCovariancePubSubTypes.h deleted file mode 100644 index 9dcd73c..0000000 --- a/mujoco/idl_gen/geometry_msgs/PoseWithCovariancePubSubTypes.h +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file PoseWithCovariancePubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCE_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCE_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "PoseWithCovariance.h" - -#include "PosePubSubTypes.h" - -#if !defined(GEN_API_VER) || (GEN_API_VER != 2) -#error \ - Generated PoseWithCovariance is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace geometry_msgs -{ - namespace msg - { - namespace dds_ - { - - - - #ifndef SWIG - namespace detail { - - template - struct PoseWithCovariance__rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - - }; - - struct PoseWithCovariance__f - { - typedef std::array PoseWithCovariance_::* type; - friend constexpr type get( - PoseWithCovariance__f); - }; - - template struct PoseWithCovariance__rob; - - template - inline size_t constexpr PoseWithCovariance__offset_of() - { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } - - } // namespace detail - #endif // ifndef SWIG - - - /*! - * @brief This class represents the TopicDataType of the type PoseWithCovariance_ defined by the user in the IDL file. - * @ingroup PoseWithCovariance - */ - class PoseWithCovariance_PubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef PoseWithCovariance_ type; - - eProsima_user_DllExport PoseWithCovariance_PubSubType(); - - eProsima_user_DllExport ~PoseWithCovariance_PubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return is_plain_xcdrv1_impl(); - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) - { - return is_plain_xcdrv2_impl(); - } - else - { - return is_plain_xcdrv1_impl(); - } - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) PoseWithCovariance_(); - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - - private: - - static constexpr bool is_plain_xcdrv1_impl() - { - return 344ULL == - (detail::PoseWithCovariance__offset_of() + - sizeof(std::array)); - } - - static constexpr bool is_plain_xcdrv2_impl() - { - return 344ULL == - (detail::PoseWithCovariance__offset_of() + - sizeof(std::array)); - } - - }; - } - } -} - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__POSEWITHCOVARIANCE_PUBSUBTYPES_H_ - diff --git a/mujoco/idl_gen/geometry_msgs/Quaternion.cxx b/mujoco/idl_gen/geometry_msgs/Quaternion.cxx deleted file mode 100644 index a6a9b05..0000000 --- a/mujoco/idl_gen/geometry_msgs/Quaternion.cxx +++ /dev/null @@ -1,394 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Quaternion.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Quaternion.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define geometry_msgs_msg_dds__Quaternion__max_cdr_typesize 32ULL; - - -namespace geometry_msgs { - -namespace msg { - -namespace dds_ { - - - -Quaternion_::Quaternion_() -{ - // double m_x - m_x = 0.0; - // double m_y - m_y = 0.0; - // double m_z - m_z = 0.0; - // double m_w - m_w = 0.0; - -} - -Quaternion_::~Quaternion_() -{ -} - -Quaternion_::Quaternion_( - const Quaternion_& x) -{ - m_x = x.m_x; - - - m_y = x.m_y; - - - m_z = x.m_z; - - - m_w = x.m_w; - -} - -Quaternion_::Quaternion_( - Quaternion_&& x) noexcept -{ - m_x = x.m_x; - - - m_y = x.m_y; - - - m_z = x.m_z; - - - m_w = x.m_w; - -} - -Quaternion_& Quaternion_::operator =( - const Quaternion_& x) -{ - m_x = x.m_x; - - - m_y = x.m_y; - - - m_z = x.m_z; - - - m_w = x.m_w; - - return *this; -} - -Quaternion_& Quaternion_::operator =( - Quaternion_&& x) noexcept -{ - m_x = x.m_x; - - - m_y = x.m_y; - - - m_z = x.m_z; - - - m_w = x.m_w; - - return *this; -} - -bool Quaternion_::operator ==( - const Quaternion_& x) const -{ - return (m_x == x.m_x && - m_y == x.m_y && - m_z == x.m_z && - m_w == x.m_w); -} - -bool Quaternion_::operator !=( - const Quaternion_& x) const -{ - return !(*this == x); -} - -size_t Quaternion_::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return geometry_msgs_msg_dds__Quaternion__max_cdr_typesize; -} - -size_t Quaternion_::getCdrSerializedSize( - const Quaternion_& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - return current_alignment - initial_alignment; -} - - -void Quaternion_::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_x; - - scdr << m_y; - - scdr << m_z; - - scdr << m_w; - -} - -void Quaternion_::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_x; - - - - dcdr >> m_y; - - - - dcdr >> m_z; - - - - dcdr >> m_w; - - -} - - -bool Quaternion_::isKeyDefined() -{ - return false; -} - -void Quaternion_::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member x - * @param _x New value for member x - */ -void Quaternion_::x( - double _x) -{ - m_x = _x; -} - -/*! - * @brief This function returns the value of member x - * @return Value of member x - */ -double Quaternion_::x() const -{ - return m_x; -} - -/*! - * @brief This function returns a reference to member x - * @return Reference to member x - */ -double& Quaternion_::x() -{ - return m_x; -} - - -/*! - * @brief This function sets a value in member y - * @param _y New value for member y - */ -void Quaternion_::y( - double _y) -{ - m_y = _y; -} - -/*! - * @brief This function returns the value of member y - * @return Value of member y - */ -double Quaternion_::y() const -{ - return m_y; -} - -/*! - * @brief This function returns a reference to member y - * @return Reference to member y - */ -double& Quaternion_::y() -{ - return m_y; -} - - -/*! - * @brief This function sets a value in member z - * @param _z New value for member z - */ -void Quaternion_::z( - double _z) -{ - m_z = _z; -} - -/*! - * @brief This function returns the value of member z - * @return Value of member z - */ -double Quaternion_::z() const -{ - return m_z; -} - -/*! - * @brief This function returns a reference to member z - * @return Reference to member z - */ -double& Quaternion_::z() -{ - return m_z; -} - - -/*! - * @brief This function sets a value in member w - * @param _w New value for member w - */ -void Quaternion_::w( - double _w) -{ - m_w = _w; -} - -/*! - * @brief This function returns the value of member w - * @return Value of member w - */ -double Quaternion_::w() const -{ - return m_w; -} - -/*! - * @brief This function returns a reference to member w - * @return Reference to member w - */ -double& Quaternion_::w() -{ - return m_w; -} - - - - - -} // namespace dds_ - - -} // namespace msg - - -} // namespace geometry_msgs - diff --git a/mujoco/idl_gen/geometry_msgs/Quaternion.h b/mujoco/idl_gen/geometry_msgs/Quaternion.h deleted file mode 100644 index 52ea093..0000000 --- a/mujoco/idl_gen/geometry_msgs/Quaternion.h +++ /dev/null @@ -1,279 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Quaternion.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNION_H_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNION_H_ - - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(QUATERNION_SOURCE) -#define QUATERNION_DllAPI __declspec( dllexport ) -#else -#define QUATERNION_DllAPI __declspec( dllimport ) -#endif // QUATERNION_SOURCE -#else -#define QUATERNION_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define QUATERNION_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -namespace geometry_msgs { - namespace msg { - namespace dds_ { - - - /*! - * @brief This class represents the structure Quaternion_ defined by the user in the IDL file. - * @ingroup Quaternion - */ - class Quaternion_ - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Quaternion_(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Quaternion_(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object geometry_msgs::msg::dds_::Quaternion_ that will be copied. - */ - eProsima_user_DllExport Quaternion_( - const Quaternion_& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object geometry_msgs::msg::dds_::Quaternion_ that will be copied. - */ - eProsima_user_DllExport Quaternion_( - Quaternion_&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object geometry_msgs::msg::dds_::Quaternion_ that will be copied. - */ - eProsima_user_DllExport Quaternion_& operator =( - const Quaternion_& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object geometry_msgs::msg::dds_::Quaternion_ that will be copied. - */ - eProsima_user_DllExport Quaternion_& operator =( - Quaternion_&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::dds_::Quaternion_ object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Quaternion_& x) const; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::dds_::Quaternion_ object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Quaternion_& x) const; - - /*! - * @brief This function sets a value in member x - * @param _x New value for member x - */ - eProsima_user_DllExport void x( - double _x); - - /*! - * @brief This function returns the value of member x - * @return Value of member x - */ - eProsima_user_DllExport double x() const; - - /*! - * @brief This function returns a reference to member x - * @return Reference to member x - */ - eProsima_user_DllExport double& x(); - - - /*! - * @brief This function sets a value in member y - * @param _y New value for member y - */ - eProsima_user_DllExport void y( - double _y); - - /*! - * @brief This function returns the value of member y - * @return Value of member y - */ - eProsima_user_DllExport double y() const; - - /*! - * @brief This function returns a reference to member y - * @return Reference to member y - */ - eProsima_user_DllExport double& y(); - - - /*! - * @brief This function sets a value in member z - * @param _z New value for member z - */ - eProsima_user_DllExport void z( - double _z); - - /*! - * @brief This function returns the value of member z - * @return Value of member z - */ - eProsima_user_DllExport double z() const; - - /*! - * @brief This function returns a reference to member z - * @return Reference to member z - */ - eProsima_user_DllExport double& z(); - - - /*! - * @brief This function sets a value in member w - * @param _w New value for member w - */ - eProsima_user_DllExport void w( - double _w); - - /*! - * @brief This function returns the value of member w - * @return Value of member w - */ - eProsima_user_DllExport double w() const; - - /*! - * @brief This function returns a reference to member w - * @return Reference to member w - */ - eProsima_user_DllExport double& w(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const geometry_msgs::msg::dds_::Quaternion_& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - double m_x; - double m_y; - double m_z; - double m_w; - - }; - - } // namespace dds_ - } // namespace msg -} // namespace geometry_msgs - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNION_H_ - - - diff --git a/mujoco/idl_gen/geometry_msgs/QuaternionCdrAux.hpp b/mujoco/idl_gen/geometry_msgs/QuaternionCdrAux.hpp deleted file mode 100644 index b284816..0000000 --- a/mujoco/idl_gen/geometry_msgs/QuaternionCdrAux.hpp +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file QuaternionCdrAux.hpp - * This source file contains some definitions of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNIONCDRAUX_HPP_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNIONCDRAUX_HPP_ - -#include "Quaternion.h" - -constexpr uint32_t geometry_msgs_msg_dds__Quaternion__max_cdr_typesize {32UL}; -constexpr uint32_t geometry_msgs_msg_dds__Quaternion__max_key_cdr_typesize {0UL}; - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::Quaternion_& data); - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNIONCDRAUX_HPP_ - diff --git a/mujoco/idl_gen/geometry_msgs/QuaternionCdrAux.ipp b/mujoco/idl_gen/geometry_msgs/QuaternionCdrAux.ipp deleted file mode 100644 index 8a3b135..0000000 --- a/mujoco/idl_gen/geometry_msgs/QuaternionCdrAux.ipp +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file QuaternionCdrAux.ipp - * This source file contains some declarations of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNIONCDRAUX_IPP_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNIONCDRAUX_IPP_ - -#include "QuaternionCdrAux.hpp" - -#include -#include - - -#include -using namespace eprosima::fastcdr::exception; - -namespace eprosima { -namespace fastcdr { - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const geometry_msgs::msg::dds_::Quaternion_& data, - size_t& current_alignment) -{ - using namespace geometry_msgs::msg::dds_; - - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.x(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.y(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.z(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), - data.w(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::Quaternion_& data) -{ - using namespace geometry_msgs::msg::dds_; - - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.x() - << eprosima::fastcdr::MemberId(1) << data.y() - << eprosima::fastcdr::MemberId(2) << data.z() - << eprosima::fastcdr::MemberId(3) << data.w() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - geometry_msgs::msg::dds_::Quaternion_& data) -{ - using namespace geometry_msgs::msg::dds_; - - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.x(); - break; - - case 1: - dcdr >> data.y(); - break; - - case 2: - dcdr >> data.z(); - break; - - case 3: - dcdr >> data.w(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::Quaternion_& data) -{ - using namespace geometry_msgs::msg::dds_; - - static_cast(scdr); - static_cast(data); -} - - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNIONCDRAUX_IPP_ - diff --git a/mujoco/idl_gen/geometry_msgs/QuaternionPubSubTypes.cxx b/mujoco/idl_gen/geometry_msgs/QuaternionPubSubTypes.cxx deleted file mode 100644 index 1a32c96..0000000 --- a/mujoco/idl_gen/geometry_msgs/QuaternionPubSubTypes.cxx +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file QuaternionPubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#include - -#include "QuaternionPubSubTypes.h" -#include "QuaternionCdrAux.hpp" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; -using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - -namespace geometry_msgs { - namespace msg { - namespace dds_ { - - - Quaternion_PubSubType::Quaternion_PubSubType() - { - setName("geometry_msgs::msg::dds_::Quaternion_"); - uint32_t type_size = - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(Quaternion_::getMaxCdrSerializedSize()); - #else - geometry_msgs_msg_dds__Quaternion__max_cdr_typesize; - #endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = geometry_msgs_msg_dds__Quaternion__max_key_cdr_typesize > 16 ? geometry_msgs_msg_dds__Quaternion__max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - Quaternion_PubSubType::~Quaternion_PubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool Quaternion_PubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) - { - Quaternion_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - #if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - #endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length - #if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); - #else - payload->length = static_cast(ser.get_serialized_data_length()); - #endif // FASTCDR_VERSION_MAJOR == 1 - return true; - } - - bool Quaternion_PubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - Quaternion_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN - #if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR - #endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; - } - - std::function Quaternion_PubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) - { - return [data, data_representation]() -> uint32_t - { - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - #else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } - #endif // FASTCDR_VERSION_MAJOR == 1 - }; - } - - void* Quaternion_PubSubType::createData() - { - return reinterpret_cast(new Quaternion_()); - } - - void Quaternion_PubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool Quaternion_PubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - Quaternion_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - geometry_msgs_msg_dds__Quaternion__max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); - #if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); - #else - eprosima::fastcdr::serialize_key(ser, *p_type); - #endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || geometry_msgs_msg_dds__Quaternion__max_key_cdr_typesize > 16) - { - m_md5.init(); - #if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - #else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); - #endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace dds_ - - - } //End of namespace msg - - -} //End of namespace geometry_msgs - diff --git a/mujoco/idl_gen/geometry_msgs/QuaternionPubSubTypes.h b/mujoco/idl_gen/geometry_msgs/QuaternionPubSubTypes.h deleted file mode 100644 index 9a7dbcd..0000000 --- a/mujoco/idl_gen/geometry_msgs/QuaternionPubSubTypes.h +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file QuaternionPubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNION_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNION_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "Quaternion.h" - - -#if !defined(GEN_API_VER) || (GEN_API_VER != 2) -#error \ - Generated Quaternion is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace geometry_msgs -{ - namespace msg - { - namespace dds_ - { - - - - #ifndef SWIG - namespace detail { - - template - struct Quaternion__rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - - }; - - struct Quaternion__f - { - typedef double Quaternion_::* type; - friend constexpr type get( - Quaternion__f); - }; - - template struct Quaternion__rob; - - template - inline size_t constexpr Quaternion__offset_of() - { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } - - } // namespace detail - #endif // ifndef SWIG - - - /*! - * @brief This class represents the TopicDataType of the type Quaternion_ defined by the user in the IDL file. - * @ingroup Quaternion - */ - class Quaternion_PubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef Quaternion_ type; - - eProsima_user_DllExport Quaternion_PubSubType(); - - eProsima_user_DllExport ~Quaternion_PubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return is_plain_xcdrv1_impl(); - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) - { - return is_plain_xcdrv2_impl(); - } - else - { - return is_plain_xcdrv1_impl(); - } - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) Quaternion_(); - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - - private: - - static constexpr bool is_plain_xcdrv1_impl() - { - return 32ULL == - (detail::Quaternion__offset_of() + - sizeof(double)); - } - - static constexpr bool is_plain_xcdrv2_impl() - { - return 32ULL == - (detail::Quaternion__offset_of() + - sizeof(double)); - } - - }; - } - } -} - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__QUATERNION_PUBSUBTYPES_H_ - diff --git a/mujoco/idl_gen/geometry_msgs/Twist.cxx b/mujoco/idl_gen/geometry_msgs/Twist.cxx deleted file mode 100644 index d6da739..0000000 --- a/mujoco/idl_gen/geometry_msgs/Twist.cxx +++ /dev/null @@ -1,309 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Twist.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Twist.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define geometry_msgs_msg_dds__Vector3__max_cdr_typesize 24ULL; -#define geometry_msgs_msg_dds__Twist__max_cdr_typesize 48ULL; - - -namespace geometry_msgs { - -namespace msg { - -namespace dds_ { - - - -Twist_::Twist_() -{ - // geometry_msgs::msg::dds_::Vector3_ m_linear - - // geometry_msgs::msg::dds_::Vector3_ m_angular - - -} - -Twist_::~Twist_() -{ -} - -Twist_::Twist_( - const Twist_& x) -{ - m_linear = x.m_linear; - - - m_angular = x.m_angular; - -} - -Twist_::Twist_( - Twist_&& x) noexcept -{ - m_linear = std::move(x.m_linear); - - - m_angular = std::move(x.m_angular); - -} - -Twist_& Twist_::operator =( - const Twist_& x) -{ - m_linear = x.m_linear; - - - m_angular = x.m_angular; - - return *this; -} - -Twist_& Twist_::operator =( - Twist_&& x) noexcept -{ - m_linear = std::move(x.m_linear); - - - m_angular = std::move(x.m_angular); - - return *this; -} - -bool Twist_::operator ==( - const Twist_& x) const -{ - return (m_linear == x.m_linear && - m_angular == x.m_angular); -} - -bool Twist_::operator !=( - const Twist_& x) const -{ - return !(*this == x); -} - -size_t Twist_::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return geometry_msgs_msg_dds__Twist__max_cdr_typesize; -} - -size_t Twist_::getCdrSerializedSize( - const Twist_& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += geometry_msgs::msg::dds_::Vector3_::getCdrSerializedSize(data.linear(), current_alignment); - - - current_alignment += geometry_msgs::msg::dds_::Vector3_::getCdrSerializedSize(data.angular(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void Twist_::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_linear; - - scdr << m_angular; - -} - -void Twist_::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_linear; - - - - dcdr >> m_angular; - - -} - - -bool Twist_::isKeyDefined() -{ - return false; -} - -void Twist_::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member linear - * @param _linear New value to be copied in member linear - */ -void Twist_::linear( - const geometry_msgs::msg::dds_::Vector3_& _linear) -{ - m_linear = _linear; -} - -/*! - * @brief This function moves the value in member linear - * @param _linear New value to be moved in member linear - */ -void Twist_::linear( - geometry_msgs::msg::dds_::Vector3_&& _linear) -{ - m_linear = std::move(_linear); -} - -/*! - * @brief This function returns a constant reference to member linear - * @return Constant reference to member linear - */ -const geometry_msgs::msg::dds_::Vector3_& Twist_::linear() const -{ - return m_linear; -} - -/*! - * @brief This function returns a reference to member linear - * @return Reference to member linear - */ -geometry_msgs::msg::dds_::Vector3_& Twist_::linear() -{ - return m_linear; -} - - -/*! - * @brief This function copies the value in member angular - * @param _angular New value to be copied in member angular - */ -void Twist_::angular( - const geometry_msgs::msg::dds_::Vector3_& _angular) -{ - m_angular = _angular; -} - -/*! - * @brief This function moves the value in member angular - * @param _angular New value to be moved in member angular - */ -void Twist_::angular( - geometry_msgs::msg::dds_::Vector3_&& _angular) -{ - m_angular = std::move(_angular); -} - -/*! - * @brief This function returns a constant reference to member angular - * @return Constant reference to member angular - */ -const geometry_msgs::msg::dds_::Vector3_& Twist_::angular() const -{ - return m_angular; -} - -/*! - * @brief This function returns a reference to member angular - * @return Reference to member angular - */ -geometry_msgs::msg::dds_::Vector3_& Twist_::angular() -{ - return m_angular; -} - - - - - -} // namespace dds_ - - -} // namespace msg - - -} // namespace geometry_msgs - diff --git a/mujoco/idl_gen/geometry_msgs/Twist.h b/mujoco/idl_gen/geometry_msgs/Twist.h deleted file mode 100644 index 64989d1..0000000 --- a/mujoco/idl_gen/geometry_msgs/Twist.h +++ /dev/null @@ -1,252 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Twist.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWIST_H_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWIST_H_ - -#include "Vector3.h" - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TWIST_SOURCE) -#define TWIST_DllAPI __declspec( dllexport ) -#else -#define TWIST_DllAPI __declspec( dllimport ) -#endif // TWIST_SOURCE -#else -#define TWIST_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define TWIST_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -namespace geometry_msgs { - namespace msg { - namespace dds_ { - - - /*! - * @brief This class represents the structure Twist_ defined by the user in the IDL file. - * @ingroup Twist - */ - class Twist_ - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Twist_(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Twist_(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object geometry_msgs::msg::dds_::Twist_ that will be copied. - */ - eProsima_user_DllExport Twist_( - const Twist_& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object geometry_msgs::msg::dds_::Twist_ that will be copied. - */ - eProsima_user_DllExport Twist_( - Twist_&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object geometry_msgs::msg::dds_::Twist_ that will be copied. - */ - eProsima_user_DllExport Twist_& operator =( - const Twist_& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object geometry_msgs::msg::dds_::Twist_ that will be copied. - */ - eProsima_user_DllExport Twist_& operator =( - Twist_&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::dds_::Twist_ object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Twist_& x) const; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::dds_::Twist_ object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Twist_& x) const; - - /*! - * @brief This function copies the value in member linear - * @param _linear New value to be copied in member linear - */ - eProsima_user_DllExport void linear( - const geometry_msgs::msg::dds_::Vector3_& _linear); - - /*! - * @brief This function moves the value in member linear - * @param _linear New value to be moved in member linear - */ - eProsima_user_DllExport void linear( - geometry_msgs::msg::dds_::Vector3_&& _linear); - - /*! - * @brief This function returns a constant reference to member linear - * @return Constant reference to member linear - */ - eProsima_user_DllExport const geometry_msgs::msg::dds_::Vector3_& linear() const; - - /*! - * @brief This function returns a reference to member linear - * @return Reference to member linear - */ - eProsima_user_DllExport geometry_msgs::msg::dds_::Vector3_& linear(); - - - /*! - * @brief This function copies the value in member angular - * @param _angular New value to be copied in member angular - */ - eProsima_user_DllExport void angular( - const geometry_msgs::msg::dds_::Vector3_& _angular); - - /*! - * @brief This function moves the value in member angular - * @param _angular New value to be moved in member angular - */ - eProsima_user_DllExport void angular( - geometry_msgs::msg::dds_::Vector3_&& _angular); - - /*! - * @brief This function returns a constant reference to member angular - * @return Constant reference to member angular - */ - eProsima_user_DllExport const geometry_msgs::msg::dds_::Vector3_& angular() const; - - /*! - * @brief This function returns a reference to member angular - * @return Reference to member angular - */ - eProsima_user_DllExport geometry_msgs::msg::dds_::Vector3_& angular(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const geometry_msgs::msg::dds_::Twist_& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - geometry_msgs::msg::dds_::Vector3_ m_linear; - geometry_msgs::msg::dds_::Vector3_ m_angular; - - }; - - } // namespace dds_ - } // namespace msg -} // namespace geometry_msgs - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWIST_H_ - - - diff --git a/mujoco/idl_gen/geometry_msgs/TwistCdrAux.hpp b/mujoco/idl_gen/geometry_msgs/TwistCdrAux.hpp deleted file mode 100644 index cff1e80..0000000 --- a/mujoco/idl_gen/geometry_msgs/TwistCdrAux.hpp +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TwistCdrAux.hpp - * This source file contains some definitions of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTCDRAUX_HPP_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTCDRAUX_HPP_ - -#include "Twist.h" - -constexpr uint32_t geometry_msgs_msg_dds__Twist__max_cdr_typesize {48UL}; -constexpr uint32_t geometry_msgs_msg_dds__Twist__max_key_cdr_typesize {0UL}; - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::Twist_& data); - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTCDRAUX_HPP_ - diff --git a/mujoco/idl_gen/geometry_msgs/TwistCdrAux.ipp b/mujoco/idl_gen/geometry_msgs/TwistCdrAux.ipp deleted file mode 100644 index 88c03d1..0000000 --- a/mujoco/idl_gen/geometry_msgs/TwistCdrAux.ipp +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TwistCdrAux.ipp - * This source file contains some declarations of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTCDRAUX_IPP_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTCDRAUX_IPP_ - -#include "TwistCdrAux.hpp" - -#include -#include - - -#include -using namespace eprosima::fastcdr::exception; - -namespace eprosima { -namespace fastcdr { - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const geometry_msgs::msg::dds_::Twist_& data, - size_t& current_alignment) -{ - using namespace geometry_msgs::msg::dds_; - - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.linear(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.angular(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::Twist_& data) -{ - using namespace geometry_msgs::msg::dds_; - - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.linear() - << eprosima::fastcdr::MemberId(1) << data.angular() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - geometry_msgs::msg::dds_::Twist_& data) -{ - using namespace geometry_msgs::msg::dds_; - - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.linear(); - break; - - case 1: - dcdr >> data.angular(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::Twist_& data) -{ - using namespace geometry_msgs::msg::dds_; - - static_cast(scdr); - static_cast(data); -} - - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTCDRAUX_IPP_ - diff --git a/mujoco/idl_gen/geometry_msgs/TwistPubSubTypes.cxx b/mujoco/idl_gen/geometry_msgs/TwistPubSubTypes.cxx deleted file mode 100644 index 71792a3..0000000 --- a/mujoco/idl_gen/geometry_msgs/TwistPubSubTypes.cxx +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TwistPubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#include - -#include "TwistPubSubTypes.h" -#include "TwistCdrAux.hpp" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; -using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - -namespace geometry_msgs { - namespace msg { - namespace dds_ { - - - Twist_PubSubType::Twist_PubSubType() - { - setName("geometry_msgs::msg::dds_::Twist_"); - uint32_t type_size = - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(Twist_::getMaxCdrSerializedSize()); - #else - geometry_msgs_msg_dds__Twist__max_cdr_typesize; - #endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = geometry_msgs_msg_dds__Twist__max_key_cdr_typesize > 16 ? geometry_msgs_msg_dds__Twist__max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - Twist_PubSubType::~Twist_PubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool Twist_PubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) - { - Twist_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - #if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - #endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length - #if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); - #else - payload->length = static_cast(ser.get_serialized_data_length()); - #endif // FASTCDR_VERSION_MAJOR == 1 - return true; - } - - bool Twist_PubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - Twist_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN - #if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR - #endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; - } - - std::function Twist_PubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) - { - return [data, data_representation]() -> uint32_t - { - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - #else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } - #endif // FASTCDR_VERSION_MAJOR == 1 - }; - } - - void* Twist_PubSubType::createData() - { - return reinterpret_cast(new Twist_()); - } - - void Twist_PubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool Twist_PubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - Twist_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - geometry_msgs_msg_dds__Twist__max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); - #if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); - #else - eprosima::fastcdr::serialize_key(ser, *p_type); - #endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || geometry_msgs_msg_dds__Twist__max_key_cdr_typesize > 16) - { - m_md5.init(); - #if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - #else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); - #endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace dds_ - - - } //End of namespace msg - - -} //End of namespace geometry_msgs - diff --git a/mujoco/idl_gen/geometry_msgs/TwistPubSubTypes.h b/mujoco/idl_gen/geometry_msgs/TwistPubSubTypes.h deleted file mode 100644 index defb4e8..0000000 --- a/mujoco/idl_gen/geometry_msgs/TwistPubSubTypes.h +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TwistPubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWIST_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWIST_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "Twist.h" - -#include "Vector3PubSubTypes.h" - -#if !defined(GEN_API_VER) || (GEN_API_VER != 2) -#error \ - Generated Twist is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace geometry_msgs -{ - namespace msg - { - namespace dds_ - { - - - - #ifndef SWIG - namespace detail { - - template - struct Twist__rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - - }; - - struct Twist__f - { - typedef geometry_msgs::msg::dds_::Vector3_ Twist_::* type; - friend constexpr type get( - Twist__f); - }; - - template struct Twist__rob; - - template - inline size_t constexpr Twist__offset_of() - { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } - - } // namespace detail - #endif // ifndef SWIG - - - /*! - * @brief This class represents the TopicDataType of the type Twist_ defined by the user in the IDL file. - * @ingroup Twist - */ - class Twist_PubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef Twist_ type; - - eProsima_user_DllExport Twist_PubSubType(); - - eProsima_user_DllExport ~Twist_PubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return is_plain_xcdrv1_impl(); - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) - { - return is_plain_xcdrv2_impl(); - } - else - { - return is_plain_xcdrv1_impl(); - } - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) Twist_(); - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - - private: - - static constexpr bool is_plain_xcdrv1_impl() - { - return 48ULL == - (detail::Twist__offset_of() + - sizeof(geometry_msgs::msg::dds_::Vector3_)); - } - - static constexpr bool is_plain_xcdrv2_impl() - { - return 48ULL == - (detail::Twist__offset_of() + - sizeof(geometry_msgs::msg::dds_::Vector3_)); - } - - }; - } - } -} - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWIST_PUBSUBTYPES_H_ - diff --git a/mujoco/idl_gen/geometry_msgs/TwistWithCovariance.cxx b/mujoco/idl_gen/geometry_msgs/TwistWithCovariance.cxx deleted file mode 100644 index 462570d..0000000 --- a/mujoco/idl_gen/geometry_msgs/TwistWithCovariance.cxx +++ /dev/null @@ -1,312 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TwistWithCovariance.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "TwistWithCovariance.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define geometry_msgs_msg_dds__Vector3__max_cdr_typesize 24ULL; -#define geometry_msgs_msg_dds__TwistWithCovariance__max_cdr_typesize 336ULL; -#define geometry_msgs_msg_dds__Twist__max_cdr_typesize 48ULL; - - -namespace geometry_msgs { - -namespace msg { - -namespace dds_ { - - - -TwistWithCovariance_::TwistWithCovariance_() -{ - // geometry_msgs::msg::dds_::Twist_ m_twist - - // double m_covariance - memset(&m_covariance, 0, ((36)) * 8); - -} - -TwistWithCovariance_::~TwistWithCovariance_() -{ -} - -TwistWithCovariance_::TwistWithCovariance_( - const TwistWithCovariance_& x) -{ - m_twist = x.m_twist; - - - m_covariance = x.m_covariance; - -} - -TwistWithCovariance_::TwistWithCovariance_( - TwistWithCovariance_&& x) noexcept -{ - m_twist = std::move(x.m_twist); - - - m_covariance = std::move(x.m_covariance); - -} - -TwistWithCovariance_& TwistWithCovariance_::operator =( - const TwistWithCovariance_& x) -{ - m_twist = x.m_twist; - - - m_covariance = x.m_covariance; - - return *this; -} - -TwistWithCovariance_& TwistWithCovariance_::operator =( - TwistWithCovariance_&& x) noexcept -{ - m_twist = std::move(x.m_twist); - - - m_covariance = std::move(x.m_covariance); - - return *this; -} - -bool TwistWithCovariance_::operator ==( - const TwistWithCovariance_& x) const -{ - return (m_twist == x.m_twist && - m_covariance == x.m_covariance); -} - -bool TwistWithCovariance_::operator !=( - const TwistWithCovariance_& x) const -{ - return !(*this == x); -} - -size_t TwistWithCovariance_::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return geometry_msgs_msg_dds__TwistWithCovariance__max_cdr_typesize; -} - -size_t TwistWithCovariance_::getCdrSerializedSize( - const TwistWithCovariance_& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += geometry_msgs::msg::dds_::Twist_::getCdrSerializedSize(data.twist(), current_alignment); - - - current_alignment += (((36)) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - - return current_alignment - initial_alignment; -} - - -void TwistWithCovariance_::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_twist; - - scdr << m_covariance; - - -} - -void TwistWithCovariance_::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_twist; - - - - dcdr >> m_covariance; - - -} - - -bool TwistWithCovariance_::isKeyDefined() -{ - return false; -} - -void TwistWithCovariance_::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member twist - * @param _twist New value to be copied in member twist - */ -void TwistWithCovariance_::twist( - const geometry_msgs::msg::dds_::Twist_& _twist) -{ - m_twist = _twist; -} - -/*! - * @brief This function moves the value in member twist - * @param _twist New value to be moved in member twist - */ -void TwistWithCovariance_::twist( - geometry_msgs::msg::dds_::Twist_&& _twist) -{ - m_twist = std::move(_twist); -} - -/*! - * @brief This function returns a constant reference to member twist - * @return Constant reference to member twist - */ -const geometry_msgs::msg::dds_::Twist_& TwistWithCovariance_::twist() const -{ - return m_twist; -} - -/*! - * @brief This function returns a reference to member twist - * @return Reference to member twist - */ -geometry_msgs::msg::dds_::Twist_& TwistWithCovariance_::twist() -{ - return m_twist; -} - - -/*! - * @brief This function copies the value in member covariance - * @param _covariance New value to be copied in member covariance - */ -void TwistWithCovariance_::covariance( - const std::array& _covariance) -{ - m_covariance = _covariance; -} - -/*! - * @brief This function moves the value in member covariance - * @param _covariance New value to be moved in member covariance - */ -void TwistWithCovariance_::covariance( - std::array&& _covariance) -{ - m_covariance = std::move(_covariance); -} - -/*! - * @brief This function returns a constant reference to member covariance - * @return Constant reference to member covariance - */ -const std::array& TwistWithCovariance_::covariance() const -{ - return m_covariance; -} - -/*! - * @brief This function returns a reference to member covariance - * @return Reference to member covariance - */ -std::array& TwistWithCovariance_::covariance() -{ - return m_covariance; -} - - - - - -} // namespace dds_ - - -} // namespace msg - - -} // namespace geometry_msgs - diff --git a/mujoco/idl_gen/geometry_msgs/TwistWithCovariance.h b/mujoco/idl_gen/geometry_msgs/TwistWithCovariance.h deleted file mode 100644 index e263013..0000000 --- a/mujoco/idl_gen/geometry_msgs/TwistWithCovariance.h +++ /dev/null @@ -1,252 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TwistWithCovariance.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCE_H_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCE_H_ - -#include "Twist.h" - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TWISTWITHCOVARIANCE_SOURCE) -#define TWISTWITHCOVARIANCE_DllAPI __declspec( dllexport ) -#else -#define TWISTWITHCOVARIANCE_DllAPI __declspec( dllimport ) -#endif // TWISTWITHCOVARIANCE_SOURCE -#else -#define TWISTWITHCOVARIANCE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define TWISTWITHCOVARIANCE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -namespace geometry_msgs { - namespace msg { - namespace dds_ { - - - /*! - * @brief This class represents the structure TwistWithCovariance_ defined by the user in the IDL file. - * @ingroup TwistWithCovariance - */ - class TwistWithCovariance_ - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport TwistWithCovariance_(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~TwistWithCovariance_(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object geometry_msgs::msg::dds_::TwistWithCovariance_ that will be copied. - */ - eProsima_user_DllExport TwistWithCovariance_( - const TwistWithCovariance_& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object geometry_msgs::msg::dds_::TwistWithCovariance_ that will be copied. - */ - eProsima_user_DllExport TwistWithCovariance_( - TwistWithCovariance_&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object geometry_msgs::msg::dds_::TwistWithCovariance_ that will be copied. - */ - eProsima_user_DllExport TwistWithCovariance_& operator =( - const TwistWithCovariance_& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object geometry_msgs::msg::dds_::TwistWithCovariance_ that will be copied. - */ - eProsima_user_DllExport TwistWithCovariance_& operator =( - TwistWithCovariance_&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::dds_::TwistWithCovariance_ object to compare. - */ - eProsima_user_DllExport bool operator ==( - const TwistWithCovariance_& x) const; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::dds_::TwistWithCovariance_ object to compare. - */ - eProsima_user_DllExport bool operator !=( - const TwistWithCovariance_& x) const; - - /*! - * @brief This function copies the value in member twist - * @param _twist New value to be copied in member twist - */ - eProsima_user_DllExport void twist( - const geometry_msgs::msg::dds_::Twist_& _twist); - - /*! - * @brief This function moves the value in member twist - * @param _twist New value to be moved in member twist - */ - eProsima_user_DllExport void twist( - geometry_msgs::msg::dds_::Twist_&& _twist); - - /*! - * @brief This function returns a constant reference to member twist - * @return Constant reference to member twist - */ - eProsima_user_DllExport const geometry_msgs::msg::dds_::Twist_& twist() const; - - /*! - * @brief This function returns a reference to member twist - * @return Reference to member twist - */ - eProsima_user_DllExport geometry_msgs::msg::dds_::Twist_& twist(); - - - /*! - * @brief This function copies the value in member covariance - * @param _covariance New value to be copied in member covariance - */ - eProsima_user_DllExport void covariance( - const std::array& _covariance); - - /*! - * @brief This function moves the value in member covariance - * @param _covariance New value to be moved in member covariance - */ - eProsima_user_DllExport void covariance( - std::array&& _covariance); - - /*! - * @brief This function returns a constant reference to member covariance - * @return Constant reference to member covariance - */ - eProsima_user_DllExport const std::array& covariance() const; - - /*! - * @brief This function returns a reference to member covariance - * @return Reference to member covariance - */ - eProsima_user_DllExport std::array& covariance(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const geometry_msgs::msg::dds_::TwistWithCovariance_& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - geometry_msgs::msg::dds_::Twist_ m_twist; - std::array m_covariance; - - }; - - } // namespace dds_ - } // namespace msg -} // namespace geometry_msgs - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCE_H_ - - - diff --git a/mujoco/idl_gen/geometry_msgs/TwistWithCovarianceCdrAux.hpp b/mujoco/idl_gen/geometry_msgs/TwistWithCovarianceCdrAux.hpp deleted file mode 100644 index 297ad3b..0000000 --- a/mujoco/idl_gen/geometry_msgs/TwistWithCovarianceCdrAux.hpp +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TwistWithCovarianceCdrAux.hpp - * This source file contains some definitions of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCECDRAUX_HPP_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCECDRAUX_HPP_ - -#include "TwistWithCovariance.h" - -constexpr uint32_t geometry_msgs_msg_dds__TwistWithCovariance__max_cdr_typesize {336UL}; -constexpr uint32_t geometry_msgs_msg_dds__TwistWithCovariance__max_key_cdr_typesize {0UL}; - - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::TwistWithCovariance_& data); - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCECDRAUX_HPP_ - diff --git a/mujoco/idl_gen/geometry_msgs/TwistWithCovarianceCdrAux.ipp b/mujoco/idl_gen/geometry_msgs/TwistWithCovarianceCdrAux.ipp deleted file mode 100644 index a3fc729..0000000 --- a/mujoco/idl_gen/geometry_msgs/TwistWithCovarianceCdrAux.ipp +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TwistWithCovarianceCdrAux.ipp - * This source file contains some declarations of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCECDRAUX_IPP_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCECDRAUX_IPP_ - -#include "TwistWithCovarianceCdrAux.hpp" - -#include -#include - - -#include -using namespace eprosima::fastcdr::exception; - -namespace eprosima { -namespace fastcdr { - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const geometry_msgs::msg::dds_::TwistWithCovariance_& data, - size_t& current_alignment) -{ - using namespace geometry_msgs::msg::dds_; - - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.twist(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.covariance(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::TwistWithCovariance_& data) -{ - using namespace geometry_msgs::msg::dds_; - - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.twist() - << eprosima::fastcdr::MemberId(1) << data.covariance() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - geometry_msgs::msg::dds_::TwistWithCovariance_& data) -{ - using namespace geometry_msgs::msg::dds_; - - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.twist(); - break; - - case 1: - dcdr >> data.covariance(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::TwistWithCovariance_& data) -{ - using namespace geometry_msgs::msg::dds_; - - static_cast(scdr); - static_cast(data); -} - - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCECDRAUX_IPP_ - diff --git a/mujoco/idl_gen/geometry_msgs/TwistWithCovariancePubSubTypes.cxx b/mujoco/idl_gen/geometry_msgs/TwistWithCovariancePubSubTypes.cxx deleted file mode 100644 index 4c24e80..0000000 --- a/mujoco/idl_gen/geometry_msgs/TwistWithCovariancePubSubTypes.cxx +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TwistWithCovariancePubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#include - -#include "TwistWithCovariancePubSubTypes.h" -#include "TwistWithCovarianceCdrAux.hpp" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; -using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - -namespace geometry_msgs { - namespace msg { - namespace dds_ { - - - TwistWithCovariance_PubSubType::TwistWithCovariance_PubSubType() - { - setName("geometry_msgs::msg::dds_::TwistWithCovariance_"); - uint32_t type_size = - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(TwistWithCovariance_::getMaxCdrSerializedSize()); - #else - geometry_msgs_msg_dds__TwistWithCovariance__max_cdr_typesize; - #endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = geometry_msgs_msg_dds__TwistWithCovariance__max_key_cdr_typesize > 16 ? geometry_msgs_msg_dds__TwistWithCovariance__max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - TwistWithCovariance_PubSubType::~TwistWithCovariance_PubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool TwistWithCovariance_PubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) - { - TwistWithCovariance_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - #if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - #endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length - #if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); - #else - payload->length = static_cast(ser.get_serialized_data_length()); - #endif // FASTCDR_VERSION_MAJOR == 1 - return true; - } - - bool TwistWithCovariance_PubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - TwistWithCovariance_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN - #if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR - #endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; - } - - std::function TwistWithCovariance_PubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) - { - return [data, data_representation]() -> uint32_t - { - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - #else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } - #endif // FASTCDR_VERSION_MAJOR == 1 - }; - } - - void* TwistWithCovariance_PubSubType::createData() - { - return reinterpret_cast(new TwistWithCovariance_()); - } - - void TwistWithCovariance_PubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool TwistWithCovariance_PubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - TwistWithCovariance_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - geometry_msgs_msg_dds__TwistWithCovariance__max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); - #if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); - #else - eprosima::fastcdr::serialize_key(ser, *p_type); - #endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || geometry_msgs_msg_dds__TwistWithCovariance__max_key_cdr_typesize > 16) - { - m_md5.init(); - #if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - #else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); - #endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace dds_ - - - } //End of namespace msg - - -} //End of namespace geometry_msgs - diff --git a/mujoco/idl_gen/geometry_msgs/TwistWithCovariancePubSubTypes.h b/mujoco/idl_gen/geometry_msgs/TwistWithCovariancePubSubTypes.h deleted file mode 100644 index 5302fbd..0000000 --- a/mujoco/idl_gen/geometry_msgs/TwistWithCovariancePubSubTypes.h +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TwistWithCovariancePubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCE_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCE_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "TwistWithCovariance.h" - -#include "TwistPubSubTypes.h" - -#if !defined(GEN_API_VER) || (GEN_API_VER != 2) -#error \ - Generated TwistWithCovariance is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace geometry_msgs -{ - namespace msg - { - namespace dds_ - { - - - - #ifndef SWIG - namespace detail { - - template - struct TwistWithCovariance__rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - - }; - - struct TwistWithCovariance__f - { - typedef std::array TwistWithCovariance_::* type; - friend constexpr type get( - TwistWithCovariance__f); - }; - - template struct TwistWithCovariance__rob; - - template - inline size_t constexpr TwistWithCovariance__offset_of() - { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } - - } // namespace detail - #endif // ifndef SWIG - - - /*! - * @brief This class represents the TopicDataType of the type TwistWithCovariance_ defined by the user in the IDL file. - * @ingroup TwistWithCovariance - */ - class TwistWithCovariance_PubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef TwistWithCovariance_ type; - - eProsima_user_DllExport TwistWithCovariance_PubSubType(); - - eProsima_user_DllExport ~TwistWithCovariance_PubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return is_plain_xcdrv1_impl(); - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) - { - return is_plain_xcdrv2_impl(); - } - else - { - return is_plain_xcdrv1_impl(); - } - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) TwistWithCovariance_(); - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - - private: - - static constexpr bool is_plain_xcdrv1_impl() - { - return 336ULL == - (detail::TwistWithCovariance__offset_of() + - sizeof(std::array)); - } - - static constexpr bool is_plain_xcdrv2_impl() - { - return 336ULL == - (detail::TwistWithCovariance__offset_of() + - sizeof(std::array)); - } - - }; - } - } -} - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__TWISTWITHCOVARIANCE_PUBSUBTYPES_H_ - diff --git a/mujoco/idl_gen/geometry_msgs/Vector3.cxx b/mujoco/idl_gen/geometry_msgs/Vector3.cxx deleted file mode 100644 index b9f24b9..0000000 --- a/mujoco/idl_gen/geometry_msgs/Vector3.cxx +++ /dev/null @@ -1,341 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Vector3.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Vector3.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define geometry_msgs_msg_dds__Vector3__max_cdr_typesize 24ULL; - - -namespace geometry_msgs { - -namespace msg { - -namespace dds_ { - - - -Vector3_::Vector3_() -{ - // double m_x - m_x = 0.0; - // double m_y - m_y = 0.0; - // double m_z - m_z = 0.0; - -} - -Vector3_::~Vector3_() -{ -} - -Vector3_::Vector3_( - const Vector3_& x) -{ - m_x = x.m_x; - - - m_y = x.m_y; - - - m_z = x.m_z; - -} - -Vector3_::Vector3_( - Vector3_&& x) noexcept -{ - m_x = x.m_x; - - - m_y = x.m_y; - - - m_z = x.m_z; - -} - -Vector3_& Vector3_::operator =( - const Vector3_& x) -{ - m_x = x.m_x; - - - m_y = x.m_y; - - - m_z = x.m_z; - - return *this; -} - -Vector3_& Vector3_::operator =( - Vector3_&& x) noexcept -{ - m_x = x.m_x; - - - m_y = x.m_y; - - - m_z = x.m_z; - - return *this; -} - -bool Vector3_::operator ==( - const Vector3_& x) const -{ - return (m_x == x.m_x && - m_y == x.m_y && - m_z == x.m_z); -} - -bool Vector3_::operator !=( - const Vector3_& x) const -{ - return !(*this == x); -} - -size_t Vector3_::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return geometry_msgs_msg_dds__Vector3__max_cdr_typesize; -} - -size_t Vector3_::getCdrSerializedSize( - const Vector3_& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - return current_alignment - initial_alignment; -} - - -void Vector3_::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_x; - - scdr << m_y; - - scdr << m_z; - -} - -void Vector3_::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_x; - - - - dcdr >> m_y; - - - - dcdr >> m_z; - - -} - - -bool Vector3_::isKeyDefined() -{ - return false; -} - -void Vector3_::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member x - * @param _x New value for member x - */ -void Vector3_::x( - double _x) -{ - m_x = _x; -} - -/*! - * @brief This function returns the value of member x - * @return Value of member x - */ -double Vector3_::x() const -{ - return m_x; -} - -/*! - * @brief This function returns a reference to member x - * @return Reference to member x - */ -double& Vector3_::x() -{ - return m_x; -} - - -/*! - * @brief This function sets a value in member y - * @param _y New value for member y - */ -void Vector3_::y( - double _y) -{ - m_y = _y; -} - -/*! - * @brief This function returns the value of member y - * @return Value of member y - */ -double Vector3_::y() const -{ - return m_y; -} - -/*! - * @brief This function returns a reference to member y - * @return Reference to member y - */ -double& Vector3_::y() -{ - return m_y; -} - - -/*! - * @brief This function sets a value in member z - * @param _z New value for member z - */ -void Vector3_::z( - double _z) -{ - m_z = _z; -} - -/*! - * @brief This function returns the value of member z - * @return Value of member z - */ -double Vector3_::z() const -{ - return m_z; -} - -/*! - * @brief This function returns a reference to member z - * @return Reference to member z - */ -double& Vector3_::z() -{ - return m_z; -} - - - - - -} // namespace dds_ - - -} // namespace msg - - -} // namespace geometry_msgs - diff --git a/mujoco/idl_gen/geometry_msgs/Vector3.h b/mujoco/idl_gen/geometry_msgs/Vector3.h deleted file mode 100644 index 98a76cf..0000000 --- a/mujoco/idl_gen/geometry_msgs/Vector3.h +++ /dev/null @@ -1,258 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Vector3.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3_H_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3_H_ - - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(VECTOR3_SOURCE) -#define VECTOR3_DllAPI __declspec( dllexport ) -#else -#define VECTOR3_DllAPI __declspec( dllimport ) -#endif // VECTOR3_SOURCE -#else -#define VECTOR3_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define VECTOR3_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -namespace geometry_msgs { - namespace msg { - namespace dds_ { - - - /*! - * @brief This class represents the structure Vector3_ defined by the user in the IDL file. - * @ingroup Vector3 - */ - class Vector3_ - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Vector3_(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Vector3_(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object geometry_msgs::msg::dds_::Vector3_ that will be copied. - */ - eProsima_user_DllExport Vector3_( - const Vector3_& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object geometry_msgs::msg::dds_::Vector3_ that will be copied. - */ - eProsima_user_DllExport Vector3_( - Vector3_&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object geometry_msgs::msg::dds_::Vector3_ that will be copied. - */ - eProsima_user_DllExport Vector3_& operator =( - const Vector3_& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object geometry_msgs::msg::dds_::Vector3_ that will be copied. - */ - eProsima_user_DllExport Vector3_& operator =( - Vector3_&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::dds_::Vector3_ object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Vector3_& x) const; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::dds_::Vector3_ object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Vector3_& x) const; - - /*! - * @brief This function sets a value in member x - * @param _x New value for member x - */ - eProsima_user_DllExport void x( - double _x); - - /*! - * @brief This function returns the value of member x - * @return Value of member x - */ - eProsima_user_DllExport double x() const; - - /*! - * @brief This function returns a reference to member x - * @return Reference to member x - */ - eProsima_user_DllExport double& x(); - - - /*! - * @brief This function sets a value in member y - * @param _y New value for member y - */ - eProsima_user_DllExport void y( - double _y); - - /*! - * @brief This function returns the value of member y - * @return Value of member y - */ - eProsima_user_DllExport double y() const; - - /*! - * @brief This function returns a reference to member y - * @return Reference to member y - */ - eProsima_user_DllExport double& y(); - - - /*! - * @brief This function sets a value in member z - * @param _z New value for member z - */ - eProsima_user_DllExport void z( - double _z); - - /*! - * @brief This function returns the value of member z - * @return Value of member z - */ - eProsima_user_DllExport double z() const; - - /*! - * @brief This function returns a reference to member z - * @return Reference to member z - */ - eProsima_user_DllExport double& z(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const geometry_msgs::msg::dds_::Vector3_& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - double m_x; - double m_y; - double m_z; - - }; - - } // namespace dds_ - } // namespace msg -} // namespace geometry_msgs - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3_H_ - - - diff --git a/mujoco/idl_gen/geometry_msgs/Vector3CdrAux.hpp b/mujoco/idl_gen/geometry_msgs/Vector3CdrAux.hpp deleted file mode 100644 index cf1af8c..0000000 --- a/mujoco/idl_gen/geometry_msgs/Vector3CdrAux.hpp +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Vector3CdrAux.hpp - * This source file contains some definitions of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3CDRAUX_HPP_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3CDRAUX_HPP_ - -#include "Vector3.h" - -constexpr uint32_t geometry_msgs_msg_dds__Vector3__max_cdr_typesize {24UL}; -constexpr uint32_t geometry_msgs_msg_dds__Vector3__max_key_cdr_typesize {0UL}; - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::Vector3_& data); - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3CDRAUX_HPP_ - diff --git a/mujoco/idl_gen/geometry_msgs/Vector3CdrAux.ipp b/mujoco/idl_gen/geometry_msgs/Vector3CdrAux.ipp deleted file mode 100644 index 9bf2b9a..0000000 --- a/mujoco/idl_gen/geometry_msgs/Vector3CdrAux.ipp +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Vector3CdrAux.ipp - * This source file contains some declarations of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3CDRAUX_IPP_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3CDRAUX_IPP_ - -#include "Vector3CdrAux.hpp" - -#include -#include - - -#include -using namespace eprosima::fastcdr::exception; - -namespace eprosima { -namespace fastcdr { - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const geometry_msgs::msg::dds_::Vector3_& data, - size_t& current_alignment) -{ - using namespace geometry_msgs::msg::dds_; - - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.x(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.y(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.z(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::Vector3_& data) -{ - using namespace geometry_msgs::msg::dds_; - - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.x() - << eprosima::fastcdr::MemberId(1) << data.y() - << eprosima::fastcdr::MemberId(2) << data.z() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - geometry_msgs::msg::dds_::Vector3_& data) -{ - using namespace geometry_msgs::msg::dds_; - - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.x(); - break; - - case 1: - dcdr >> data.y(); - break; - - case 2: - dcdr >> data.z(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const geometry_msgs::msg::dds_::Vector3_& data) -{ - using namespace geometry_msgs::msg::dds_; - - static_cast(scdr); - static_cast(data); -} - - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3CDRAUX_IPP_ - diff --git a/mujoco/idl_gen/geometry_msgs/Vector3PubSubTypes.cxx b/mujoco/idl_gen/geometry_msgs/Vector3PubSubTypes.cxx deleted file mode 100644 index a8a59b9..0000000 --- a/mujoco/idl_gen/geometry_msgs/Vector3PubSubTypes.cxx +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Vector3PubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#include - -#include "Vector3PubSubTypes.h" -#include "Vector3CdrAux.hpp" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; -using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - -namespace geometry_msgs { - namespace msg { - namespace dds_ { - - - Vector3_PubSubType::Vector3_PubSubType() - { - setName("geometry_msgs::msg::dds_::Vector3_"); - uint32_t type_size = - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(Vector3_::getMaxCdrSerializedSize()); - #else - geometry_msgs_msg_dds__Vector3__max_cdr_typesize; - #endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = geometry_msgs_msg_dds__Vector3__max_key_cdr_typesize > 16 ? geometry_msgs_msg_dds__Vector3__max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - Vector3_PubSubType::~Vector3_PubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool Vector3_PubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) - { - Vector3_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - #if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - #endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length - #if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); - #else - payload->length = static_cast(ser.get_serialized_data_length()); - #endif // FASTCDR_VERSION_MAJOR == 1 - return true; - } - - bool Vector3_PubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - Vector3_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN - #if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR - #endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; - } - - std::function Vector3_PubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) - { - return [data, data_representation]() -> uint32_t - { - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - #else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } - #endif // FASTCDR_VERSION_MAJOR == 1 - }; - } - - void* Vector3_PubSubType::createData() - { - return reinterpret_cast(new Vector3_()); - } - - void Vector3_PubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool Vector3_PubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - Vector3_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - geometry_msgs_msg_dds__Vector3__max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); - #if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); - #else - eprosima::fastcdr::serialize_key(ser, *p_type); - #endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || geometry_msgs_msg_dds__Vector3__max_key_cdr_typesize > 16) - { - m_md5.init(); - #if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - #else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); - #endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace dds_ - - - } //End of namespace msg - - -} //End of namespace geometry_msgs - diff --git a/mujoco/idl_gen/geometry_msgs/Vector3PubSubTypes.h b/mujoco/idl_gen/geometry_msgs/Vector3PubSubTypes.h deleted file mode 100644 index a7045eb..0000000 --- a/mujoco/idl_gen/geometry_msgs/Vector3PubSubTypes.h +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Vector3PubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "Vector3.h" - - -#if !defined(GEN_API_VER) || (GEN_API_VER != 2) -#error \ - Generated Vector3 is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace geometry_msgs -{ - namespace msg - { - namespace dds_ - { - - - - #ifndef SWIG - namespace detail { - - template - struct Vector3__rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - - }; - - struct Vector3__f - { - typedef double Vector3_::* type; - friend constexpr type get( - Vector3__f); - }; - - template struct Vector3__rob; - - template - inline size_t constexpr Vector3__offset_of() - { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } - - } // namespace detail - #endif // ifndef SWIG - - - /*! - * @brief This class represents the TopicDataType of the type Vector3_ defined by the user in the IDL file. - * @ingroup Vector3 - */ - class Vector3_PubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef Vector3_ type; - - eProsima_user_DllExport Vector3_PubSubType(); - - eProsima_user_DllExport ~Vector3_PubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return is_plain_xcdrv1_impl(); - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) - { - return is_plain_xcdrv2_impl(); - } - else - { - return is_plain_xcdrv1_impl(); - } - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) Vector3_(); - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - - private: - - static constexpr bool is_plain_xcdrv1_impl() - { - return 24ULL == - (detail::Vector3__offset_of() + - sizeof(double)); - } - - static constexpr bool is_plain_xcdrv2_impl() - { - return 24ULL == - (detail::Vector3__offset_of() + - sizeof(double)); - } - - }; - } - } -} - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_DDS__VECTOR3_PUBSUBTYPES_H_ - diff --git a/mujoco/idl_gen/nav_msgs/Odometry.cxx b/mujoco/idl_gen/nav_msgs/Odometry.cxx deleted file mode 100644 index 9e7ef5e..0000000 --- a/mujoco/idl_gen/nav_msgs/Odometry.cxx +++ /dev/null @@ -1,443 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Odometry.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Odometry.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define geometry_msgs_msg_dds__Quaternion__max_cdr_typesize 32ULL; -#define geometry_msgs_msg_dds__Vector3__max_cdr_typesize 24ULL; -#define builtin_interfaces_msg_dds__Time__max_cdr_typesize 8ULL; -#define geometry_msgs_msg_dds__TwistWithCovariance__max_cdr_typesize 336ULL; -#define std_msgs_msg_dds__Header__max_cdr_typesize 268ULL; -#define geometry_msgs_msg_dds__Point__max_cdr_typesize 24ULL; -#define geometry_msgs_msg_dds__Pose__max_cdr_typesize 56ULL; -#define geometry_msgs_msg_dds__Twist__max_cdr_typesize 48ULL; -#define nav_msgs_msg_dds__Odometry__max_cdr_typesize 1208ULL; -#define geometry_msgs_msg_dds__PoseWithCovariance__max_cdr_typesize 344ULL; - - -namespace nav_msgs { - -namespace msg { - -namespace dds_ { - - - -Odometry_::Odometry_() -{ - // std_msgs::msg::dds_::Header_ m_header - - // /type_d() m_child_frame_id - - // geometry_msgs::msg::dds_::PoseWithCovariance_ m_pose - - // geometry_msgs::msg::dds_::TwistWithCovariance_ m_twist - - -} - -Odometry_::~Odometry_() -{ -} - -Odometry_::Odometry_( - const Odometry_& x) -{ - m_header = x.m_header; - - - m_child_frame_id = x.m_child_frame_id; - - - m_pose = x.m_pose; - - - m_twist = x.m_twist; - -} - -Odometry_::Odometry_( - Odometry_&& x) noexcept -{ - m_header = std::move(x.m_header); - - - m_child_frame_id = std::move(x.m_child_frame_id); - - - m_pose = std::move(x.m_pose); - - - m_twist = std::move(x.m_twist); - -} - -Odometry_& Odometry_::operator =( - const Odometry_& x) -{ - m_header = x.m_header; - - - m_child_frame_id = x.m_child_frame_id; - - - m_pose = x.m_pose; - - - m_twist = x.m_twist; - - return *this; -} - -Odometry_& Odometry_::operator =( - Odometry_&& x) noexcept -{ - m_header = std::move(x.m_header); - - - m_child_frame_id = std::move(x.m_child_frame_id); - - - m_pose = std::move(x.m_pose); - - - m_twist = std::move(x.m_twist); - - return *this; -} - -bool Odometry_::operator ==( - const Odometry_& x) const -{ - return (m_header == x.m_header && - m_child_frame_id == x.m_child_frame_id && - m_pose == x.m_pose && - m_twist == x.m_twist); -} - -bool Odometry_::operator !=( - const Odometry_& x) const -{ - return !(*this == x); -} - -size_t Odometry_::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return nav_msgs_msg_dds__Odometry__max_cdr_typesize; -} - -size_t Odometry_::getCdrSerializedSize( - const Odometry_& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += std_msgs::msg::dds_::Header_::getCdrSerializedSize(data.header(), current_alignment); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.child_frame_id().size() + 1; - - - current_alignment += geometry_msgs::msg::dds_::PoseWithCovariance_::getCdrSerializedSize(data.pose(), current_alignment); - - - current_alignment += geometry_msgs::msg::dds_::TwistWithCovariance_::getCdrSerializedSize(data.twist(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void Odometry_::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_header; - - scdr << m_child_frame_id.c_str(); - - scdr << m_pose; - - scdr << m_twist; - -} - -void Odometry_::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_header; - - - - dcdr >> m_child_frame_id; - - - - dcdr >> m_pose; - - - - dcdr >> m_twist; - - -} - - -bool Odometry_::isKeyDefined() -{ - return false; -} - -void Odometry_::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ -void Odometry_::header( - const std_msgs::msg::dds_::Header_& _header) -{ - m_header = _header; -} - -/*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ -void Odometry_::header( - std_msgs::msg::dds_::Header_&& _header) -{ - m_header = std::move(_header); -} - -/*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ -const std_msgs::msg::dds_::Header_& Odometry_::header() const -{ - return m_header; -} - -/*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ -std_msgs::msg::dds_::Header_& Odometry_::header() -{ - return m_header; -} - - -/*! - * @brief This function copies the value in member child_frame_id - * @param _child_frame_id New value to be copied in member child_frame_id - */ -void Odometry_::child_frame_id( - const std::string& _child_frame_id) -{ - m_child_frame_id = _child_frame_id; -} - -/*! - * @brief This function moves the value in member child_frame_id - * @param _child_frame_id New value to be moved in member child_frame_id - */ -void Odometry_::child_frame_id( - std::string&& _child_frame_id) -{ - m_child_frame_id = std::move(_child_frame_id); -} - -/*! - * @brief This function returns a constant reference to member child_frame_id - * @return Constant reference to member child_frame_id - */ -const std::string& Odometry_::child_frame_id() const -{ - return m_child_frame_id; -} - -/*! - * @brief This function returns a reference to member child_frame_id - * @return Reference to member child_frame_id - */ -std::string& Odometry_::child_frame_id() -{ - return m_child_frame_id; -} - - -/*! - * @brief This function copies the value in member pose - * @param _pose New value to be copied in member pose - */ -void Odometry_::pose( - const geometry_msgs::msg::dds_::PoseWithCovariance_& _pose) -{ - m_pose = _pose; -} - -/*! - * @brief This function moves the value in member pose - * @param _pose New value to be moved in member pose - */ -void Odometry_::pose( - geometry_msgs::msg::dds_::PoseWithCovariance_&& _pose) -{ - m_pose = std::move(_pose); -} - -/*! - * @brief This function returns a constant reference to member pose - * @return Constant reference to member pose - */ -const geometry_msgs::msg::dds_::PoseWithCovariance_& Odometry_::pose() const -{ - return m_pose; -} - -/*! - * @brief This function returns a reference to member pose - * @return Reference to member pose - */ -geometry_msgs::msg::dds_::PoseWithCovariance_& Odometry_::pose() -{ - return m_pose; -} - - -/*! - * @brief This function copies the value in member twist - * @param _twist New value to be copied in member twist - */ -void Odometry_::twist( - const geometry_msgs::msg::dds_::TwistWithCovariance_& _twist) -{ - m_twist = _twist; -} - -/*! - * @brief This function moves the value in member twist - * @param _twist New value to be moved in member twist - */ -void Odometry_::twist( - geometry_msgs::msg::dds_::TwistWithCovariance_&& _twist) -{ - m_twist = std::move(_twist); -} - -/*! - * @brief This function returns a constant reference to member twist - * @return Constant reference to member twist - */ -const geometry_msgs::msg::dds_::TwistWithCovariance_& Odometry_::twist() const -{ - return m_twist; -} - -/*! - * @brief This function returns a reference to member twist - * @return Reference to member twist - */ -geometry_msgs::msg::dds_::TwistWithCovariance_& Odometry_::twist() -{ - return m_twist; -} - - - - - -} // namespace dds_ - - -} // namespace msg - - -} // namespace nav_msgs - diff --git a/mujoco/idl_gen/nav_msgs/Odometry.h b/mujoco/idl_gen/nav_msgs/Odometry.h deleted file mode 100644 index b7a4fb9..0000000 --- a/mujoco/idl_gen/nav_msgs/Odometry.h +++ /dev/null @@ -1,310 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Odometry.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_NAV_MSGS_MSG_DDS__ODOMETRY_H_ -#define _FAST_DDS_GENERATED_NAV_MSGS_MSG_DDS__ODOMETRY_H_ - -#include "Header.h" -#include "PoseWithCovariance.h" -#include "TwistWithCovariance.h" - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(ODOMETRY_SOURCE) -#define ODOMETRY_DllAPI __declspec( dllexport ) -#else -#define ODOMETRY_DllAPI __declspec( dllimport ) -#endif // ODOMETRY_SOURCE -#else -#define ODOMETRY_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define ODOMETRY_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -namespace nav_msgs { - namespace msg { - namespace dds_ { - - - /*! - * @brief This class represents the structure Odometry_ defined by the user in the IDL file. - * @ingroup Odometry - */ - class Odometry_ - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Odometry_(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Odometry_(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object nav_msgs::msg::dds_::Odometry_ that will be copied. - */ - eProsima_user_DllExport Odometry_( - const Odometry_& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object nav_msgs::msg::dds_::Odometry_ that will be copied. - */ - eProsima_user_DllExport Odometry_( - Odometry_&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object nav_msgs::msg::dds_::Odometry_ that will be copied. - */ - eProsima_user_DllExport Odometry_& operator =( - const Odometry_& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object nav_msgs::msg::dds_::Odometry_ that will be copied. - */ - eProsima_user_DllExport Odometry_& operator =( - Odometry_&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x nav_msgs::msg::dds_::Odometry_ object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Odometry_& x) const; - - /*! - * @brief Comparison operator. - * @param x nav_msgs::msg::dds_::Odometry_ object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Odometry_& x) const; - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - eProsima_user_DllExport void header( - const std_msgs::msg::dds_::Header_& _header); - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - eProsima_user_DllExport void header( - std_msgs::msg::dds_::Header_&& _header); - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - eProsima_user_DllExport const std_msgs::msg::dds_::Header_& header() const; - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - eProsima_user_DllExport std_msgs::msg::dds_::Header_& header(); - - - /*! - * @brief This function copies the value in member child_frame_id - * @param _child_frame_id New value to be copied in member child_frame_id - */ - eProsima_user_DllExport void child_frame_id( - const std::string& _child_frame_id); - - /*! - * @brief This function moves the value in member child_frame_id - * @param _child_frame_id New value to be moved in member child_frame_id - */ - eProsima_user_DllExport void child_frame_id( - std::string&& _child_frame_id); - - /*! - * @brief This function returns a constant reference to member child_frame_id - * @return Constant reference to member child_frame_id - */ - eProsima_user_DllExport const std::string& child_frame_id() const; - - /*! - * @brief This function returns a reference to member child_frame_id - * @return Reference to member child_frame_id - */ - eProsima_user_DllExport std::string& child_frame_id(); - - - /*! - * @brief This function copies the value in member pose - * @param _pose New value to be copied in member pose - */ - eProsima_user_DllExport void pose( - const geometry_msgs::msg::dds_::PoseWithCovariance_& _pose); - - /*! - * @brief This function moves the value in member pose - * @param _pose New value to be moved in member pose - */ - eProsima_user_DllExport void pose( - geometry_msgs::msg::dds_::PoseWithCovariance_&& _pose); - - /*! - * @brief This function returns a constant reference to member pose - * @return Constant reference to member pose - */ - eProsima_user_DllExport const geometry_msgs::msg::dds_::PoseWithCovariance_& pose() const; - - /*! - * @brief This function returns a reference to member pose - * @return Reference to member pose - */ - eProsima_user_DllExport geometry_msgs::msg::dds_::PoseWithCovariance_& pose(); - - - /*! - * @brief This function copies the value in member twist - * @param _twist New value to be copied in member twist - */ - eProsima_user_DllExport void twist( - const geometry_msgs::msg::dds_::TwistWithCovariance_& _twist); - - /*! - * @brief This function moves the value in member twist - * @param _twist New value to be moved in member twist - */ - eProsima_user_DllExport void twist( - geometry_msgs::msg::dds_::TwistWithCovariance_&& _twist); - - /*! - * @brief This function returns a constant reference to member twist - * @return Constant reference to member twist - */ - eProsima_user_DllExport const geometry_msgs::msg::dds_::TwistWithCovariance_& twist() const; - - /*! - * @brief This function returns a reference to member twist - * @return Reference to member twist - */ - eProsima_user_DllExport geometry_msgs::msg::dds_::TwistWithCovariance_& twist(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const nav_msgs::msg::dds_::Odometry_& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - std_msgs::msg::dds_::Header_ m_header; - std::string m_child_frame_id; - geometry_msgs::msg::dds_::PoseWithCovariance_ m_pose; - geometry_msgs::msg::dds_::TwistWithCovariance_ m_twist; - - }; - - } // namespace dds_ - } // namespace msg -} // namespace nav_msgs - -#endif // _FAST_DDS_GENERATED_NAV_MSGS_MSG_DDS__ODOMETRY_H_ - - - diff --git a/mujoco/idl_gen/nav_msgs/OdometryCdrAux.hpp b/mujoco/idl_gen/nav_msgs/OdometryCdrAux.hpp deleted file mode 100644 index 73d078a..0000000 --- a/mujoco/idl_gen/nav_msgs/OdometryCdrAux.hpp +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file OdometryCdrAux.hpp - * This source file contains some definitions of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_NAV_MSGS_MSG_DDS__ODOMETRYCDRAUX_HPP_ -#define _FAST_DDS_GENERATED_NAV_MSGS_MSG_DDS__ODOMETRYCDRAUX_HPP_ - -#include "Odometry.h" - -constexpr uint32_t nav_msgs_msg_dds__Odometry__max_cdr_typesize {1208UL}; -constexpr uint32_t nav_msgs_msg_dds__Odometry__max_key_cdr_typesize {0UL}; - - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const nav_msgs::msg::dds_::Odometry_& data); - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_NAV_MSGS_MSG_DDS__ODOMETRYCDRAUX_HPP_ - diff --git a/mujoco/idl_gen/nav_msgs/OdometryCdrAux.ipp b/mujoco/idl_gen/nav_msgs/OdometryCdrAux.ipp deleted file mode 100644 index 9c2acb5..0000000 --- a/mujoco/idl_gen/nav_msgs/OdometryCdrAux.ipp +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file OdometryCdrAux.ipp - * This source file contains some declarations of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_NAV_MSGS_MSG_DDS__ODOMETRYCDRAUX_IPP_ -#define _FAST_DDS_GENERATED_NAV_MSGS_MSG_DDS__ODOMETRYCDRAUX_IPP_ - -#include "OdometryCdrAux.hpp" - -#include -#include - - -#include -using namespace eprosima::fastcdr::exception; - -namespace eprosima { -namespace fastcdr { - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const nav_msgs::msg::dds_::Odometry_& data, - size_t& current_alignment) -{ - using namespace nav_msgs::msg::dds_; - - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.header(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.child_frame_id(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.pose(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), - data.twist(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const nav_msgs::msg::dds_::Odometry_& data) -{ - using namespace nav_msgs::msg::dds_; - - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.header() - << eprosima::fastcdr::MemberId(1) << data.child_frame_id() - << eprosima::fastcdr::MemberId(2) << data.pose() - << eprosima::fastcdr::MemberId(3) << data.twist() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - nav_msgs::msg::dds_::Odometry_& data) -{ - using namespace nav_msgs::msg::dds_; - - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.header(); - break; - - case 1: - dcdr >> data.child_frame_id(); - break; - - case 2: - dcdr >> data.pose(); - break; - - case 3: - dcdr >> data.twist(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const nav_msgs::msg::dds_::Odometry_& data) -{ - using namespace nav_msgs::msg::dds_; - - static_cast(scdr); - static_cast(data); -} - - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_NAV_MSGS_MSG_DDS__ODOMETRYCDRAUX_IPP_ - diff --git a/mujoco/idl_gen/nav_msgs/OdometryPubSubTypes.cxx b/mujoco/idl_gen/nav_msgs/OdometryPubSubTypes.cxx deleted file mode 100644 index 2a2e45d..0000000 --- a/mujoco/idl_gen/nav_msgs/OdometryPubSubTypes.cxx +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file OdometryPubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#include - -#include "OdometryPubSubTypes.h" -#include "OdometryCdrAux.hpp" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; -using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - -namespace nav_msgs { - namespace msg { - namespace dds_ { - - - Odometry_PubSubType::Odometry_PubSubType() - { - setName("nav_msgs::msg::dds_::Odometry_"); - uint32_t type_size = - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(Odometry_::getMaxCdrSerializedSize()); - #else - nav_msgs_msg_dds__Odometry__max_cdr_typesize; - #endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = nav_msgs_msg_dds__Odometry__max_key_cdr_typesize > 16 ? nav_msgs_msg_dds__Odometry__max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - Odometry_PubSubType::~Odometry_PubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool Odometry_PubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) - { - Odometry_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - #if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - #endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length - #if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); - #else - payload->length = static_cast(ser.get_serialized_data_length()); - #endif // FASTCDR_VERSION_MAJOR == 1 - return true; - } - - bool Odometry_PubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - Odometry_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN - #if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR - #endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; - } - - std::function Odometry_PubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) - { - return [data, data_representation]() -> uint32_t - { - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - #else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } - #endif // FASTCDR_VERSION_MAJOR == 1 - }; - } - - void* Odometry_PubSubType::createData() - { - return reinterpret_cast(new Odometry_()); - } - - void Odometry_PubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool Odometry_PubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - Odometry_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - nav_msgs_msg_dds__Odometry__max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); - #if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); - #else - eprosima::fastcdr::serialize_key(ser, *p_type); - #endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || nav_msgs_msg_dds__Odometry__max_key_cdr_typesize > 16) - { - m_md5.init(); - #if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - #else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); - #endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace dds_ - - - } //End of namespace msg - - -} //End of namespace nav_msgs - diff --git a/mujoco/idl_gen/nav_msgs/OdometryPubSubTypes.h b/mujoco/idl_gen/nav_msgs/OdometryPubSubTypes.h deleted file mode 100644 index edce4c8..0000000 --- a/mujoco/idl_gen/nav_msgs/OdometryPubSubTypes.h +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file OdometryPubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_NAV_MSGS_MSG_DDS__ODOMETRY_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_NAV_MSGS_MSG_DDS__ODOMETRY_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "Odometry.h" - -#include "HeaderPubSubTypes.h" -#include "PoseWithCovariancePubSubTypes.h" -#include "TwistWithCovariancePubSubTypes.h" - -#if !defined(GEN_API_VER) || (GEN_API_VER != 2) -#error \ - Generated Odometry is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace nav_msgs -{ - namespace msg - { - namespace dds_ - { - - - - /*! - * @brief This class represents the TopicDataType of the type Odometry_ defined by the user in the IDL file. - * @ingroup Odometry - */ - class Odometry_PubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef Odometry_ type; - - eProsima_user_DllExport Odometry_PubSubType(); - - eProsima_user_DllExport ~Odometry_PubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - - }; - } - } -} - -#endif // _FAST_DDS_GENERATED_NAV_MSGS_MSG_DDS__ODOMETRY_PUBSUBTYPES_H_ - diff --git a/mujoco/idl_gen/std_msgs/Header.cxx b/mujoco/idl_gen/std_msgs/Header.cxx deleted file mode 100644 index fc56cc5..0000000 --- a/mujoco/idl_gen/std_msgs/Header.cxx +++ /dev/null @@ -1,309 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Header.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Header.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define builtin_interfaces_msg_dds__Time__max_cdr_typesize 8ULL; -#define std_msgs_msg_dds__Header__max_cdr_typesize 268ULL; - - -namespace std_msgs { - -namespace msg { - -namespace dds_ { - - - -Header_::Header_() -{ - // builtin_interfaces::msg::dds_::Time_ m_stamp - - // /type_d() m_frame_id - - -} - -Header_::~Header_() -{ -} - -Header_::Header_( - const Header_& x) -{ - m_stamp = x.m_stamp; - - - m_frame_id = x.m_frame_id; - -} - -Header_::Header_( - Header_&& x) noexcept -{ - m_stamp = std::move(x.m_stamp); - - - m_frame_id = std::move(x.m_frame_id); - -} - -Header_& Header_::operator =( - const Header_& x) -{ - m_stamp = x.m_stamp; - - - m_frame_id = x.m_frame_id; - - return *this; -} - -Header_& Header_::operator =( - Header_&& x) noexcept -{ - m_stamp = std::move(x.m_stamp); - - - m_frame_id = std::move(x.m_frame_id); - - return *this; -} - -bool Header_::operator ==( - const Header_& x) const -{ - return (m_stamp == x.m_stamp && - m_frame_id == x.m_frame_id); -} - -bool Header_::operator !=( - const Header_& x) const -{ - return !(*this == x); -} - -size_t Header_::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return std_msgs_msg_dds__Header__max_cdr_typesize; -} - -size_t Header_::getCdrSerializedSize( - const Header_& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += builtin_interfaces::msg::dds_::Time_::getCdrSerializedSize(data.stamp(), current_alignment); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.frame_id().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void Header_::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_stamp; - - scdr << m_frame_id.c_str(); - -} - -void Header_::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_stamp; - - - - dcdr >> m_frame_id; - - -} - - -bool Header_::isKeyDefined() -{ - return false; -} - -void Header_::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member stamp - * @param _stamp New value to be copied in member stamp - */ -void Header_::stamp( - const builtin_interfaces::msg::dds_::Time_& _stamp) -{ - m_stamp = _stamp; -} - -/*! - * @brief This function moves the value in member stamp - * @param _stamp New value to be moved in member stamp - */ -void Header_::stamp( - builtin_interfaces::msg::dds_::Time_&& _stamp) -{ - m_stamp = std::move(_stamp); -} - -/*! - * @brief This function returns a constant reference to member stamp - * @return Constant reference to member stamp - */ -const builtin_interfaces::msg::dds_::Time_& Header_::stamp() const -{ - return m_stamp; -} - -/*! - * @brief This function returns a reference to member stamp - * @return Reference to member stamp - */ -builtin_interfaces::msg::dds_::Time_& Header_::stamp() -{ - return m_stamp; -} - - -/*! - * @brief This function copies the value in member frame_id - * @param _frame_id New value to be copied in member frame_id - */ -void Header_::frame_id( - const std::string& _frame_id) -{ - m_frame_id = _frame_id; -} - -/*! - * @brief This function moves the value in member frame_id - * @param _frame_id New value to be moved in member frame_id - */ -void Header_::frame_id( - std::string&& _frame_id) -{ - m_frame_id = std::move(_frame_id); -} - -/*! - * @brief This function returns a constant reference to member frame_id - * @return Constant reference to member frame_id - */ -const std::string& Header_::frame_id() const -{ - return m_frame_id; -} - -/*! - * @brief This function returns a reference to member frame_id - * @return Reference to member frame_id - */ -std::string& Header_::frame_id() -{ - return m_frame_id; -} - - - - - -} // namespace dds_ - - -} // namespace msg - - -} // namespace std_msgs - diff --git a/mujoco/idl_gen/std_msgs/Header.h b/mujoco/idl_gen/std_msgs/Header.h deleted file mode 100644 index 91bdf94..0000000 --- a/mujoco/idl_gen/std_msgs/Header.h +++ /dev/null @@ -1,252 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Header.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADER_H_ -#define _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADER_H_ - -#include "Time.h" - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(HEADER_SOURCE) -#define HEADER_DllAPI __declspec( dllexport ) -#else -#define HEADER_DllAPI __declspec( dllimport ) -#endif // HEADER_SOURCE -#else -#define HEADER_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define HEADER_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -namespace std_msgs { - namespace msg { - namespace dds_ { - - - /*! - * @brief This class represents the structure Header_ defined by the user in the IDL file. - * @ingroup Header - */ - class Header_ - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Header_(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Header_(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object std_msgs::msg::dds_::Header_ that will be copied. - */ - eProsima_user_DllExport Header_( - const Header_& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object std_msgs::msg::dds_::Header_ that will be copied. - */ - eProsima_user_DllExport Header_( - Header_&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object std_msgs::msg::dds_::Header_ that will be copied. - */ - eProsima_user_DllExport Header_& operator =( - const Header_& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object std_msgs::msg::dds_::Header_ that will be copied. - */ - eProsima_user_DllExport Header_& operator =( - Header_&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x std_msgs::msg::dds_::Header_ object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Header_& x) const; - - /*! - * @brief Comparison operator. - * @param x std_msgs::msg::dds_::Header_ object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Header_& x) const; - - /*! - * @brief This function copies the value in member stamp - * @param _stamp New value to be copied in member stamp - */ - eProsima_user_DllExport void stamp( - const builtin_interfaces::msg::dds_::Time_& _stamp); - - /*! - * @brief This function moves the value in member stamp - * @param _stamp New value to be moved in member stamp - */ - eProsima_user_DllExport void stamp( - builtin_interfaces::msg::dds_::Time_&& _stamp); - - /*! - * @brief This function returns a constant reference to member stamp - * @return Constant reference to member stamp - */ - eProsima_user_DllExport const builtin_interfaces::msg::dds_::Time_& stamp() const; - - /*! - * @brief This function returns a reference to member stamp - * @return Reference to member stamp - */ - eProsima_user_DllExport builtin_interfaces::msg::dds_::Time_& stamp(); - - - /*! - * @brief This function copies the value in member frame_id - * @param _frame_id New value to be copied in member frame_id - */ - eProsima_user_DllExport void frame_id( - const std::string& _frame_id); - - /*! - * @brief This function moves the value in member frame_id - * @param _frame_id New value to be moved in member frame_id - */ - eProsima_user_DllExport void frame_id( - std::string&& _frame_id); - - /*! - * @brief This function returns a constant reference to member frame_id - * @return Constant reference to member frame_id - */ - eProsima_user_DllExport const std::string& frame_id() const; - - /*! - * @brief This function returns a reference to member frame_id - * @return Reference to member frame_id - */ - eProsima_user_DllExport std::string& frame_id(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const std_msgs::msg::dds_::Header_& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - builtin_interfaces::msg::dds_::Time_ m_stamp; - std::string m_frame_id; - - }; - - } // namespace dds_ - } // namespace msg -} // namespace std_msgs - -#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADER_H_ - - - diff --git a/mujoco/idl_gen/std_msgs/HeaderCdrAux.hpp b/mujoco/idl_gen/std_msgs/HeaderCdrAux.hpp deleted file mode 100644 index f7fed1f..0000000 --- a/mujoco/idl_gen/std_msgs/HeaderCdrAux.hpp +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HeaderCdrAux.hpp - * This source file contains some definitions of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADERCDRAUX_HPP_ -#define _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADERCDRAUX_HPP_ - -#include "Header.h" - -constexpr uint32_t std_msgs_msg_dds__Header__max_cdr_typesize {268UL}; -constexpr uint32_t std_msgs_msg_dds__Header__max_key_cdr_typesize {0UL}; - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const std_msgs::msg::dds_::Header_& data); - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADERCDRAUX_HPP_ - diff --git a/mujoco/idl_gen/std_msgs/HeaderCdrAux.ipp b/mujoco/idl_gen/std_msgs/HeaderCdrAux.ipp deleted file mode 100644 index 628d73f..0000000 --- a/mujoco/idl_gen/std_msgs/HeaderCdrAux.ipp +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HeaderCdrAux.ipp - * This source file contains some declarations of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADERCDRAUX_IPP_ -#define _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADERCDRAUX_IPP_ - -#include "HeaderCdrAux.hpp" - -#include -#include - - -#include -using namespace eprosima::fastcdr::exception; - -namespace eprosima { -namespace fastcdr { - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const std_msgs::msg::dds_::Header_& data, - size_t& current_alignment) -{ - using namespace std_msgs::msg::dds_; - - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.stamp(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.frame_id(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const std_msgs::msg::dds_::Header_& data) -{ - using namespace std_msgs::msg::dds_; - - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.stamp() - << eprosima::fastcdr::MemberId(1) << data.frame_id() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - std_msgs::msg::dds_::Header_& data) -{ - using namespace std_msgs::msg::dds_; - - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.stamp(); - break; - - case 1: - dcdr >> data.frame_id(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const std_msgs::msg::dds_::Header_& data) -{ - using namespace std_msgs::msg::dds_; - - static_cast(scdr); - static_cast(data); -} - - - - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADERCDRAUX_IPP_ - diff --git a/mujoco/idl_gen/std_msgs/HeaderPubSubTypes.cxx b/mujoco/idl_gen/std_msgs/HeaderPubSubTypes.cxx deleted file mode 100644 index 6c6cfb4..0000000 --- a/mujoco/idl_gen/std_msgs/HeaderPubSubTypes.cxx +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HeaderPubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#include - -#include "HeaderPubSubTypes.h" -#include "HeaderCdrAux.hpp" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; -using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - -namespace std_msgs { - namespace msg { - namespace dds_ { - - - Header_PubSubType::Header_PubSubType() - { - setName("std_msgs::msg::dds_::Header_"); - uint32_t type_size = - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(Header_::getMaxCdrSerializedSize()); - #else - std_msgs_msg_dds__Header__max_cdr_typesize; - #endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = std_msgs_msg_dds__Header__max_key_cdr_typesize > 16 ? std_msgs_msg_dds__Header__max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - Header_PubSubType::~Header_PubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool Header_PubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) - { - Header_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - #if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - #endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length - #if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); - #else - payload->length = static_cast(ser.get_serialized_data_length()); - #endif // FASTCDR_VERSION_MAJOR == 1 - return true; - } - - bool Header_PubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - Header_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN - #if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR - #endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; - } - - std::function Header_PubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) - { - return [data, data_representation]() -> uint32_t - { - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - #else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } - #endif // FASTCDR_VERSION_MAJOR == 1 - }; - } - - void* Header_PubSubType::createData() - { - return reinterpret_cast(new Header_()); - } - - void Header_PubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool Header_PubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - Header_* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - std_msgs_msg_dds__Header__max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); - #if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); - #else - eprosima::fastcdr::serialize_key(ser, *p_type); - #endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || std_msgs_msg_dds__Header__max_key_cdr_typesize > 16) - { - m_md5.init(); - #if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - #else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); - #endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace dds_ - - - } //End of namespace msg - - -} //End of namespace std_msgs - diff --git a/mujoco/idl_gen/std_msgs/HeaderPubSubTypes.h b/mujoco/idl_gen/std_msgs/HeaderPubSubTypes.h deleted file mode 100644 index 20f2d28..0000000 --- a/mujoco/idl_gen/std_msgs/HeaderPubSubTypes.h +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HeaderPubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADER_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADER_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "Header.h" - -#include "TimePubSubTypes.h" - -#if !defined(GEN_API_VER) || (GEN_API_VER != 2) -#error \ - Generated Header is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace std_msgs -{ - namespace msg - { - namespace dds_ - { - - - - /*! - * @brief This class represents the TopicDataType of the type Header_ defined by the user in the IDL file. - * @ingroup Header - */ - class Header_PubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef Header_ type; - - eProsima_user_DllExport Header_PubSubType(); - - eProsima_user_DllExport ~Header_PubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - - }; - } - } -} - -#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_DDS__HEADER_PUBSUBTYPES_H_ - diff --git a/mujoco/module/SdkBridge/CMakeLists.txt b/mujoco/module/SdkBridge/CMakeLists.txt index cc81828..6047dae 100644 --- a/mujoco/module/SdkBridge/CMakeLists.txt +++ b/mujoco/module/SdkBridge/CMakeLists.txt @@ -1,39 +1,25 @@ -# --- k1sim_idl: vendored fastddsgen output (mujoco/idl_gen/, see idl/regenerate.sh) --- -# Clean-room IDL for the Booster SDK wire types; see PROTOCOL.md for provenance. -set(K1SIM_IDL_GEN_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../idl_gen) +# --- k1sim_idl: Fast-DDS type support generated from mujoco/idl/ at build time --- +# Clean-room IDL for the Booster SDK wire types; see PROTOCOL.md for provenance. The +# generated code lives in the build directory and is never committed — cmake/IdlGen.cmake +# runs idl/regenerate.sh and exports k1sim_idl_outputs / k1sim_idl_packages. Adding a +# message means adding one .idl; nothing in this file changes. +include(${PROJECT_SOURCE_DIR}/cmake/IdlGen.cmake) -file(GLOB k1sim_idl_srcs CONFIGURE_DEPENDS - ${K1SIM_IDL_GEN_DIR}/booster_interface/*.cxx - ${K1SIM_IDL_GEN_DIR}/booster_msgs/*.cxx - ${K1SIM_IDL_GEN_DIR}/geometry_msgs/*.cxx - ${K1SIM_IDL_GEN_DIR}/builtin_interfaces/*.cxx - ${K1SIM_IDL_GEN_DIR}/std_msgs/*.cxx - ${K1SIM_IDL_GEN_DIR}/nav_msgs/*.cxx -) -file(GLOB k1sim_idl_ipp CONFIGURE_DEPENDS - ${K1SIM_IDL_GEN_DIR}/booster_interface/*.ipp - ${K1SIM_IDL_GEN_DIR}/booster_msgs/*.ipp - ${K1SIM_IDL_GEN_DIR}/geometry_msgs/*.ipp - ${K1SIM_IDL_GEN_DIR}/builtin_interfaces/*.ipp - ${K1SIM_IDL_GEN_DIR}/std_msgs/*.ipp - ${K1SIM_IDL_GEN_DIR}/nav_msgs/*.ipp -) # Each CdrAux.ipp holds explicit fastcdr template specializations # (calculate_serialized_size/serialize/deserialize/serialize_key for that exact # type) that PubSubTypes.cxx calls but neither declares nor includes the # definition of — fastddsgen expects them compiled as their own translation unit. # CMake doesn't recognise ".ipp" as a C++ source extension by default, so mark it -# explicitly (each file's include guard + single glob-inclusion keeps this to -# exactly one definition per type across the whole link). -set_source_files_properties(${k1sim_idl_ipp} PROPERTIES LANGUAGE CXX) +# explicitly (each file's include guard + one entry per type in k1sim_idl_outputs +# keeps this to exactly one definition per type across the whole link). +foreach(generated ${k1sim_idl_outputs}) + if(generated MATCHES "\\.ipp$") + set_source_files_properties(${generated} PROPERTIES LANGUAGE CXX) + endif() +endforeach() -add_library(k1sim_idl STATIC ${k1sim_idl_srcs} ${k1sim_idl_ipp}) -target_include_directories( - k1sim_idl - PUBLIC ${K1SIM_IDL_GEN_DIR}/booster_interface ${K1SIM_IDL_GEN_DIR}/booster_msgs - ${K1SIM_IDL_GEN_DIR}/geometry_msgs ${K1SIM_IDL_GEN_DIR}/builtin_interfaces - ${K1SIM_IDL_GEN_DIR}/std_msgs ${K1SIM_IDL_GEN_DIR}/nav_msgs -) +add_library(k1sim_idl STATIC ${k1sim_idl_outputs}) +target_include_directories(k1sim_idl PUBLIC ${k1sim_idl_packages}) target_link_libraries(k1sim_idl PUBLIC fastrtps fastcdr) # --- module::SdkBridge --- diff --git a/mujoco/module/SdkBridge/PROTOCOL.md b/mujoco/module/SdkBridge/PROTOCOL.md index 07451ab..f933d1a 100644 --- a/mujoco/module/SdkBridge/PROTOCOL.md +++ b/mujoco/module/SdkBridge/PROTOCOL.md @@ -234,7 +234,8 @@ module dds_ { struct Type_ { ... }; }; }; };`), not an SDK-specific invention. Our `mujoco/idl/**/*.idl` files reproduce this exact 3-level module nesting, and plain fastddsgen (see §5 for why **not** `-typeros2`) then registers each type under the identical fully-qualified scoped name — verified directly against the generated -`*PubSubTypes.cxx` (`setName(...)` string literal) after each generation, see +`*PubSubTypes.cxx` (`setName(...)` string literal), which the build writes into +`build-docker/idl_gen//` rather than the source tree (§5) — see `mujoco/idl/regenerate.sh` output and the M4 acceptance test. **Empirical finding on `-typeros2`** (the task's suggested starting point was @@ -257,7 +258,8 @@ nesting); since we author the nesting ourselves (to match the SDK's exact struct including cases like `FallDownStateType_` where the SDK uses a genuine IDL `enum` rather than ROS2 `.msg`-style integer constants — not something `-typeros2` would produce from a `.msg` mirror), passing `-typeros2` on top double-applies the transform. -`mujoco/idl/regenerate.sh` therefore does **not** pass `-typeros2`. +`mujoco/idl/regenerate.sh` — the script CMake runs at build time, see §5 — therefore +does **not** pass `-typeros2`. ## 3. RPC JSON schemas @@ -367,6 +369,13 @@ mixed-uid segments ever accumulate, remove the stale `fastrtps_*` / ## 5. CDR / fastddsgen generation notes +The type support is **generated during the build**, never committed: CMake runs +`mujoco/idl/regenerate.sh` over `mujoco/idl/**/*.idl` into `${CMAKE_BINARY_DIR}/idl_gen` +(`build-docker/idl_gen` for the docker workflow), which git does not track — the same +arrangement NUbots uses to generate its protobuf code from `shared/message/**.proto` +and commit none of it. The `.idl` files are the committed source of truth; there is no +regeneration step to run by hand and nothing generated is ever added to git. + The SDK's headers assert `GEN_API_VER == 2` (i.e. were generated by a Fast-DDS 2.x-era fastddsgen against classic CDR). The toolchain available to us (`/opt/k1sim-deps/bin/fastddsgen`, baked into `k1sim:latest`) is **3.2.1**, whose @@ -379,3 +388,12 @@ profile, which these `dds_::Type_` names impersonate) would have produced. This was validated empirically by the contract test actually deserializing our published `LowState_`/`Odometer_`/etc. samples with the real SDK's compiled (2.x-generated) reader code — see `test/contract/README.md`. + +Those flags (and the deliberate absence of `-typeros2`, §2) live in +`mujoco/idl/regenerate.sh`, which is the single source of truth for the invocation and +is what CMake runs; the script also hard-asserts the generator is 3.2.1 before it +generates anything, since 3.x releases move their own defaults. Both rationales matter +*more* now that generation is automatic than they did when the output was committed: a +changed flag or a swapped generator no longer shows up as a reviewable diff of +`*PubSubTypes.cxx`, it shows up as a robot that silently stops decoding our samples. +Re-read this section and §2 before touching the invocation. diff --git a/mujoco/tools/install_deps.sh b/mujoco/tools/install_deps.sh index 8926e18..b756143 100755 --- a/mujoco/tools/install_deps.sh +++ b/mujoco/tools/install_deps.sh @@ -2,14 +2,23 @@ # Installs the k1_mujoco_sim build prerequisites that CMake does not fetch itself: # - MuJoCo prebuilt release (headers + libmujoco.so) # - Fast-CDR / foonathan_memory_vendor / Fast-DDS (built from source) +# - Fast-DDS-Gen (fastddsgen), the IDL code generator +# +# fastddsgen is part of the standard set, not an extra: CMake now runs it at +# build time to generate the Fast-DDS types into the build dir, so they are no +# longer committed to the repo. A Java 11+ runtime is therefore a hard +# requirement of this script and of the sim build, not an optional add-on. # # This is normally run INSIDE the docker image build (docker/Dockerfile) with # PREFIX=/opt/k1sim-deps — see docker/k1sim.sh for the supported workflow. # Running it directly on a host is a fallback for native development only. # # Usage: -# tools/install_deps.sh # runtime/build deps only -# tools/install_deps.sh --with-fastddsgen # also build the IDL code generator (needs java 11+) +# tools/install_deps.sh # installs everything, fastddsgen included +# tools/install_deps.sh --with-fastddsgen # accepted for backwards compatibility; does nothing +# +# (Unknown arguments are ignored rather than fatal, so older callers such as +# docker/Dockerfile that still pass --with-fastddsgen keep working unchanged.) # # Version pins (rationale in docs/K1_MUJOCO_SETUP.md): # Fast-DDS v2.13.6 matches the minor version bundled with Booster's SDK (2.13.1), @@ -71,21 +80,19 @@ build fastdds https://github.com/eProsima/Fast-DDS.git "$FASTDDS_TAG" \ -DCOMPILE_TOOLS=OFF \ -DSECURITY=OFF -# --- fastddsgen (optional, for regenerating idl_gen/) ------------------------ -if [[ "${1:-}" == "--with-fastddsgen" ]]; then - if [ ! -f "$PREFIX/share/fastddsgen/java/fastddsgen.jar" ]; then - echo "== Fast-DDS-Gen $FASTDDSGEN_TAG" - rm -rf "$SRC/fastddsgen" - git clone --recursive --depth 1 --branch "$FASTDDSGEN_TAG" \ - https://github.com/eProsima/Fast-DDS-Gen.git "$SRC/fastddsgen" - (cd "$SRC/fastddsgen" && ./gradlew assemble) - mkdir -p "$PREFIX/share/fastddsgen/java" "$PREFIX/bin" - cp "$SRC/fastddsgen/share/fastddsgen/java/fastddsgen.jar" "$PREFIX/share/fastddsgen/java/" - cp "$SRC/fastddsgen/scripts/fastddsgen" "$PREFIX/bin/" - chmod +x "$PREFIX/bin/fastddsgen" - else - echo "== Fast-DDS-Gen (cached)" - fi +# --- fastddsgen (required, CMake generates the DDS types at build time) ------ +if [ ! -f "$PREFIX/share/fastddsgen/java/fastddsgen.jar" ]; then + echo "== Fast-DDS-Gen $FASTDDSGEN_TAG" + rm -rf "$SRC/fastddsgen" + git clone --recursive --depth 1 --branch "$FASTDDSGEN_TAG" \ + https://github.com/eProsima/Fast-DDS-Gen.git "$SRC/fastddsgen" + (cd "$SRC/fastddsgen" && ./gradlew assemble) + mkdir -p "$PREFIX/share/fastddsgen/java" "$PREFIX/bin" + cp "$SRC/fastddsgen/share/fastddsgen/java/fastddsgen.jar" "$PREFIX/share/fastddsgen/java/" + cp "$SRC/fastddsgen/scripts/fastddsgen" "$PREFIX/bin/" + chmod +x "$PREFIX/bin/fastddsgen" +else + echo "== Fast-DDS-Gen (cached)" fi echo From 94d6c92f7b97574911a71418f6fb03bd9d284c10 Mon Sep 17 00:00:00 2001 From: jpptm Date: Sun, 13 Sep 2026 12:19:36 +1000 Subject: [PATCH 7/7] . --- mujoco/.gitignore | 4 ---- 1 file changed, 4 deletions(-) diff --git a/mujoco/.gitignore b/mujoco/.gitignore index eeab6ae..0f1928a 100644 --- a/mujoco/.gitignore +++ b/mujoco/.gitignore @@ -2,7 +2,3 @@ build*/ .deps/ .cache/ compile_commands.json - -# Generated at build time by cmake/IdlGen.cmake into the build dir; never committed. -# This entry only catches a stray manual run of idl/regenerate.sh in the source tree. -idl_gen/