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/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/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 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/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/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/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/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/module/SdkBridge/CMakeLists.txt b/mujoco/module/SdkBridge/CMakeLists.txt index 9ff18da..6047dae 100644 --- a/mujoco/module/SdkBridge/CMakeLists.txt +++ b/mujoco/module/SdkBridge/CMakeLists.txt @@ -1,32 +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 -) -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 # 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 -) +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 c74354b..f933d1a 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_`, @@ -213,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 @@ -236,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 @@ -309,7 +332,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. @@ -346,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 @@ -358,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/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()), 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