From 7453ac4e4213eb57dc039c67beee7076460f011b Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Tue, 23 Nov 2021 17:00:16 +0100 Subject: [PATCH] Switch to generate YARP idl files at every build to fix compatibility with YARP master (#131) While working on https://github.com/robotology/robotology-superbuild/issues/900, I had problems with the idl generated files, as the one generated with YARP 3.5 (I guess) had problems to be compiled with YARP master. To avoid the problem at the root, I switched to generate the idl files at each build (instead of committing them manually) and I removed the autogenerated files that at the moment were committed in the repo. This was done by just generating the idl files in the build directory instead of the source directory. * Switch to generate YARP idl files at every build * update changelog Co-authored-by: Hosameldin Mohamed <45564317+HosameldinMohamed@users.noreply.github.com> --- CHANGELOG.md | 4 +- idl/floatingBaseEstimatorRPC/CMakeLists.txt | 2 +- ...dyco_floatingBaseEstimatorRPC_thrift.cmake | 11 - .../floatingBaseEstimatorRPC_index.txt | 4 - .../include/codyco/HomTransform.h | 337 --- .../include/codyco/floatingBaseEstimatorRPC.h | 73 - .../autogenerated/src/HomTransform.cpp | 1658 ------------ .../src/floatingBaseEstimatorRPC.cpp | 467 ---- idl/wholeBodyDynamicsSettings/CMakeLists.txt | 2 +- .../autogenerated/include/ContactPoint.h | 178 -- .../autogenerated/include/Gravity.h | 178 -- .../include/KinematicSourceType.h | 31 - .../include/wholeBodyDynamicsSettings.h | 357 --- .../autogenerated/src/ContactPoint.cpp | 610 ----- .../autogenerated/src/Gravity.cpp | 610 ----- .../autogenerated/src/KinematicSourceType.cpp | 35 - .../src/wholeBodyDynamicsSettings.cpp | 1695 ------------- .../wholeBodyDynamicsSettings_index.txt | 8 - .../wholeBodyDynamicsSettings_thrift.cmake | 11 - .../CMakeLists.txt | 2 +- .../include/wholeBodyDynamics_IDLServer.h | 225 -- .../src/wholeBodyDynamics_IDLServer.cpp | 2234 ----------------- .../wholeBodyDynamics_IDLServer_index.txt | 2 - .../wholeBodyDynamics_IDLServer_thrift.cmake | 11 - 24 files changed, 6 insertions(+), 8739 deletions(-) delete mode 100644 idl/floatingBaseEstimatorRPC/autogenerated/codyco_floatingBaseEstimatorRPC_thrift.cmake delete mode 100644 idl/floatingBaseEstimatorRPC/autogenerated/floatingBaseEstimatorRPC_index.txt delete mode 100644 idl/floatingBaseEstimatorRPC/autogenerated/include/codyco/HomTransform.h delete mode 100644 idl/floatingBaseEstimatorRPC/autogenerated/include/codyco/floatingBaseEstimatorRPC.h delete mode 100644 idl/floatingBaseEstimatorRPC/autogenerated/src/HomTransform.cpp delete mode 100644 idl/floatingBaseEstimatorRPC/autogenerated/src/floatingBaseEstimatorRPC.cpp delete mode 100644 idl/wholeBodyDynamicsSettings/autogenerated/include/ContactPoint.h delete mode 100644 idl/wholeBodyDynamicsSettings/autogenerated/include/Gravity.h delete mode 100644 idl/wholeBodyDynamicsSettings/autogenerated/include/KinematicSourceType.h delete mode 100644 idl/wholeBodyDynamicsSettings/autogenerated/include/wholeBodyDynamicsSettings.h delete mode 100644 idl/wholeBodyDynamicsSettings/autogenerated/src/ContactPoint.cpp delete mode 100644 idl/wholeBodyDynamicsSettings/autogenerated/src/Gravity.cpp delete mode 100644 idl/wholeBodyDynamicsSettings/autogenerated/src/KinematicSourceType.cpp delete mode 100644 idl/wholeBodyDynamicsSettings/autogenerated/src/wholeBodyDynamicsSettings.cpp delete mode 100644 idl/wholeBodyDynamicsSettings/autogenerated/wholeBodyDynamicsSettings_index.txt delete mode 100644 idl/wholeBodyDynamicsSettings/autogenerated/wholeBodyDynamicsSettings_thrift.cmake delete mode 100644 idl/wholeBodyDynamics_IDLServer/autogenerated/include/wholeBodyDynamics_IDLServer.h delete mode 100644 idl/wholeBodyDynamics_IDLServer/autogenerated/src/wholeBodyDynamics_IDLServer.cpp delete mode 100644 idl/wholeBodyDynamics_IDLServer/autogenerated/wholeBodyDynamics_IDLServer_index.txt delete mode 100644 idl/wholeBodyDynamics_IDLServer/autogenerated/wholeBodyDynamics_IDLServer_thrift.cmake diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d6b13a..b577619 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Fixed joint acceleration filtering (See [!124](https://github.com/robotology/whole-body-estimators/pull/124)). -- Fixed `wholeBodyDynamics` device when loaded by the `gazebo_yarp_robotinterface` Gazebo plugin [!126](https://github.com/robotology/whole-body-estimators/issues/126) +- Fixed `wholeBodyDynamics` device when loaded by the `gazebo_yarp_robotinterface` Gazebo plugin [!126](https://github.com/robotology/whole-body-estimators/issues/126). +- Switch to generate YARP idl files at every build to fix compatibility with YARP master [!131](https://github.com/robotology/whole-body-estimators/pull/131). + ### Changed - Always enable compilation of devices (See [!115](https://github.com/robotology/whole-body-estimators/pull/115)) - Migrate from `RateThread` to `PeriodicThread` in WholeBodyDynamics device (See [!130](https://github.com/robotology/whole-body-estimators/pull/130)). diff --git a/idl/floatingBaseEstimatorRPC/CMakeLists.txt b/idl/floatingBaseEstimatorRPC/CMakeLists.txt index 2465c62..ba3a4ab 100644 --- a/idl/floatingBaseEstimatorRPC/CMakeLists.txt +++ b/idl/floatingBaseEstimatorRPC/CMakeLists.txt @@ -3,7 +3,7 @@ # CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT yarp_idl_to_dir(INPUT_FILES codyco/floatingBaseEstimatorRPC.thrift - OUTPUT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/autogenerated + OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/autogenerated SOURCES_VAR WBDIDLSERVER_SRC HEADERS_VAR WBDIDLSERVER_HEADERS INCLUDE_DIRS_VAR WBDIDLSERVER_INCLUDES) diff --git a/idl/floatingBaseEstimatorRPC/autogenerated/codyco_floatingBaseEstimatorRPC_thrift.cmake b/idl/floatingBaseEstimatorRPC/autogenerated/codyco_floatingBaseEstimatorRPC_thrift.cmake deleted file mode 100644 index 69d5031..0000000 --- a/idl/floatingBaseEstimatorRPC/autogenerated/codyco_floatingBaseEstimatorRPC_thrift.cmake +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) -# All rights reserved. -# -# This software may be modified and distributed under the terms of the -# BSD-3-Clause license. See the accompanying LICENSE file for details. - -## This is an automatically-generated file. -## It could get re-generated if the ALLOW_IDL_GENERATION flag is on - -set(headers include/codyco/HomTransform.h;include/codyco/floatingBaseEstimatorRPC.h) -set(sources src/HomTransform.cpp;src/floatingBaseEstimatorRPC.cpp) diff --git a/idl/floatingBaseEstimatorRPC/autogenerated/floatingBaseEstimatorRPC_index.txt b/idl/floatingBaseEstimatorRPC/autogenerated/floatingBaseEstimatorRPC_index.txt deleted file mode 100644 index a55f381..0000000 --- a/idl/floatingBaseEstimatorRPC/autogenerated/floatingBaseEstimatorRPC_index.txt +++ /dev/null @@ -1,4 +0,0 @@ -include/codyco/HomTransform.h -src/HomTransform.cpp -include/codyco/floatingBaseEstimatorRPC.h -src/floatingBaseEstimatorRPC.cpp diff --git a/idl/floatingBaseEstimatorRPC/autogenerated/include/codyco/HomTransform.h b/idl/floatingBaseEstimatorRPC/autogenerated/include/codyco/HomTransform.h deleted file mode 100644 index 39bd7e9..0000000 --- a/idl/floatingBaseEstimatorRPC/autogenerated/include/codyco/HomTransform.h +++ /dev/null @@ -1,337 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) - * SPDX-License-Identifier: BSD-3-Clause - */ - -// Autogenerated by Thrift Compiler (0.14.1-yarped) -// -// This is an automatically generated file. -// It could get re-generated if the ALLOW_IDL_GENERATION flag is on. - -#ifndef YARP_THRIFT_GENERATOR_STRUCT_HOMTRANSFORM_H -#define YARP_THRIFT_GENERATOR_STRUCT_HOMTRANSFORM_H - -#include -#include - -namespace codyco { - -/** - * Structure representing an homogeneous transform, i.e. - * a 4x4 matrix with structure: - * B_H_C = ( xx xy xz x ) - * ( yx yy yz y ) - * ( zx zy zz z ) - * ( 0 0 0 1 ) - * A matrix like that respresents the location of a frame C w.r.t. to a frame B. - * For more information on the semantics of such transformation, please - * refer to http://repository.tue.nl/849895 . - */ -class HomTransform : - public yarp::os::idl::WirePortable -{ -public: - // Fields - double x; - double y; - double z; - double xx; - double xy; - double xz; - double yx; - double yy; - double yz; - double zx; - double zy; - double zz; - - // Default constructor - HomTransform(); - - // Constructor with field values - HomTransform(const double x, - const double y, - const double z, - const double xx, - const double xy, - const double xz, - const double yx, - const double yy, - const double yz, - const double zx, - const double zy, - const double zz); - - // Read structure on a Wire - bool read(yarp::os::idl::WireReader& reader) override; - - // Read structure on a Connection - bool read(yarp::os::ConnectionReader& connection) override; - - // Write structure on a Wire - bool write(const yarp::os::idl::WireWriter& writer) const override; - - // Write structure on a Connection - bool write(yarp::os::ConnectionWriter& connection) const override; - - // Convert to a printable string - std::string toString() const; - - // If you want to serialize this class without nesting, use this helper - typedef yarp::os::idl::Unwrapped unwrapped; - - class Editor : - public yarp::os::Wire, - public yarp::os::PortWriter - { - public: - // Editor: default constructor - Editor(); - - // Editor: constructor with base class - Editor(HomTransform& obj); - - // Editor: destructor - ~Editor() override; - - // Editor: Deleted constructors and operator= - Editor(const Editor& rhs) = delete; - Editor(Editor&& rhs) = delete; - Editor& operator=(const Editor& rhs) = delete; - Editor& operator=(Editor&& rhs) = delete; - - // Editor: edit - bool edit(HomTransform& obj, bool dirty = true); - - // Editor: validity check - bool isValid() const; - - // Editor: state - HomTransform& state(); - - // Editor: start editing - void start_editing(); - -#ifndef YARP_NO_DEPRECATED // Since YARP 3.2 - YARP_DEPRECATED_MSG("Use start_editing() instead") - void begin() - { - start_editing(); - } -#endif // YARP_NO_DEPRECATED - - // Editor: stop editing - void stop_editing(); - -#ifndef YARP_NO_DEPRECATED // Since YARP 3.2 - YARP_DEPRECATED_MSG("Use stop_editing() instead") - void end() - { - stop_editing(); - } -#endif // YARP_NO_DEPRECATED - - // Editor: x field - void set_x(const double x); - double get_x() const; - virtual bool will_set_x(); - virtual bool did_set_x(); - - // Editor: y field - void set_y(const double y); - double get_y() const; - virtual bool will_set_y(); - virtual bool did_set_y(); - - // Editor: z field - void set_z(const double z); - double get_z() const; - virtual bool will_set_z(); - virtual bool did_set_z(); - - // Editor: xx field - void set_xx(const double xx); - double get_xx() const; - virtual bool will_set_xx(); - virtual bool did_set_xx(); - - // Editor: xy field - void set_xy(const double xy); - double get_xy() const; - virtual bool will_set_xy(); - virtual bool did_set_xy(); - - // Editor: xz field - void set_xz(const double xz); - double get_xz() const; - virtual bool will_set_xz(); - virtual bool did_set_xz(); - - // Editor: yx field - void set_yx(const double yx); - double get_yx() const; - virtual bool will_set_yx(); - virtual bool did_set_yx(); - - // Editor: yy field - void set_yy(const double yy); - double get_yy() const; - virtual bool will_set_yy(); - virtual bool did_set_yy(); - - // Editor: yz field - void set_yz(const double yz); - double get_yz() const; - virtual bool will_set_yz(); - virtual bool did_set_yz(); - - // Editor: zx field - void set_zx(const double zx); - double get_zx() const; - virtual bool will_set_zx(); - virtual bool did_set_zx(); - - // Editor: zy field - void set_zy(const double zy); - double get_zy() const; - virtual bool will_set_zy(); - virtual bool did_set_zy(); - - // Editor: zz field - void set_zz(const double zz); - double get_zz() const; - virtual bool will_set_zz(); - virtual bool did_set_zz(); - - // Editor: clean - void clean(); - - // Editor: read - bool read(yarp::os::ConnectionReader& connection) override; - - // Editor: write - bool write(yarp::os::ConnectionWriter& connection) const override; - - private: - // Editor: state - HomTransform* obj; - bool obj_owned; - int group; - - // Editor: dirty variables - bool is_dirty; - bool is_dirty_x; - bool is_dirty_y; - bool is_dirty_z; - bool is_dirty_xx; - bool is_dirty_xy; - bool is_dirty_xz; - bool is_dirty_yx; - bool is_dirty_yy; - bool is_dirty_yz; - bool is_dirty_zx; - bool is_dirty_zy; - bool is_dirty_zz; - int dirty_count; - - // Editor: send if possible - void communicate(); - - // Editor: mark dirty overall - void mark_dirty(); - - // Editor: mark dirty single fields - void mark_dirty_x(); - void mark_dirty_y(); - void mark_dirty_z(); - void mark_dirty_xx(); - void mark_dirty_xy(); - void mark_dirty_xz(); - void mark_dirty_yx(); - void mark_dirty_yy(); - void mark_dirty_yz(); - void mark_dirty_zx(); - void mark_dirty_zy(); - void mark_dirty_zz(); - - // Editor: dirty_flags - void dirty_flags(bool flag); - }; - -private: - // read/write x field - bool read_x(yarp::os::idl::WireReader& reader); - bool write_x(const yarp::os::idl::WireWriter& writer) const; - bool nested_read_x(yarp::os::idl::WireReader& reader); - bool nested_write_x(const yarp::os::idl::WireWriter& writer) const; - - // read/write y field - bool read_y(yarp::os::idl::WireReader& reader); - bool write_y(const yarp::os::idl::WireWriter& writer) const; - bool nested_read_y(yarp::os::idl::WireReader& reader); - bool nested_write_y(const yarp::os::idl::WireWriter& writer) const; - - // read/write z field - bool read_z(yarp::os::idl::WireReader& reader); - bool write_z(const yarp::os::idl::WireWriter& writer) const; - bool nested_read_z(yarp::os::idl::WireReader& reader); - bool nested_write_z(const yarp::os::idl::WireWriter& writer) const; - - // read/write xx field - bool read_xx(yarp::os::idl::WireReader& reader); - bool write_xx(const yarp::os::idl::WireWriter& writer) const; - bool nested_read_xx(yarp::os::idl::WireReader& reader); - bool nested_write_xx(const yarp::os::idl::WireWriter& writer) const; - - // read/write xy field - bool read_xy(yarp::os::idl::WireReader& reader); - bool write_xy(const yarp::os::idl::WireWriter& writer) const; - bool nested_read_xy(yarp::os::idl::WireReader& reader); - bool nested_write_xy(const yarp::os::idl::WireWriter& writer) const; - - // read/write xz field - bool read_xz(yarp::os::idl::WireReader& reader); - bool write_xz(const yarp::os::idl::WireWriter& writer) const; - bool nested_read_xz(yarp::os::idl::WireReader& reader); - bool nested_write_xz(const yarp::os::idl::WireWriter& writer) const; - - // read/write yx field - bool read_yx(yarp::os::idl::WireReader& reader); - bool write_yx(const yarp::os::idl::WireWriter& writer) const; - bool nested_read_yx(yarp::os::idl::WireReader& reader); - bool nested_write_yx(const yarp::os::idl::WireWriter& writer) const; - - // read/write yy field - bool read_yy(yarp::os::idl::WireReader& reader); - bool write_yy(const yarp::os::idl::WireWriter& writer) const; - bool nested_read_yy(yarp::os::idl::WireReader& reader); - bool nested_write_yy(const yarp::os::idl::WireWriter& writer) const; - - // read/write yz field - bool read_yz(yarp::os::idl::WireReader& reader); - bool write_yz(const yarp::os::idl::WireWriter& writer) const; - bool nested_read_yz(yarp::os::idl::WireReader& reader); - bool nested_write_yz(const yarp::os::idl::WireWriter& writer) const; - - // read/write zx field - bool read_zx(yarp::os::idl::WireReader& reader); - bool write_zx(const yarp::os::idl::WireWriter& writer) const; - bool nested_read_zx(yarp::os::idl::WireReader& reader); - bool nested_write_zx(const yarp::os::idl::WireWriter& writer) const; - - // read/write zy field - bool read_zy(yarp::os::idl::WireReader& reader); - bool write_zy(const yarp::os::idl::WireWriter& writer) const; - bool nested_read_zy(yarp::os::idl::WireReader& reader); - bool nested_write_zy(const yarp::os::idl::WireWriter& writer) const; - - // read/write zz field - bool read_zz(yarp::os::idl::WireReader& reader); - bool write_zz(const yarp::os::idl::WireWriter& writer) const; - bool nested_read_zz(yarp::os::idl::WireReader& reader); - bool nested_write_zz(const yarp::os::idl::WireWriter& writer) const; -}; - -} // namespace codyco - -#endif // YARP_THRIFT_GENERATOR_STRUCT_HOMTRANSFORM_H diff --git a/idl/floatingBaseEstimatorRPC/autogenerated/include/codyco/floatingBaseEstimatorRPC.h b/idl/floatingBaseEstimatorRPC/autogenerated/include/codyco/floatingBaseEstimatorRPC.h deleted file mode 100644 index 745be06..0000000 --- a/idl/floatingBaseEstimatorRPC/autogenerated/include/codyco/floatingBaseEstimatorRPC.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) - * SPDX-License-Identifier: BSD-3-Clause - */ - -// Autogenerated by Thrift Compiler (0.14.1-yarped) -// -// This is an automatically generated file. -// It could get re-generated if the ALLOW_IDL_GENERATION flag is on. - -#ifndef YARP_THRIFT_GENERATOR_SERVICE_FLOATINGBASEESTIMATORRPC_H -#define YARP_THRIFT_GENERATOR_SERVICE_FLOATINGBASEESTIMATORRPC_H - -#include -#include -#include - -namespace codyco { - -/** - * floatingBaseEstimatorRPC - * Interface. - */ -class floatingBaseEstimatorRPC : - public yarp::os::Wire -{ -public: - // Constructor - floatingBaseEstimatorRPC(); - - /** - * Reset the odometry world to be (initially) a frame specified in the robot model, - * and specify a frame that is assumed to be fixed in the odometry. - * @param initial_world_frame the frame of the robot model that is assume to be initially - * coincident with the world/inertial frame. - * @param new_fixed_frame the name of a frame attached to the link that should be considered fixed - * @return true/false on success/failure (typically if the frame/link names are wrong) - */ - virtual bool resetSimpleLeggedOdometry(const std::string& initial_world_frame, const std::string& initial_fixed_frame); - - /** - * Reset the odometry world to be (initially) a frame specified in the robot model, - * and specify a frame that is assumed to be fixed in the odometry. - * @param initial_reference_frame the frame of the robot model with respect to which we expressed the location of the world. - * @param initial_reference_frame_H_world the initial location of the world w.r.t. the initial_reference_frame. - * @param new_fixed_frame the name of a frame attached to the link that should be considered fixed. - * @return true/false on success/failure (typically if the frame/link names are wrong) - */ - virtual bool resetSimpleLeggedOdometryToArbitraryFrame(const std::string& initial_reference_frame, const HomTransform& initial_reference_frame_H_world, const std::string& initial_fixed_frame); - - /** - * Change the link that is considered fixed by the odometry. - * @param new_fixed_frame the name of a frame attached to the link that should be considered fixed - * @return true/false on success/failure (typically if the frame names are wrong) - */ - virtual bool changeFixedLinkSimpleLeggedOdometry(const std::string& new_fixed_frame); - - /** - * Get the current settings in the form of a string. - * @return the current settings as a human readable string. - */ - virtual std::string getCurrentSettingsString(); - - // help method - virtual std::vector help(const std::string& functionName = "--all"); - - // read from ConnectionReader - bool read(yarp::os::ConnectionReader& connection) override; -}; - -} // namespace codyco - -#endif // YARP_THRIFT_GENERATOR_SERVICE_FLOATINGBASEESTIMATORRPC_H diff --git a/idl/floatingBaseEstimatorRPC/autogenerated/src/HomTransform.cpp b/idl/floatingBaseEstimatorRPC/autogenerated/src/HomTransform.cpp deleted file mode 100644 index da60ecd..0000000 --- a/idl/floatingBaseEstimatorRPC/autogenerated/src/HomTransform.cpp +++ /dev/null @@ -1,1658 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) - * SPDX-License-Identifier: BSD-3-Clause - */ - -// Autogenerated by Thrift Compiler (0.14.1-yarped) -// -// This is an automatically generated file. -// It could get re-generated if the ALLOW_IDL_GENERATION flag is on. - -#include - -namespace codyco { - -// Default constructor -HomTransform::HomTransform() : - WirePortable(), - x(0), - y(0), - z(0), - xx(0), - xy(0), - xz(0), - yx(0), - yy(0), - yz(0), - zx(0), - zy(0), - zz(0) -{ -} - -// Constructor with field values -HomTransform::HomTransform(const double x, - const double y, - const double z, - const double xx, - const double xy, - const double xz, - const double yx, - const double yy, - const double yz, - const double zx, - const double zy, - const double zz) : - WirePortable(), - x(x), - y(y), - z(z), - xx(xx), - xy(xy), - xz(xz), - yx(yx), - yy(yy), - yz(yz), - zx(zx), - zy(zy), - zz(zz) -{ -} - -// Read structure on a Wire -bool HomTransform::read(yarp::os::idl::WireReader& reader) -{ - if (!read_x(reader)) { - return false; - } - if (!read_y(reader)) { - return false; - } - if (!read_z(reader)) { - return false; - } - if (!read_xx(reader)) { - return false; - } - if (!read_xy(reader)) { - return false; - } - if (!read_xz(reader)) { - return false; - } - if (!read_yx(reader)) { - return false; - } - if (!read_yy(reader)) { - return false; - } - if (!read_yz(reader)) { - return false; - } - if (!read_zx(reader)) { - return false; - } - if (!read_zy(reader)) { - return false; - } - if (!read_zz(reader)) { - return false; - } - return !reader.isError(); -} - -// Read structure on a Connection -bool HomTransform::read(yarp::os::ConnectionReader& connection) -{ - yarp::os::idl::WireReader reader(connection); - if (!reader.readListHeader(12)) { - return false; - } - return read(reader); -} - -// Write structure on a Wire -bool HomTransform::write(const yarp::os::idl::WireWriter& writer) const -{ - if (!write_x(writer)) { - return false; - } - if (!write_y(writer)) { - return false; - } - if (!write_z(writer)) { - return false; - } - if (!write_xx(writer)) { - return false; - } - if (!write_xy(writer)) { - return false; - } - if (!write_xz(writer)) { - return false; - } - if (!write_yx(writer)) { - return false; - } - if (!write_yy(writer)) { - return false; - } - if (!write_yz(writer)) { - return false; - } - if (!write_zx(writer)) { - return false; - } - if (!write_zy(writer)) { - return false; - } - if (!write_zz(writer)) { - return false; - } - return !writer.isError(); -} - -// Write structure on a Connection -bool HomTransform::write(yarp::os::ConnectionWriter& connection) const -{ - yarp::os::idl::WireWriter writer(connection); - if (!writer.writeListHeader(12)) { - return false; - } - return write(writer); -} - -// Convert to a printable string -std::string HomTransform::toString() const -{ - yarp::os::Bottle b; - b.read(*this); - return b.toString(); -} - -// Editor: default constructor -HomTransform::Editor::Editor() -{ - group = 0; - obj_owned = true; - obj = new HomTransform; - dirty_flags(false); - yarp().setOwner(*this); -} - -// Editor: constructor with base class -HomTransform::Editor::Editor(HomTransform& obj) -{ - group = 0; - obj_owned = false; - edit(obj, false); - yarp().setOwner(*this); -} - -// Editor: destructor -HomTransform::Editor::~Editor() -{ - if (obj_owned) { - delete obj; - } -} - -// Editor: edit -bool HomTransform::Editor::edit(HomTransform& obj, bool dirty) -{ - if (obj_owned) { - delete this->obj; - } - this->obj = &obj; - obj_owned = false; - dirty_flags(dirty); - return true; -} - -// Editor: validity check -bool HomTransform::Editor::isValid() const -{ - return obj != nullptr; -} - -// Editor: state -HomTransform& HomTransform::Editor::state() -{ - return *obj; -} - -// Editor: grouping begin -void HomTransform::Editor::start_editing() -{ - group++; -} - -// Editor: grouping end -void HomTransform::Editor::stop_editing() -{ - group--; - if (group == 0 && is_dirty) { - communicate(); - } -} -// Editor: x setter -void HomTransform::Editor::set_x(const double x) -{ - will_set_x(); - obj->x = x; - mark_dirty_x(); - communicate(); - did_set_x(); -} - -// Editor: x getter -double HomTransform::Editor::get_x() const -{ - return obj->x; -} - -// Editor: x will_set -bool HomTransform::Editor::will_set_x() -{ - return true; -} - -// Editor: x did_set -bool HomTransform::Editor::did_set_x() -{ - return true; -} - -// Editor: y setter -void HomTransform::Editor::set_y(const double y) -{ - will_set_y(); - obj->y = y; - mark_dirty_y(); - communicate(); - did_set_y(); -} - -// Editor: y getter -double HomTransform::Editor::get_y() const -{ - return obj->y; -} - -// Editor: y will_set -bool HomTransform::Editor::will_set_y() -{ - return true; -} - -// Editor: y did_set -bool HomTransform::Editor::did_set_y() -{ - return true; -} - -// Editor: z setter -void HomTransform::Editor::set_z(const double z) -{ - will_set_z(); - obj->z = z; - mark_dirty_z(); - communicate(); - did_set_z(); -} - -// Editor: z getter -double HomTransform::Editor::get_z() const -{ - return obj->z; -} - -// Editor: z will_set -bool HomTransform::Editor::will_set_z() -{ - return true; -} - -// Editor: z did_set -bool HomTransform::Editor::did_set_z() -{ - return true; -} - -// Editor: xx setter -void HomTransform::Editor::set_xx(const double xx) -{ - will_set_xx(); - obj->xx = xx; - mark_dirty_xx(); - communicate(); - did_set_xx(); -} - -// Editor: xx getter -double HomTransform::Editor::get_xx() const -{ - return obj->xx; -} - -// Editor: xx will_set -bool HomTransform::Editor::will_set_xx() -{ - return true; -} - -// Editor: xx did_set -bool HomTransform::Editor::did_set_xx() -{ - return true; -} - -// Editor: xy setter -void HomTransform::Editor::set_xy(const double xy) -{ - will_set_xy(); - obj->xy = xy; - mark_dirty_xy(); - communicate(); - did_set_xy(); -} - -// Editor: xy getter -double HomTransform::Editor::get_xy() const -{ - return obj->xy; -} - -// Editor: xy will_set -bool HomTransform::Editor::will_set_xy() -{ - return true; -} - -// Editor: xy did_set -bool HomTransform::Editor::did_set_xy() -{ - return true; -} - -// Editor: xz setter -void HomTransform::Editor::set_xz(const double xz) -{ - will_set_xz(); - obj->xz = xz; - mark_dirty_xz(); - communicate(); - did_set_xz(); -} - -// Editor: xz getter -double HomTransform::Editor::get_xz() const -{ - return obj->xz; -} - -// Editor: xz will_set -bool HomTransform::Editor::will_set_xz() -{ - return true; -} - -// Editor: xz did_set -bool HomTransform::Editor::did_set_xz() -{ - return true; -} - -// Editor: yx setter -void HomTransform::Editor::set_yx(const double yx) -{ - will_set_yx(); - obj->yx = yx; - mark_dirty_yx(); - communicate(); - did_set_yx(); -} - -// Editor: yx getter -double HomTransform::Editor::get_yx() const -{ - return obj->yx; -} - -// Editor: yx will_set -bool HomTransform::Editor::will_set_yx() -{ - return true; -} - -// Editor: yx did_set -bool HomTransform::Editor::did_set_yx() -{ - return true; -} - -// Editor: yy setter -void HomTransform::Editor::set_yy(const double yy) -{ - will_set_yy(); - obj->yy = yy; - mark_dirty_yy(); - communicate(); - did_set_yy(); -} - -// Editor: yy getter -double HomTransform::Editor::get_yy() const -{ - return obj->yy; -} - -// Editor: yy will_set -bool HomTransform::Editor::will_set_yy() -{ - return true; -} - -// Editor: yy did_set -bool HomTransform::Editor::did_set_yy() -{ - return true; -} - -// Editor: yz setter -void HomTransform::Editor::set_yz(const double yz) -{ - will_set_yz(); - obj->yz = yz; - mark_dirty_yz(); - communicate(); - did_set_yz(); -} - -// Editor: yz getter -double HomTransform::Editor::get_yz() const -{ - return obj->yz; -} - -// Editor: yz will_set -bool HomTransform::Editor::will_set_yz() -{ - return true; -} - -// Editor: yz did_set -bool HomTransform::Editor::did_set_yz() -{ - return true; -} - -// Editor: zx setter -void HomTransform::Editor::set_zx(const double zx) -{ - will_set_zx(); - obj->zx = zx; - mark_dirty_zx(); - communicate(); - did_set_zx(); -} - -// Editor: zx getter -double HomTransform::Editor::get_zx() const -{ - return obj->zx; -} - -// Editor: zx will_set -bool HomTransform::Editor::will_set_zx() -{ - return true; -} - -// Editor: zx did_set -bool HomTransform::Editor::did_set_zx() -{ - return true; -} - -// Editor: zy setter -void HomTransform::Editor::set_zy(const double zy) -{ - will_set_zy(); - obj->zy = zy; - mark_dirty_zy(); - communicate(); - did_set_zy(); -} - -// Editor: zy getter -double HomTransform::Editor::get_zy() const -{ - return obj->zy; -} - -// Editor: zy will_set -bool HomTransform::Editor::will_set_zy() -{ - return true; -} - -// Editor: zy did_set -bool HomTransform::Editor::did_set_zy() -{ - return true; -} - -// Editor: zz setter -void HomTransform::Editor::set_zz(const double zz) -{ - will_set_zz(); - obj->zz = zz; - mark_dirty_zz(); - communicate(); - did_set_zz(); -} - -// Editor: zz getter -double HomTransform::Editor::get_zz() const -{ - return obj->zz; -} - -// Editor: zz will_set -bool HomTransform::Editor::will_set_zz() -{ - return true; -} - -// Editor: zz did_set -bool HomTransform::Editor::did_set_zz() -{ - return true; -} - -// Editor: clean -void HomTransform::Editor::clean() -{ - dirty_flags(false); -} - -// Editor: read -bool HomTransform::Editor::read(yarp::os::ConnectionReader& connection) -{ - if (!isValid()) { - return false; - } - yarp::os::idl::WireReader reader(connection); - reader.expectAccept(); - if (!reader.readListHeader()) { - return false; - } - int len = reader.getLength(); - if (len == 0) { - yarp::os::idl::WireWriter writer(reader); - if (writer.isNull()) { - return true; - } - if (!writer.writeListHeader(1)) { - return false; - } - writer.writeString("send: 'help' or 'patch (param1 val1) (param2 val2)'"); - return true; - } - std::string tag; - if (!reader.readString(tag)) { - return false; - } - if (tag == "help") { - yarp::os::idl::WireWriter writer(reader); - if (writer.isNull()) { - return true; - } - if (!writer.writeListHeader(2)) { - return false; - } - if (!writer.writeTag("many", 1, 0)) { - return false; - } - if (reader.getLength() > 0) { - std::string field; - if (!reader.readString(field)) { - return false; - } - if (field == "x") { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeString("double x")) { - return false; - } - } - if (field == "y") { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeString("double y")) { - return false; - } - } - if (field == "z") { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeString("double z")) { - return false; - } - } - if (field == "xx") { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeString("double xx")) { - return false; - } - } - if (field == "xy") { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeString("double xy")) { - return false; - } - } - if (field == "xz") { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeString("double xz")) { - return false; - } - } - if (field == "yx") { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeString("double yx")) { - return false; - } - } - if (field == "yy") { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeString("double yy")) { - return false; - } - } - if (field == "yz") { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeString("double yz")) { - return false; - } - } - if (field == "zx") { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeString("double zx")) { - return false; - } - } - if (field == "zy") { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeString("double zy")) { - return false; - } - } - if (field == "zz") { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeString("double zz")) { - return false; - } - } - } - if (!writer.writeListHeader(13)) { - return false; - } - writer.writeString("*** Available fields:"); - writer.writeString("x"); - writer.writeString("y"); - writer.writeString("z"); - writer.writeString("xx"); - writer.writeString("xy"); - writer.writeString("xz"); - writer.writeString("yx"); - writer.writeString("yy"); - writer.writeString("yz"); - writer.writeString("zx"); - writer.writeString("zy"); - writer.writeString("zz"); - return true; - } - bool nested = true; - bool have_act = false; - if (tag != "patch") { - if (((len - 1) % 2) != 0) { - return false; - } - len = 1 + ((len - 1) / 2); - nested = false; - have_act = true; - } - for (int i = 1; i < len; ++i) { - if (nested && !reader.readListHeader(3)) { - return false; - } - std::string act; - std::string key; - if (have_act) { - act = tag; - } else if (!reader.readString(act)) { - return false; - } - if (!reader.readString(key)) { - return false; - } - if (key == "x") { - will_set_x(); - if (!obj->nested_read_x(reader)) { - return false; - } - did_set_x(); - } else if (key == "y") { - will_set_y(); - if (!obj->nested_read_y(reader)) { - return false; - } - did_set_y(); - } else if (key == "z") { - will_set_z(); - if (!obj->nested_read_z(reader)) { - return false; - } - did_set_z(); - } else if (key == "xx") { - will_set_xx(); - if (!obj->nested_read_xx(reader)) { - return false; - } - did_set_xx(); - } else if (key == "xy") { - will_set_xy(); - if (!obj->nested_read_xy(reader)) { - return false; - } - did_set_xy(); - } else if (key == "xz") { - will_set_xz(); - if (!obj->nested_read_xz(reader)) { - return false; - } - did_set_xz(); - } else if (key == "yx") { - will_set_yx(); - if (!obj->nested_read_yx(reader)) { - return false; - } - did_set_yx(); - } else if (key == "yy") { - will_set_yy(); - if (!obj->nested_read_yy(reader)) { - return false; - } - did_set_yy(); - } else if (key == "yz") { - will_set_yz(); - if (!obj->nested_read_yz(reader)) { - return false; - } - did_set_yz(); - } else if (key == "zx") { - will_set_zx(); - if (!obj->nested_read_zx(reader)) { - return false; - } - did_set_zx(); - } else if (key == "zy") { - will_set_zy(); - if (!obj->nested_read_zy(reader)) { - return false; - } - did_set_zy(); - } else if (key == "zz") { - will_set_zz(); - if (!obj->nested_read_zz(reader)) { - return false; - } - did_set_zz(); - } else { - // would be useful to have a fallback here - } - } - reader.accept(); - yarp::os::idl::WireWriter writer(reader); - if (writer.isNull()) { - return true; - } - writer.writeListHeader(1); - writer.writeVocab32('o', 'k'); - return true; -} - -// Editor: write -bool HomTransform::Editor::write(yarp::os::ConnectionWriter& connection) const -{ - if (!isValid()) { - return false; - } - yarp::os::idl::WireWriter writer(connection); - if (!writer.writeListHeader(dirty_count + 1)) { - return false; - } - if (!writer.writeString("patch")) { - return false; - } - if (is_dirty_x) { - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeString("set")) { - return false; - } - if (!writer.writeString("x")) { - return false; - } - if (!obj->nested_write_x(writer)) { - return false; - } - } - if (is_dirty_y) { - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeString("set")) { - return false; - } - if (!writer.writeString("y")) { - return false; - } - if (!obj->nested_write_y(writer)) { - return false; - } - } - if (is_dirty_z) { - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeString("set")) { - return false; - } - if (!writer.writeString("z")) { - return false; - } - if (!obj->nested_write_z(writer)) { - return false; - } - } - if (is_dirty_xx) { - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeString("set")) { - return false; - } - if (!writer.writeString("xx")) { - return false; - } - if (!obj->nested_write_xx(writer)) { - return false; - } - } - if (is_dirty_xy) { - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeString("set")) { - return false; - } - if (!writer.writeString("xy")) { - return false; - } - if (!obj->nested_write_xy(writer)) { - return false; - } - } - if (is_dirty_xz) { - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeString("set")) { - return false; - } - if (!writer.writeString("xz")) { - return false; - } - if (!obj->nested_write_xz(writer)) { - return false; - } - } - if (is_dirty_yx) { - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeString("set")) { - return false; - } - if (!writer.writeString("yx")) { - return false; - } - if (!obj->nested_write_yx(writer)) { - return false; - } - } - if (is_dirty_yy) { - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeString("set")) { - return false; - } - if (!writer.writeString("yy")) { - return false; - } - if (!obj->nested_write_yy(writer)) { - return false; - } - } - if (is_dirty_yz) { - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeString("set")) { - return false; - } - if (!writer.writeString("yz")) { - return false; - } - if (!obj->nested_write_yz(writer)) { - return false; - } - } - if (is_dirty_zx) { - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeString("set")) { - return false; - } - if (!writer.writeString("zx")) { - return false; - } - if (!obj->nested_write_zx(writer)) { - return false; - } - } - if (is_dirty_zy) { - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeString("set")) { - return false; - } - if (!writer.writeString("zy")) { - return false; - } - if (!obj->nested_write_zy(writer)) { - return false; - } - } - if (is_dirty_zz) { - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeString("set")) { - return false; - } - if (!writer.writeString("zz")) { - return false; - } - if (!obj->nested_write_zz(writer)) { - return false; - } - } - return !writer.isError(); -} - -// Editor: send if possible -void HomTransform::Editor::communicate() -{ - if (group != 0) { - return; - } - if (yarp().canWrite()) { - yarp().write(*this); - clean(); - } -} - -// Editor: mark dirty overall -void HomTransform::Editor::mark_dirty() -{ - is_dirty = true; -} - -// Editor: x mark_dirty -void HomTransform::Editor::mark_dirty_x() -{ - if (is_dirty_x) { - return; - } - dirty_count++; - is_dirty_x = true; - mark_dirty(); -} - -// Editor: y mark_dirty -void HomTransform::Editor::mark_dirty_y() -{ - if (is_dirty_y) { - return; - } - dirty_count++; - is_dirty_y = true; - mark_dirty(); -} - -// Editor: z mark_dirty -void HomTransform::Editor::mark_dirty_z() -{ - if (is_dirty_z) { - return; - } - dirty_count++; - is_dirty_z = true; - mark_dirty(); -} - -// Editor: xx mark_dirty -void HomTransform::Editor::mark_dirty_xx() -{ - if (is_dirty_xx) { - return; - } - dirty_count++; - is_dirty_xx = true; - mark_dirty(); -} - -// Editor: xy mark_dirty -void HomTransform::Editor::mark_dirty_xy() -{ - if (is_dirty_xy) { - return; - } - dirty_count++; - is_dirty_xy = true; - mark_dirty(); -} - -// Editor: xz mark_dirty -void HomTransform::Editor::mark_dirty_xz() -{ - if (is_dirty_xz) { - return; - } - dirty_count++; - is_dirty_xz = true; - mark_dirty(); -} - -// Editor: yx mark_dirty -void HomTransform::Editor::mark_dirty_yx() -{ - if (is_dirty_yx) { - return; - } - dirty_count++; - is_dirty_yx = true; - mark_dirty(); -} - -// Editor: yy mark_dirty -void HomTransform::Editor::mark_dirty_yy() -{ - if (is_dirty_yy) { - return; - } - dirty_count++; - is_dirty_yy = true; - mark_dirty(); -} - -// Editor: yz mark_dirty -void HomTransform::Editor::mark_dirty_yz() -{ - if (is_dirty_yz) { - return; - } - dirty_count++; - is_dirty_yz = true; - mark_dirty(); -} - -// Editor: zx mark_dirty -void HomTransform::Editor::mark_dirty_zx() -{ - if (is_dirty_zx) { - return; - } - dirty_count++; - is_dirty_zx = true; - mark_dirty(); -} - -// Editor: zy mark_dirty -void HomTransform::Editor::mark_dirty_zy() -{ - if (is_dirty_zy) { - return; - } - dirty_count++; - is_dirty_zy = true; - mark_dirty(); -} - -// Editor: zz mark_dirty -void HomTransform::Editor::mark_dirty_zz() -{ - if (is_dirty_zz) { - return; - } - dirty_count++; - is_dirty_zz = true; - mark_dirty(); -} - -// Editor: dirty_flags -void HomTransform::Editor::dirty_flags(bool flag) -{ - is_dirty = flag; - is_dirty_x = flag; - is_dirty_y = flag; - is_dirty_z = flag; - is_dirty_xx = flag; - is_dirty_xy = flag; - is_dirty_xz = flag; - is_dirty_yx = flag; - is_dirty_yy = flag; - is_dirty_yz = flag; - is_dirty_zx = flag; - is_dirty_zy = flag; - is_dirty_zz = flag; - dirty_count = flag ? 12 : 0; -} - -// read x field -bool HomTransform::read_x(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(x)) { - reader.fail(); - return false; - } - return true; -} - -// write x field -bool HomTransform::write_x(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(x)) { - return false; - } - return true; -} - -// read (nested) x field -bool HomTransform::nested_read_x(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(x)) { - reader.fail(); - return false; - } - return true; -} - -// write (nested) x field -bool HomTransform::nested_write_x(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(x)) { - return false; - } - return true; -} - -// read y field -bool HomTransform::read_y(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(y)) { - reader.fail(); - return false; - } - return true; -} - -// write y field -bool HomTransform::write_y(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(y)) { - return false; - } - return true; -} - -// read (nested) y field -bool HomTransform::nested_read_y(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(y)) { - reader.fail(); - return false; - } - return true; -} - -// write (nested) y field -bool HomTransform::nested_write_y(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(y)) { - return false; - } - return true; -} - -// read z field -bool HomTransform::read_z(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(z)) { - reader.fail(); - return false; - } - return true; -} - -// write z field -bool HomTransform::write_z(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(z)) { - return false; - } - return true; -} - -// read (nested) z field -bool HomTransform::nested_read_z(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(z)) { - reader.fail(); - return false; - } - return true; -} - -// write (nested) z field -bool HomTransform::nested_write_z(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(z)) { - return false; - } - return true; -} - -// read xx field -bool HomTransform::read_xx(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(xx)) { - reader.fail(); - return false; - } - return true; -} - -// write xx field -bool HomTransform::write_xx(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(xx)) { - return false; - } - return true; -} - -// read (nested) xx field -bool HomTransform::nested_read_xx(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(xx)) { - reader.fail(); - return false; - } - return true; -} - -// write (nested) xx field -bool HomTransform::nested_write_xx(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(xx)) { - return false; - } - return true; -} - -// read xy field -bool HomTransform::read_xy(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(xy)) { - reader.fail(); - return false; - } - return true; -} - -// write xy field -bool HomTransform::write_xy(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(xy)) { - return false; - } - return true; -} - -// read (nested) xy field -bool HomTransform::nested_read_xy(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(xy)) { - reader.fail(); - return false; - } - return true; -} - -// write (nested) xy field -bool HomTransform::nested_write_xy(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(xy)) { - return false; - } - return true; -} - -// read xz field -bool HomTransform::read_xz(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(xz)) { - reader.fail(); - return false; - } - return true; -} - -// write xz field -bool HomTransform::write_xz(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(xz)) { - return false; - } - return true; -} - -// read (nested) xz field -bool HomTransform::nested_read_xz(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(xz)) { - reader.fail(); - return false; - } - return true; -} - -// write (nested) xz field -bool HomTransform::nested_write_xz(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(xz)) { - return false; - } - return true; -} - -// read yx field -bool HomTransform::read_yx(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(yx)) { - reader.fail(); - return false; - } - return true; -} - -// write yx field -bool HomTransform::write_yx(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(yx)) { - return false; - } - return true; -} - -// read (nested) yx field -bool HomTransform::nested_read_yx(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(yx)) { - reader.fail(); - return false; - } - return true; -} - -// write (nested) yx field -bool HomTransform::nested_write_yx(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(yx)) { - return false; - } - return true; -} - -// read yy field -bool HomTransform::read_yy(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(yy)) { - reader.fail(); - return false; - } - return true; -} - -// write yy field -bool HomTransform::write_yy(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(yy)) { - return false; - } - return true; -} - -// read (nested) yy field -bool HomTransform::nested_read_yy(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(yy)) { - reader.fail(); - return false; - } - return true; -} - -// write (nested) yy field -bool HomTransform::nested_write_yy(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(yy)) { - return false; - } - return true; -} - -// read yz field -bool HomTransform::read_yz(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(yz)) { - reader.fail(); - return false; - } - return true; -} - -// write yz field -bool HomTransform::write_yz(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(yz)) { - return false; - } - return true; -} - -// read (nested) yz field -bool HomTransform::nested_read_yz(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(yz)) { - reader.fail(); - return false; - } - return true; -} - -// write (nested) yz field -bool HomTransform::nested_write_yz(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(yz)) { - return false; - } - return true; -} - -// read zx field -bool HomTransform::read_zx(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(zx)) { - reader.fail(); - return false; - } - return true; -} - -// write zx field -bool HomTransform::write_zx(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(zx)) { - return false; - } - return true; -} - -// read (nested) zx field -bool HomTransform::nested_read_zx(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(zx)) { - reader.fail(); - return false; - } - return true; -} - -// write (nested) zx field -bool HomTransform::nested_write_zx(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(zx)) { - return false; - } - return true; -} - -// read zy field -bool HomTransform::read_zy(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(zy)) { - reader.fail(); - return false; - } - return true; -} - -// write zy field -bool HomTransform::write_zy(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(zy)) { - return false; - } - return true; -} - -// read (nested) zy field -bool HomTransform::nested_read_zy(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(zy)) { - reader.fail(); - return false; - } - return true; -} - -// write (nested) zy field -bool HomTransform::nested_write_zy(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(zy)) { - return false; - } - return true; -} - -// read zz field -bool HomTransform::read_zz(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(zz)) { - reader.fail(); - return false; - } - return true; -} - -// write zz field -bool HomTransform::write_zz(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(zz)) { - return false; - } - return true; -} - -// read (nested) zz field -bool HomTransform::nested_read_zz(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(zz)) { - reader.fail(); - return false; - } - return true; -} - -// write (nested) zz field -bool HomTransform::nested_write_zz(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(zz)) { - return false; - } - return true; -} - -} // namespace codyco diff --git a/idl/floatingBaseEstimatorRPC/autogenerated/src/floatingBaseEstimatorRPC.cpp b/idl/floatingBaseEstimatorRPC/autogenerated/src/floatingBaseEstimatorRPC.cpp deleted file mode 100644 index f7ca8e4..0000000 --- a/idl/floatingBaseEstimatorRPC/autogenerated/src/floatingBaseEstimatorRPC.cpp +++ /dev/null @@ -1,467 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) - * SPDX-License-Identifier: BSD-3-Clause - */ - -// Autogenerated by Thrift Compiler (0.14.1-yarped) -// -// This is an automatically generated file. -// It could get re-generated if the ALLOW_IDL_GENERATION flag is on. - -#include - -#include - -namespace codyco { - -class floatingBaseEstimatorRPC_resetSimpleLeggedOdometry_helper : - public yarp::os::Portable -{ -public: - explicit floatingBaseEstimatorRPC_resetSimpleLeggedOdometry_helper(const std::string& initial_world_frame, const std::string& initial_fixed_frame); - bool write(yarp::os::ConnectionWriter& connection) const override; - bool read(yarp::os::ConnectionReader& connection) override; - - std::string m_initial_world_frame; - std::string m_initial_fixed_frame; - - thread_local static bool s_return_helper; -}; - -thread_local bool floatingBaseEstimatorRPC_resetSimpleLeggedOdometry_helper::s_return_helper = {}; - -floatingBaseEstimatorRPC_resetSimpleLeggedOdometry_helper::floatingBaseEstimatorRPC_resetSimpleLeggedOdometry_helper(const std::string& initial_world_frame, const std::string& initial_fixed_frame) : - m_initial_world_frame{initial_world_frame}, - m_initial_fixed_frame{initial_fixed_frame} -{ - s_return_helper = {}; -} - -bool floatingBaseEstimatorRPC_resetSimpleLeggedOdometry_helper::write(yarp::os::ConnectionWriter& connection) const -{ - yarp::os::idl::WireWriter writer(connection); - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeTag("resetSimpleLeggedOdometry", 1, 1)) { - return false; - } - if (!writer.writeString(m_initial_world_frame)) { - return false; - } - if (!writer.writeString(m_initial_fixed_frame)) { - return false; - } - return true; -} - -bool floatingBaseEstimatorRPC_resetSimpleLeggedOdometry_helper::read(yarp::os::ConnectionReader& connection) -{ - yarp::os::idl::WireReader reader(connection); - if (!reader.readListReturn()) { - return false; - } - if (!reader.readBool(s_return_helper)) { - reader.fail(); - return false; - } - return true; -} - -class floatingBaseEstimatorRPC_resetSimpleLeggedOdometryToArbitraryFrame_helper : - public yarp::os::Portable -{ -public: - explicit floatingBaseEstimatorRPC_resetSimpleLeggedOdometryToArbitraryFrame_helper(const std::string& initial_reference_frame, const HomTransform& initial_reference_frame_H_world, const std::string& initial_fixed_frame); - bool write(yarp::os::ConnectionWriter& connection) const override; - bool read(yarp::os::ConnectionReader& connection) override; - - std::string m_initial_reference_frame; - HomTransform m_initial_reference_frame_H_world; - std::string m_initial_fixed_frame; - - thread_local static bool s_return_helper; -}; - -thread_local bool floatingBaseEstimatorRPC_resetSimpleLeggedOdometryToArbitraryFrame_helper::s_return_helper = {}; - -floatingBaseEstimatorRPC_resetSimpleLeggedOdometryToArbitraryFrame_helper::floatingBaseEstimatorRPC_resetSimpleLeggedOdometryToArbitraryFrame_helper(const std::string& initial_reference_frame, const HomTransform& initial_reference_frame_H_world, const std::string& initial_fixed_frame) : - m_initial_reference_frame{initial_reference_frame}, - m_initial_reference_frame_H_world{initial_reference_frame_H_world}, - m_initial_fixed_frame{initial_fixed_frame} -{ - s_return_helper = {}; -} - -bool floatingBaseEstimatorRPC_resetSimpleLeggedOdometryToArbitraryFrame_helper::write(yarp::os::ConnectionWriter& connection) const -{ - yarp::os::idl::WireWriter writer(connection); - if (!writer.writeListHeader(15)) { - return false; - } - if (!writer.writeTag("resetSimpleLeggedOdometryToArbitraryFrame", 1, 1)) { - return false; - } - if (!writer.writeString(m_initial_reference_frame)) { - return false; - } - if (!writer.write(m_initial_reference_frame_H_world)) { - return false; - } - if (!writer.writeString(m_initial_fixed_frame)) { - return false; - } - return true; -} - -bool floatingBaseEstimatorRPC_resetSimpleLeggedOdometryToArbitraryFrame_helper::read(yarp::os::ConnectionReader& connection) -{ - yarp::os::idl::WireReader reader(connection); - if (!reader.readListReturn()) { - return false; - } - if (!reader.readBool(s_return_helper)) { - reader.fail(); - return false; - } - return true; -} - -class floatingBaseEstimatorRPC_changeFixedLinkSimpleLeggedOdometry_helper : - public yarp::os::Portable -{ -public: - explicit floatingBaseEstimatorRPC_changeFixedLinkSimpleLeggedOdometry_helper(const std::string& new_fixed_frame); - bool write(yarp::os::ConnectionWriter& connection) const override; - bool read(yarp::os::ConnectionReader& connection) override; - - std::string m_new_fixed_frame; - - thread_local static bool s_return_helper; -}; - -thread_local bool floatingBaseEstimatorRPC_changeFixedLinkSimpleLeggedOdometry_helper::s_return_helper = {}; - -floatingBaseEstimatorRPC_changeFixedLinkSimpleLeggedOdometry_helper::floatingBaseEstimatorRPC_changeFixedLinkSimpleLeggedOdometry_helper(const std::string& new_fixed_frame) : - m_new_fixed_frame{new_fixed_frame} -{ - s_return_helper = {}; -} - -bool floatingBaseEstimatorRPC_changeFixedLinkSimpleLeggedOdometry_helper::write(yarp::os::ConnectionWriter& connection) const -{ - yarp::os::idl::WireWriter writer(connection); - if (!writer.writeListHeader(2)) { - return false; - } - if (!writer.writeTag("changeFixedLinkSimpleLeggedOdometry", 1, 1)) { - return false; - } - if (!writer.writeString(m_new_fixed_frame)) { - return false; - } - return true; -} - -bool floatingBaseEstimatorRPC_changeFixedLinkSimpleLeggedOdometry_helper::read(yarp::os::ConnectionReader& connection) -{ - yarp::os::idl::WireReader reader(connection); - if (!reader.readListReturn()) { - return false; - } - if (!reader.readBool(s_return_helper)) { - reader.fail(); - return false; - } - return true; -} - -class floatingBaseEstimatorRPC_getCurrentSettingsString_helper : - public yarp::os::Portable -{ -public: - explicit floatingBaseEstimatorRPC_getCurrentSettingsString_helper(); - bool write(yarp::os::ConnectionWriter& connection) const override; - bool read(yarp::os::ConnectionReader& connection) override; - - thread_local static std::string s_return_helper; -}; - -thread_local std::string floatingBaseEstimatorRPC_getCurrentSettingsString_helper::s_return_helper = {}; - -floatingBaseEstimatorRPC_getCurrentSettingsString_helper::floatingBaseEstimatorRPC_getCurrentSettingsString_helper() -{ - s_return_helper = {}; -} - -bool floatingBaseEstimatorRPC_getCurrentSettingsString_helper::write(yarp::os::ConnectionWriter& connection) const -{ - yarp::os::idl::WireWriter writer(connection); - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeTag("getCurrentSettingsString", 1, 1)) { - return false; - } - return true; -} - -bool floatingBaseEstimatorRPC_getCurrentSettingsString_helper::read(yarp::os::ConnectionReader& connection) -{ - yarp::os::idl::WireReader reader(connection); - if (!reader.readListReturn()) { - return false; - } - if (!reader.readString(s_return_helper)) { - reader.fail(); - return false; - } - return true; -} - -// Constructor -floatingBaseEstimatorRPC::floatingBaseEstimatorRPC() -{ - yarp().setOwner(*this); -} - -bool floatingBaseEstimatorRPC::resetSimpleLeggedOdometry(const std::string& initial_world_frame, const std::string& initial_fixed_frame) -{ - floatingBaseEstimatorRPC_resetSimpleLeggedOdometry_helper helper{initial_world_frame, initial_fixed_frame}; - if (!yarp().canWrite()) { - yError("Missing server method '%s'?", "bool floatingBaseEstimatorRPC::resetSimpleLeggedOdometry(const std::string& initial_world_frame, const std::string& initial_fixed_frame)"); - } - bool ok = yarp().write(helper, helper); - return ok ? floatingBaseEstimatorRPC_resetSimpleLeggedOdometry_helper::s_return_helper : bool{}; -} - -bool floatingBaseEstimatorRPC::resetSimpleLeggedOdometryToArbitraryFrame(const std::string& initial_reference_frame, const HomTransform& initial_reference_frame_H_world, const std::string& initial_fixed_frame) -{ - floatingBaseEstimatorRPC_resetSimpleLeggedOdometryToArbitraryFrame_helper helper{initial_reference_frame, initial_reference_frame_H_world, initial_fixed_frame}; - if (!yarp().canWrite()) { - yError("Missing server method '%s'?", "bool floatingBaseEstimatorRPC::resetSimpleLeggedOdometryToArbitraryFrame(const std::string& initial_reference_frame, const HomTransform& initial_reference_frame_H_world, const std::string& initial_fixed_frame)"); - } - bool ok = yarp().write(helper, helper); - return ok ? floatingBaseEstimatorRPC_resetSimpleLeggedOdometryToArbitraryFrame_helper::s_return_helper : bool{}; -} - -bool floatingBaseEstimatorRPC::changeFixedLinkSimpleLeggedOdometry(const std::string& new_fixed_frame) -{ - floatingBaseEstimatorRPC_changeFixedLinkSimpleLeggedOdometry_helper helper{new_fixed_frame}; - if (!yarp().canWrite()) { - yError("Missing server method '%s'?", "bool floatingBaseEstimatorRPC::changeFixedLinkSimpleLeggedOdometry(const std::string& new_fixed_frame)"); - } - bool ok = yarp().write(helper, helper); - return ok ? floatingBaseEstimatorRPC_changeFixedLinkSimpleLeggedOdometry_helper::s_return_helper : bool{}; -} - -std::string floatingBaseEstimatorRPC::getCurrentSettingsString() -{ - floatingBaseEstimatorRPC_getCurrentSettingsString_helper helper{}; - if (!yarp().canWrite()) { - yError("Missing server method '%s'?", "std::string floatingBaseEstimatorRPC::getCurrentSettingsString()"); - } - bool ok = yarp().write(helper, helper); - return ok ? floatingBaseEstimatorRPC_getCurrentSettingsString_helper::s_return_helper : std::string{}; -} - -// help method -std::vector floatingBaseEstimatorRPC::help(const std::string& functionName) -{ - bool showAll = (functionName == "--all"); - std::vector helpString; - if (showAll) { - helpString.emplace_back("*** Available commands:"); - helpString.emplace_back("resetSimpleLeggedOdometry"); - helpString.emplace_back("resetSimpleLeggedOdometryToArbitraryFrame"); - helpString.emplace_back("changeFixedLinkSimpleLeggedOdometry"); - helpString.emplace_back("getCurrentSettingsString"); - helpString.emplace_back("help"); - } else { - if (functionName == "resetSimpleLeggedOdometry") { - helpString.emplace_back("bool resetSimpleLeggedOdometry(const std::string& initial_world_frame, const std::string& initial_fixed_frame) "); - helpString.emplace_back("Reset the odometry world to be (initially) a frame specified in the robot model, "); - helpString.emplace_back("and specify a frame that is assumed to be fixed in the odometry. "); - helpString.emplace_back("@param initial_world_frame the frame of the robot model that is assume to be initially "); - helpString.emplace_back(" coincident with the world/inertial frame. "); - helpString.emplace_back("@param new_fixed_frame the name of a frame attached to the link that should be considered fixed "); - helpString.emplace_back("@return true/false on success/failure (typically if the frame/link names are wrong) "); - } - if (functionName == "resetSimpleLeggedOdometryToArbitraryFrame") { - helpString.emplace_back("bool resetSimpleLeggedOdometryToArbitraryFrame(const std::string& initial_reference_frame, const HomTransform& initial_reference_frame_H_world, const std::string& initial_fixed_frame) "); - helpString.emplace_back("Reset the odometry world to be (initially) a frame specified in the robot model, "); - helpString.emplace_back("and specify a frame that is assumed to be fixed in the odometry. "); - helpString.emplace_back("@param initial_reference_frame the frame of the robot model with respect to which we expressed the location of the world. "); - helpString.emplace_back("@param initial_reference_frame_H_world the initial location of the world w.r.t. the initial_reference_frame. "); - helpString.emplace_back("@param new_fixed_frame the name of a frame attached to the link that should be considered fixed. "); - helpString.emplace_back("@return true/false on success/failure (typically if the frame/link names are wrong) "); - } - if (functionName == "changeFixedLinkSimpleLeggedOdometry") { - helpString.emplace_back("bool changeFixedLinkSimpleLeggedOdometry(const std::string& new_fixed_frame) "); - helpString.emplace_back("Change the link that is considered fixed by the odometry. "); - helpString.emplace_back("@param new_fixed_frame the name of a frame attached to the link that should be considered fixed "); - helpString.emplace_back("@return true/false on success/failure (typically if the frame names are wrong) "); - } - if (functionName == "getCurrentSettingsString") { - helpString.emplace_back("std::string getCurrentSettingsString() "); - helpString.emplace_back("Get the current settings in the form of a string. "); - helpString.emplace_back("@return the current settings as a human readable string. "); - } - if (functionName == "help") { - helpString.emplace_back("std::vector help(const std::string& functionName = \"--all\")"); - helpString.emplace_back("Return list of available commands, or help message for a specific function"); - helpString.emplace_back("@param functionName name of command for which to get a detailed description. If none or '--all' is provided, print list of available commands"); - helpString.emplace_back("@return list of strings (one string per line)"); - } - } - if (helpString.empty()) { - helpString.emplace_back("Command not found"); - } - return helpString; -} - -// read from ConnectionReader -bool floatingBaseEstimatorRPC::read(yarp::os::ConnectionReader& connection) -{ - yarp::os::idl::WireReader reader(connection); - reader.expectAccept(); - if (!reader.readListHeader()) { - reader.fail(); - return false; - } - - std::string tag = reader.readTag(); - bool direct = (tag == "__direct__"); - if (direct) { - tag = reader.readTag(); - } - while (!reader.isError()) { - if (tag == "resetSimpleLeggedOdometry") { - std::string initial_world_frame; - std::string initial_fixed_frame; - if (!reader.readString(initial_world_frame)) { - reader.fail(); - return false; - } - if (!reader.readString(initial_fixed_frame)) { - reader.fail(); - return false; - } - floatingBaseEstimatorRPC_resetSimpleLeggedOdometry_helper::s_return_helper = resetSimpleLeggedOdometry(initial_world_frame, initial_fixed_frame); - yarp::os::idl::WireWriter writer(reader); - if (!writer.isNull()) { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeBool(floatingBaseEstimatorRPC_resetSimpleLeggedOdometry_helper::s_return_helper)) { - return false; - } - } - reader.accept(); - return true; - } - if (tag == "resetSimpleLeggedOdometryToArbitraryFrame") { - std::string initial_reference_frame; - HomTransform initial_reference_frame_H_world; - std::string initial_fixed_frame; - if (!reader.readString(initial_reference_frame)) { - reader.fail(); - return false; - } - if (!reader.read(initial_reference_frame_H_world)) { - reader.fail(); - return false; - } - if (!reader.readString(initial_fixed_frame)) { - reader.fail(); - return false; - } - floatingBaseEstimatorRPC_resetSimpleLeggedOdometryToArbitraryFrame_helper::s_return_helper = resetSimpleLeggedOdometryToArbitraryFrame(initial_reference_frame, initial_reference_frame_H_world, initial_fixed_frame); - yarp::os::idl::WireWriter writer(reader); - if (!writer.isNull()) { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeBool(floatingBaseEstimatorRPC_resetSimpleLeggedOdometryToArbitraryFrame_helper::s_return_helper)) { - return false; - } - } - reader.accept(); - return true; - } - if (tag == "changeFixedLinkSimpleLeggedOdometry") { - std::string new_fixed_frame; - if (!reader.readString(new_fixed_frame)) { - reader.fail(); - return false; - } - floatingBaseEstimatorRPC_changeFixedLinkSimpleLeggedOdometry_helper::s_return_helper = changeFixedLinkSimpleLeggedOdometry(new_fixed_frame); - yarp::os::idl::WireWriter writer(reader); - if (!writer.isNull()) { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeBool(floatingBaseEstimatorRPC_changeFixedLinkSimpleLeggedOdometry_helper::s_return_helper)) { - return false; - } - } - reader.accept(); - return true; - } - if (tag == "getCurrentSettingsString") { - floatingBaseEstimatorRPC_getCurrentSettingsString_helper::s_return_helper = getCurrentSettingsString(); - yarp::os::idl::WireWriter writer(reader); - if (!writer.isNull()) { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeString(floatingBaseEstimatorRPC_getCurrentSettingsString_helper::s_return_helper)) { - return false; - } - } - reader.accept(); - return true; - } - if (tag == "help") { - std::string functionName; - if (!reader.readString(functionName)) { - functionName = "--all"; - } - auto help_strings = help(functionName); - yarp::os::idl::WireWriter writer(reader); - if (!writer.isNull()) { - if (!writer.writeListHeader(2)) { - return false; - } - if (!writer.writeTag("many", 1, 0)) { - return false; - } - if (!writer.writeListBegin(BOTTLE_TAG_INT32, static_cast(help_strings.size()))) { - return false; - } - for (const auto& help_string : help_strings) { - if (!writer.writeString(help_string)) { - return false; - } - } - if (!writer.writeListEnd()) { - return false; - } - } - reader.accept(); - return true; - } - if (reader.noMore()) { - reader.fail(); - return false; - } - std::string next_tag = reader.readTag(); - if (next_tag == "") { - break; - } - tag.append("_").append(next_tag); - } - return false; -} - -} // namespace codyco diff --git a/idl/wholeBodyDynamicsSettings/CMakeLists.txt b/idl/wholeBodyDynamicsSettings/CMakeLists.txt index cb81640..1b67312 100644 --- a/idl/wholeBodyDynamicsSettings/CMakeLists.txt +++ b/idl/wholeBodyDynamicsSettings/CMakeLists.txt @@ -7,7 +7,7 @@ cmake_minimum_required(VERSION 3.5) project(wholeBodyDynamicsSettings) yarp_idl_to_dir(INPUT_FILES wholeBodyDynamicsSettings.thrift - OUTPUT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/autogenerated + OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/autogenerated SOURCES_VAR WBDSETTINGS_SRC HEADERS_VAR WBDSETTINGS_HEADERS INCLUDE_DIRS_VAR WBDSETTINGS_INCLUDES) diff --git a/idl/wholeBodyDynamicsSettings/autogenerated/include/ContactPoint.h b/idl/wholeBodyDynamicsSettings/autogenerated/include/ContactPoint.h deleted file mode 100644 index d391e84..0000000 --- a/idl/wholeBodyDynamicsSettings/autogenerated/include/ContactPoint.h +++ /dev/null @@ -1,178 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) - * SPDX-License-Identifier: BSD-3-Clause - */ - -// Autogenerated by Thrift Compiler (0.14.1-yarped) -// -// This is an automatically generated file. -// It could get re-generated if the ALLOW_IDL_GENERATION flag is on. - -#ifndef YARP_THRIFT_GENERATOR_STRUCT_CONTACTPOINT_H -#define YARP_THRIFT_GENERATOR_STRUCT_CONTACTPOINT_H - -#include -#include - -class ContactPoint : - public yarp::os::idl::WirePortable -{ -public: - // Fields - double x; - double y; - double z; - - // Default constructor - ContactPoint(); - - // Constructor with field values - ContactPoint(const double x, - const double y, - const double z); - - // Read structure on a Wire - bool read(yarp::os::idl::WireReader& reader) override; - - // Read structure on a Connection - bool read(yarp::os::ConnectionReader& connection) override; - - // Write structure on a Wire - bool write(const yarp::os::idl::WireWriter& writer) const override; - - // Write structure on a Connection - bool write(yarp::os::ConnectionWriter& connection) const override; - - // Convert to a printable string - std::string toString() const; - - // If you want to serialize this class without nesting, use this helper - typedef yarp::os::idl::Unwrapped unwrapped; - - class Editor : - public yarp::os::Wire, - public yarp::os::PortWriter - { - public: - // Editor: default constructor - Editor(); - - // Editor: constructor with base class - Editor(ContactPoint& obj); - - // Editor: destructor - ~Editor() override; - - // Editor: Deleted constructors and operator= - Editor(const Editor& rhs) = delete; - Editor(Editor&& rhs) = delete; - Editor& operator=(const Editor& rhs) = delete; - Editor& operator=(Editor&& rhs) = delete; - - // Editor: edit - bool edit(ContactPoint& obj, bool dirty = true); - - // Editor: validity check - bool isValid() const; - - // Editor: state - ContactPoint& state(); - - // Editor: start editing - void start_editing(); - -#ifndef YARP_NO_DEPRECATED // Since YARP 3.2 - YARP_DEPRECATED_MSG("Use start_editing() instead") - void begin() - { - start_editing(); - } -#endif // YARP_NO_DEPRECATED - - // Editor: stop editing - void stop_editing(); - -#ifndef YARP_NO_DEPRECATED // Since YARP 3.2 - YARP_DEPRECATED_MSG("Use stop_editing() instead") - void end() - { - stop_editing(); - } -#endif // YARP_NO_DEPRECATED - - // Editor: x field - void set_x(const double x); - double get_x() const; - virtual bool will_set_x(); - virtual bool did_set_x(); - - // Editor: y field - void set_y(const double y); - double get_y() const; - virtual bool will_set_y(); - virtual bool did_set_y(); - - // Editor: z field - void set_z(const double z); - double get_z() const; - virtual bool will_set_z(); - virtual bool did_set_z(); - - // Editor: clean - void clean(); - - // Editor: read - bool read(yarp::os::ConnectionReader& connection) override; - - // Editor: write - bool write(yarp::os::ConnectionWriter& connection) const override; - - private: - // Editor: state - ContactPoint* obj; - bool obj_owned; - int group; - - // Editor: dirty variables - bool is_dirty; - bool is_dirty_x; - bool is_dirty_y; - bool is_dirty_z; - int dirty_count; - - // Editor: send if possible - void communicate(); - - // Editor: mark dirty overall - void mark_dirty(); - - // Editor: mark dirty single fields - void mark_dirty_x(); - void mark_dirty_y(); - void mark_dirty_z(); - - // Editor: dirty_flags - void dirty_flags(bool flag); - }; - -private: - // read/write x field - bool read_x(yarp::os::idl::WireReader& reader); - bool write_x(const yarp::os::idl::WireWriter& writer) const; - bool nested_read_x(yarp::os::idl::WireReader& reader); - bool nested_write_x(const yarp::os::idl::WireWriter& writer) const; - - // read/write y field - bool read_y(yarp::os::idl::WireReader& reader); - bool write_y(const yarp::os::idl::WireWriter& writer) const; - bool nested_read_y(yarp::os::idl::WireReader& reader); - bool nested_write_y(const yarp::os::idl::WireWriter& writer) const; - - // read/write z field - bool read_z(yarp::os::idl::WireReader& reader); - bool write_z(const yarp::os::idl::WireWriter& writer) const; - bool nested_read_z(yarp::os::idl::WireReader& reader); - bool nested_write_z(const yarp::os::idl::WireWriter& writer) const; -}; - -#endif // YARP_THRIFT_GENERATOR_STRUCT_CONTACTPOINT_H diff --git a/idl/wholeBodyDynamicsSettings/autogenerated/include/Gravity.h b/idl/wholeBodyDynamicsSettings/autogenerated/include/Gravity.h deleted file mode 100644 index c753834..0000000 --- a/idl/wholeBodyDynamicsSettings/autogenerated/include/Gravity.h +++ /dev/null @@ -1,178 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) - * SPDX-License-Identifier: BSD-3-Clause - */ - -// Autogenerated by Thrift Compiler (0.14.1-yarped) -// -// This is an automatically generated file. -// It could get re-generated if the ALLOW_IDL_GENERATION flag is on. - -#ifndef YARP_THRIFT_GENERATOR_STRUCT_GRAVITY_H -#define YARP_THRIFT_GENERATOR_STRUCT_GRAVITY_H - -#include -#include - -class Gravity : - public yarp::os::idl::WirePortable -{ -public: - // Fields - double x; - double y; - double z; - - // Default constructor - Gravity(); - - // Constructor with field values - Gravity(const double x, - const double y, - const double z); - - // Read structure on a Wire - bool read(yarp::os::idl::WireReader& reader) override; - - // Read structure on a Connection - bool read(yarp::os::ConnectionReader& connection) override; - - // Write structure on a Wire - bool write(const yarp::os::idl::WireWriter& writer) const override; - - // Write structure on a Connection - bool write(yarp::os::ConnectionWriter& connection) const override; - - // Convert to a printable string - std::string toString() const; - - // If you want to serialize this class without nesting, use this helper - typedef yarp::os::idl::Unwrapped unwrapped; - - class Editor : - public yarp::os::Wire, - public yarp::os::PortWriter - { - public: - // Editor: default constructor - Editor(); - - // Editor: constructor with base class - Editor(Gravity& obj); - - // Editor: destructor - ~Editor() override; - - // Editor: Deleted constructors and operator= - Editor(const Editor& rhs) = delete; - Editor(Editor&& rhs) = delete; - Editor& operator=(const Editor& rhs) = delete; - Editor& operator=(Editor&& rhs) = delete; - - // Editor: edit - bool edit(Gravity& obj, bool dirty = true); - - // Editor: validity check - bool isValid() const; - - // Editor: state - Gravity& state(); - - // Editor: start editing - void start_editing(); - -#ifndef YARP_NO_DEPRECATED // Since YARP 3.2 - YARP_DEPRECATED_MSG("Use start_editing() instead") - void begin() - { - start_editing(); - } -#endif // YARP_NO_DEPRECATED - - // Editor: stop editing - void stop_editing(); - -#ifndef YARP_NO_DEPRECATED // Since YARP 3.2 - YARP_DEPRECATED_MSG("Use stop_editing() instead") - void end() - { - stop_editing(); - } -#endif // YARP_NO_DEPRECATED - - // Editor: x field - void set_x(const double x); - double get_x() const; - virtual bool will_set_x(); - virtual bool did_set_x(); - - // Editor: y field - void set_y(const double y); - double get_y() const; - virtual bool will_set_y(); - virtual bool did_set_y(); - - // Editor: z field - void set_z(const double z); - double get_z() const; - virtual bool will_set_z(); - virtual bool did_set_z(); - - // Editor: clean - void clean(); - - // Editor: read - bool read(yarp::os::ConnectionReader& connection) override; - - // Editor: write - bool write(yarp::os::ConnectionWriter& connection) const override; - - private: - // Editor: state - Gravity* obj; - bool obj_owned; - int group; - - // Editor: dirty variables - bool is_dirty; - bool is_dirty_x; - bool is_dirty_y; - bool is_dirty_z; - int dirty_count; - - // Editor: send if possible - void communicate(); - - // Editor: mark dirty overall - void mark_dirty(); - - // Editor: mark dirty single fields - void mark_dirty_x(); - void mark_dirty_y(); - void mark_dirty_z(); - - // Editor: dirty_flags - void dirty_flags(bool flag); - }; - -private: - // read/write x field - bool read_x(yarp::os::idl::WireReader& reader); - bool write_x(const yarp::os::idl::WireWriter& writer) const; - bool nested_read_x(yarp::os::idl::WireReader& reader); - bool nested_write_x(const yarp::os::idl::WireWriter& writer) const; - - // read/write y field - bool read_y(yarp::os::idl::WireReader& reader); - bool write_y(const yarp::os::idl::WireWriter& writer) const; - bool nested_read_y(yarp::os::idl::WireReader& reader); - bool nested_write_y(const yarp::os::idl::WireWriter& writer) const; - - // read/write z field - bool read_z(yarp::os::idl::WireReader& reader); - bool write_z(const yarp::os::idl::WireWriter& writer) const; - bool nested_read_z(yarp::os::idl::WireReader& reader); - bool nested_write_z(const yarp::os::idl::WireWriter& writer) const; -}; - -#endif // YARP_THRIFT_GENERATOR_STRUCT_GRAVITY_H diff --git a/idl/wholeBodyDynamicsSettings/autogenerated/include/KinematicSourceType.h b/idl/wholeBodyDynamicsSettings/autogenerated/include/KinematicSourceType.h deleted file mode 100644 index 6f95c13..0000000 --- a/idl/wholeBodyDynamicsSettings/autogenerated/include/KinematicSourceType.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) - * SPDX-License-Identifier: BSD-3-Clause - */ - -// Autogenerated by Thrift Compiler (0.14.1-yarped) -// -// This is an automatically generated file. -// It could get re-generated if the ALLOW_IDL_GENERATION flag is on. - -#ifndef YARP_THRIFT_GENERATOR_ENUM_KINEMATICSOURCETYPE_H -#define YARP_THRIFT_GENERATOR_ENUM_KINEMATICSOURCETYPE_H - -#include -#include - -enum KinematicSourceType -{ - IMU = 0, - FIXED_FRAME = 1 -}; - -class KinematicSourceTypeVocab : - public yarp::os::idl::WireVocab -{ -public: - int fromString(const std::string& input) override; - std::string toString(int input) const override; -}; - -#endif // YARP_THRIFT_GENERATOR_ENUM_KINEMATICSOURCETYPE_H diff --git a/idl/wholeBodyDynamicsSettings/autogenerated/include/wholeBodyDynamicsSettings.h b/idl/wholeBodyDynamicsSettings/autogenerated/include/wholeBodyDynamicsSettings.h deleted file mode 100644 index ca306e1..0000000 --- a/idl/wholeBodyDynamicsSettings/autogenerated/include/wholeBodyDynamicsSettings.h +++ /dev/null @@ -1,357 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) - * SPDX-License-Identifier: BSD-3-Clause - */ - -// Autogenerated by Thrift Compiler (0.14.1-yarped) -// -// This is an automatically generated file. -// It could get re-generated if the ALLOW_IDL_GENERATION flag is on. - -#ifndef YARP_THRIFT_GENERATOR_STRUCT_WHOLEBODYDYNAMICSSETTINGS_H -#define YARP_THRIFT_GENERATOR_STRUCT_WHOLEBODYDYNAMICSSETTINGS_H - -#include -#include -#include -#include - -class wholeBodyDynamicsSettings : - public yarp::os::idl::WirePortable -{ -public: - // Fields - KinematicSourceType kinematicSource; - /** - * Specify the source of the kinematic information for one link, see KinematicSourceType information for more info. - */ - std::string fixedFrameName; - /** - * If kinematicSource is FIXED_LINK, specify the frame of the robot that we know to be fixed (i.e. not moving with respect to an inertial frame) - */ - Gravity fixedFrameGravity; - /** - * If kinematicSource is FIXED_LINK, specify the gravity vector (in m/s^2) in the fixedFrame - */ - std::string imuFrameName; - /** - * If kinematicSource is IMU, specify the frame name of the imu - */ - double imuFilterCutoffInHz; - /** - * Cutoff frequency (in Hz) of the first order filter of the IMU - */ - double forceTorqueFilterCutoffInHz; - /** - * Cutoff frequency(in Hz) of the first order filter of the F/T sensors - */ - double jointVelFilterCutoffInHz; - /** - * Cutoff frequency(in Hz) of the first order filter of the joint velocities - */ - double jointAccFilterCutoffInHz; - /** - * Cutoff frequency(in Hz) of the first order filter of the joint accelerations - */ - bool useJointVelocity; - /** - * Use the joint velocity measurement if this is true, assume they are zero otherwise. - */ - bool useJointAcceleration; - /** - * Use the joint acceleration measurment if this is true, assume they are zero otherwise. - */ - bool startWithZeroFTSensorOffsets; - /** - * If this flag is set to true, the read from the sensors is skipped at startup - */ - bool disableSensorReadCheckAtStartup; - - // Default constructor - wholeBodyDynamicsSettings(); - - // Constructor with field values - wholeBodyDynamicsSettings(const KinematicSourceType kinematicSource, - const std::string& fixedFrameName, - const Gravity& fixedFrameGravity, - const std::string& imuFrameName, - const double imuFilterCutoffInHz, - const double forceTorqueFilterCutoffInHz, - const double jointVelFilterCutoffInHz, - const double jointAccFilterCutoffInHz, - const bool useJointVelocity, - const bool useJointAcceleration, - const bool startWithZeroFTSensorOffsets, - const bool disableSensorReadCheckAtStartup); - - // Read structure on a Wire - bool read(yarp::os::idl::WireReader& reader) override; - - // Read structure on a Connection - bool read(yarp::os::ConnectionReader& connection) override; - - // Write structure on a Wire - bool write(const yarp::os::idl::WireWriter& writer) const override; - - // Write structure on a Connection - bool write(yarp::os::ConnectionWriter& connection) const override; - - // Convert to a printable string - std::string toString() const; - - // If you want to serialize this class without nesting, use this helper - typedef yarp::os::idl::Unwrapped unwrapped; - - class Editor : - public yarp::os::Wire, - public yarp::os::PortWriter - { - public: - // Editor: default constructor - Editor(); - - // Editor: constructor with base class - Editor(wholeBodyDynamicsSettings& obj); - - // Editor: destructor - ~Editor() override; - - // Editor: Deleted constructors and operator= - Editor(const Editor& rhs) = delete; - Editor(Editor&& rhs) = delete; - Editor& operator=(const Editor& rhs) = delete; - Editor& operator=(Editor&& rhs) = delete; - - // Editor: edit - bool edit(wholeBodyDynamicsSettings& obj, bool dirty = true); - - // Editor: validity check - bool isValid() const; - - // Editor: state - wholeBodyDynamicsSettings& state(); - - // Editor: start editing - void start_editing(); - -#ifndef YARP_NO_DEPRECATED // Since YARP 3.2 - YARP_DEPRECATED_MSG("Use start_editing() instead") - void begin() - { - start_editing(); - } -#endif // YARP_NO_DEPRECATED - - // Editor: stop editing - void stop_editing(); - -#ifndef YARP_NO_DEPRECATED // Since YARP 3.2 - YARP_DEPRECATED_MSG("Use stop_editing() instead") - void end() - { - stop_editing(); - } -#endif // YARP_NO_DEPRECATED - - // Editor: kinematicSource field - void set_kinematicSource(const KinematicSourceType kinematicSource); - KinematicSourceType get_kinematicSource() const; - virtual bool will_set_kinematicSource(); - virtual bool did_set_kinematicSource(); - - // Editor: fixedFrameName field - void set_fixedFrameName(const std::string& fixedFrameName); - const std::string& get_fixedFrameName() const; - virtual bool will_set_fixedFrameName(); - virtual bool did_set_fixedFrameName(); - - // Editor: fixedFrameGravity field - void set_fixedFrameGravity(const Gravity& fixedFrameGravity); - const Gravity& get_fixedFrameGravity() const; - virtual bool will_set_fixedFrameGravity(); - virtual bool did_set_fixedFrameGravity(); - - // Editor: imuFrameName field - void set_imuFrameName(const std::string& imuFrameName); - const std::string& get_imuFrameName() const; - virtual bool will_set_imuFrameName(); - virtual bool did_set_imuFrameName(); - - // Editor: imuFilterCutoffInHz field - void set_imuFilterCutoffInHz(const double imuFilterCutoffInHz); - double get_imuFilterCutoffInHz() const; - virtual bool will_set_imuFilterCutoffInHz(); - virtual bool did_set_imuFilterCutoffInHz(); - - // Editor: forceTorqueFilterCutoffInHz field - void set_forceTorqueFilterCutoffInHz(const double forceTorqueFilterCutoffInHz); - double get_forceTorqueFilterCutoffInHz() const; - virtual bool will_set_forceTorqueFilterCutoffInHz(); - virtual bool did_set_forceTorqueFilterCutoffInHz(); - - // Editor: jointVelFilterCutoffInHz field - void set_jointVelFilterCutoffInHz(const double jointVelFilterCutoffInHz); - double get_jointVelFilterCutoffInHz() const; - virtual bool will_set_jointVelFilterCutoffInHz(); - virtual bool did_set_jointVelFilterCutoffInHz(); - - // Editor: jointAccFilterCutoffInHz field - void set_jointAccFilterCutoffInHz(const double jointAccFilterCutoffInHz); - double get_jointAccFilterCutoffInHz() const; - virtual bool will_set_jointAccFilterCutoffInHz(); - virtual bool did_set_jointAccFilterCutoffInHz(); - - // Editor: useJointVelocity field - void set_useJointVelocity(const bool useJointVelocity); - bool get_useJointVelocity() const; - virtual bool will_set_useJointVelocity(); - virtual bool did_set_useJointVelocity(); - - // Editor: useJointAcceleration field - void set_useJointAcceleration(const bool useJointAcceleration); - bool get_useJointAcceleration() const; - virtual bool will_set_useJointAcceleration(); - virtual bool did_set_useJointAcceleration(); - - // Editor: startWithZeroFTSensorOffsets field - void set_startWithZeroFTSensorOffsets(const bool startWithZeroFTSensorOffsets); - bool get_startWithZeroFTSensorOffsets() const; - virtual bool will_set_startWithZeroFTSensorOffsets(); - virtual bool did_set_startWithZeroFTSensorOffsets(); - - // Editor: disableSensorReadCheckAtStartup field - void set_disableSensorReadCheckAtStartup(const bool disableSensorReadCheckAtStartup); - bool get_disableSensorReadCheckAtStartup() const; - virtual bool will_set_disableSensorReadCheckAtStartup(); - virtual bool did_set_disableSensorReadCheckAtStartup(); - - // Editor: clean - void clean(); - - // Editor: read - bool read(yarp::os::ConnectionReader& connection) override; - - // Editor: write - bool write(yarp::os::ConnectionWriter& connection) const override; - - private: - // Editor: state - wholeBodyDynamicsSettings* obj; - bool obj_owned; - int group; - - // Editor: dirty variables - bool is_dirty; - bool is_dirty_kinematicSource; - bool is_dirty_fixedFrameName; - bool is_dirty_fixedFrameGravity; - bool is_dirty_imuFrameName; - bool is_dirty_imuFilterCutoffInHz; - bool is_dirty_forceTorqueFilterCutoffInHz; - bool is_dirty_jointVelFilterCutoffInHz; - bool is_dirty_jointAccFilterCutoffInHz; - bool is_dirty_useJointVelocity; - bool is_dirty_useJointAcceleration; - bool is_dirty_startWithZeroFTSensorOffsets; - bool is_dirty_disableSensorReadCheckAtStartup; - int dirty_count; - - // Editor: send if possible - void communicate(); - - // Editor: mark dirty overall - void mark_dirty(); - - // Editor: mark dirty single fields - void mark_dirty_kinematicSource(); - void mark_dirty_fixedFrameName(); - void mark_dirty_fixedFrameGravity(); - void mark_dirty_imuFrameName(); - void mark_dirty_imuFilterCutoffInHz(); - void mark_dirty_forceTorqueFilterCutoffInHz(); - void mark_dirty_jointVelFilterCutoffInHz(); - void mark_dirty_jointAccFilterCutoffInHz(); - void mark_dirty_useJointVelocity(); - void mark_dirty_useJointAcceleration(); - void mark_dirty_startWithZeroFTSensorOffsets(); - void mark_dirty_disableSensorReadCheckAtStartup(); - - // Editor: dirty_flags - void dirty_flags(bool flag); - }; - -private: - // read/write kinematicSource field - bool read_kinematicSource(yarp::os::idl::WireReader& reader); - bool write_kinematicSource(const yarp::os::idl::WireWriter& writer) const; - bool nested_read_kinematicSource(yarp::os::idl::WireReader& reader); - bool nested_write_kinematicSource(const yarp::os::idl::WireWriter& writer) const; - - // read/write fixedFrameName field - bool read_fixedFrameName(yarp::os::idl::WireReader& reader); - bool write_fixedFrameName(const yarp::os::idl::WireWriter& writer) const; - bool nested_read_fixedFrameName(yarp::os::idl::WireReader& reader); - bool nested_write_fixedFrameName(const yarp::os::idl::WireWriter& writer) const; - - // read/write fixedFrameGravity field - bool read_fixedFrameGravity(yarp::os::idl::WireReader& reader); - bool write_fixedFrameGravity(const yarp::os::idl::WireWriter& writer) const; - bool nested_read_fixedFrameGravity(yarp::os::idl::WireReader& reader); - bool nested_write_fixedFrameGravity(const yarp::os::idl::WireWriter& writer) const; - - // read/write imuFrameName field - bool read_imuFrameName(yarp::os::idl::WireReader& reader); - bool write_imuFrameName(const yarp::os::idl::WireWriter& writer) const; - bool nested_read_imuFrameName(yarp::os::idl::WireReader& reader); - bool nested_write_imuFrameName(const yarp::os::idl::WireWriter& writer) const; - - // read/write imuFilterCutoffInHz field - bool read_imuFilterCutoffInHz(yarp::os::idl::WireReader& reader); - bool write_imuFilterCutoffInHz(const yarp::os::idl::WireWriter& writer) const; - bool nested_read_imuFilterCutoffInHz(yarp::os::idl::WireReader& reader); - bool nested_write_imuFilterCutoffInHz(const yarp::os::idl::WireWriter& writer) const; - - // read/write forceTorqueFilterCutoffInHz field - bool read_forceTorqueFilterCutoffInHz(yarp::os::idl::WireReader& reader); - bool write_forceTorqueFilterCutoffInHz(const yarp::os::idl::WireWriter& writer) const; - bool nested_read_forceTorqueFilterCutoffInHz(yarp::os::idl::WireReader& reader); - bool nested_write_forceTorqueFilterCutoffInHz(const yarp::os::idl::WireWriter& writer) const; - - // read/write jointVelFilterCutoffInHz field - bool read_jointVelFilterCutoffInHz(yarp::os::idl::WireReader& reader); - bool write_jointVelFilterCutoffInHz(const yarp::os::idl::WireWriter& writer) const; - bool nested_read_jointVelFilterCutoffInHz(yarp::os::idl::WireReader& reader); - bool nested_write_jointVelFilterCutoffInHz(const yarp::os::idl::WireWriter& writer) const; - - // read/write jointAccFilterCutoffInHz field - bool read_jointAccFilterCutoffInHz(yarp::os::idl::WireReader& reader); - bool write_jointAccFilterCutoffInHz(const yarp::os::idl::WireWriter& writer) const; - bool nested_read_jointAccFilterCutoffInHz(yarp::os::idl::WireReader& reader); - bool nested_write_jointAccFilterCutoffInHz(const yarp::os::idl::WireWriter& writer) const; - - // read/write useJointVelocity field - bool read_useJointVelocity(yarp::os::idl::WireReader& reader); - bool write_useJointVelocity(const yarp::os::idl::WireWriter& writer) const; - bool nested_read_useJointVelocity(yarp::os::idl::WireReader& reader); - bool nested_write_useJointVelocity(const yarp::os::idl::WireWriter& writer) const; - - // read/write useJointAcceleration field - bool read_useJointAcceleration(yarp::os::idl::WireReader& reader); - bool write_useJointAcceleration(const yarp::os::idl::WireWriter& writer) const; - bool nested_read_useJointAcceleration(yarp::os::idl::WireReader& reader); - bool nested_write_useJointAcceleration(const yarp::os::idl::WireWriter& writer) const; - - // read/write startWithZeroFTSensorOffsets field - bool read_startWithZeroFTSensorOffsets(yarp::os::idl::WireReader& reader); - bool write_startWithZeroFTSensorOffsets(const yarp::os::idl::WireWriter& writer) const; - bool nested_read_startWithZeroFTSensorOffsets(yarp::os::idl::WireReader& reader); - bool nested_write_startWithZeroFTSensorOffsets(const yarp::os::idl::WireWriter& writer) const; - - // read/write disableSensorReadCheckAtStartup field - bool read_disableSensorReadCheckAtStartup(yarp::os::idl::WireReader& reader); - bool write_disableSensorReadCheckAtStartup(const yarp::os::idl::WireWriter& writer) const; - bool nested_read_disableSensorReadCheckAtStartup(yarp::os::idl::WireReader& reader); - bool nested_write_disableSensorReadCheckAtStartup(const yarp::os::idl::WireWriter& writer) const; -}; - -#endif // YARP_THRIFT_GENERATOR_STRUCT_WHOLEBODYDYNAMICSSETTINGS_H diff --git a/idl/wholeBodyDynamicsSettings/autogenerated/src/ContactPoint.cpp b/idl/wholeBodyDynamicsSettings/autogenerated/src/ContactPoint.cpp deleted file mode 100644 index ae3fefc..0000000 --- a/idl/wholeBodyDynamicsSettings/autogenerated/src/ContactPoint.cpp +++ /dev/null @@ -1,610 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) - * SPDX-License-Identifier: BSD-3-Clause - */ - -// Autogenerated by Thrift Compiler (0.14.1-yarped) -// -// This is an automatically generated file. -// It could get re-generated if the ALLOW_IDL_GENERATION flag is on. - -#include - -// Default constructor -ContactPoint::ContactPoint() : - WirePortable(), - x(0), - y(0), - z(0) -{ -} - -// Constructor with field values -ContactPoint::ContactPoint(const double x, - const double y, - const double z) : - WirePortable(), - x(x), - y(y), - z(z) -{ -} - -// Read structure on a Wire -bool ContactPoint::read(yarp::os::idl::WireReader& reader) -{ - if (!read_x(reader)) { - return false; - } - if (!read_y(reader)) { - return false; - } - if (!read_z(reader)) { - return false; - } - return !reader.isError(); -} - -// Read structure on a Connection -bool ContactPoint::read(yarp::os::ConnectionReader& connection) -{ - yarp::os::idl::WireReader reader(connection); - if (!reader.readListHeader(3)) { - return false; - } - return read(reader); -} - -// Write structure on a Wire -bool ContactPoint::write(const yarp::os::idl::WireWriter& writer) const -{ - if (!write_x(writer)) { - return false; - } - if (!write_y(writer)) { - return false; - } - if (!write_z(writer)) { - return false; - } - return !writer.isError(); -} - -// Write structure on a Connection -bool ContactPoint::write(yarp::os::ConnectionWriter& connection) const -{ - yarp::os::idl::WireWriter writer(connection); - if (!writer.writeListHeader(3)) { - return false; - } - return write(writer); -} - -// Convert to a printable string -std::string ContactPoint::toString() const -{ - yarp::os::Bottle b; - b.read(*this); - return b.toString(); -} - -// Editor: default constructor -ContactPoint::Editor::Editor() -{ - group = 0; - obj_owned = true; - obj = new ContactPoint; - dirty_flags(false); - yarp().setOwner(*this); -} - -// Editor: constructor with base class -ContactPoint::Editor::Editor(ContactPoint& obj) -{ - group = 0; - obj_owned = false; - edit(obj, false); - yarp().setOwner(*this); -} - -// Editor: destructor -ContactPoint::Editor::~Editor() -{ - if (obj_owned) { - delete obj; - } -} - -// Editor: edit -bool ContactPoint::Editor::edit(ContactPoint& obj, bool dirty) -{ - if (obj_owned) { - delete this->obj; - } - this->obj = &obj; - obj_owned = false; - dirty_flags(dirty); - return true; -} - -// Editor: validity check -bool ContactPoint::Editor::isValid() const -{ - return obj != nullptr; -} - -// Editor: state -ContactPoint& ContactPoint::Editor::state() -{ - return *obj; -} - -// Editor: grouping begin -void ContactPoint::Editor::start_editing() -{ - group++; -} - -// Editor: grouping end -void ContactPoint::Editor::stop_editing() -{ - group--; - if (group == 0 && is_dirty) { - communicate(); - } -} -// Editor: x setter -void ContactPoint::Editor::set_x(const double x) -{ - will_set_x(); - obj->x = x; - mark_dirty_x(); - communicate(); - did_set_x(); -} - -// Editor: x getter -double ContactPoint::Editor::get_x() const -{ - return obj->x; -} - -// Editor: x will_set -bool ContactPoint::Editor::will_set_x() -{ - return true; -} - -// Editor: x did_set -bool ContactPoint::Editor::did_set_x() -{ - return true; -} - -// Editor: y setter -void ContactPoint::Editor::set_y(const double y) -{ - will_set_y(); - obj->y = y; - mark_dirty_y(); - communicate(); - did_set_y(); -} - -// Editor: y getter -double ContactPoint::Editor::get_y() const -{ - return obj->y; -} - -// Editor: y will_set -bool ContactPoint::Editor::will_set_y() -{ - return true; -} - -// Editor: y did_set -bool ContactPoint::Editor::did_set_y() -{ - return true; -} - -// Editor: z setter -void ContactPoint::Editor::set_z(const double z) -{ - will_set_z(); - obj->z = z; - mark_dirty_z(); - communicate(); - did_set_z(); -} - -// Editor: z getter -double ContactPoint::Editor::get_z() const -{ - return obj->z; -} - -// Editor: z will_set -bool ContactPoint::Editor::will_set_z() -{ - return true; -} - -// Editor: z did_set -bool ContactPoint::Editor::did_set_z() -{ - return true; -} - -// Editor: clean -void ContactPoint::Editor::clean() -{ - dirty_flags(false); -} - -// Editor: read -bool ContactPoint::Editor::read(yarp::os::ConnectionReader& connection) -{ - if (!isValid()) { - return false; - } - yarp::os::idl::WireReader reader(connection); - reader.expectAccept(); - if (!reader.readListHeader()) { - return false; - } - int len = reader.getLength(); - if (len == 0) { - yarp::os::idl::WireWriter writer(reader); - if (writer.isNull()) { - return true; - } - if (!writer.writeListHeader(1)) { - return false; - } - writer.writeString("send: 'help' or 'patch (param1 val1) (param2 val2)'"); - return true; - } - std::string tag; - if (!reader.readString(tag)) { - return false; - } - if (tag == "help") { - yarp::os::idl::WireWriter writer(reader); - if (writer.isNull()) { - return true; - } - if (!writer.writeListHeader(2)) { - return false; - } - if (!writer.writeTag("many", 1, 0)) { - return false; - } - if (reader.getLength() > 0) { - std::string field; - if (!reader.readString(field)) { - return false; - } - if (field == "x") { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeString("double x")) { - return false; - } - } - if (field == "y") { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeString("double y")) { - return false; - } - } - if (field == "z") { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeString("double z")) { - return false; - } - } - } - if (!writer.writeListHeader(4)) { - return false; - } - writer.writeString("*** Available fields:"); - writer.writeString("x"); - writer.writeString("y"); - writer.writeString("z"); - return true; - } - bool nested = true; - bool have_act = false; - if (tag != "patch") { - if (((len - 1) % 2) != 0) { - return false; - } - len = 1 + ((len - 1) / 2); - nested = false; - have_act = true; - } - for (int i = 1; i < len; ++i) { - if (nested && !reader.readListHeader(3)) { - return false; - } - std::string act; - std::string key; - if (have_act) { - act = tag; - } else if (!reader.readString(act)) { - return false; - } - if (!reader.readString(key)) { - return false; - } - if (key == "x") { - will_set_x(); - if (!obj->nested_read_x(reader)) { - return false; - } - did_set_x(); - } else if (key == "y") { - will_set_y(); - if (!obj->nested_read_y(reader)) { - return false; - } - did_set_y(); - } else if (key == "z") { - will_set_z(); - if (!obj->nested_read_z(reader)) { - return false; - } - did_set_z(); - } else { - // would be useful to have a fallback here - } - } - reader.accept(); - yarp::os::idl::WireWriter writer(reader); - if (writer.isNull()) { - return true; - } - writer.writeListHeader(1); - writer.writeVocab32('o', 'k'); - return true; -} - -// Editor: write -bool ContactPoint::Editor::write(yarp::os::ConnectionWriter& connection) const -{ - if (!isValid()) { - return false; - } - yarp::os::idl::WireWriter writer(connection); - if (!writer.writeListHeader(dirty_count + 1)) { - return false; - } - if (!writer.writeString("patch")) { - return false; - } - if (is_dirty_x) { - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeString("set")) { - return false; - } - if (!writer.writeString("x")) { - return false; - } - if (!obj->nested_write_x(writer)) { - return false; - } - } - if (is_dirty_y) { - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeString("set")) { - return false; - } - if (!writer.writeString("y")) { - return false; - } - if (!obj->nested_write_y(writer)) { - return false; - } - } - if (is_dirty_z) { - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeString("set")) { - return false; - } - if (!writer.writeString("z")) { - return false; - } - if (!obj->nested_write_z(writer)) { - return false; - } - } - return !writer.isError(); -} - -// Editor: send if possible -void ContactPoint::Editor::communicate() -{ - if (group != 0) { - return; - } - if (yarp().canWrite()) { - yarp().write(*this); - clean(); - } -} - -// Editor: mark dirty overall -void ContactPoint::Editor::mark_dirty() -{ - is_dirty = true; -} - -// Editor: x mark_dirty -void ContactPoint::Editor::mark_dirty_x() -{ - if (is_dirty_x) { - return; - } - dirty_count++; - is_dirty_x = true; - mark_dirty(); -} - -// Editor: y mark_dirty -void ContactPoint::Editor::mark_dirty_y() -{ - if (is_dirty_y) { - return; - } - dirty_count++; - is_dirty_y = true; - mark_dirty(); -} - -// Editor: z mark_dirty -void ContactPoint::Editor::mark_dirty_z() -{ - if (is_dirty_z) { - return; - } - dirty_count++; - is_dirty_z = true; - mark_dirty(); -} - -// Editor: dirty_flags -void ContactPoint::Editor::dirty_flags(bool flag) -{ - is_dirty = flag; - is_dirty_x = flag; - is_dirty_y = flag; - is_dirty_z = flag; - dirty_count = flag ? 3 : 0; -} - -// read x field -bool ContactPoint::read_x(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(x)) { - reader.fail(); - return false; - } - return true; -} - -// write x field -bool ContactPoint::write_x(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(x)) { - return false; - } - return true; -} - -// read (nested) x field -bool ContactPoint::nested_read_x(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(x)) { - reader.fail(); - return false; - } - return true; -} - -// write (nested) x field -bool ContactPoint::nested_write_x(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(x)) { - return false; - } - return true; -} - -// read y field -bool ContactPoint::read_y(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(y)) { - reader.fail(); - return false; - } - return true; -} - -// write y field -bool ContactPoint::write_y(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(y)) { - return false; - } - return true; -} - -// read (nested) y field -bool ContactPoint::nested_read_y(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(y)) { - reader.fail(); - return false; - } - return true; -} - -// write (nested) y field -bool ContactPoint::nested_write_y(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(y)) { - return false; - } - return true; -} - -// read z field -bool ContactPoint::read_z(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(z)) { - reader.fail(); - return false; - } - return true; -} - -// write z field -bool ContactPoint::write_z(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(z)) { - return false; - } - return true; -} - -// read (nested) z field -bool ContactPoint::nested_read_z(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(z)) { - reader.fail(); - return false; - } - return true; -} - -// write (nested) z field -bool ContactPoint::nested_write_z(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(z)) { - return false; - } - return true; -} diff --git a/idl/wholeBodyDynamicsSettings/autogenerated/src/Gravity.cpp b/idl/wholeBodyDynamicsSettings/autogenerated/src/Gravity.cpp deleted file mode 100644 index 665931c..0000000 --- a/idl/wholeBodyDynamicsSettings/autogenerated/src/Gravity.cpp +++ /dev/null @@ -1,610 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) - * SPDX-License-Identifier: BSD-3-Clause - */ - -// Autogenerated by Thrift Compiler (0.14.1-yarped) -// -// This is an automatically generated file. -// It could get re-generated if the ALLOW_IDL_GENERATION flag is on. - -#include - -// Default constructor -Gravity::Gravity() : - WirePortable(), - x(0), - y(0), - z(0) -{ -} - -// Constructor with field values -Gravity::Gravity(const double x, - const double y, - const double z) : - WirePortable(), - x(x), - y(y), - z(z) -{ -} - -// Read structure on a Wire -bool Gravity::read(yarp::os::idl::WireReader& reader) -{ - if (!read_x(reader)) { - return false; - } - if (!read_y(reader)) { - return false; - } - if (!read_z(reader)) { - return false; - } - return !reader.isError(); -} - -// Read structure on a Connection -bool Gravity::read(yarp::os::ConnectionReader& connection) -{ - yarp::os::idl::WireReader reader(connection); - if (!reader.readListHeader(3)) { - return false; - } - return read(reader); -} - -// Write structure on a Wire -bool Gravity::write(const yarp::os::idl::WireWriter& writer) const -{ - if (!write_x(writer)) { - return false; - } - if (!write_y(writer)) { - return false; - } - if (!write_z(writer)) { - return false; - } - return !writer.isError(); -} - -// Write structure on a Connection -bool Gravity::write(yarp::os::ConnectionWriter& connection) const -{ - yarp::os::idl::WireWriter writer(connection); - if (!writer.writeListHeader(3)) { - return false; - } - return write(writer); -} - -// Convert to a printable string -std::string Gravity::toString() const -{ - yarp::os::Bottle b; - b.read(*this); - return b.toString(); -} - -// Editor: default constructor -Gravity::Editor::Editor() -{ - group = 0; - obj_owned = true; - obj = new Gravity; - dirty_flags(false); - yarp().setOwner(*this); -} - -// Editor: constructor with base class -Gravity::Editor::Editor(Gravity& obj) -{ - group = 0; - obj_owned = false; - edit(obj, false); - yarp().setOwner(*this); -} - -// Editor: destructor -Gravity::Editor::~Editor() -{ - if (obj_owned) { - delete obj; - } -} - -// Editor: edit -bool Gravity::Editor::edit(Gravity& obj, bool dirty) -{ - if (obj_owned) { - delete this->obj; - } - this->obj = &obj; - obj_owned = false; - dirty_flags(dirty); - return true; -} - -// Editor: validity check -bool Gravity::Editor::isValid() const -{ - return obj != nullptr; -} - -// Editor: state -Gravity& Gravity::Editor::state() -{ - return *obj; -} - -// Editor: grouping begin -void Gravity::Editor::start_editing() -{ - group++; -} - -// Editor: grouping end -void Gravity::Editor::stop_editing() -{ - group--; - if (group == 0 && is_dirty) { - communicate(); - } -} -// Editor: x setter -void Gravity::Editor::set_x(const double x) -{ - will_set_x(); - obj->x = x; - mark_dirty_x(); - communicate(); - did_set_x(); -} - -// Editor: x getter -double Gravity::Editor::get_x() const -{ - return obj->x; -} - -// Editor: x will_set -bool Gravity::Editor::will_set_x() -{ - return true; -} - -// Editor: x did_set -bool Gravity::Editor::did_set_x() -{ - return true; -} - -// Editor: y setter -void Gravity::Editor::set_y(const double y) -{ - will_set_y(); - obj->y = y; - mark_dirty_y(); - communicate(); - did_set_y(); -} - -// Editor: y getter -double Gravity::Editor::get_y() const -{ - return obj->y; -} - -// Editor: y will_set -bool Gravity::Editor::will_set_y() -{ - return true; -} - -// Editor: y did_set -bool Gravity::Editor::did_set_y() -{ - return true; -} - -// Editor: z setter -void Gravity::Editor::set_z(const double z) -{ - will_set_z(); - obj->z = z; - mark_dirty_z(); - communicate(); - did_set_z(); -} - -// Editor: z getter -double Gravity::Editor::get_z() const -{ - return obj->z; -} - -// Editor: z will_set -bool Gravity::Editor::will_set_z() -{ - return true; -} - -// Editor: z did_set -bool Gravity::Editor::did_set_z() -{ - return true; -} - -// Editor: clean -void Gravity::Editor::clean() -{ - dirty_flags(false); -} - -// Editor: read -bool Gravity::Editor::read(yarp::os::ConnectionReader& connection) -{ - if (!isValid()) { - return false; - } - yarp::os::idl::WireReader reader(connection); - reader.expectAccept(); - if (!reader.readListHeader()) { - return false; - } - int len = reader.getLength(); - if (len == 0) { - yarp::os::idl::WireWriter writer(reader); - if (writer.isNull()) { - return true; - } - if (!writer.writeListHeader(1)) { - return false; - } - writer.writeString("send: 'help' or 'patch (param1 val1) (param2 val2)'"); - return true; - } - std::string tag; - if (!reader.readString(tag)) { - return false; - } - if (tag == "help") { - yarp::os::idl::WireWriter writer(reader); - if (writer.isNull()) { - return true; - } - if (!writer.writeListHeader(2)) { - return false; - } - if (!writer.writeTag("many", 1, 0)) { - return false; - } - if (reader.getLength() > 0) { - std::string field; - if (!reader.readString(field)) { - return false; - } - if (field == "x") { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeString("double x")) { - return false; - } - } - if (field == "y") { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeString("double y")) { - return false; - } - } - if (field == "z") { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeString("double z")) { - return false; - } - } - } - if (!writer.writeListHeader(4)) { - return false; - } - writer.writeString("*** Available fields:"); - writer.writeString("x"); - writer.writeString("y"); - writer.writeString("z"); - return true; - } - bool nested = true; - bool have_act = false; - if (tag != "patch") { - if (((len - 1) % 2) != 0) { - return false; - } - len = 1 + ((len - 1) / 2); - nested = false; - have_act = true; - } - for (int i = 1; i < len; ++i) { - if (nested && !reader.readListHeader(3)) { - return false; - } - std::string act; - std::string key; - if (have_act) { - act = tag; - } else if (!reader.readString(act)) { - return false; - } - if (!reader.readString(key)) { - return false; - } - if (key == "x") { - will_set_x(); - if (!obj->nested_read_x(reader)) { - return false; - } - did_set_x(); - } else if (key == "y") { - will_set_y(); - if (!obj->nested_read_y(reader)) { - return false; - } - did_set_y(); - } else if (key == "z") { - will_set_z(); - if (!obj->nested_read_z(reader)) { - return false; - } - did_set_z(); - } else { - // would be useful to have a fallback here - } - } - reader.accept(); - yarp::os::idl::WireWriter writer(reader); - if (writer.isNull()) { - return true; - } - writer.writeListHeader(1); - writer.writeVocab32('o', 'k'); - return true; -} - -// Editor: write -bool Gravity::Editor::write(yarp::os::ConnectionWriter& connection) const -{ - if (!isValid()) { - return false; - } - yarp::os::idl::WireWriter writer(connection); - if (!writer.writeListHeader(dirty_count + 1)) { - return false; - } - if (!writer.writeString("patch")) { - return false; - } - if (is_dirty_x) { - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeString("set")) { - return false; - } - if (!writer.writeString("x")) { - return false; - } - if (!obj->nested_write_x(writer)) { - return false; - } - } - if (is_dirty_y) { - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeString("set")) { - return false; - } - if (!writer.writeString("y")) { - return false; - } - if (!obj->nested_write_y(writer)) { - return false; - } - } - if (is_dirty_z) { - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeString("set")) { - return false; - } - if (!writer.writeString("z")) { - return false; - } - if (!obj->nested_write_z(writer)) { - return false; - } - } - return !writer.isError(); -} - -// Editor: send if possible -void Gravity::Editor::communicate() -{ - if (group != 0) { - return; - } - if (yarp().canWrite()) { - yarp().write(*this); - clean(); - } -} - -// Editor: mark dirty overall -void Gravity::Editor::mark_dirty() -{ - is_dirty = true; -} - -// Editor: x mark_dirty -void Gravity::Editor::mark_dirty_x() -{ - if (is_dirty_x) { - return; - } - dirty_count++; - is_dirty_x = true; - mark_dirty(); -} - -// Editor: y mark_dirty -void Gravity::Editor::mark_dirty_y() -{ - if (is_dirty_y) { - return; - } - dirty_count++; - is_dirty_y = true; - mark_dirty(); -} - -// Editor: z mark_dirty -void Gravity::Editor::mark_dirty_z() -{ - if (is_dirty_z) { - return; - } - dirty_count++; - is_dirty_z = true; - mark_dirty(); -} - -// Editor: dirty_flags -void Gravity::Editor::dirty_flags(bool flag) -{ - is_dirty = flag; - is_dirty_x = flag; - is_dirty_y = flag; - is_dirty_z = flag; - dirty_count = flag ? 3 : 0; -} - -// read x field -bool Gravity::read_x(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(x)) { - reader.fail(); - return false; - } - return true; -} - -// write x field -bool Gravity::write_x(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(x)) { - return false; - } - return true; -} - -// read (nested) x field -bool Gravity::nested_read_x(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(x)) { - reader.fail(); - return false; - } - return true; -} - -// write (nested) x field -bool Gravity::nested_write_x(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(x)) { - return false; - } - return true; -} - -// read y field -bool Gravity::read_y(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(y)) { - reader.fail(); - return false; - } - return true; -} - -// write y field -bool Gravity::write_y(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(y)) { - return false; - } - return true; -} - -// read (nested) y field -bool Gravity::nested_read_y(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(y)) { - reader.fail(); - return false; - } - return true; -} - -// write (nested) y field -bool Gravity::nested_write_y(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(y)) { - return false; - } - return true; -} - -// read z field -bool Gravity::read_z(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(z)) { - reader.fail(); - return false; - } - return true; -} - -// write z field -bool Gravity::write_z(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(z)) { - return false; - } - return true; -} - -// read (nested) z field -bool Gravity::nested_read_z(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(z)) { - reader.fail(); - return false; - } - return true; -} - -// write (nested) z field -bool Gravity::nested_write_z(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(z)) { - return false; - } - return true; -} diff --git a/idl/wholeBodyDynamicsSettings/autogenerated/src/KinematicSourceType.cpp b/idl/wholeBodyDynamicsSettings/autogenerated/src/KinematicSourceType.cpp deleted file mode 100644 index cf68253..0000000 --- a/idl/wholeBodyDynamicsSettings/autogenerated/src/KinematicSourceType.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) - * SPDX-License-Identifier: BSD-3-Clause - */ - -// Autogenerated by Thrift Compiler (0.14.1-yarped) -// -// This is an automatically generated file. -// It could get re-generated if the ALLOW_IDL_GENERATION flag is on. - -#include -#include -#include - -int KinematicSourceTypeVocab::fromString(const std::string& input) -{ - // definitely needs optimizing :-) - if (input=="IMU") { - return static_cast(IMU); - } - if (input=="FIXED_FRAME") { - return static_cast(FIXED_FRAME); - } - return -1; -} -std::string KinematicSourceTypeVocab::toString(int input) const -{ - switch(static_cast(input)) { - case IMU: - return "IMU"; - case FIXED_FRAME: - return "FIXED_FRAME"; - } - return ""; -} diff --git a/idl/wholeBodyDynamicsSettings/autogenerated/src/wholeBodyDynamicsSettings.cpp b/idl/wholeBodyDynamicsSettings/autogenerated/src/wholeBodyDynamicsSettings.cpp deleted file mode 100644 index 9bd1b75..0000000 --- a/idl/wholeBodyDynamicsSettings/autogenerated/src/wholeBodyDynamicsSettings.cpp +++ /dev/null @@ -1,1695 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) - * SPDX-License-Identifier: BSD-3-Clause - */ - -// Autogenerated by Thrift Compiler (0.14.1-yarped) -// -// This is an automatically generated file. -// It could get re-generated if the ALLOW_IDL_GENERATION flag is on. - -#include - -// Default constructor -wholeBodyDynamicsSettings::wholeBodyDynamicsSettings() : - WirePortable(), - kinematicSource((KinematicSourceType)0), - fixedFrameName(""), - fixedFrameGravity(), - imuFrameName(""), - imuFilterCutoffInHz(0), - forceTorqueFilterCutoffInHz(0), - jointVelFilterCutoffInHz(0), - jointAccFilterCutoffInHz(0), - useJointVelocity(0), - useJointAcceleration(0), - startWithZeroFTSensorOffsets(0), - disableSensorReadCheckAtStartup(0) -{ -} - -// Constructor with field values -wholeBodyDynamicsSettings::wholeBodyDynamicsSettings(const KinematicSourceType kinematicSource, - const std::string& fixedFrameName, - const Gravity& fixedFrameGravity, - const std::string& imuFrameName, - const double imuFilterCutoffInHz, - const double forceTorqueFilterCutoffInHz, - const double jointVelFilterCutoffInHz, - const double jointAccFilterCutoffInHz, - const bool useJointVelocity, - const bool useJointAcceleration, - const bool startWithZeroFTSensorOffsets, - const bool disableSensorReadCheckAtStartup) : - WirePortable(), - kinematicSource(kinematicSource), - fixedFrameName(fixedFrameName), - fixedFrameGravity(fixedFrameGravity), - imuFrameName(imuFrameName), - imuFilterCutoffInHz(imuFilterCutoffInHz), - forceTorqueFilterCutoffInHz(forceTorqueFilterCutoffInHz), - jointVelFilterCutoffInHz(jointVelFilterCutoffInHz), - jointAccFilterCutoffInHz(jointAccFilterCutoffInHz), - useJointVelocity(useJointVelocity), - useJointAcceleration(useJointAcceleration), - startWithZeroFTSensorOffsets(startWithZeroFTSensorOffsets), - disableSensorReadCheckAtStartup(disableSensorReadCheckAtStartup) -{ -} - -// Read structure on a Wire -bool wholeBodyDynamicsSettings::read(yarp::os::idl::WireReader& reader) -{ - if (!read_kinematicSource(reader)) { - return false; - } - if (!read_fixedFrameName(reader)) { - return false; - } - if (!read_fixedFrameGravity(reader)) { - return false; - } - if (!read_imuFrameName(reader)) { - return false; - } - if (!read_imuFilterCutoffInHz(reader)) { - return false; - } - if (!read_forceTorqueFilterCutoffInHz(reader)) { - return false; - } - if (!read_jointVelFilterCutoffInHz(reader)) { - return false; - } - if (!read_jointAccFilterCutoffInHz(reader)) { - return false; - } - if (!read_useJointVelocity(reader)) { - return false; - } - if (!read_useJointAcceleration(reader)) { - return false; - } - if (!read_startWithZeroFTSensorOffsets(reader)) { - return false; - } - if (!read_disableSensorReadCheckAtStartup(reader)) { - return false; - } - return !reader.isError(); -} - -// Read structure on a Connection -bool wholeBodyDynamicsSettings::read(yarp::os::ConnectionReader& connection) -{ - yarp::os::idl::WireReader reader(connection); - if (!reader.readListHeader(14)) { - return false; - } - return read(reader); -} - -// Write structure on a Wire -bool wholeBodyDynamicsSettings::write(const yarp::os::idl::WireWriter& writer) const -{ - if (!write_kinematicSource(writer)) { - return false; - } - if (!write_fixedFrameName(writer)) { - return false; - } - if (!write_fixedFrameGravity(writer)) { - return false; - } - if (!write_imuFrameName(writer)) { - return false; - } - if (!write_imuFilterCutoffInHz(writer)) { - return false; - } - if (!write_forceTorqueFilterCutoffInHz(writer)) { - return false; - } - if (!write_jointVelFilterCutoffInHz(writer)) { - return false; - } - if (!write_jointAccFilterCutoffInHz(writer)) { - return false; - } - if (!write_useJointVelocity(writer)) { - return false; - } - if (!write_useJointAcceleration(writer)) { - return false; - } - if (!write_startWithZeroFTSensorOffsets(writer)) { - return false; - } - if (!write_disableSensorReadCheckAtStartup(writer)) { - return false; - } - return !writer.isError(); -} - -// Write structure on a Connection -bool wholeBodyDynamicsSettings::write(yarp::os::ConnectionWriter& connection) const -{ - yarp::os::idl::WireWriter writer(connection); - if (!writer.writeListHeader(14)) { - return false; - } - return write(writer); -} - -// Convert to a printable string -std::string wholeBodyDynamicsSettings::toString() const -{ - yarp::os::Bottle b; - b.read(*this); - return b.toString(); -} - -// Editor: default constructor -wholeBodyDynamicsSettings::Editor::Editor() -{ - group = 0; - obj_owned = true; - obj = new wholeBodyDynamicsSettings; - dirty_flags(false); - yarp().setOwner(*this); -} - -// Editor: constructor with base class -wholeBodyDynamicsSettings::Editor::Editor(wholeBodyDynamicsSettings& obj) -{ - group = 0; - obj_owned = false; - edit(obj, false); - yarp().setOwner(*this); -} - -// Editor: destructor -wholeBodyDynamicsSettings::Editor::~Editor() -{ - if (obj_owned) { - delete obj; - } -} - -// Editor: edit -bool wholeBodyDynamicsSettings::Editor::edit(wholeBodyDynamicsSettings& obj, bool dirty) -{ - if (obj_owned) { - delete this->obj; - } - this->obj = &obj; - obj_owned = false; - dirty_flags(dirty); - return true; -} - -// Editor: validity check -bool wholeBodyDynamicsSettings::Editor::isValid() const -{ - return obj != nullptr; -} - -// Editor: state -wholeBodyDynamicsSettings& wholeBodyDynamicsSettings::Editor::state() -{ - return *obj; -} - -// Editor: grouping begin -void wholeBodyDynamicsSettings::Editor::start_editing() -{ - group++; -} - -// Editor: grouping end -void wholeBodyDynamicsSettings::Editor::stop_editing() -{ - group--; - if (group == 0 && is_dirty) { - communicate(); - } -} -// Editor: kinematicSource setter -void wholeBodyDynamicsSettings::Editor::set_kinematicSource(const KinematicSourceType kinematicSource) -{ - will_set_kinematicSource(); - obj->kinematicSource = kinematicSource; - mark_dirty_kinematicSource(); - communicate(); - did_set_kinematicSource(); -} - -// Editor: kinematicSource getter -KinematicSourceType wholeBodyDynamicsSettings::Editor::get_kinematicSource() const -{ - return obj->kinematicSource; -} - -// Editor: kinematicSource will_set -bool wholeBodyDynamicsSettings::Editor::will_set_kinematicSource() -{ - return true; -} - -// Editor: kinematicSource did_set -bool wholeBodyDynamicsSettings::Editor::did_set_kinematicSource() -{ - return true; -} - -// Editor: fixedFrameName setter -void wholeBodyDynamicsSettings::Editor::set_fixedFrameName(const std::string& fixedFrameName) -{ - will_set_fixedFrameName(); - obj->fixedFrameName = fixedFrameName; - mark_dirty_fixedFrameName(); - communicate(); - did_set_fixedFrameName(); -} - -// Editor: fixedFrameName getter -const std::string& wholeBodyDynamicsSettings::Editor::get_fixedFrameName() const -{ - return obj->fixedFrameName; -} - -// Editor: fixedFrameName will_set -bool wholeBodyDynamicsSettings::Editor::will_set_fixedFrameName() -{ - return true; -} - -// Editor: fixedFrameName did_set -bool wholeBodyDynamicsSettings::Editor::did_set_fixedFrameName() -{ - return true; -} - -// Editor: fixedFrameGravity setter -void wholeBodyDynamicsSettings::Editor::set_fixedFrameGravity(const Gravity& fixedFrameGravity) -{ - will_set_fixedFrameGravity(); - obj->fixedFrameGravity = fixedFrameGravity; - mark_dirty_fixedFrameGravity(); - communicate(); - did_set_fixedFrameGravity(); -} - -// Editor: fixedFrameGravity getter -const Gravity& wholeBodyDynamicsSettings::Editor::get_fixedFrameGravity() const -{ - return obj->fixedFrameGravity; -} - -// Editor: fixedFrameGravity will_set -bool wholeBodyDynamicsSettings::Editor::will_set_fixedFrameGravity() -{ - return true; -} - -// Editor: fixedFrameGravity did_set -bool wholeBodyDynamicsSettings::Editor::did_set_fixedFrameGravity() -{ - return true; -} - -// Editor: imuFrameName setter -void wholeBodyDynamicsSettings::Editor::set_imuFrameName(const std::string& imuFrameName) -{ - will_set_imuFrameName(); - obj->imuFrameName = imuFrameName; - mark_dirty_imuFrameName(); - communicate(); - did_set_imuFrameName(); -} - -// Editor: imuFrameName getter -const std::string& wholeBodyDynamicsSettings::Editor::get_imuFrameName() const -{ - return obj->imuFrameName; -} - -// Editor: imuFrameName will_set -bool wholeBodyDynamicsSettings::Editor::will_set_imuFrameName() -{ - return true; -} - -// Editor: imuFrameName did_set -bool wholeBodyDynamicsSettings::Editor::did_set_imuFrameName() -{ - return true; -} - -// Editor: imuFilterCutoffInHz setter -void wholeBodyDynamicsSettings::Editor::set_imuFilterCutoffInHz(const double imuFilterCutoffInHz) -{ - will_set_imuFilterCutoffInHz(); - obj->imuFilterCutoffInHz = imuFilterCutoffInHz; - mark_dirty_imuFilterCutoffInHz(); - communicate(); - did_set_imuFilterCutoffInHz(); -} - -// Editor: imuFilterCutoffInHz getter -double wholeBodyDynamicsSettings::Editor::get_imuFilterCutoffInHz() const -{ - return obj->imuFilterCutoffInHz; -} - -// Editor: imuFilterCutoffInHz will_set -bool wholeBodyDynamicsSettings::Editor::will_set_imuFilterCutoffInHz() -{ - return true; -} - -// Editor: imuFilterCutoffInHz did_set -bool wholeBodyDynamicsSettings::Editor::did_set_imuFilterCutoffInHz() -{ - return true; -} - -// Editor: forceTorqueFilterCutoffInHz setter -void wholeBodyDynamicsSettings::Editor::set_forceTorqueFilterCutoffInHz(const double forceTorqueFilterCutoffInHz) -{ - will_set_forceTorqueFilterCutoffInHz(); - obj->forceTorqueFilterCutoffInHz = forceTorqueFilterCutoffInHz; - mark_dirty_forceTorqueFilterCutoffInHz(); - communicate(); - did_set_forceTorqueFilterCutoffInHz(); -} - -// Editor: forceTorqueFilterCutoffInHz getter -double wholeBodyDynamicsSettings::Editor::get_forceTorqueFilterCutoffInHz() const -{ - return obj->forceTorqueFilterCutoffInHz; -} - -// Editor: forceTorqueFilterCutoffInHz will_set -bool wholeBodyDynamicsSettings::Editor::will_set_forceTorqueFilterCutoffInHz() -{ - return true; -} - -// Editor: forceTorqueFilterCutoffInHz did_set -bool wholeBodyDynamicsSettings::Editor::did_set_forceTorqueFilterCutoffInHz() -{ - return true; -} - -// Editor: jointVelFilterCutoffInHz setter -void wholeBodyDynamicsSettings::Editor::set_jointVelFilterCutoffInHz(const double jointVelFilterCutoffInHz) -{ - will_set_jointVelFilterCutoffInHz(); - obj->jointVelFilterCutoffInHz = jointVelFilterCutoffInHz; - mark_dirty_jointVelFilterCutoffInHz(); - communicate(); - did_set_jointVelFilterCutoffInHz(); -} - -// Editor: jointVelFilterCutoffInHz getter -double wholeBodyDynamicsSettings::Editor::get_jointVelFilterCutoffInHz() const -{ - return obj->jointVelFilterCutoffInHz; -} - -// Editor: jointVelFilterCutoffInHz will_set -bool wholeBodyDynamicsSettings::Editor::will_set_jointVelFilterCutoffInHz() -{ - return true; -} - -// Editor: jointVelFilterCutoffInHz did_set -bool wholeBodyDynamicsSettings::Editor::did_set_jointVelFilterCutoffInHz() -{ - return true; -} - -// Editor: jointAccFilterCutoffInHz setter -void wholeBodyDynamicsSettings::Editor::set_jointAccFilterCutoffInHz(const double jointAccFilterCutoffInHz) -{ - will_set_jointAccFilterCutoffInHz(); - obj->jointAccFilterCutoffInHz = jointAccFilterCutoffInHz; - mark_dirty_jointAccFilterCutoffInHz(); - communicate(); - did_set_jointAccFilterCutoffInHz(); -} - -// Editor: jointAccFilterCutoffInHz getter -double wholeBodyDynamicsSettings::Editor::get_jointAccFilterCutoffInHz() const -{ - return obj->jointAccFilterCutoffInHz; -} - -// Editor: jointAccFilterCutoffInHz will_set -bool wholeBodyDynamicsSettings::Editor::will_set_jointAccFilterCutoffInHz() -{ - return true; -} - -// Editor: jointAccFilterCutoffInHz did_set -bool wholeBodyDynamicsSettings::Editor::did_set_jointAccFilterCutoffInHz() -{ - return true; -} - -// Editor: useJointVelocity setter -void wholeBodyDynamicsSettings::Editor::set_useJointVelocity(const bool useJointVelocity) -{ - will_set_useJointVelocity(); - obj->useJointVelocity = useJointVelocity; - mark_dirty_useJointVelocity(); - communicate(); - did_set_useJointVelocity(); -} - -// Editor: useJointVelocity getter -bool wholeBodyDynamicsSettings::Editor::get_useJointVelocity() const -{ - return obj->useJointVelocity; -} - -// Editor: useJointVelocity will_set -bool wholeBodyDynamicsSettings::Editor::will_set_useJointVelocity() -{ - return true; -} - -// Editor: useJointVelocity did_set -bool wholeBodyDynamicsSettings::Editor::did_set_useJointVelocity() -{ - return true; -} - -// Editor: useJointAcceleration setter -void wholeBodyDynamicsSettings::Editor::set_useJointAcceleration(const bool useJointAcceleration) -{ - will_set_useJointAcceleration(); - obj->useJointAcceleration = useJointAcceleration; - mark_dirty_useJointAcceleration(); - communicate(); - did_set_useJointAcceleration(); -} - -// Editor: useJointAcceleration getter -bool wholeBodyDynamicsSettings::Editor::get_useJointAcceleration() const -{ - return obj->useJointAcceleration; -} - -// Editor: useJointAcceleration will_set -bool wholeBodyDynamicsSettings::Editor::will_set_useJointAcceleration() -{ - return true; -} - -// Editor: useJointAcceleration did_set -bool wholeBodyDynamicsSettings::Editor::did_set_useJointAcceleration() -{ - return true; -} - -// Editor: startWithZeroFTSensorOffsets setter -void wholeBodyDynamicsSettings::Editor::set_startWithZeroFTSensorOffsets(const bool startWithZeroFTSensorOffsets) -{ - will_set_startWithZeroFTSensorOffsets(); - obj->startWithZeroFTSensorOffsets = startWithZeroFTSensorOffsets; - mark_dirty_startWithZeroFTSensorOffsets(); - communicate(); - did_set_startWithZeroFTSensorOffsets(); -} - -// Editor: startWithZeroFTSensorOffsets getter -bool wholeBodyDynamicsSettings::Editor::get_startWithZeroFTSensorOffsets() const -{ - return obj->startWithZeroFTSensorOffsets; -} - -// Editor: startWithZeroFTSensorOffsets will_set -bool wholeBodyDynamicsSettings::Editor::will_set_startWithZeroFTSensorOffsets() -{ - return true; -} - -// Editor: startWithZeroFTSensorOffsets did_set -bool wholeBodyDynamicsSettings::Editor::did_set_startWithZeroFTSensorOffsets() -{ - return true; -} - -// Editor: disableSensorReadCheckAtStartup setter -void wholeBodyDynamicsSettings::Editor::set_disableSensorReadCheckAtStartup(const bool disableSensorReadCheckAtStartup) -{ - will_set_disableSensorReadCheckAtStartup(); - obj->disableSensorReadCheckAtStartup = disableSensorReadCheckAtStartup; - mark_dirty_disableSensorReadCheckAtStartup(); - communicate(); - did_set_disableSensorReadCheckAtStartup(); -} - -// Editor: disableSensorReadCheckAtStartup getter -bool wholeBodyDynamicsSettings::Editor::get_disableSensorReadCheckAtStartup() const -{ - return obj->disableSensorReadCheckAtStartup; -} - -// Editor: disableSensorReadCheckAtStartup will_set -bool wholeBodyDynamicsSettings::Editor::will_set_disableSensorReadCheckAtStartup() -{ - return true; -} - -// Editor: disableSensorReadCheckAtStartup did_set -bool wholeBodyDynamicsSettings::Editor::did_set_disableSensorReadCheckAtStartup() -{ - return true; -} - -// Editor: clean -void wholeBodyDynamicsSettings::Editor::clean() -{ - dirty_flags(false); -} - -// Editor: read -bool wholeBodyDynamicsSettings::Editor::read(yarp::os::ConnectionReader& connection) -{ - if (!isValid()) { - return false; - } - yarp::os::idl::WireReader reader(connection); - reader.expectAccept(); - if (!reader.readListHeader()) { - return false; - } - int len = reader.getLength(); - if (len == 0) { - yarp::os::idl::WireWriter writer(reader); - if (writer.isNull()) { - return true; - } - if (!writer.writeListHeader(1)) { - return false; - } - writer.writeString("send: 'help' or 'patch (param1 val1) (param2 val2)'"); - return true; - } - std::string tag; - if (!reader.readString(tag)) { - return false; - } - if (tag == "help") { - yarp::os::idl::WireWriter writer(reader); - if (writer.isNull()) { - return true; - } - if (!writer.writeListHeader(2)) { - return false; - } - if (!writer.writeTag("many", 1, 0)) { - return false; - } - if (reader.getLength() > 0) { - std::string field; - if (!reader.readString(field)) { - return false; - } - if (field == "kinematicSource") { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeString("KinematicSourceType kinematicSource")) { - return false; - } - } - if (field == "fixedFrameName") { - if (!writer.writeListHeader(2)) { - return false; - } - if (!writer.writeString("std::string fixedFrameName")) { - return false; - } - if (!writer.writeString("Specify the source of the kinematic information for one link, see KinematicSourceType information for more info.")) { - return false; - } - } - if (field == "fixedFrameGravity") { - if (!writer.writeListHeader(2)) { - return false; - } - if (!writer.writeString("Gravity fixedFrameGravity")) { - return false; - } - if (!writer.writeString("If kinematicSource is FIXED_LINK, specify the frame of the robot that we know to be fixed (i.e. not moving with respect to an inertial frame)")) { - return false; - } - } - if (field == "imuFrameName") { - if (!writer.writeListHeader(2)) { - return false; - } - if (!writer.writeString("std::string imuFrameName")) { - return false; - } - if (!writer.writeString("If kinematicSource is FIXED_LINK, specify the gravity vector (in m/s^2) in the fixedFrame")) { - return false; - } - } - if (field == "imuFilterCutoffInHz") { - if (!writer.writeListHeader(2)) { - return false; - } - if (!writer.writeString("double imuFilterCutoffInHz")) { - return false; - } - if (!writer.writeString("If kinematicSource is IMU, specify the frame name of the imu")) { - return false; - } - } - if (field == "forceTorqueFilterCutoffInHz") { - if (!writer.writeListHeader(2)) { - return false; - } - if (!writer.writeString("double forceTorqueFilterCutoffInHz")) { - return false; - } - if (!writer.writeString("Cutoff frequency (in Hz) of the first order filter of the IMU")) { - return false; - } - } - if (field == "jointVelFilterCutoffInHz") { - if (!writer.writeListHeader(2)) { - return false; - } - if (!writer.writeString("double jointVelFilterCutoffInHz")) { - return false; - } - if (!writer.writeString("Cutoff frequency(in Hz) of the first order filter of the F/T sensors")) { - return false; - } - } - if (field == "jointAccFilterCutoffInHz") { - if (!writer.writeListHeader(2)) { - return false; - } - if (!writer.writeString("double jointAccFilterCutoffInHz")) { - return false; - } - if (!writer.writeString("Cutoff frequency(in Hz) of the first order filter of the joint velocities")) { - return false; - } - } - if (field == "useJointVelocity") { - if (!writer.writeListHeader(2)) { - return false; - } - if (!writer.writeString("bool useJointVelocity")) { - return false; - } - if (!writer.writeString("Cutoff frequency(in Hz) of the first order filter of the joint accelerations")) { - return false; - } - } - if (field == "useJointAcceleration") { - if (!writer.writeListHeader(2)) { - return false; - } - if (!writer.writeString("bool useJointAcceleration")) { - return false; - } - if (!writer.writeString("Use the joint velocity measurement if this is true, assume they are zero otherwise.")) { - return false; - } - } - if (field == "startWithZeroFTSensorOffsets") { - if (!writer.writeListHeader(2)) { - return false; - } - if (!writer.writeString("bool startWithZeroFTSensorOffsets")) { - return false; - } - if (!writer.writeString("Use the joint acceleration measurment if this is true, assume they are zero otherwise.")) { - return false; - } - } - if (field == "disableSensorReadCheckAtStartup") { - if (!writer.writeListHeader(2)) { - return false; - } - if (!writer.writeString("bool disableSensorReadCheckAtStartup")) { - return false; - } - if (!writer.writeString("If this flag is set to true, the read from the sensors is skipped at startup")) { - return false; - } - } - } - if (!writer.writeListHeader(13)) { - return false; - } - writer.writeString("*** Available fields:"); - writer.writeString("kinematicSource"); - writer.writeString("fixedFrameName"); - writer.writeString("fixedFrameGravity"); - writer.writeString("imuFrameName"); - writer.writeString("imuFilterCutoffInHz"); - writer.writeString("forceTorqueFilterCutoffInHz"); - writer.writeString("jointVelFilterCutoffInHz"); - writer.writeString("jointAccFilterCutoffInHz"); - writer.writeString("useJointVelocity"); - writer.writeString("useJointAcceleration"); - writer.writeString("startWithZeroFTSensorOffsets"); - writer.writeString("disableSensorReadCheckAtStartup"); - return true; - } - bool nested = true; - bool have_act = false; - if (tag != "patch") { - if (((len - 1) % 2) != 0) { - return false; - } - len = 1 + ((len - 1) / 2); - nested = false; - have_act = true; - } - for (int i = 1; i < len; ++i) { - if (nested && !reader.readListHeader(3)) { - return false; - } - std::string act; - std::string key; - if (have_act) { - act = tag; - } else if (!reader.readString(act)) { - return false; - } - if (!reader.readString(key)) { - return false; - } - if (key == "kinematicSource") { - will_set_kinematicSource(); - if (!obj->nested_read_kinematicSource(reader)) { - return false; - } - did_set_kinematicSource(); - } else if (key == "fixedFrameName") { - will_set_fixedFrameName(); - if (!obj->nested_read_fixedFrameName(reader)) { - return false; - } - did_set_fixedFrameName(); - } else if (key == "fixedFrameGravity") { - will_set_fixedFrameGravity(); - if (!obj->nested_read_fixedFrameGravity(reader)) { - return false; - } - did_set_fixedFrameGravity(); - } else if (key == "imuFrameName") { - will_set_imuFrameName(); - if (!obj->nested_read_imuFrameName(reader)) { - return false; - } - did_set_imuFrameName(); - } else if (key == "imuFilterCutoffInHz") { - will_set_imuFilterCutoffInHz(); - if (!obj->nested_read_imuFilterCutoffInHz(reader)) { - return false; - } - did_set_imuFilterCutoffInHz(); - } else if (key == "forceTorqueFilterCutoffInHz") { - will_set_forceTorqueFilterCutoffInHz(); - if (!obj->nested_read_forceTorqueFilterCutoffInHz(reader)) { - return false; - } - did_set_forceTorqueFilterCutoffInHz(); - } else if (key == "jointVelFilterCutoffInHz") { - will_set_jointVelFilterCutoffInHz(); - if (!obj->nested_read_jointVelFilterCutoffInHz(reader)) { - return false; - } - did_set_jointVelFilterCutoffInHz(); - } else if (key == "jointAccFilterCutoffInHz") { - will_set_jointAccFilterCutoffInHz(); - if (!obj->nested_read_jointAccFilterCutoffInHz(reader)) { - return false; - } - did_set_jointAccFilterCutoffInHz(); - } else if (key == "useJointVelocity") { - will_set_useJointVelocity(); - if (!obj->nested_read_useJointVelocity(reader)) { - return false; - } - did_set_useJointVelocity(); - } else if (key == "useJointAcceleration") { - will_set_useJointAcceleration(); - if (!obj->nested_read_useJointAcceleration(reader)) { - return false; - } - did_set_useJointAcceleration(); - } else if (key == "startWithZeroFTSensorOffsets") { - will_set_startWithZeroFTSensorOffsets(); - if (!obj->nested_read_startWithZeroFTSensorOffsets(reader)) { - return false; - } - did_set_startWithZeroFTSensorOffsets(); - } else if (key == "disableSensorReadCheckAtStartup") { - will_set_disableSensorReadCheckAtStartup(); - if (!obj->nested_read_disableSensorReadCheckAtStartup(reader)) { - return false; - } - did_set_disableSensorReadCheckAtStartup(); - } else { - // would be useful to have a fallback here - } - } - reader.accept(); - yarp::os::idl::WireWriter writer(reader); - if (writer.isNull()) { - return true; - } - writer.writeListHeader(1); - writer.writeVocab32('o', 'k'); - return true; -} - -// Editor: write -bool wholeBodyDynamicsSettings::Editor::write(yarp::os::ConnectionWriter& connection) const -{ - if (!isValid()) { - return false; - } - yarp::os::idl::WireWriter writer(connection); - if (!writer.writeListHeader(dirty_count + 1)) { - return false; - } - if (!writer.writeString("patch")) { - return false; - } - if (is_dirty_kinematicSource) { - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeString("set")) { - return false; - } - if (!writer.writeString("kinematicSource")) { - return false; - } - if (!obj->nested_write_kinematicSource(writer)) { - return false; - } - } - if (is_dirty_fixedFrameName) { - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeString("set")) { - return false; - } - if (!writer.writeString("fixedFrameName")) { - return false; - } - if (!obj->nested_write_fixedFrameName(writer)) { - return false; - } - } - if (is_dirty_fixedFrameGravity) { - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeString("set")) { - return false; - } - if (!writer.writeString("fixedFrameGravity")) { - return false; - } - if (!obj->nested_write_fixedFrameGravity(writer)) { - return false; - } - } - if (is_dirty_imuFrameName) { - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeString("set")) { - return false; - } - if (!writer.writeString("imuFrameName")) { - return false; - } - if (!obj->nested_write_imuFrameName(writer)) { - return false; - } - } - if (is_dirty_imuFilterCutoffInHz) { - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeString("set")) { - return false; - } - if (!writer.writeString("imuFilterCutoffInHz")) { - return false; - } - if (!obj->nested_write_imuFilterCutoffInHz(writer)) { - return false; - } - } - if (is_dirty_forceTorqueFilterCutoffInHz) { - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeString("set")) { - return false; - } - if (!writer.writeString("forceTorqueFilterCutoffInHz")) { - return false; - } - if (!obj->nested_write_forceTorqueFilterCutoffInHz(writer)) { - return false; - } - } - if (is_dirty_jointVelFilterCutoffInHz) { - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeString("set")) { - return false; - } - if (!writer.writeString("jointVelFilterCutoffInHz")) { - return false; - } - if (!obj->nested_write_jointVelFilterCutoffInHz(writer)) { - return false; - } - } - if (is_dirty_jointAccFilterCutoffInHz) { - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeString("set")) { - return false; - } - if (!writer.writeString("jointAccFilterCutoffInHz")) { - return false; - } - if (!obj->nested_write_jointAccFilterCutoffInHz(writer)) { - return false; - } - } - if (is_dirty_useJointVelocity) { - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeString("set")) { - return false; - } - if (!writer.writeString("useJointVelocity")) { - return false; - } - if (!obj->nested_write_useJointVelocity(writer)) { - return false; - } - } - if (is_dirty_useJointAcceleration) { - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeString("set")) { - return false; - } - if (!writer.writeString("useJointAcceleration")) { - return false; - } - if (!obj->nested_write_useJointAcceleration(writer)) { - return false; - } - } - if (is_dirty_startWithZeroFTSensorOffsets) { - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeString("set")) { - return false; - } - if (!writer.writeString("startWithZeroFTSensorOffsets")) { - return false; - } - if (!obj->nested_write_startWithZeroFTSensorOffsets(writer)) { - return false; - } - } - if (is_dirty_disableSensorReadCheckAtStartup) { - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeString("set")) { - return false; - } - if (!writer.writeString("disableSensorReadCheckAtStartup")) { - return false; - } - if (!obj->nested_write_disableSensorReadCheckAtStartup(writer)) { - return false; - } - } - return !writer.isError(); -} - -// Editor: send if possible -void wholeBodyDynamicsSettings::Editor::communicate() -{ - if (group != 0) { - return; - } - if (yarp().canWrite()) { - yarp().write(*this); - clean(); - } -} - -// Editor: mark dirty overall -void wholeBodyDynamicsSettings::Editor::mark_dirty() -{ - is_dirty = true; -} - -// Editor: kinematicSource mark_dirty -void wholeBodyDynamicsSettings::Editor::mark_dirty_kinematicSource() -{ - if (is_dirty_kinematicSource) { - return; - } - dirty_count++; - is_dirty_kinematicSource = true; - mark_dirty(); -} - -// Editor: fixedFrameName mark_dirty -void wholeBodyDynamicsSettings::Editor::mark_dirty_fixedFrameName() -{ - if (is_dirty_fixedFrameName) { - return; - } - dirty_count++; - is_dirty_fixedFrameName = true; - mark_dirty(); -} - -// Editor: fixedFrameGravity mark_dirty -void wholeBodyDynamicsSettings::Editor::mark_dirty_fixedFrameGravity() -{ - if (is_dirty_fixedFrameGravity) { - return; - } - dirty_count++; - is_dirty_fixedFrameGravity = true; - mark_dirty(); -} - -// Editor: imuFrameName mark_dirty -void wholeBodyDynamicsSettings::Editor::mark_dirty_imuFrameName() -{ - if (is_dirty_imuFrameName) { - return; - } - dirty_count++; - is_dirty_imuFrameName = true; - mark_dirty(); -} - -// Editor: imuFilterCutoffInHz mark_dirty -void wholeBodyDynamicsSettings::Editor::mark_dirty_imuFilterCutoffInHz() -{ - if (is_dirty_imuFilterCutoffInHz) { - return; - } - dirty_count++; - is_dirty_imuFilterCutoffInHz = true; - mark_dirty(); -} - -// Editor: forceTorqueFilterCutoffInHz mark_dirty -void wholeBodyDynamicsSettings::Editor::mark_dirty_forceTorqueFilterCutoffInHz() -{ - if (is_dirty_forceTorqueFilterCutoffInHz) { - return; - } - dirty_count++; - is_dirty_forceTorqueFilterCutoffInHz = true; - mark_dirty(); -} - -// Editor: jointVelFilterCutoffInHz mark_dirty -void wholeBodyDynamicsSettings::Editor::mark_dirty_jointVelFilterCutoffInHz() -{ - if (is_dirty_jointVelFilterCutoffInHz) { - return; - } - dirty_count++; - is_dirty_jointVelFilterCutoffInHz = true; - mark_dirty(); -} - -// Editor: jointAccFilterCutoffInHz mark_dirty -void wholeBodyDynamicsSettings::Editor::mark_dirty_jointAccFilterCutoffInHz() -{ - if (is_dirty_jointAccFilterCutoffInHz) { - return; - } - dirty_count++; - is_dirty_jointAccFilterCutoffInHz = true; - mark_dirty(); -} - -// Editor: useJointVelocity mark_dirty -void wholeBodyDynamicsSettings::Editor::mark_dirty_useJointVelocity() -{ - if (is_dirty_useJointVelocity) { - return; - } - dirty_count++; - is_dirty_useJointVelocity = true; - mark_dirty(); -} - -// Editor: useJointAcceleration mark_dirty -void wholeBodyDynamicsSettings::Editor::mark_dirty_useJointAcceleration() -{ - if (is_dirty_useJointAcceleration) { - return; - } - dirty_count++; - is_dirty_useJointAcceleration = true; - mark_dirty(); -} - -// Editor: startWithZeroFTSensorOffsets mark_dirty -void wholeBodyDynamicsSettings::Editor::mark_dirty_startWithZeroFTSensorOffsets() -{ - if (is_dirty_startWithZeroFTSensorOffsets) { - return; - } - dirty_count++; - is_dirty_startWithZeroFTSensorOffsets = true; - mark_dirty(); -} - -// Editor: disableSensorReadCheckAtStartup mark_dirty -void wholeBodyDynamicsSettings::Editor::mark_dirty_disableSensorReadCheckAtStartup() -{ - if (is_dirty_disableSensorReadCheckAtStartup) { - return; - } - dirty_count++; - is_dirty_disableSensorReadCheckAtStartup = true; - mark_dirty(); -} - -// Editor: dirty_flags -void wholeBodyDynamicsSettings::Editor::dirty_flags(bool flag) -{ - is_dirty = flag; - is_dirty_kinematicSource = flag; - is_dirty_fixedFrameName = flag; - is_dirty_fixedFrameGravity = flag; - is_dirty_imuFrameName = flag; - is_dirty_imuFilterCutoffInHz = flag; - is_dirty_forceTorqueFilterCutoffInHz = flag; - is_dirty_jointVelFilterCutoffInHz = flag; - is_dirty_jointAccFilterCutoffInHz = flag; - is_dirty_useJointVelocity = flag; - is_dirty_useJointAcceleration = flag; - is_dirty_startWithZeroFTSensorOffsets = flag; - is_dirty_disableSensorReadCheckAtStartup = flag; - dirty_count = flag ? 12 : 0; -} - -// read kinematicSource field -bool wholeBodyDynamicsSettings::read_kinematicSource(yarp::os::idl::WireReader& reader) -{ - int32_t ecast0; - KinematicSourceTypeVocab cvrt1; - if (!reader.readEnum(ecast0, cvrt1)) { - reader.fail(); - return false; - } else { - kinematicSource = static_cast(ecast0); - } - return true; -} - -// write kinematicSource field -bool wholeBodyDynamicsSettings::write_kinematicSource(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeI32(static_cast(kinematicSource))) { - return false; - } - return true; -} - -// read (nested) kinematicSource field -bool wholeBodyDynamicsSettings::nested_read_kinematicSource(yarp::os::idl::WireReader& reader) -{ - int32_t ecast2; - KinematicSourceTypeVocab cvrt3; - if (!reader.readEnum(ecast2, cvrt3)) { - reader.fail(); - return false; - } else { - kinematicSource = static_cast(ecast2); - } - return true; -} - -// write (nested) kinematicSource field -bool wholeBodyDynamicsSettings::nested_write_kinematicSource(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeI32(static_cast(kinematicSource))) { - return false; - } - return true; -} - -// read fixedFrameName field -bool wholeBodyDynamicsSettings::read_fixedFrameName(yarp::os::idl::WireReader& reader) -{ - if (!reader.readString(fixedFrameName)) { - reader.fail(); - return false; - } - return true; -} - -// write fixedFrameName field -bool wholeBodyDynamicsSettings::write_fixedFrameName(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeString(fixedFrameName)) { - return false; - } - return true; -} - -// read (nested) fixedFrameName field -bool wholeBodyDynamicsSettings::nested_read_fixedFrameName(yarp::os::idl::WireReader& reader) -{ - if (!reader.readString(fixedFrameName)) { - reader.fail(); - return false; - } - return true; -} - -// write (nested) fixedFrameName field -bool wholeBodyDynamicsSettings::nested_write_fixedFrameName(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeString(fixedFrameName)) { - return false; - } - return true; -} - -// read fixedFrameGravity field -bool wholeBodyDynamicsSettings::read_fixedFrameGravity(yarp::os::idl::WireReader& reader) -{ - if (!reader.read(fixedFrameGravity)) { - reader.fail(); - return false; - } - return true; -} - -// write fixedFrameGravity field -bool wholeBodyDynamicsSettings::write_fixedFrameGravity(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.write(fixedFrameGravity)) { - return false; - } - return true; -} - -// read (nested) fixedFrameGravity field -bool wholeBodyDynamicsSettings::nested_read_fixedFrameGravity(yarp::os::idl::WireReader& reader) -{ - if (!reader.readNested(fixedFrameGravity)) { - reader.fail(); - return false; - } - return true; -} - -// write (nested) fixedFrameGravity field -bool wholeBodyDynamicsSettings::nested_write_fixedFrameGravity(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeNested(fixedFrameGravity)) { - return false; - } - return true; -} - -// read imuFrameName field -bool wholeBodyDynamicsSettings::read_imuFrameName(yarp::os::idl::WireReader& reader) -{ - if (!reader.readString(imuFrameName)) { - reader.fail(); - return false; - } - return true; -} - -// write imuFrameName field -bool wholeBodyDynamicsSettings::write_imuFrameName(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeString(imuFrameName)) { - return false; - } - return true; -} - -// read (nested) imuFrameName field -bool wholeBodyDynamicsSettings::nested_read_imuFrameName(yarp::os::idl::WireReader& reader) -{ - if (!reader.readString(imuFrameName)) { - reader.fail(); - return false; - } - return true; -} - -// write (nested) imuFrameName field -bool wholeBodyDynamicsSettings::nested_write_imuFrameName(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeString(imuFrameName)) { - return false; - } - return true; -} - -// read imuFilterCutoffInHz field -bool wholeBodyDynamicsSettings::read_imuFilterCutoffInHz(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(imuFilterCutoffInHz)) { - reader.fail(); - return false; - } - return true; -} - -// write imuFilterCutoffInHz field -bool wholeBodyDynamicsSettings::write_imuFilterCutoffInHz(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(imuFilterCutoffInHz)) { - return false; - } - return true; -} - -// read (nested) imuFilterCutoffInHz field -bool wholeBodyDynamicsSettings::nested_read_imuFilterCutoffInHz(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(imuFilterCutoffInHz)) { - reader.fail(); - return false; - } - return true; -} - -// write (nested) imuFilterCutoffInHz field -bool wholeBodyDynamicsSettings::nested_write_imuFilterCutoffInHz(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(imuFilterCutoffInHz)) { - return false; - } - return true; -} - -// read forceTorqueFilterCutoffInHz field -bool wholeBodyDynamicsSettings::read_forceTorqueFilterCutoffInHz(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(forceTorqueFilterCutoffInHz)) { - reader.fail(); - return false; - } - return true; -} - -// write forceTorqueFilterCutoffInHz field -bool wholeBodyDynamicsSettings::write_forceTorqueFilterCutoffInHz(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(forceTorqueFilterCutoffInHz)) { - return false; - } - return true; -} - -// read (nested) forceTorqueFilterCutoffInHz field -bool wholeBodyDynamicsSettings::nested_read_forceTorqueFilterCutoffInHz(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(forceTorqueFilterCutoffInHz)) { - reader.fail(); - return false; - } - return true; -} - -// write (nested) forceTorqueFilterCutoffInHz field -bool wholeBodyDynamicsSettings::nested_write_forceTorqueFilterCutoffInHz(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(forceTorqueFilterCutoffInHz)) { - return false; - } - return true; -} - -// read jointVelFilterCutoffInHz field -bool wholeBodyDynamicsSettings::read_jointVelFilterCutoffInHz(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(jointVelFilterCutoffInHz)) { - reader.fail(); - return false; - } - return true; -} - -// write jointVelFilterCutoffInHz field -bool wholeBodyDynamicsSettings::write_jointVelFilterCutoffInHz(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(jointVelFilterCutoffInHz)) { - return false; - } - return true; -} - -// read (nested) jointVelFilterCutoffInHz field -bool wholeBodyDynamicsSettings::nested_read_jointVelFilterCutoffInHz(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(jointVelFilterCutoffInHz)) { - reader.fail(); - return false; - } - return true; -} - -// write (nested) jointVelFilterCutoffInHz field -bool wholeBodyDynamicsSettings::nested_write_jointVelFilterCutoffInHz(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(jointVelFilterCutoffInHz)) { - return false; - } - return true; -} - -// read jointAccFilterCutoffInHz field -bool wholeBodyDynamicsSettings::read_jointAccFilterCutoffInHz(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(jointAccFilterCutoffInHz)) { - reader.fail(); - return false; - } - return true; -} - -// write jointAccFilterCutoffInHz field -bool wholeBodyDynamicsSettings::write_jointAccFilterCutoffInHz(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(jointAccFilterCutoffInHz)) { - return false; - } - return true; -} - -// read (nested) jointAccFilterCutoffInHz field -bool wholeBodyDynamicsSettings::nested_read_jointAccFilterCutoffInHz(yarp::os::idl::WireReader& reader) -{ - if (!reader.readFloat64(jointAccFilterCutoffInHz)) { - reader.fail(); - return false; - } - return true; -} - -// write (nested) jointAccFilterCutoffInHz field -bool wholeBodyDynamicsSettings::nested_write_jointAccFilterCutoffInHz(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeFloat64(jointAccFilterCutoffInHz)) { - return false; - } - return true; -} - -// read useJointVelocity field -bool wholeBodyDynamicsSettings::read_useJointVelocity(yarp::os::idl::WireReader& reader) -{ - if (!reader.readBool(useJointVelocity)) { - reader.fail(); - return false; - } - return true; -} - -// write useJointVelocity field -bool wholeBodyDynamicsSettings::write_useJointVelocity(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeBool(useJointVelocity)) { - return false; - } - return true; -} - -// read (nested) useJointVelocity field -bool wholeBodyDynamicsSettings::nested_read_useJointVelocity(yarp::os::idl::WireReader& reader) -{ - if (!reader.readBool(useJointVelocity)) { - reader.fail(); - return false; - } - return true; -} - -// write (nested) useJointVelocity field -bool wholeBodyDynamicsSettings::nested_write_useJointVelocity(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeBool(useJointVelocity)) { - return false; - } - return true; -} - -// read useJointAcceleration field -bool wholeBodyDynamicsSettings::read_useJointAcceleration(yarp::os::idl::WireReader& reader) -{ - if (!reader.readBool(useJointAcceleration)) { - reader.fail(); - return false; - } - return true; -} - -// write useJointAcceleration field -bool wholeBodyDynamicsSettings::write_useJointAcceleration(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeBool(useJointAcceleration)) { - return false; - } - return true; -} - -// read (nested) useJointAcceleration field -bool wholeBodyDynamicsSettings::nested_read_useJointAcceleration(yarp::os::idl::WireReader& reader) -{ - if (!reader.readBool(useJointAcceleration)) { - reader.fail(); - return false; - } - return true; -} - -// write (nested) useJointAcceleration field -bool wholeBodyDynamicsSettings::nested_write_useJointAcceleration(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeBool(useJointAcceleration)) { - return false; - } - return true; -} - -// read startWithZeroFTSensorOffsets field -bool wholeBodyDynamicsSettings::read_startWithZeroFTSensorOffsets(yarp::os::idl::WireReader& reader) -{ - if (!reader.readBool(startWithZeroFTSensorOffsets)) { - reader.fail(); - return false; - } - return true; -} - -// write startWithZeroFTSensorOffsets field -bool wholeBodyDynamicsSettings::write_startWithZeroFTSensorOffsets(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeBool(startWithZeroFTSensorOffsets)) { - return false; - } - return true; -} - -// read (nested) startWithZeroFTSensorOffsets field -bool wholeBodyDynamicsSettings::nested_read_startWithZeroFTSensorOffsets(yarp::os::idl::WireReader& reader) -{ - if (!reader.readBool(startWithZeroFTSensorOffsets)) { - reader.fail(); - return false; - } - return true; -} - -// write (nested) startWithZeroFTSensorOffsets field -bool wholeBodyDynamicsSettings::nested_write_startWithZeroFTSensorOffsets(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeBool(startWithZeroFTSensorOffsets)) { - return false; - } - return true; -} - -// read disableSensorReadCheckAtStartup field -bool wholeBodyDynamicsSettings::read_disableSensorReadCheckAtStartup(yarp::os::idl::WireReader& reader) -{ - if (!reader.readBool(disableSensorReadCheckAtStartup)) { - reader.fail(); - return false; - } - return true; -} - -// write disableSensorReadCheckAtStartup field -bool wholeBodyDynamicsSettings::write_disableSensorReadCheckAtStartup(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeBool(disableSensorReadCheckAtStartup)) { - return false; - } - return true; -} - -// read (nested) disableSensorReadCheckAtStartup field -bool wholeBodyDynamicsSettings::nested_read_disableSensorReadCheckAtStartup(yarp::os::idl::WireReader& reader) -{ - if (!reader.readBool(disableSensorReadCheckAtStartup)) { - reader.fail(); - return false; - } - return true; -} - -// write (nested) disableSensorReadCheckAtStartup field -bool wholeBodyDynamicsSettings::nested_write_disableSensorReadCheckAtStartup(const yarp::os::idl::WireWriter& writer) const -{ - if (!writer.writeBool(disableSensorReadCheckAtStartup)) { - return false; - } - return true; -} diff --git a/idl/wholeBodyDynamicsSettings/autogenerated/wholeBodyDynamicsSettings_index.txt b/idl/wholeBodyDynamicsSettings/autogenerated/wholeBodyDynamicsSettings_index.txt deleted file mode 100644 index f6957fc..0000000 --- a/idl/wholeBodyDynamicsSettings/autogenerated/wholeBodyDynamicsSettings_index.txt +++ /dev/null @@ -1,8 +0,0 @@ -include/KinematicSourceType.h -src/KinematicSourceType.cpp -include/Gravity.h -src/Gravity.cpp -include/ContactPoint.h -src/ContactPoint.cpp -include/wholeBodyDynamicsSettings.h -src/wholeBodyDynamicsSettings.cpp diff --git a/idl/wholeBodyDynamicsSettings/autogenerated/wholeBodyDynamicsSettings_thrift.cmake b/idl/wholeBodyDynamicsSettings/autogenerated/wholeBodyDynamicsSettings_thrift.cmake deleted file mode 100644 index 47ae9f7..0000000 --- a/idl/wholeBodyDynamicsSettings/autogenerated/wholeBodyDynamicsSettings_thrift.cmake +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) -# All rights reserved. -# -# This software may be modified and distributed under the terms of the -# BSD-3-Clause license. See the accompanying LICENSE file for details. - -## This is an automatically-generated file. -## It could get re-generated if the ALLOW_IDL_GENERATION flag is on - -set(headers include/KinematicSourceType.h;include/Gravity.h;include/ContactPoint.h;include/wholeBodyDynamicsSettings.h) -set(sources src/KinematicSourceType.cpp;src/Gravity.cpp;src/ContactPoint.cpp;src/wholeBodyDynamicsSettings.cpp) diff --git a/idl/wholeBodyDynamics_IDLServer/CMakeLists.txt b/idl/wholeBodyDynamics_IDLServer/CMakeLists.txt index ea273e7..82056e2 100644 --- a/idl/wholeBodyDynamics_IDLServer/CMakeLists.txt +++ b/idl/wholeBodyDynamics_IDLServer/CMakeLists.txt @@ -7,7 +7,7 @@ cmake_minimum_required(VERSION 3.5) project(wholeBodyDynamics_IDLServer) yarp_idl_to_dir(INPUT_FILES wholeBodyDynamics_IDLServer.thrift - OUTPUT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/autogenerated + OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/autogenerated SOURCES_VAR WBDIDLSERVER_SRC HEADERS_VAR WBDIDLSERVER_HEADERS INCLUDE_DIRS_VAR WBDIDLSERVER_INCLUDES) diff --git a/idl/wholeBodyDynamics_IDLServer/autogenerated/include/wholeBodyDynamics_IDLServer.h b/idl/wholeBodyDynamics_IDLServer/autogenerated/include/wholeBodyDynamics_IDLServer.h deleted file mode 100644 index dd102e8..0000000 --- a/idl/wholeBodyDynamics_IDLServer/autogenerated/include/wholeBodyDynamics_IDLServer.h +++ /dev/null @@ -1,225 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) - * SPDX-License-Identifier: BSD-3-Clause - */ - -// Autogenerated by Thrift Compiler (0.14.1-yarped) -// -// This is an automatically generated file. -// It could get re-generated if the ALLOW_IDL_GENERATION flag is on. - -#ifndef YARP_THRIFT_GENERATOR_SERVICE_WHOLEBODYDYNAMICS_IDLSERVER_H -#define YARP_THRIFT_GENERATOR_SERVICE_WHOLEBODYDYNAMICS_IDLSERVER_H - -#include -#include - -/** - * wholeBodyDynamics_IDLServer - * Interface. - */ -class wholeBodyDynamics_IDLServer : - public yarp::os::Wire -{ -public: - // Constructor - wholeBodyDynamics_IDLServer(); - - /** - * Calibrate the force/torque sensors - * (WARNING: calibrate the sensors when the only external forces acting on the robot are on the torso/waist) - * @param calib_code argument to specify the sensors to calibrate (all,arms,legs,feet) - * @param nr_of_samples number of samples - * @return true/false on success/failure - */ - virtual bool calib(const std::string& calib_code, const std::int32_t nr_of_samples = 100); - - /** - * Calibrate the force/torque sensors when on double support - * (WARNING: calibrate the sensors when the only external forces acting on the robot are on the sole). - * For this calibration the strong assumption of symmetry of the robot and its pose is done. - * @param calib_code argument to specify the sensors to calibrate (all,arms,legs,feet) - * @param nr_of_samples number of samples - * @return true/false on success/failure - */ - virtual bool calibStanding(const std::string& calib_code, const std::int32_t nr_of_samples = 100); - - /** - * Calibrate the force/torque sensors when on double support and with jet engines turned ON and on idle thrust - * (WARNING: works only with iRonCub-Mk1). - * (WARNING: calibrate the sensors when the only external forces acting on the robot are on the sole). - * For this calibration the strong assumption of symmetry of the robot and its pose is done. Also, only pure forces are - * assumed to be acting on the soles - * @param calib_code argument to specify the sensors to calibrate (all,arms,legs,feet) - * @param nr_of_samples number of samples - * @return true/false on success/failure - */ - virtual bool calibStandingWithJetsiRonCubMk1(const std::string& calib_code, const std::int32_t nr_of_samples = 100); - - /** - * Calibrate the force/torque sensors when on single support on left foot - * (WARNING: calibrate the sensors when the only external forces acting on the robot are on the left sole). - * @param calib_code argument to specify the sensors to calibrate (all,arms,legs,feet) - * @param nr_of_samples number of samples - * @return true/false on success/failure - */ - virtual bool calibStandingLeftFoot(const std::string& calib_code, const std::int32_t nr_of_samples = 100); - - /** - * Calibrate the force/torque sensors when on single support on right foot - * (WARNING: calibrate the sensors when the only external forces acting on the robot are on the right sole). - * @param calib_code argument to specify the sensors to calibrate (all,arms,legs,feet) - * @param nr_of_samples number of samples - * @return true/false on success/failure - */ - virtual bool calibStandingRightFoot(const std::string& calib_code, const std::int32_t nr_of_samples = 100); - - /** - * Calibrate the force/torque sensors offsets when the external forces are acting on only one link. - * This method is typically used when the robot is standing on only one feet, - * or when it is attached to a fixture that is acting on a single link (typically the chest or the waist). - * @note This method calibrates the offsets of all the force-torque sensors. - * @param standing_frame a frame belonging to the link on which it is assumed that external forces are acting. - * @param nr_of_samples number of samples to use for calibration. - * @return true/false on success/failure. - */ - virtual bool calibStandingOnOneLink(const std::string& standing_frame, const std::int32_t nr_of_samples = 100); - - /** - * Calibrate the force/torque sensors offsets when the external forces are acting on only two links. - * This method is not in general guaranteed to work, and it works in practice only when the robot and its internal - * forces are symmetric w.r.t. the two contact links. Note that the value obtaiend from this calibration depend - * on the location of the origin of the specific frames of the contact links used for the calibration. - * @note This method calibrates the offsets of all the force-torque sensors. - * @param first_standing_frame a frame belonging to one of the two links on which it is assumed that tue external forces are acting. - * @param second_standing_frame a frame belonging to the other link on which it is assumed that tue external forces are acting. - * @param nr_of_samples number of samples - * @return true/false on success/failure - */ - virtual bool calibStandingOnTwoLinks(const std::string& first_standing_frame, const std::string& second_standing_frame, const std::int32_t nr_of_samples = 100); - - /** - * Reset the sensor offset to 0 0 0 0 0 0 (six zeros). - * @param calib_code argument to specify the sensors to reset (all,arms,legs,feet) - * @return true/false on success/failure - */ - virtual bool resetOffset(const std::string& calib_code); - - /** - * Use the offline estimated offset of the sensor. - * Only sensors with a specified offset in configuration file are affected by this method.s - * @return true/false on success/failure - */ - virtual bool usePreEstimatedOffset(); - - /** - * Quit the module. - * @return true/false on success/failure - */ - virtual bool quit(); - - /** - * Reset the odometry world to be (initially) a frame specified in the robot model, - * and specify a link that is assumed to be fixed in the odometry. - * @param initial_world_frame the frame of the robot model that is assume to be initially - * coincident with the world/inertial frame. - * @param new_fixed_link the name of the link that should be initially fixed - * @return true/false on success/failure (typically if the frame/link names are wrong) - */ - virtual bool resetSimpleLeggedOdometry(const std::string& initial_world_frame, const std::string& initial_fixed_link); - - /** - * Change the link that is considered fixed by the odometry. - * @param new_fixed_link the name of the new link that should be considered fixed - * @return true/false on success/failure (typically if the frame/link names are wrong) - */ - virtual bool changeFixedLinkSimpleLeggedOdometry(const std::string& new_fixed_link); - - /** - * Set the cutoff frequency (in Hz) for IMU measurements - * @return true/false on success/failure - */ - virtual bool set_imuFilterCutoffInHz(const double newCutoff); - - /** - * Get the cutoff frequency (in Hz) for IMU measurements - * @return the cutoff frequency (in Hz) - */ - virtual double get_imuFilterCutoffInHz(); - - /** - * Set the cutoff frequency (in Hz) for FT measurements - * @return true/false on success/failure - */ - virtual bool set_forceTorqueFilterCutoffInHz(const double newCutoff); - - /** - * Get the cutoff frequency (in Hz) for FT measurements - * @return the cutoff frequency (in Hz) - */ - virtual double get_forceTorqueFilterCutoffInHz(); - - /** - * Set the cutoff frequency (in Hz) for joint velocities measurements - * @return true/false on success/failure - */ - virtual bool set_jointVelFilterCutoffInHz(const double newCutoff); - - /** - * Get the cutoff frequency (in Hz) for joint velocities measurements - * @return the cutoff frequency (in Hz) - */ - virtual double get_jointVelFilterCutoffInHz(); - - /** - * Set the cutoff frequency (in Hz) for joint acceleration measurements - * @return true/false on success/failure - */ - virtual bool set_jointAccFilterCutoffInHz(const double newCutoff); - - /** - * Get the cutoff frequency (in Hz) for joint acceleration measurements - * @return the cutoff frequency (in Hz) - */ - virtual double get_jointAccFilterCutoffInHz(); - - /** - * Use the IMU as the kinematic source of - * information for the acceleration of one link. - */ - virtual bool useIMUAsKinematicSource(); - - /** - * Use a fixed frame (tipically root_link, l_sole or r_sole) - * as the source of kinematic information. The assumption - * is that the specified frame will remain fixed until - * the kinematic source is changing, and the gravity - * on this link is specified by the fixedFrameGravity (tipically - * set to (0,0,-9.81) . - */ - virtual bool useFixedFrameAsKinematicSource(const std::string& fixedFrame); - - /** - * Set if to use or not the joint velocities in estimation. - */ - virtual bool setUseOfJointVelocities(const bool enable); - - /** - * Set if to use or not the joint velocities in estimation. - */ - virtual bool setUseOfJointAccelerations(const bool enable); - - /** - * Get the current settings in the form of a string. - * @return the current settings as a human readable string. - */ - virtual std::string getCurrentSettingsString(); - - // help method - virtual std::vector help(const std::string& functionName = "--all"); - - // read from ConnectionReader - bool read(yarp::os::ConnectionReader& connection) override; -}; - -#endif // YARP_THRIFT_GENERATOR_SERVICE_WHOLEBODYDYNAMICS_IDLSERVER_H diff --git a/idl/wholeBodyDynamics_IDLServer/autogenerated/src/wholeBodyDynamics_IDLServer.cpp b/idl/wholeBodyDynamics_IDLServer/autogenerated/src/wholeBodyDynamics_IDLServer.cpp deleted file mode 100644 index c42b7e4..0000000 --- a/idl/wholeBodyDynamics_IDLServer/autogenerated/src/wholeBodyDynamics_IDLServer.cpp +++ /dev/null @@ -1,2234 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) - * SPDX-License-Identifier: BSD-3-Clause - */ - -// Autogenerated by Thrift Compiler (0.14.1-yarped) -// -// This is an automatically generated file. -// It could get re-generated if the ALLOW_IDL_GENERATION flag is on. - -#include - -#include - -class wholeBodyDynamics_IDLServer_calib_helper : - public yarp::os::Portable -{ -public: - explicit wholeBodyDynamics_IDLServer_calib_helper(const std::string& calib_code, const std::int32_t nr_of_samples); - bool write(yarp::os::ConnectionWriter& connection) const override; - bool read(yarp::os::ConnectionReader& connection) override; - - std::string m_calib_code; - std::int32_t m_nr_of_samples; - - thread_local static bool s_return_helper; -}; - -thread_local bool wholeBodyDynamics_IDLServer_calib_helper::s_return_helper = {}; - -wholeBodyDynamics_IDLServer_calib_helper::wholeBodyDynamics_IDLServer_calib_helper(const std::string& calib_code, const std::int32_t nr_of_samples) : - m_calib_code{calib_code}, - m_nr_of_samples{nr_of_samples} -{ - s_return_helper = {}; -} - -bool wholeBodyDynamics_IDLServer_calib_helper::write(yarp::os::ConnectionWriter& connection) const -{ - yarp::os::idl::WireWriter writer(connection); - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeTag("calib", 1, 1)) { - return false; - } - if (!writer.writeString(m_calib_code)) { - return false; - } - if (!writer.writeI32(m_nr_of_samples)) { - return false; - } - return true; -} - -bool wholeBodyDynamics_IDLServer_calib_helper::read(yarp::os::ConnectionReader& connection) -{ - yarp::os::idl::WireReader reader(connection); - if (!reader.readListReturn()) { - return false; - } - if (!reader.readBool(s_return_helper)) { - reader.fail(); - return false; - } - return true; -} - -class wholeBodyDynamics_IDLServer_calibStanding_helper : - public yarp::os::Portable -{ -public: - explicit wholeBodyDynamics_IDLServer_calibStanding_helper(const std::string& calib_code, const std::int32_t nr_of_samples); - bool write(yarp::os::ConnectionWriter& connection) const override; - bool read(yarp::os::ConnectionReader& connection) override; - - std::string m_calib_code; - std::int32_t m_nr_of_samples; - - thread_local static bool s_return_helper; -}; - -thread_local bool wholeBodyDynamics_IDLServer_calibStanding_helper::s_return_helper = {}; - -wholeBodyDynamics_IDLServer_calibStanding_helper::wholeBodyDynamics_IDLServer_calibStanding_helper(const std::string& calib_code, const std::int32_t nr_of_samples) : - m_calib_code{calib_code}, - m_nr_of_samples{nr_of_samples} -{ - s_return_helper = {}; -} - -bool wholeBodyDynamics_IDLServer_calibStanding_helper::write(yarp::os::ConnectionWriter& connection) const -{ - yarp::os::idl::WireWriter writer(connection); - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeTag("calibStanding", 1, 1)) { - return false; - } - if (!writer.writeString(m_calib_code)) { - return false; - } - if (!writer.writeI32(m_nr_of_samples)) { - return false; - } - return true; -} - -bool wholeBodyDynamics_IDLServer_calibStanding_helper::read(yarp::os::ConnectionReader& connection) -{ - yarp::os::idl::WireReader reader(connection); - if (!reader.readListReturn()) { - return false; - } - if (!reader.readBool(s_return_helper)) { - reader.fail(); - return false; - } - return true; -} - -class wholeBodyDynamics_IDLServer_calibStandingWithJetsiRonCubMk1_helper : - public yarp::os::Portable -{ -public: - explicit wholeBodyDynamics_IDLServer_calibStandingWithJetsiRonCubMk1_helper(const std::string& calib_code, const std::int32_t nr_of_samples); - bool write(yarp::os::ConnectionWriter& connection) const override; - bool read(yarp::os::ConnectionReader& connection) override; - - std::string m_calib_code; - std::int32_t m_nr_of_samples; - - thread_local static bool s_return_helper; -}; - -thread_local bool wholeBodyDynamics_IDLServer_calibStandingWithJetsiRonCubMk1_helper::s_return_helper = {}; - -wholeBodyDynamics_IDLServer_calibStandingWithJetsiRonCubMk1_helper::wholeBodyDynamics_IDLServer_calibStandingWithJetsiRonCubMk1_helper(const std::string& calib_code, const std::int32_t nr_of_samples) : - m_calib_code{calib_code}, - m_nr_of_samples{nr_of_samples} -{ - s_return_helper = {}; -} - -bool wholeBodyDynamics_IDLServer_calibStandingWithJetsiRonCubMk1_helper::write(yarp::os::ConnectionWriter& connection) const -{ - yarp::os::idl::WireWriter writer(connection); - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeTag("calibStandingWithJetsiRonCubMk1", 1, 1)) { - return false; - } - if (!writer.writeString(m_calib_code)) { - return false; - } - if (!writer.writeI32(m_nr_of_samples)) { - return false; - } - return true; -} - -bool wholeBodyDynamics_IDLServer_calibStandingWithJetsiRonCubMk1_helper::read(yarp::os::ConnectionReader& connection) -{ - yarp::os::idl::WireReader reader(connection); - if (!reader.readListReturn()) { - return false; - } - if (!reader.readBool(s_return_helper)) { - reader.fail(); - return false; - } - return true; -} - -class wholeBodyDynamics_IDLServer_calibStandingLeftFoot_helper : - public yarp::os::Portable -{ -public: - explicit wholeBodyDynamics_IDLServer_calibStandingLeftFoot_helper(const std::string& calib_code, const std::int32_t nr_of_samples); - bool write(yarp::os::ConnectionWriter& connection) const override; - bool read(yarp::os::ConnectionReader& connection) override; - - std::string m_calib_code; - std::int32_t m_nr_of_samples; - - thread_local static bool s_return_helper; -}; - -thread_local bool wholeBodyDynamics_IDLServer_calibStandingLeftFoot_helper::s_return_helper = {}; - -wholeBodyDynamics_IDLServer_calibStandingLeftFoot_helper::wholeBodyDynamics_IDLServer_calibStandingLeftFoot_helper(const std::string& calib_code, const std::int32_t nr_of_samples) : - m_calib_code{calib_code}, - m_nr_of_samples{nr_of_samples} -{ - s_return_helper = {}; -} - -bool wholeBodyDynamics_IDLServer_calibStandingLeftFoot_helper::write(yarp::os::ConnectionWriter& connection) const -{ - yarp::os::idl::WireWriter writer(connection); - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeTag("calibStandingLeftFoot", 1, 1)) { - return false; - } - if (!writer.writeString(m_calib_code)) { - return false; - } - if (!writer.writeI32(m_nr_of_samples)) { - return false; - } - return true; -} - -bool wholeBodyDynamics_IDLServer_calibStandingLeftFoot_helper::read(yarp::os::ConnectionReader& connection) -{ - yarp::os::idl::WireReader reader(connection); - if (!reader.readListReturn()) { - return false; - } - if (!reader.readBool(s_return_helper)) { - reader.fail(); - return false; - } - return true; -} - -class wholeBodyDynamics_IDLServer_calibStandingRightFoot_helper : - public yarp::os::Portable -{ -public: - explicit wholeBodyDynamics_IDLServer_calibStandingRightFoot_helper(const std::string& calib_code, const std::int32_t nr_of_samples); - bool write(yarp::os::ConnectionWriter& connection) const override; - bool read(yarp::os::ConnectionReader& connection) override; - - std::string m_calib_code; - std::int32_t m_nr_of_samples; - - thread_local static bool s_return_helper; -}; - -thread_local bool wholeBodyDynamics_IDLServer_calibStandingRightFoot_helper::s_return_helper = {}; - -wholeBodyDynamics_IDLServer_calibStandingRightFoot_helper::wholeBodyDynamics_IDLServer_calibStandingRightFoot_helper(const std::string& calib_code, const std::int32_t nr_of_samples) : - m_calib_code{calib_code}, - m_nr_of_samples{nr_of_samples} -{ - s_return_helper = {}; -} - -bool wholeBodyDynamics_IDLServer_calibStandingRightFoot_helper::write(yarp::os::ConnectionWriter& connection) const -{ - yarp::os::idl::WireWriter writer(connection); - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeTag("calibStandingRightFoot", 1, 1)) { - return false; - } - if (!writer.writeString(m_calib_code)) { - return false; - } - if (!writer.writeI32(m_nr_of_samples)) { - return false; - } - return true; -} - -bool wholeBodyDynamics_IDLServer_calibStandingRightFoot_helper::read(yarp::os::ConnectionReader& connection) -{ - yarp::os::idl::WireReader reader(connection); - if (!reader.readListReturn()) { - return false; - } - if (!reader.readBool(s_return_helper)) { - reader.fail(); - return false; - } - return true; -} - -class wholeBodyDynamics_IDLServer_calibStandingOnOneLink_helper : - public yarp::os::Portable -{ -public: - explicit wholeBodyDynamics_IDLServer_calibStandingOnOneLink_helper(const std::string& standing_frame, const std::int32_t nr_of_samples); - bool write(yarp::os::ConnectionWriter& connection) const override; - bool read(yarp::os::ConnectionReader& connection) override; - - std::string m_standing_frame; - std::int32_t m_nr_of_samples; - - thread_local static bool s_return_helper; -}; - -thread_local bool wholeBodyDynamics_IDLServer_calibStandingOnOneLink_helper::s_return_helper = {}; - -wholeBodyDynamics_IDLServer_calibStandingOnOneLink_helper::wholeBodyDynamics_IDLServer_calibStandingOnOneLink_helper(const std::string& standing_frame, const std::int32_t nr_of_samples) : - m_standing_frame{standing_frame}, - m_nr_of_samples{nr_of_samples} -{ - s_return_helper = {}; -} - -bool wholeBodyDynamics_IDLServer_calibStandingOnOneLink_helper::write(yarp::os::ConnectionWriter& connection) const -{ - yarp::os::idl::WireWriter writer(connection); - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeTag("calibStandingOnOneLink", 1, 1)) { - return false; - } - if (!writer.writeString(m_standing_frame)) { - return false; - } - if (!writer.writeI32(m_nr_of_samples)) { - return false; - } - return true; -} - -bool wholeBodyDynamics_IDLServer_calibStandingOnOneLink_helper::read(yarp::os::ConnectionReader& connection) -{ - yarp::os::idl::WireReader reader(connection); - if (!reader.readListReturn()) { - return false; - } - if (!reader.readBool(s_return_helper)) { - reader.fail(); - return false; - } - return true; -} - -class wholeBodyDynamics_IDLServer_calibStandingOnTwoLinks_helper : - public yarp::os::Portable -{ -public: - explicit wholeBodyDynamics_IDLServer_calibStandingOnTwoLinks_helper(const std::string& first_standing_frame, const std::string& second_standing_frame, const std::int32_t nr_of_samples); - bool write(yarp::os::ConnectionWriter& connection) const override; - bool read(yarp::os::ConnectionReader& connection) override; - - std::string m_first_standing_frame; - std::string m_second_standing_frame; - std::int32_t m_nr_of_samples; - - thread_local static bool s_return_helper; -}; - -thread_local bool wholeBodyDynamics_IDLServer_calibStandingOnTwoLinks_helper::s_return_helper = {}; - -wholeBodyDynamics_IDLServer_calibStandingOnTwoLinks_helper::wholeBodyDynamics_IDLServer_calibStandingOnTwoLinks_helper(const std::string& first_standing_frame, const std::string& second_standing_frame, const std::int32_t nr_of_samples) : - m_first_standing_frame{first_standing_frame}, - m_second_standing_frame{second_standing_frame}, - m_nr_of_samples{nr_of_samples} -{ - s_return_helper = {}; -} - -bool wholeBodyDynamics_IDLServer_calibStandingOnTwoLinks_helper::write(yarp::os::ConnectionWriter& connection) const -{ - yarp::os::idl::WireWriter writer(connection); - if (!writer.writeListHeader(4)) { - return false; - } - if (!writer.writeTag("calibStandingOnTwoLinks", 1, 1)) { - return false; - } - if (!writer.writeString(m_first_standing_frame)) { - return false; - } - if (!writer.writeString(m_second_standing_frame)) { - return false; - } - if (!writer.writeI32(m_nr_of_samples)) { - return false; - } - return true; -} - -bool wholeBodyDynamics_IDLServer_calibStandingOnTwoLinks_helper::read(yarp::os::ConnectionReader& connection) -{ - yarp::os::idl::WireReader reader(connection); - if (!reader.readListReturn()) { - return false; - } - if (!reader.readBool(s_return_helper)) { - reader.fail(); - return false; - } - return true; -} - -class wholeBodyDynamics_IDLServer_resetOffset_helper : - public yarp::os::Portable -{ -public: - explicit wholeBodyDynamics_IDLServer_resetOffset_helper(const std::string& calib_code); - bool write(yarp::os::ConnectionWriter& connection) const override; - bool read(yarp::os::ConnectionReader& connection) override; - - std::string m_calib_code; - - thread_local static bool s_return_helper; -}; - -thread_local bool wholeBodyDynamics_IDLServer_resetOffset_helper::s_return_helper = {}; - -wholeBodyDynamics_IDLServer_resetOffset_helper::wholeBodyDynamics_IDLServer_resetOffset_helper(const std::string& calib_code) : - m_calib_code{calib_code} -{ - s_return_helper = {}; -} - -bool wholeBodyDynamics_IDLServer_resetOffset_helper::write(yarp::os::ConnectionWriter& connection) const -{ - yarp::os::idl::WireWriter writer(connection); - if (!writer.writeListHeader(2)) { - return false; - } - if (!writer.writeTag("resetOffset", 1, 1)) { - return false; - } - if (!writer.writeString(m_calib_code)) { - return false; - } - return true; -} - -bool wholeBodyDynamics_IDLServer_resetOffset_helper::read(yarp::os::ConnectionReader& connection) -{ - yarp::os::idl::WireReader reader(connection); - if (!reader.readListReturn()) { - return false; - } - if (!reader.readBool(s_return_helper)) { - reader.fail(); - return false; - } - return true; -} - -class wholeBodyDynamics_IDLServer_usePreEstimatedOffset_helper : - public yarp::os::Portable -{ -public: - explicit wholeBodyDynamics_IDLServer_usePreEstimatedOffset_helper(); - bool write(yarp::os::ConnectionWriter& connection) const override; - bool read(yarp::os::ConnectionReader& connection) override; - - thread_local static bool s_return_helper; -}; - -thread_local bool wholeBodyDynamics_IDLServer_usePreEstimatedOffset_helper::s_return_helper = {}; - -wholeBodyDynamics_IDLServer_usePreEstimatedOffset_helper::wholeBodyDynamics_IDLServer_usePreEstimatedOffset_helper() -{ - s_return_helper = {}; -} - -bool wholeBodyDynamics_IDLServer_usePreEstimatedOffset_helper::write(yarp::os::ConnectionWriter& connection) const -{ - yarp::os::idl::WireWriter writer(connection); - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeTag("usePreEstimatedOffset", 1, 1)) { - return false; - } - return true; -} - -bool wholeBodyDynamics_IDLServer_usePreEstimatedOffset_helper::read(yarp::os::ConnectionReader& connection) -{ - yarp::os::idl::WireReader reader(connection); - if (!reader.readListReturn()) { - return false; - } - if (!reader.readBool(s_return_helper)) { - reader.fail(); - return false; - } - return true; -} - -class wholeBodyDynamics_IDLServer_quit_helper : - public yarp::os::Portable -{ -public: - explicit wholeBodyDynamics_IDLServer_quit_helper(); - bool write(yarp::os::ConnectionWriter& connection) const override; - bool read(yarp::os::ConnectionReader& connection) override; - - thread_local static bool s_return_helper; -}; - -thread_local bool wholeBodyDynamics_IDLServer_quit_helper::s_return_helper = {}; - -wholeBodyDynamics_IDLServer_quit_helper::wholeBodyDynamics_IDLServer_quit_helper() -{ - s_return_helper = {}; -} - -bool wholeBodyDynamics_IDLServer_quit_helper::write(yarp::os::ConnectionWriter& connection) const -{ - yarp::os::idl::WireWriter writer(connection); - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeTag("quit", 1, 1)) { - return false; - } - return true; -} - -bool wholeBodyDynamics_IDLServer_quit_helper::read(yarp::os::ConnectionReader& connection) -{ - yarp::os::idl::WireReader reader(connection); - if (!reader.readListReturn()) { - return false; - } - if (!reader.readBool(s_return_helper)) { - reader.fail(); - return false; - } - return true; -} - -class wholeBodyDynamics_IDLServer_resetSimpleLeggedOdometry_helper : - public yarp::os::Portable -{ -public: - explicit wholeBodyDynamics_IDLServer_resetSimpleLeggedOdometry_helper(const std::string& initial_world_frame, const std::string& initial_fixed_link); - bool write(yarp::os::ConnectionWriter& connection) const override; - bool read(yarp::os::ConnectionReader& connection) override; - - std::string m_initial_world_frame; - std::string m_initial_fixed_link; - - thread_local static bool s_return_helper; -}; - -thread_local bool wholeBodyDynamics_IDLServer_resetSimpleLeggedOdometry_helper::s_return_helper = {}; - -wholeBodyDynamics_IDLServer_resetSimpleLeggedOdometry_helper::wholeBodyDynamics_IDLServer_resetSimpleLeggedOdometry_helper(const std::string& initial_world_frame, const std::string& initial_fixed_link) : - m_initial_world_frame{initial_world_frame}, - m_initial_fixed_link{initial_fixed_link} -{ - s_return_helper = {}; -} - -bool wholeBodyDynamics_IDLServer_resetSimpleLeggedOdometry_helper::write(yarp::os::ConnectionWriter& connection) const -{ - yarp::os::idl::WireWriter writer(connection); - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeTag("resetSimpleLeggedOdometry", 1, 1)) { - return false; - } - if (!writer.writeString(m_initial_world_frame)) { - return false; - } - if (!writer.writeString(m_initial_fixed_link)) { - return false; - } - return true; -} - -bool wholeBodyDynamics_IDLServer_resetSimpleLeggedOdometry_helper::read(yarp::os::ConnectionReader& connection) -{ - yarp::os::idl::WireReader reader(connection); - if (!reader.readListReturn()) { - return false; - } - if (!reader.readBool(s_return_helper)) { - reader.fail(); - return false; - } - return true; -} - -class wholeBodyDynamics_IDLServer_changeFixedLinkSimpleLeggedOdometry_helper : - public yarp::os::Portable -{ -public: - explicit wholeBodyDynamics_IDLServer_changeFixedLinkSimpleLeggedOdometry_helper(const std::string& new_fixed_link); - bool write(yarp::os::ConnectionWriter& connection) const override; - bool read(yarp::os::ConnectionReader& connection) override; - - std::string m_new_fixed_link; - - thread_local static bool s_return_helper; -}; - -thread_local bool wholeBodyDynamics_IDLServer_changeFixedLinkSimpleLeggedOdometry_helper::s_return_helper = {}; - -wholeBodyDynamics_IDLServer_changeFixedLinkSimpleLeggedOdometry_helper::wholeBodyDynamics_IDLServer_changeFixedLinkSimpleLeggedOdometry_helper(const std::string& new_fixed_link) : - m_new_fixed_link{new_fixed_link} -{ - s_return_helper = {}; -} - -bool wholeBodyDynamics_IDLServer_changeFixedLinkSimpleLeggedOdometry_helper::write(yarp::os::ConnectionWriter& connection) const -{ - yarp::os::idl::WireWriter writer(connection); - if (!writer.writeListHeader(2)) { - return false; - } - if (!writer.writeTag("changeFixedLinkSimpleLeggedOdometry", 1, 1)) { - return false; - } - if (!writer.writeString(m_new_fixed_link)) { - return false; - } - return true; -} - -bool wholeBodyDynamics_IDLServer_changeFixedLinkSimpleLeggedOdometry_helper::read(yarp::os::ConnectionReader& connection) -{ - yarp::os::idl::WireReader reader(connection); - if (!reader.readListReturn()) { - return false; - } - if (!reader.readBool(s_return_helper)) { - reader.fail(); - return false; - } - return true; -} - -class wholeBodyDynamics_IDLServer_set_imuFilterCutoffInHz_helper : - public yarp::os::Portable -{ -public: - explicit wholeBodyDynamics_IDLServer_set_imuFilterCutoffInHz_helper(const double newCutoff); - bool write(yarp::os::ConnectionWriter& connection) const override; - bool read(yarp::os::ConnectionReader& connection) override; - - double m_newCutoff; - - thread_local static bool s_return_helper; -}; - -thread_local bool wholeBodyDynamics_IDLServer_set_imuFilterCutoffInHz_helper::s_return_helper = {}; - -wholeBodyDynamics_IDLServer_set_imuFilterCutoffInHz_helper::wholeBodyDynamics_IDLServer_set_imuFilterCutoffInHz_helper(const double newCutoff) : - m_newCutoff{newCutoff} -{ - s_return_helper = {}; -} - -bool wholeBodyDynamics_IDLServer_set_imuFilterCutoffInHz_helper::write(yarp::os::ConnectionWriter& connection) const -{ - yarp::os::idl::WireWriter writer(connection); - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeTag("set_imuFilterCutoffInHz", 1, 2)) { - return false; - } - if (!writer.writeFloat64(m_newCutoff)) { - return false; - } - return true; -} - -bool wholeBodyDynamics_IDLServer_set_imuFilterCutoffInHz_helper::read(yarp::os::ConnectionReader& connection) -{ - yarp::os::idl::WireReader reader(connection); - if (!reader.readListReturn()) { - return false; - } - if (!reader.readBool(s_return_helper)) { - reader.fail(); - return false; - } - return true; -} - -class wholeBodyDynamics_IDLServer_get_imuFilterCutoffInHz_helper : - public yarp::os::Portable -{ -public: - explicit wholeBodyDynamics_IDLServer_get_imuFilterCutoffInHz_helper(); - bool write(yarp::os::ConnectionWriter& connection) const override; - bool read(yarp::os::ConnectionReader& connection) override; - - thread_local static double s_return_helper; -}; - -thread_local double wholeBodyDynamics_IDLServer_get_imuFilterCutoffInHz_helper::s_return_helper = {}; - -wholeBodyDynamics_IDLServer_get_imuFilterCutoffInHz_helper::wholeBodyDynamics_IDLServer_get_imuFilterCutoffInHz_helper() -{ - s_return_helper = {}; -} - -bool wholeBodyDynamics_IDLServer_get_imuFilterCutoffInHz_helper::write(yarp::os::ConnectionWriter& connection) const -{ - yarp::os::idl::WireWriter writer(connection); - if (!writer.writeListHeader(2)) { - return false; - } - if (!writer.writeTag("get_imuFilterCutoffInHz", 1, 2)) { - return false; - } - return true; -} - -bool wholeBodyDynamics_IDLServer_get_imuFilterCutoffInHz_helper::read(yarp::os::ConnectionReader& connection) -{ - yarp::os::idl::WireReader reader(connection); - if (!reader.readListReturn()) { - return false; - } - if (!reader.readFloat64(s_return_helper)) { - reader.fail(); - return false; - } - return true; -} - -class wholeBodyDynamics_IDLServer_set_forceTorqueFilterCutoffInHz_helper : - public yarp::os::Portable -{ -public: - explicit wholeBodyDynamics_IDLServer_set_forceTorqueFilterCutoffInHz_helper(const double newCutoff); - bool write(yarp::os::ConnectionWriter& connection) const override; - bool read(yarp::os::ConnectionReader& connection) override; - - double m_newCutoff; - - thread_local static bool s_return_helper; -}; - -thread_local bool wholeBodyDynamics_IDLServer_set_forceTorqueFilterCutoffInHz_helper::s_return_helper = {}; - -wholeBodyDynamics_IDLServer_set_forceTorqueFilterCutoffInHz_helper::wholeBodyDynamics_IDLServer_set_forceTorqueFilterCutoffInHz_helper(const double newCutoff) : - m_newCutoff{newCutoff} -{ - s_return_helper = {}; -} - -bool wholeBodyDynamics_IDLServer_set_forceTorqueFilterCutoffInHz_helper::write(yarp::os::ConnectionWriter& connection) const -{ - yarp::os::idl::WireWriter writer(connection); - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeTag("set_forceTorqueFilterCutoffInHz", 1, 2)) { - return false; - } - if (!writer.writeFloat64(m_newCutoff)) { - return false; - } - return true; -} - -bool wholeBodyDynamics_IDLServer_set_forceTorqueFilterCutoffInHz_helper::read(yarp::os::ConnectionReader& connection) -{ - yarp::os::idl::WireReader reader(connection); - if (!reader.readListReturn()) { - return false; - } - if (!reader.readBool(s_return_helper)) { - reader.fail(); - return false; - } - return true; -} - -class wholeBodyDynamics_IDLServer_get_forceTorqueFilterCutoffInHz_helper : - public yarp::os::Portable -{ -public: - explicit wholeBodyDynamics_IDLServer_get_forceTorqueFilterCutoffInHz_helper(); - bool write(yarp::os::ConnectionWriter& connection) const override; - bool read(yarp::os::ConnectionReader& connection) override; - - thread_local static double s_return_helper; -}; - -thread_local double wholeBodyDynamics_IDLServer_get_forceTorqueFilterCutoffInHz_helper::s_return_helper = {}; - -wholeBodyDynamics_IDLServer_get_forceTorqueFilterCutoffInHz_helper::wholeBodyDynamics_IDLServer_get_forceTorqueFilterCutoffInHz_helper() -{ - s_return_helper = {}; -} - -bool wholeBodyDynamics_IDLServer_get_forceTorqueFilterCutoffInHz_helper::write(yarp::os::ConnectionWriter& connection) const -{ - yarp::os::idl::WireWriter writer(connection); - if (!writer.writeListHeader(2)) { - return false; - } - if (!writer.writeTag("get_forceTorqueFilterCutoffInHz", 1, 2)) { - return false; - } - return true; -} - -bool wholeBodyDynamics_IDLServer_get_forceTorqueFilterCutoffInHz_helper::read(yarp::os::ConnectionReader& connection) -{ - yarp::os::idl::WireReader reader(connection); - if (!reader.readListReturn()) { - return false; - } - if (!reader.readFloat64(s_return_helper)) { - reader.fail(); - return false; - } - return true; -} - -class wholeBodyDynamics_IDLServer_set_jointVelFilterCutoffInHz_helper : - public yarp::os::Portable -{ -public: - explicit wholeBodyDynamics_IDLServer_set_jointVelFilterCutoffInHz_helper(const double newCutoff); - bool write(yarp::os::ConnectionWriter& connection) const override; - bool read(yarp::os::ConnectionReader& connection) override; - - double m_newCutoff; - - thread_local static bool s_return_helper; -}; - -thread_local bool wholeBodyDynamics_IDLServer_set_jointVelFilterCutoffInHz_helper::s_return_helper = {}; - -wholeBodyDynamics_IDLServer_set_jointVelFilterCutoffInHz_helper::wholeBodyDynamics_IDLServer_set_jointVelFilterCutoffInHz_helper(const double newCutoff) : - m_newCutoff{newCutoff} -{ - s_return_helper = {}; -} - -bool wholeBodyDynamics_IDLServer_set_jointVelFilterCutoffInHz_helper::write(yarp::os::ConnectionWriter& connection) const -{ - yarp::os::idl::WireWriter writer(connection); - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeTag("set_jointVelFilterCutoffInHz", 1, 2)) { - return false; - } - if (!writer.writeFloat64(m_newCutoff)) { - return false; - } - return true; -} - -bool wholeBodyDynamics_IDLServer_set_jointVelFilterCutoffInHz_helper::read(yarp::os::ConnectionReader& connection) -{ - yarp::os::idl::WireReader reader(connection); - if (!reader.readListReturn()) { - return false; - } - if (!reader.readBool(s_return_helper)) { - reader.fail(); - return false; - } - return true; -} - -class wholeBodyDynamics_IDLServer_get_jointVelFilterCutoffInHz_helper : - public yarp::os::Portable -{ -public: - explicit wholeBodyDynamics_IDLServer_get_jointVelFilterCutoffInHz_helper(); - bool write(yarp::os::ConnectionWriter& connection) const override; - bool read(yarp::os::ConnectionReader& connection) override; - - thread_local static double s_return_helper; -}; - -thread_local double wholeBodyDynamics_IDLServer_get_jointVelFilterCutoffInHz_helper::s_return_helper = {}; - -wholeBodyDynamics_IDLServer_get_jointVelFilterCutoffInHz_helper::wholeBodyDynamics_IDLServer_get_jointVelFilterCutoffInHz_helper() -{ - s_return_helper = {}; -} - -bool wholeBodyDynamics_IDLServer_get_jointVelFilterCutoffInHz_helper::write(yarp::os::ConnectionWriter& connection) const -{ - yarp::os::idl::WireWriter writer(connection); - if (!writer.writeListHeader(2)) { - return false; - } - if (!writer.writeTag("get_jointVelFilterCutoffInHz", 1, 2)) { - return false; - } - return true; -} - -bool wholeBodyDynamics_IDLServer_get_jointVelFilterCutoffInHz_helper::read(yarp::os::ConnectionReader& connection) -{ - yarp::os::idl::WireReader reader(connection); - if (!reader.readListReturn()) { - return false; - } - if (!reader.readFloat64(s_return_helper)) { - reader.fail(); - return false; - } - return true; -} - -class wholeBodyDynamics_IDLServer_set_jointAccFilterCutoffInHz_helper : - public yarp::os::Portable -{ -public: - explicit wholeBodyDynamics_IDLServer_set_jointAccFilterCutoffInHz_helper(const double newCutoff); - bool write(yarp::os::ConnectionWriter& connection) const override; - bool read(yarp::os::ConnectionReader& connection) override; - - double m_newCutoff; - - thread_local static bool s_return_helper; -}; - -thread_local bool wholeBodyDynamics_IDLServer_set_jointAccFilterCutoffInHz_helper::s_return_helper = {}; - -wholeBodyDynamics_IDLServer_set_jointAccFilterCutoffInHz_helper::wholeBodyDynamics_IDLServer_set_jointAccFilterCutoffInHz_helper(const double newCutoff) : - m_newCutoff{newCutoff} -{ - s_return_helper = {}; -} - -bool wholeBodyDynamics_IDLServer_set_jointAccFilterCutoffInHz_helper::write(yarp::os::ConnectionWriter& connection) const -{ - yarp::os::idl::WireWriter writer(connection); - if (!writer.writeListHeader(3)) { - return false; - } - if (!writer.writeTag("set_jointAccFilterCutoffInHz", 1, 2)) { - return false; - } - if (!writer.writeFloat64(m_newCutoff)) { - return false; - } - return true; -} - -bool wholeBodyDynamics_IDLServer_set_jointAccFilterCutoffInHz_helper::read(yarp::os::ConnectionReader& connection) -{ - yarp::os::idl::WireReader reader(connection); - if (!reader.readListReturn()) { - return false; - } - if (!reader.readBool(s_return_helper)) { - reader.fail(); - return false; - } - return true; -} - -class wholeBodyDynamics_IDLServer_get_jointAccFilterCutoffInHz_helper : - public yarp::os::Portable -{ -public: - explicit wholeBodyDynamics_IDLServer_get_jointAccFilterCutoffInHz_helper(); - bool write(yarp::os::ConnectionWriter& connection) const override; - bool read(yarp::os::ConnectionReader& connection) override; - - thread_local static double s_return_helper; -}; - -thread_local double wholeBodyDynamics_IDLServer_get_jointAccFilterCutoffInHz_helper::s_return_helper = {}; - -wholeBodyDynamics_IDLServer_get_jointAccFilterCutoffInHz_helper::wholeBodyDynamics_IDLServer_get_jointAccFilterCutoffInHz_helper() -{ - s_return_helper = {}; -} - -bool wholeBodyDynamics_IDLServer_get_jointAccFilterCutoffInHz_helper::write(yarp::os::ConnectionWriter& connection) const -{ - yarp::os::idl::WireWriter writer(connection); - if (!writer.writeListHeader(2)) { - return false; - } - if (!writer.writeTag("get_jointAccFilterCutoffInHz", 1, 2)) { - return false; - } - return true; -} - -bool wholeBodyDynamics_IDLServer_get_jointAccFilterCutoffInHz_helper::read(yarp::os::ConnectionReader& connection) -{ - yarp::os::idl::WireReader reader(connection); - if (!reader.readListReturn()) { - return false; - } - if (!reader.readFloat64(s_return_helper)) { - reader.fail(); - return false; - } - return true; -} - -class wholeBodyDynamics_IDLServer_useIMUAsKinematicSource_helper : - public yarp::os::Portable -{ -public: - explicit wholeBodyDynamics_IDLServer_useIMUAsKinematicSource_helper(); - bool write(yarp::os::ConnectionWriter& connection) const override; - bool read(yarp::os::ConnectionReader& connection) override; - - thread_local static bool s_return_helper; -}; - -thread_local bool wholeBodyDynamics_IDLServer_useIMUAsKinematicSource_helper::s_return_helper = {}; - -wholeBodyDynamics_IDLServer_useIMUAsKinematicSource_helper::wholeBodyDynamics_IDLServer_useIMUAsKinematicSource_helper() -{ - s_return_helper = {}; -} - -bool wholeBodyDynamics_IDLServer_useIMUAsKinematicSource_helper::write(yarp::os::ConnectionWriter& connection) const -{ - yarp::os::idl::WireWriter writer(connection); - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeTag("useIMUAsKinematicSource", 1, 1)) { - return false; - } - return true; -} - -bool wholeBodyDynamics_IDLServer_useIMUAsKinematicSource_helper::read(yarp::os::ConnectionReader& connection) -{ - yarp::os::idl::WireReader reader(connection); - if (!reader.readListReturn()) { - return false; - } - if (!reader.readBool(s_return_helper)) { - reader.fail(); - return false; - } - return true; -} - -class wholeBodyDynamics_IDLServer_useFixedFrameAsKinematicSource_helper : - public yarp::os::Portable -{ -public: - explicit wholeBodyDynamics_IDLServer_useFixedFrameAsKinematicSource_helper(const std::string& fixedFrame); - bool write(yarp::os::ConnectionWriter& connection) const override; - bool read(yarp::os::ConnectionReader& connection) override; - - std::string m_fixedFrame; - - thread_local static bool s_return_helper; -}; - -thread_local bool wholeBodyDynamics_IDLServer_useFixedFrameAsKinematicSource_helper::s_return_helper = {}; - -wholeBodyDynamics_IDLServer_useFixedFrameAsKinematicSource_helper::wholeBodyDynamics_IDLServer_useFixedFrameAsKinematicSource_helper(const std::string& fixedFrame) : - m_fixedFrame{fixedFrame} -{ - s_return_helper = {}; -} - -bool wholeBodyDynamics_IDLServer_useFixedFrameAsKinematicSource_helper::write(yarp::os::ConnectionWriter& connection) const -{ - yarp::os::idl::WireWriter writer(connection); - if (!writer.writeListHeader(2)) { - return false; - } - if (!writer.writeTag("useFixedFrameAsKinematicSource", 1, 1)) { - return false; - } - if (!writer.writeString(m_fixedFrame)) { - return false; - } - return true; -} - -bool wholeBodyDynamics_IDLServer_useFixedFrameAsKinematicSource_helper::read(yarp::os::ConnectionReader& connection) -{ - yarp::os::idl::WireReader reader(connection); - if (!reader.readListReturn()) { - return false; - } - if (!reader.readBool(s_return_helper)) { - reader.fail(); - return false; - } - return true; -} - -class wholeBodyDynamics_IDLServer_setUseOfJointVelocities_helper : - public yarp::os::Portable -{ -public: - explicit wholeBodyDynamics_IDLServer_setUseOfJointVelocities_helper(const bool enable); - bool write(yarp::os::ConnectionWriter& connection) const override; - bool read(yarp::os::ConnectionReader& connection) override; - - bool m_enable; - - thread_local static bool s_return_helper; -}; - -thread_local bool wholeBodyDynamics_IDLServer_setUseOfJointVelocities_helper::s_return_helper = {}; - -wholeBodyDynamics_IDLServer_setUseOfJointVelocities_helper::wholeBodyDynamics_IDLServer_setUseOfJointVelocities_helper(const bool enable) : - m_enable{enable} -{ - s_return_helper = {}; -} - -bool wholeBodyDynamics_IDLServer_setUseOfJointVelocities_helper::write(yarp::os::ConnectionWriter& connection) const -{ - yarp::os::idl::WireWriter writer(connection); - if (!writer.writeListHeader(2)) { - return false; - } - if (!writer.writeTag("setUseOfJointVelocities", 1, 1)) { - return false; - } - if (!writer.writeBool(m_enable)) { - return false; - } - return true; -} - -bool wholeBodyDynamics_IDLServer_setUseOfJointVelocities_helper::read(yarp::os::ConnectionReader& connection) -{ - yarp::os::idl::WireReader reader(connection); - if (!reader.readListReturn()) { - return false; - } - if (!reader.readBool(s_return_helper)) { - reader.fail(); - return false; - } - return true; -} - -class wholeBodyDynamics_IDLServer_setUseOfJointAccelerations_helper : - public yarp::os::Portable -{ -public: - explicit wholeBodyDynamics_IDLServer_setUseOfJointAccelerations_helper(const bool enable); - bool write(yarp::os::ConnectionWriter& connection) const override; - bool read(yarp::os::ConnectionReader& connection) override; - - bool m_enable; - - thread_local static bool s_return_helper; -}; - -thread_local bool wholeBodyDynamics_IDLServer_setUseOfJointAccelerations_helper::s_return_helper = {}; - -wholeBodyDynamics_IDLServer_setUseOfJointAccelerations_helper::wholeBodyDynamics_IDLServer_setUseOfJointAccelerations_helper(const bool enable) : - m_enable{enable} -{ - s_return_helper = {}; -} - -bool wholeBodyDynamics_IDLServer_setUseOfJointAccelerations_helper::write(yarp::os::ConnectionWriter& connection) const -{ - yarp::os::idl::WireWriter writer(connection); - if (!writer.writeListHeader(2)) { - return false; - } - if (!writer.writeTag("setUseOfJointAccelerations", 1, 1)) { - return false; - } - if (!writer.writeBool(m_enable)) { - return false; - } - return true; -} - -bool wholeBodyDynamics_IDLServer_setUseOfJointAccelerations_helper::read(yarp::os::ConnectionReader& connection) -{ - yarp::os::idl::WireReader reader(connection); - if (!reader.readListReturn()) { - return false; - } - if (!reader.readBool(s_return_helper)) { - reader.fail(); - return false; - } - return true; -} - -class wholeBodyDynamics_IDLServer_getCurrentSettingsString_helper : - public yarp::os::Portable -{ -public: - explicit wholeBodyDynamics_IDLServer_getCurrentSettingsString_helper(); - bool write(yarp::os::ConnectionWriter& connection) const override; - bool read(yarp::os::ConnectionReader& connection) override; - - thread_local static std::string s_return_helper; -}; - -thread_local std::string wholeBodyDynamics_IDLServer_getCurrentSettingsString_helper::s_return_helper = {}; - -wholeBodyDynamics_IDLServer_getCurrentSettingsString_helper::wholeBodyDynamics_IDLServer_getCurrentSettingsString_helper() -{ - s_return_helper = {}; -} - -bool wholeBodyDynamics_IDLServer_getCurrentSettingsString_helper::write(yarp::os::ConnectionWriter& connection) const -{ - yarp::os::idl::WireWriter writer(connection); - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeTag("getCurrentSettingsString", 1, 1)) { - return false; - } - return true; -} - -bool wholeBodyDynamics_IDLServer_getCurrentSettingsString_helper::read(yarp::os::ConnectionReader& connection) -{ - yarp::os::idl::WireReader reader(connection); - if (!reader.readListReturn()) { - return false; - } - if (!reader.readString(s_return_helper)) { - reader.fail(); - return false; - } - return true; -} - -// Constructor -wholeBodyDynamics_IDLServer::wholeBodyDynamics_IDLServer() -{ - yarp().setOwner(*this); -} - -bool wholeBodyDynamics_IDLServer::calib(const std::string& calib_code, const std::int32_t nr_of_samples) -{ - wholeBodyDynamics_IDLServer_calib_helper helper{calib_code, nr_of_samples}; - if (!yarp().canWrite()) { - yError("Missing server method '%s'?", "bool wholeBodyDynamics_IDLServer::calib(const std::string& calib_code, const std::int32_t nr_of_samples)"); - } - bool ok = yarp().write(helper, helper); - return ok ? wholeBodyDynamics_IDLServer_calib_helper::s_return_helper : bool{}; -} - -bool wholeBodyDynamics_IDLServer::calibStanding(const std::string& calib_code, const std::int32_t nr_of_samples) -{ - wholeBodyDynamics_IDLServer_calibStanding_helper helper{calib_code, nr_of_samples}; - if (!yarp().canWrite()) { - yError("Missing server method '%s'?", "bool wholeBodyDynamics_IDLServer::calibStanding(const std::string& calib_code, const std::int32_t nr_of_samples)"); - } - bool ok = yarp().write(helper, helper); - return ok ? wholeBodyDynamics_IDLServer_calibStanding_helper::s_return_helper : bool{}; -} - -bool wholeBodyDynamics_IDLServer::calibStandingWithJetsiRonCubMk1(const std::string& calib_code, const std::int32_t nr_of_samples) -{ - wholeBodyDynamics_IDLServer_calibStandingWithJetsiRonCubMk1_helper helper{calib_code, nr_of_samples}; - if (!yarp().canWrite()) { - yError("Missing server method '%s'?", "bool wholeBodyDynamics_IDLServer::calibStandingWithJetsiRonCubMk1(const std::string& calib_code, const std::int32_t nr_of_samples)"); - } - bool ok = yarp().write(helper, helper); - return ok ? wholeBodyDynamics_IDLServer_calibStandingWithJetsiRonCubMk1_helper::s_return_helper : bool{}; -} - -bool wholeBodyDynamics_IDLServer::calibStandingLeftFoot(const std::string& calib_code, const std::int32_t nr_of_samples) -{ - wholeBodyDynamics_IDLServer_calibStandingLeftFoot_helper helper{calib_code, nr_of_samples}; - if (!yarp().canWrite()) { - yError("Missing server method '%s'?", "bool wholeBodyDynamics_IDLServer::calibStandingLeftFoot(const std::string& calib_code, const std::int32_t nr_of_samples)"); - } - bool ok = yarp().write(helper, helper); - return ok ? wholeBodyDynamics_IDLServer_calibStandingLeftFoot_helper::s_return_helper : bool{}; -} - -bool wholeBodyDynamics_IDLServer::calibStandingRightFoot(const std::string& calib_code, const std::int32_t nr_of_samples) -{ - wholeBodyDynamics_IDLServer_calibStandingRightFoot_helper helper{calib_code, nr_of_samples}; - if (!yarp().canWrite()) { - yError("Missing server method '%s'?", "bool wholeBodyDynamics_IDLServer::calibStandingRightFoot(const std::string& calib_code, const std::int32_t nr_of_samples)"); - } - bool ok = yarp().write(helper, helper); - return ok ? wholeBodyDynamics_IDLServer_calibStandingRightFoot_helper::s_return_helper : bool{}; -} - -bool wholeBodyDynamics_IDLServer::calibStandingOnOneLink(const std::string& standing_frame, const std::int32_t nr_of_samples) -{ - wholeBodyDynamics_IDLServer_calibStandingOnOneLink_helper helper{standing_frame, nr_of_samples}; - if (!yarp().canWrite()) { - yError("Missing server method '%s'?", "bool wholeBodyDynamics_IDLServer::calibStandingOnOneLink(const std::string& standing_frame, const std::int32_t nr_of_samples)"); - } - bool ok = yarp().write(helper, helper); - return ok ? wholeBodyDynamics_IDLServer_calibStandingOnOneLink_helper::s_return_helper : bool{}; -} - -bool wholeBodyDynamics_IDLServer::calibStandingOnTwoLinks(const std::string& first_standing_frame, const std::string& second_standing_frame, const std::int32_t nr_of_samples) -{ - wholeBodyDynamics_IDLServer_calibStandingOnTwoLinks_helper helper{first_standing_frame, second_standing_frame, nr_of_samples}; - if (!yarp().canWrite()) { - yError("Missing server method '%s'?", "bool wholeBodyDynamics_IDLServer::calibStandingOnTwoLinks(const std::string& first_standing_frame, const std::string& second_standing_frame, const std::int32_t nr_of_samples)"); - } - bool ok = yarp().write(helper, helper); - return ok ? wholeBodyDynamics_IDLServer_calibStandingOnTwoLinks_helper::s_return_helper : bool{}; -} - -bool wholeBodyDynamics_IDLServer::resetOffset(const std::string& calib_code) -{ - wholeBodyDynamics_IDLServer_resetOffset_helper helper{calib_code}; - if (!yarp().canWrite()) { - yError("Missing server method '%s'?", "bool wholeBodyDynamics_IDLServer::resetOffset(const std::string& calib_code)"); - } - bool ok = yarp().write(helper, helper); - return ok ? wholeBodyDynamics_IDLServer_resetOffset_helper::s_return_helper : bool{}; -} - -bool wholeBodyDynamics_IDLServer::usePreEstimatedOffset() -{ - wholeBodyDynamics_IDLServer_usePreEstimatedOffset_helper helper{}; - if (!yarp().canWrite()) { - yError("Missing server method '%s'?", "bool wholeBodyDynamics_IDLServer::usePreEstimatedOffset()"); - } - bool ok = yarp().write(helper, helper); - return ok ? wholeBodyDynamics_IDLServer_usePreEstimatedOffset_helper::s_return_helper : bool{}; -} - -bool wholeBodyDynamics_IDLServer::quit() -{ - wholeBodyDynamics_IDLServer_quit_helper helper{}; - if (!yarp().canWrite()) { - yError("Missing server method '%s'?", "bool wholeBodyDynamics_IDLServer::quit()"); - } - bool ok = yarp().write(helper, helper); - return ok ? wholeBodyDynamics_IDLServer_quit_helper::s_return_helper : bool{}; -} - -bool wholeBodyDynamics_IDLServer::resetSimpleLeggedOdometry(const std::string& initial_world_frame, const std::string& initial_fixed_link) -{ - wholeBodyDynamics_IDLServer_resetSimpleLeggedOdometry_helper helper{initial_world_frame, initial_fixed_link}; - if (!yarp().canWrite()) { - yError("Missing server method '%s'?", "bool wholeBodyDynamics_IDLServer::resetSimpleLeggedOdometry(const std::string& initial_world_frame, const std::string& initial_fixed_link)"); - } - bool ok = yarp().write(helper, helper); - return ok ? wholeBodyDynamics_IDLServer_resetSimpleLeggedOdometry_helper::s_return_helper : bool{}; -} - -bool wholeBodyDynamics_IDLServer::changeFixedLinkSimpleLeggedOdometry(const std::string& new_fixed_link) -{ - wholeBodyDynamics_IDLServer_changeFixedLinkSimpleLeggedOdometry_helper helper{new_fixed_link}; - if (!yarp().canWrite()) { - yError("Missing server method '%s'?", "bool wholeBodyDynamics_IDLServer::changeFixedLinkSimpleLeggedOdometry(const std::string& new_fixed_link)"); - } - bool ok = yarp().write(helper, helper); - return ok ? wholeBodyDynamics_IDLServer_changeFixedLinkSimpleLeggedOdometry_helper::s_return_helper : bool{}; -} - -bool wholeBodyDynamics_IDLServer::set_imuFilterCutoffInHz(const double newCutoff) -{ - wholeBodyDynamics_IDLServer_set_imuFilterCutoffInHz_helper helper{newCutoff}; - if (!yarp().canWrite()) { - yError("Missing server method '%s'?", "bool wholeBodyDynamics_IDLServer::set_imuFilterCutoffInHz(const double newCutoff)"); - } - bool ok = yarp().write(helper, helper); - return ok ? wholeBodyDynamics_IDLServer_set_imuFilterCutoffInHz_helper::s_return_helper : bool{}; -} - -double wholeBodyDynamics_IDLServer::get_imuFilterCutoffInHz() -{ - wholeBodyDynamics_IDLServer_get_imuFilterCutoffInHz_helper helper{}; - if (!yarp().canWrite()) { - yError("Missing server method '%s'?", "double wholeBodyDynamics_IDLServer::get_imuFilterCutoffInHz()"); - } - bool ok = yarp().write(helper, helper); - return ok ? wholeBodyDynamics_IDLServer_get_imuFilterCutoffInHz_helper::s_return_helper : double{}; -} - -bool wholeBodyDynamics_IDLServer::set_forceTorqueFilterCutoffInHz(const double newCutoff) -{ - wholeBodyDynamics_IDLServer_set_forceTorqueFilterCutoffInHz_helper helper{newCutoff}; - if (!yarp().canWrite()) { - yError("Missing server method '%s'?", "bool wholeBodyDynamics_IDLServer::set_forceTorqueFilterCutoffInHz(const double newCutoff)"); - } - bool ok = yarp().write(helper, helper); - return ok ? wholeBodyDynamics_IDLServer_set_forceTorqueFilterCutoffInHz_helper::s_return_helper : bool{}; -} - -double wholeBodyDynamics_IDLServer::get_forceTorqueFilterCutoffInHz() -{ - wholeBodyDynamics_IDLServer_get_forceTorqueFilterCutoffInHz_helper helper{}; - if (!yarp().canWrite()) { - yError("Missing server method '%s'?", "double wholeBodyDynamics_IDLServer::get_forceTorqueFilterCutoffInHz()"); - } - bool ok = yarp().write(helper, helper); - return ok ? wholeBodyDynamics_IDLServer_get_forceTorqueFilterCutoffInHz_helper::s_return_helper : double{}; -} - -bool wholeBodyDynamics_IDLServer::set_jointVelFilterCutoffInHz(const double newCutoff) -{ - wholeBodyDynamics_IDLServer_set_jointVelFilterCutoffInHz_helper helper{newCutoff}; - if (!yarp().canWrite()) { - yError("Missing server method '%s'?", "bool wholeBodyDynamics_IDLServer::set_jointVelFilterCutoffInHz(const double newCutoff)"); - } - bool ok = yarp().write(helper, helper); - return ok ? wholeBodyDynamics_IDLServer_set_jointVelFilterCutoffInHz_helper::s_return_helper : bool{}; -} - -double wholeBodyDynamics_IDLServer::get_jointVelFilterCutoffInHz() -{ - wholeBodyDynamics_IDLServer_get_jointVelFilterCutoffInHz_helper helper{}; - if (!yarp().canWrite()) { - yError("Missing server method '%s'?", "double wholeBodyDynamics_IDLServer::get_jointVelFilterCutoffInHz()"); - } - bool ok = yarp().write(helper, helper); - return ok ? wholeBodyDynamics_IDLServer_get_jointVelFilterCutoffInHz_helper::s_return_helper : double{}; -} - -bool wholeBodyDynamics_IDLServer::set_jointAccFilterCutoffInHz(const double newCutoff) -{ - wholeBodyDynamics_IDLServer_set_jointAccFilterCutoffInHz_helper helper{newCutoff}; - if (!yarp().canWrite()) { - yError("Missing server method '%s'?", "bool wholeBodyDynamics_IDLServer::set_jointAccFilterCutoffInHz(const double newCutoff)"); - } - bool ok = yarp().write(helper, helper); - return ok ? wholeBodyDynamics_IDLServer_set_jointAccFilterCutoffInHz_helper::s_return_helper : bool{}; -} - -double wholeBodyDynamics_IDLServer::get_jointAccFilterCutoffInHz() -{ - wholeBodyDynamics_IDLServer_get_jointAccFilterCutoffInHz_helper helper{}; - if (!yarp().canWrite()) { - yError("Missing server method '%s'?", "double wholeBodyDynamics_IDLServer::get_jointAccFilterCutoffInHz()"); - } - bool ok = yarp().write(helper, helper); - return ok ? wholeBodyDynamics_IDLServer_get_jointAccFilterCutoffInHz_helper::s_return_helper : double{}; -} - -bool wholeBodyDynamics_IDLServer::useIMUAsKinematicSource() -{ - wholeBodyDynamics_IDLServer_useIMUAsKinematicSource_helper helper{}; - if (!yarp().canWrite()) { - yError("Missing server method '%s'?", "bool wholeBodyDynamics_IDLServer::useIMUAsKinematicSource()"); - } - bool ok = yarp().write(helper, helper); - return ok ? wholeBodyDynamics_IDLServer_useIMUAsKinematicSource_helper::s_return_helper : bool{}; -} - -bool wholeBodyDynamics_IDLServer::useFixedFrameAsKinematicSource(const std::string& fixedFrame) -{ - wholeBodyDynamics_IDLServer_useFixedFrameAsKinematicSource_helper helper{fixedFrame}; - if (!yarp().canWrite()) { - yError("Missing server method '%s'?", "bool wholeBodyDynamics_IDLServer::useFixedFrameAsKinematicSource(const std::string& fixedFrame)"); - } - bool ok = yarp().write(helper, helper); - return ok ? wholeBodyDynamics_IDLServer_useFixedFrameAsKinematicSource_helper::s_return_helper : bool{}; -} - -bool wholeBodyDynamics_IDLServer::setUseOfJointVelocities(const bool enable) -{ - wholeBodyDynamics_IDLServer_setUseOfJointVelocities_helper helper{enable}; - if (!yarp().canWrite()) { - yError("Missing server method '%s'?", "bool wholeBodyDynamics_IDLServer::setUseOfJointVelocities(const bool enable)"); - } - bool ok = yarp().write(helper, helper); - return ok ? wholeBodyDynamics_IDLServer_setUseOfJointVelocities_helper::s_return_helper : bool{}; -} - -bool wholeBodyDynamics_IDLServer::setUseOfJointAccelerations(const bool enable) -{ - wholeBodyDynamics_IDLServer_setUseOfJointAccelerations_helper helper{enable}; - if (!yarp().canWrite()) { - yError("Missing server method '%s'?", "bool wholeBodyDynamics_IDLServer::setUseOfJointAccelerations(const bool enable)"); - } - bool ok = yarp().write(helper, helper); - return ok ? wholeBodyDynamics_IDLServer_setUseOfJointAccelerations_helper::s_return_helper : bool{}; -} - -std::string wholeBodyDynamics_IDLServer::getCurrentSettingsString() -{ - wholeBodyDynamics_IDLServer_getCurrentSettingsString_helper helper{}; - if (!yarp().canWrite()) { - yError("Missing server method '%s'?", "std::string wholeBodyDynamics_IDLServer::getCurrentSettingsString()"); - } - bool ok = yarp().write(helper, helper); - return ok ? wholeBodyDynamics_IDLServer_getCurrentSettingsString_helper::s_return_helper : std::string{}; -} - -// help method -std::vector wholeBodyDynamics_IDLServer::help(const std::string& functionName) -{ - bool showAll = (functionName == "--all"); - std::vector helpString; - if (showAll) { - helpString.emplace_back("*** Available commands:"); - helpString.emplace_back("calib"); - helpString.emplace_back("calibStanding"); - helpString.emplace_back("calibStandingWithJetsiRonCubMk1"); - helpString.emplace_back("calibStandingLeftFoot"); - helpString.emplace_back("calibStandingRightFoot"); - helpString.emplace_back("calibStandingOnOneLink"); - helpString.emplace_back("calibStandingOnTwoLinks"); - helpString.emplace_back("resetOffset"); - helpString.emplace_back("usePreEstimatedOffset"); - helpString.emplace_back("quit"); - helpString.emplace_back("resetSimpleLeggedOdometry"); - helpString.emplace_back("changeFixedLinkSimpleLeggedOdometry"); - helpString.emplace_back("set_imuFilterCutoffInHz"); - helpString.emplace_back("get_imuFilterCutoffInHz"); - helpString.emplace_back("set_forceTorqueFilterCutoffInHz"); - helpString.emplace_back("get_forceTorqueFilterCutoffInHz"); - helpString.emplace_back("set_jointVelFilterCutoffInHz"); - helpString.emplace_back("get_jointVelFilterCutoffInHz"); - helpString.emplace_back("set_jointAccFilterCutoffInHz"); - helpString.emplace_back("get_jointAccFilterCutoffInHz"); - helpString.emplace_back("useIMUAsKinematicSource"); - helpString.emplace_back("useFixedFrameAsKinematicSource"); - helpString.emplace_back("setUseOfJointVelocities"); - helpString.emplace_back("setUseOfJointAccelerations"); - helpString.emplace_back("getCurrentSettingsString"); - helpString.emplace_back("help"); - } else { - if (functionName == "calib") { - helpString.emplace_back("bool calib(const std::string& calib_code, const std::int32_t nr_of_samples = 100) "); - helpString.emplace_back("Calibrate the force/torque sensors "); - helpString.emplace_back("(WARNING: calibrate the sensors when the only external forces acting on the robot are on the torso/waist) "); - helpString.emplace_back("@param calib_code argument to specify the sensors to calibrate (all,arms,legs,feet) "); - helpString.emplace_back("@param nr_of_samples number of samples "); - helpString.emplace_back("@return true/false on success/failure "); - } - if (functionName == "calibStanding") { - helpString.emplace_back("bool calibStanding(const std::string& calib_code, const std::int32_t nr_of_samples = 100) "); - helpString.emplace_back("Calibrate the force/torque sensors when on double support "); - helpString.emplace_back("(WARNING: calibrate the sensors when the only external forces acting on the robot are on the sole). "); - helpString.emplace_back("For this calibration the strong assumption of symmetry of the robot and its pose is done. "); - helpString.emplace_back("@param calib_code argument to specify the sensors to calibrate (all,arms,legs,feet) "); - helpString.emplace_back("@param nr_of_samples number of samples "); - helpString.emplace_back("@return true/false on success/failure "); - } - if (functionName == "calibStandingWithJetsiRonCubMk1") { - helpString.emplace_back("bool calibStandingWithJetsiRonCubMk1(const std::string& calib_code, const std::int32_t nr_of_samples = 100) "); - helpString.emplace_back("Calibrate the force/torque sensors when on double support and with jet engines turned ON and on idle thrust "); - helpString.emplace_back("(WARNING: works only with iRonCub-Mk1). "); - helpString.emplace_back("(WARNING: calibrate the sensors when the only external forces acting on the robot are on the sole). "); - helpString.emplace_back("For this calibration the strong assumption of symmetry of the robot and its pose is done. Also, only pure forces are "); - helpString.emplace_back("assumed to be acting on the soles "); - helpString.emplace_back("@param calib_code argument to specify the sensors to calibrate (all,arms,legs,feet) "); - helpString.emplace_back("@param nr_of_samples number of samples "); - helpString.emplace_back("@return true/false on success/failure "); - } - if (functionName == "calibStandingLeftFoot") { - helpString.emplace_back("bool calibStandingLeftFoot(const std::string& calib_code, const std::int32_t nr_of_samples = 100) "); - helpString.emplace_back("Calibrate the force/torque sensors when on single support on left foot "); - helpString.emplace_back("(WARNING: calibrate the sensors when the only external forces acting on the robot are on the left sole). "); - helpString.emplace_back("@param calib_code argument to specify the sensors to calibrate (all,arms,legs,feet) "); - helpString.emplace_back("@param nr_of_samples number of samples "); - helpString.emplace_back("@return true/false on success/failure "); - } - if (functionName == "calibStandingRightFoot") { - helpString.emplace_back("bool calibStandingRightFoot(const std::string& calib_code, const std::int32_t nr_of_samples = 100) "); - helpString.emplace_back("Calibrate the force/torque sensors when on single support on right foot "); - helpString.emplace_back("(WARNING: calibrate the sensors when the only external forces acting on the robot are on the right sole). "); - helpString.emplace_back("@param calib_code argument to specify the sensors to calibrate (all,arms,legs,feet) "); - helpString.emplace_back("@param nr_of_samples number of samples "); - helpString.emplace_back("@return true/false on success/failure "); - } - if (functionName == "calibStandingOnOneLink") { - helpString.emplace_back("bool calibStandingOnOneLink(const std::string& standing_frame, const std::int32_t nr_of_samples = 100) "); - helpString.emplace_back("Calibrate the force/torque sensors offsets when the external forces are acting on only one link. "); - helpString.emplace_back("This method is typically used when the robot is standing on only one feet, "); - helpString.emplace_back("or when it is attached to a fixture that is acting on a single link (typically the chest or the waist). "); - helpString.emplace_back("@note This method calibrates the offsets of all the force-torque sensors. "); - helpString.emplace_back("@param standing_frame a frame belonging to the link on which it is assumed that external forces are acting. "); - helpString.emplace_back("@param nr_of_samples number of samples to use for calibration. "); - helpString.emplace_back("@return true/false on success/failure. "); - } - if (functionName == "calibStandingOnTwoLinks") { - helpString.emplace_back("bool calibStandingOnTwoLinks(const std::string& first_standing_frame, const std::string& second_standing_frame, const std::int32_t nr_of_samples = 100) "); - helpString.emplace_back("Calibrate the force/torque sensors offsets when the external forces are acting on only two links. "); - helpString.emplace_back("This method is not in general guaranteed to work, and it works in practice only when the robot and its internal "); - helpString.emplace_back("forces are symmetric w.r.t. the two contact links. Note that the value obtaiend from this calibration depend "); - helpString.emplace_back("on the location of the origin of the specific frames of the contact links used for the calibration. "); - helpString.emplace_back("@note This method calibrates the offsets of all the force-torque sensors. "); - helpString.emplace_back("@param first_standing_frame a frame belonging to one of the two links on which it is assumed that tue external forces are acting. "); - helpString.emplace_back("@param second_standing_frame a frame belonging to the other link on which it is assumed that tue external forces are acting. "); - helpString.emplace_back("@param nr_of_samples number of samples "); - helpString.emplace_back("@return true/false on success/failure "); - } - if (functionName == "resetOffset") { - helpString.emplace_back("bool resetOffset(const std::string& calib_code) "); - helpString.emplace_back("Reset the sensor offset to 0 0 0 0 0 0 (six zeros). "); - helpString.emplace_back("@param calib_code argument to specify the sensors to reset (all,arms,legs,feet) "); - helpString.emplace_back("@return true/false on success/failure "); - } - if (functionName == "usePreEstimatedOffset") { - helpString.emplace_back("bool usePreEstimatedOffset() "); - helpString.emplace_back("Use the offline estimated offset of the sensor. "); - helpString.emplace_back("Only sensors with a specified offset in configuration file are affected by this method.s "); - helpString.emplace_back("@return true/false on success/failure "); - } - if (functionName == "quit") { - helpString.emplace_back("bool quit() "); - helpString.emplace_back("Quit the module. "); - helpString.emplace_back("@return true/false on success/failure "); - } - if (functionName == "resetSimpleLeggedOdometry") { - helpString.emplace_back("bool resetSimpleLeggedOdometry(const std::string& initial_world_frame, const std::string& initial_fixed_link) "); - helpString.emplace_back("Reset the odometry world to be (initially) a frame specified in the robot model, "); - helpString.emplace_back("and specify a link that is assumed to be fixed in the odometry. "); - helpString.emplace_back("@param initial_world_frame the frame of the robot model that is assume to be initially "); - helpString.emplace_back(" coincident with the world/inertial frame. "); - helpString.emplace_back("@param new_fixed_link the name of the link that should be initially fixed "); - helpString.emplace_back("@return true/false on success/failure (typically if the frame/link names are wrong) "); - } - if (functionName == "changeFixedLinkSimpleLeggedOdometry") { - helpString.emplace_back("bool changeFixedLinkSimpleLeggedOdometry(const std::string& new_fixed_link) "); - helpString.emplace_back("Change the link that is considered fixed by the odometry. "); - helpString.emplace_back("@param new_fixed_link the name of the new link that should be considered fixed "); - helpString.emplace_back("@return true/false on success/failure (typically if the frame/link names are wrong) "); - } - if (functionName == "set_imuFilterCutoffInHz") { - helpString.emplace_back("bool set_imuFilterCutoffInHz(const double newCutoff) "); - helpString.emplace_back("Set the cutoff frequency (in Hz) for IMU measurements "); - helpString.emplace_back("@return true/false on success/failure "); - } - if (functionName == "get_imuFilterCutoffInHz") { - helpString.emplace_back("double get_imuFilterCutoffInHz() "); - helpString.emplace_back("Get the cutoff frequency (in Hz) for IMU measurements "); - helpString.emplace_back("@return the cutoff frequency (in Hz) "); - } - if (functionName == "set_forceTorqueFilterCutoffInHz") { - helpString.emplace_back("bool set_forceTorqueFilterCutoffInHz(const double newCutoff) "); - helpString.emplace_back("Set the cutoff frequency (in Hz) for FT measurements "); - helpString.emplace_back("@return true/false on success/failure "); - } - if (functionName == "get_forceTorqueFilterCutoffInHz") { - helpString.emplace_back("double get_forceTorqueFilterCutoffInHz() "); - helpString.emplace_back("Get the cutoff frequency (in Hz) for FT measurements "); - helpString.emplace_back("@return the cutoff frequency (in Hz) "); - } - if (functionName == "set_jointVelFilterCutoffInHz") { - helpString.emplace_back("bool set_jointVelFilterCutoffInHz(const double newCutoff) "); - helpString.emplace_back("Set the cutoff frequency (in Hz) for joint velocities measurements "); - helpString.emplace_back("@return true/false on success/failure "); - } - if (functionName == "get_jointVelFilterCutoffInHz") { - helpString.emplace_back("double get_jointVelFilterCutoffInHz() "); - helpString.emplace_back("Get the cutoff frequency (in Hz) for joint velocities measurements "); - helpString.emplace_back("@return the cutoff frequency (in Hz) "); - } - if (functionName == "set_jointAccFilterCutoffInHz") { - helpString.emplace_back("bool set_jointAccFilterCutoffInHz(const double newCutoff) "); - helpString.emplace_back("Set the cutoff frequency (in Hz) for joint acceleration measurements "); - helpString.emplace_back("@return true/false on success/failure "); - } - if (functionName == "get_jointAccFilterCutoffInHz") { - helpString.emplace_back("double get_jointAccFilterCutoffInHz() "); - helpString.emplace_back("Get the cutoff frequency (in Hz) for joint acceleration measurements "); - helpString.emplace_back("@return the cutoff frequency (in Hz) "); - } - if (functionName == "useIMUAsKinematicSource") { - helpString.emplace_back("bool useIMUAsKinematicSource() "); - helpString.emplace_back("Use the IMU as the kinematic source of "); - helpString.emplace_back("information for the acceleration of one link. "); - } - if (functionName == "useFixedFrameAsKinematicSource") { - helpString.emplace_back("bool useFixedFrameAsKinematicSource(const std::string& fixedFrame) "); - helpString.emplace_back("Use a fixed frame (tipically root_link, l_sole or r_sole) "); - helpString.emplace_back("as the source of kinematic information. The assumption "); - helpString.emplace_back("is that the specified frame will remain fixed until "); - helpString.emplace_back("the kinematic source is changing, and the gravity "); - helpString.emplace_back("on this link is specified by the fixedFrameGravity (tipically "); - helpString.emplace_back("set to (0,0,-9.81) . "); - } - if (functionName == "setUseOfJointVelocities") { - helpString.emplace_back("bool setUseOfJointVelocities(const bool enable) "); - helpString.emplace_back("Set if to use or not the joint velocities in estimation. "); - } - if (functionName == "setUseOfJointAccelerations") { - helpString.emplace_back("bool setUseOfJointAccelerations(const bool enable) "); - helpString.emplace_back("Set if to use or not the joint velocities in estimation. "); - } - if (functionName == "getCurrentSettingsString") { - helpString.emplace_back("std::string getCurrentSettingsString() "); - helpString.emplace_back("Get the current settings in the form of a string. "); - helpString.emplace_back("@return the current settings as a human readable string. "); - } - if (functionName == "help") { - helpString.emplace_back("std::vector help(const std::string& functionName = \"--all\")"); - helpString.emplace_back("Return list of available commands, or help message for a specific function"); - helpString.emplace_back("@param functionName name of command for which to get a detailed description. If none or '--all' is provided, print list of available commands"); - helpString.emplace_back("@return list of strings (one string per line)"); - } - } - if (helpString.empty()) { - helpString.emplace_back("Command not found"); - } - return helpString; -} - -// read from ConnectionReader -bool wholeBodyDynamics_IDLServer::read(yarp::os::ConnectionReader& connection) -{ - yarp::os::idl::WireReader reader(connection); - reader.expectAccept(); - if (!reader.readListHeader()) { - reader.fail(); - return false; - } - - std::string tag = reader.readTag(); - bool direct = (tag == "__direct__"); - if (direct) { - tag = reader.readTag(); - } - while (!reader.isError()) { - if (tag == "calib") { - std::string calib_code; - std::int32_t nr_of_samples; - if (!reader.readString(calib_code)) { - reader.fail(); - return false; - } - if (!reader.readI32(nr_of_samples)) { - nr_of_samples = 100; - } - wholeBodyDynamics_IDLServer_calib_helper::s_return_helper = calib(calib_code, nr_of_samples); - yarp::os::idl::WireWriter writer(reader); - if (!writer.isNull()) { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeBool(wholeBodyDynamics_IDLServer_calib_helper::s_return_helper)) { - return false; - } - } - reader.accept(); - return true; - } - if (tag == "calibStanding") { - std::string calib_code; - std::int32_t nr_of_samples; - if (!reader.readString(calib_code)) { - reader.fail(); - return false; - } - if (!reader.readI32(nr_of_samples)) { - nr_of_samples = 100; - } - wholeBodyDynamics_IDLServer_calibStanding_helper::s_return_helper = calibStanding(calib_code, nr_of_samples); - yarp::os::idl::WireWriter writer(reader); - if (!writer.isNull()) { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeBool(wholeBodyDynamics_IDLServer_calibStanding_helper::s_return_helper)) { - return false; - } - } - reader.accept(); - return true; - } - if (tag == "calibStandingWithJetsiRonCubMk1") { - std::string calib_code; - std::int32_t nr_of_samples; - if (!reader.readString(calib_code)) { - reader.fail(); - return false; - } - if (!reader.readI32(nr_of_samples)) { - nr_of_samples = 100; - } - wholeBodyDynamics_IDLServer_calibStandingWithJetsiRonCubMk1_helper::s_return_helper = calibStandingWithJetsiRonCubMk1(calib_code, nr_of_samples); - yarp::os::idl::WireWriter writer(reader); - if (!writer.isNull()) { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeBool(wholeBodyDynamics_IDLServer_calibStandingWithJetsiRonCubMk1_helper::s_return_helper)) { - return false; - } - } - reader.accept(); - return true; - } - if (tag == "calibStandingLeftFoot") { - std::string calib_code; - std::int32_t nr_of_samples; - if (!reader.readString(calib_code)) { - reader.fail(); - return false; - } - if (!reader.readI32(nr_of_samples)) { - nr_of_samples = 100; - } - wholeBodyDynamics_IDLServer_calibStandingLeftFoot_helper::s_return_helper = calibStandingLeftFoot(calib_code, nr_of_samples); - yarp::os::idl::WireWriter writer(reader); - if (!writer.isNull()) { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeBool(wholeBodyDynamics_IDLServer_calibStandingLeftFoot_helper::s_return_helper)) { - return false; - } - } - reader.accept(); - return true; - } - if (tag == "calibStandingRightFoot") { - std::string calib_code; - std::int32_t nr_of_samples; - if (!reader.readString(calib_code)) { - reader.fail(); - return false; - } - if (!reader.readI32(nr_of_samples)) { - nr_of_samples = 100; - } - wholeBodyDynamics_IDLServer_calibStandingRightFoot_helper::s_return_helper = calibStandingRightFoot(calib_code, nr_of_samples); - yarp::os::idl::WireWriter writer(reader); - if (!writer.isNull()) { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeBool(wholeBodyDynamics_IDLServer_calibStandingRightFoot_helper::s_return_helper)) { - return false; - } - } - reader.accept(); - return true; - } - if (tag == "calibStandingOnOneLink") { - std::string standing_frame; - std::int32_t nr_of_samples; - if (!reader.readString(standing_frame)) { - reader.fail(); - return false; - } - if (!reader.readI32(nr_of_samples)) { - nr_of_samples = 100; - } - wholeBodyDynamics_IDLServer_calibStandingOnOneLink_helper::s_return_helper = calibStandingOnOneLink(standing_frame, nr_of_samples); - yarp::os::idl::WireWriter writer(reader); - if (!writer.isNull()) { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeBool(wholeBodyDynamics_IDLServer_calibStandingOnOneLink_helper::s_return_helper)) { - return false; - } - } - reader.accept(); - return true; - } - if (tag == "calibStandingOnTwoLinks") { - std::string first_standing_frame; - std::string second_standing_frame; - std::int32_t nr_of_samples; - if (!reader.readString(first_standing_frame)) { - reader.fail(); - return false; - } - if (!reader.readString(second_standing_frame)) { - reader.fail(); - return false; - } - if (!reader.readI32(nr_of_samples)) { - nr_of_samples = 100; - } - wholeBodyDynamics_IDLServer_calibStandingOnTwoLinks_helper::s_return_helper = calibStandingOnTwoLinks(first_standing_frame, second_standing_frame, nr_of_samples); - yarp::os::idl::WireWriter writer(reader); - if (!writer.isNull()) { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeBool(wholeBodyDynamics_IDLServer_calibStandingOnTwoLinks_helper::s_return_helper)) { - return false; - } - } - reader.accept(); - return true; - } - if (tag == "resetOffset") { - std::string calib_code; - if (!reader.readString(calib_code)) { - reader.fail(); - return false; - } - wholeBodyDynamics_IDLServer_resetOffset_helper::s_return_helper = resetOffset(calib_code); - yarp::os::idl::WireWriter writer(reader); - if (!writer.isNull()) { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeBool(wholeBodyDynamics_IDLServer_resetOffset_helper::s_return_helper)) { - return false; - } - } - reader.accept(); - return true; - } - if (tag == "usePreEstimatedOffset") { - wholeBodyDynamics_IDLServer_usePreEstimatedOffset_helper::s_return_helper = usePreEstimatedOffset(); - yarp::os::idl::WireWriter writer(reader); - if (!writer.isNull()) { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeBool(wholeBodyDynamics_IDLServer_usePreEstimatedOffset_helper::s_return_helper)) { - return false; - } - } - reader.accept(); - return true; - } - if (tag == "quit") { - wholeBodyDynamics_IDLServer_quit_helper::s_return_helper = quit(); - yarp::os::idl::WireWriter writer(reader); - if (!writer.isNull()) { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeBool(wholeBodyDynamics_IDLServer_quit_helper::s_return_helper)) { - return false; - } - } - reader.accept(); - return true; - } - if (tag == "resetSimpleLeggedOdometry") { - std::string initial_world_frame; - std::string initial_fixed_link; - if (!reader.readString(initial_world_frame)) { - reader.fail(); - return false; - } - if (!reader.readString(initial_fixed_link)) { - reader.fail(); - return false; - } - wholeBodyDynamics_IDLServer_resetSimpleLeggedOdometry_helper::s_return_helper = resetSimpleLeggedOdometry(initial_world_frame, initial_fixed_link); - yarp::os::idl::WireWriter writer(reader); - if (!writer.isNull()) { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeBool(wholeBodyDynamics_IDLServer_resetSimpleLeggedOdometry_helper::s_return_helper)) { - return false; - } - } - reader.accept(); - return true; - } - if (tag == "changeFixedLinkSimpleLeggedOdometry") { - std::string new_fixed_link; - if (!reader.readString(new_fixed_link)) { - reader.fail(); - return false; - } - wholeBodyDynamics_IDLServer_changeFixedLinkSimpleLeggedOdometry_helper::s_return_helper = changeFixedLinkSimpleLeggedOdometry(new_fixed_link); - yarp::os::idl::WireWriter writer(reader); - if (!writer.isNull()) { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeBool(wholeBodyDynamics_IDLServer_changeFixedLinkSimpleLeggedOdometry_helper::s_return_helper)) { - return false; - } - } - reader.accept(); - return true; - } - if (tag == "set_imuFilterCutoffInHz") { - double newCutoff; - if (!reader.readFloat64(newCutoff)) { - reader.fail(); - return false; - } - wholeBodyDynamics_IDLServer_set_imuFilterCutoffInHz_helper::s_return_helper = set_imuFilterCutoffInHz(newCutoff); - yarp::os::idl::WireWriter writer(reader); - if (!writer.isNull()) { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeBool(wholeBodyDynamics_IDLServer_set_imuFilterCutoffInHz_helper::s_return_helper)) { - return false; - } - } - reader.accept(); - return true; - } - if (tag == "get_imuFilterCutoffInHz") { - wholeBodyDynamics_IDLServer_get_imuFilterCutoffInHz_helper::s_return_helper = get_imuFilterCutoffInHz(); - yarp::os::idl::WireWriter writer(reader); - if (!writer.isNull()) { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeFloat64(wholeBodyDynamics_IDLServer_get_imuFilterCutoffInHz_helper::s_return_helper)) { - return false; - } - } - reader.accept(); - return true; - } - if (tag == "set_forceTorqueFilterCutoffInHz") { - double newCutoff; - if (!reader.readFloat64(newCutoff)) { - reader.fail(); - return false; - } - wholeBodyDynamics_IDLServer_set_forceTorqueFilterCutoffInHz_helper::s_return_helper = set_forceTorqueFilterCutoffInHz(newCutoff); - yarp::os::idl::WireWriter writer(reader); - if (!writer.isNull()) { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeBool(wholeBodyDynamics_IDLServer_set_forceTorqueFilterCutoffInHz_helper::s_return_helper)) { - return false; - } - } - reader.accept(); - return true; - } - if (tag == "get_forceTorqueFilterCutoffInHz") { - wholeBodyDynamics_IDLServer_get_forceTorqueFilterCutoffInHz_helper::s_return_helper = get_forceTorqueFilterCutoffInHz(); - yarp::os::idl::WireWriter writer(reader); - if (!writer.isNull()) { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeFloat64(wholeBodyDynamics_IDLServer_get_forceTorqueFilterCutoffInHz_helper::s_return_helper)) { - return false; - } - } - reader.accept(); - return true; - } - if (tag == "set_jointVelFilterCutoffInHz") { - double newCutoff; - if (!reader.readFloat64(newCutoff)) { - reader.fail(); - return false; - } - wholeBodyDynamics_IDLServer_set_jointVelFilterCutoffInHz_helper::s_return_helper = set_jointVelFilterCutoffInHz(newCutoff); - yarp::os::idl::WireWriter writer(reader); - if (!writer.isNull()) { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeBool(wholeBodyDynamics_IDLServer_set_jointVelFilterCutoffInHz_helper::s_return_helper)) { - return false; - } - } - reader.accept(); - return true; - } - if (tag == "get_jointVelFilterCutoffInHz") { - wholeBodyDynamics_IDLServer_get_jointVelFilterCutoffInHz_helper::s_return_helper = get_jointVelFilterCutoffInHz(); - yarp::os::idl::WireWriter writer(reader); - if (!writer.isNull()) { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeFloat64(wholeBodyDynamics_IDLServer_get_jointVelFilterCutoffInHz_helper::s_return_helper)) { - return false; - } - } - reader.accept(); - return true; - } - if (tag == "set_jointAccFilterCutoffInHz") { - double newCutoff; - if (!reader.readFloat64(newCutoff)) { - reader.fail(); - return false; - } - wholeBodyDynamics_IDLServer_set_jointAccFilterCutoffInHz_helper::s_return_helper = set_jointAccFilterCutoffInHz(newCutoff); - yarp::os::idl::WireWriter writer(reader); - if (!writer.isNull()) { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeBool(wholeBodyDynamics_IDLServer_set_jointAccFilterCutoffInHz_helper::s_return_helper)) { - return false; - } - } - reader.accept(); - return true; - } - if (tag == "get_jointAccFilterCutoffInHz") { - wholeBodyDynamics_IDLServer_get_jointAccFilterCutoffInHz_helper::s_return_helper = get_jointAccFilterCutoffInHz(); - yarp::os::idl::WireWriter writer(reader); - if (!writer.isNull()) { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeFloat64(wholeBodyDynamics_IDLServer_get_jointAccFilterCutoffInHz_helper::s_return_helper)) { - return false; - } - } - reader.accept(); - return true; - } - if (tag == "useIMUAsKinematicSource") { - wholeBodyDynamics_IDLServer_useIMUAsKinematicSource_helper::s_return_helper = useIMUAsKinematicSource(); - yarp::os::idl::WireWriter writer(reader); - if (!writer.isNull()) { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeBool(wholeBodyDynamics_IDLServer_useIMUAsKinematicSource_helper::s_return_helper)) { - return false; - } - } - reader.accept(); - return true; - } - if (tag == "useFixedFrameAsKinematicSource") { - std::string fixedFrame; - if (!reader.readString(fixedFrame)) { - reader.fail(); - return false; - } - wholeBodyDynamics_IDLServer_useFixedFrameAsKinematicSource_helper::s_return_helper = useFixedFrameAsKinematicSource(fixedFrame); - yarp::os::idl::WireWriter writer(reader); - if (!writer.isNull()) { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeBool(wholeBodyDynamics_IDLServer_useFixedFrameAsKinematicSource_helper::s_return_helper)) { - return false; - } - } - reader.accept(); - return true; - } - if (tag == "setUseOfJointVelocities") { - bool enable; - if (!reader.readBool(enable)) { - reader.fail(); - return false; - } - wholeBodyDynamics_IDLServer_setUseOfJointVelocities_helper::s_return_helper = setUseOfJointVelocities(enable); - yarp::os::idl::WireWriter writer(reader); - if (!writer.isNull()) { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeBool(wholeBodyDynamics_IDLServer_setUseOfJointVelocities_helper::s_return_helper)) { - return false; - } - } - reader.accept(); - return true; - } - if (tag == "setUseOfJointAccelerations") { - bool enable; - if (!reader.readBool(enable)) { - reader.fail(); - return false; - } - wholeBodyDynamics_IDLServer_setUseOfJointAccelerations_helper::s_return_helper = setUseOfJointAccelerations(enable); - yarp::os::idl::WireWriter writer(reader); - if (!writer.isNull()) { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeBool(wholeBodyDynamics_IDLServer_setUseOfJointAccelerations_helper::s_return_helper)) { - return false; - } - } - reader.accept(); - return true; - } - if (tag == "getCurrentSettingsString") { - wholeBodyDynamics_IDLServer_getCurrentSettingsString_helper::s_return_helper = getCurrentSettingsString(); - yarp::os::idl::WireWriter writer(reader); - if (!writer.isNull()) { - if (!writer.writeListHeader(1)) { - return false; - } - if (!writer.writeString(wholeBodyDynamics_IDLServer_getCurrentSettingsString_helper::s_return_helper)) { - return false; - } - } - reader.accept(); - return true; - } - if (tag == "help") { - std::string functionName; - if (!reader.readString(functionName)) { - functionName = "--all"; - } - auto help_strings = help(functionName); - yarp::os::idl::WireWriter writer(reader); - if (!writer.isNull()) { - if (!writer.writeListHeader(2)) { - return false; - } - if (!writer.writeTag("many", 1, 0)) { - return false; - } - if (!writer.writeListBegin(BOTTLE_TAG_INT32, static_cast(help_strings.size()))) { - return false; - } - for (const auto& help_string : help_strings) { - if (!writer.writeString(help_string)) { - return false; - } - } - if (!writer.writeListEnd()) { - return false; - } - } - reader.accept(); - return true; - } - if (reader.noMore()) { - reader.fail(); - return false; - } - std::string next_tag = reader.readTag(); - if (next_tag == "") { - break; - } - tag.append("_").append(next_tag); - } - return false; -} diff --git a/idl/wholeBodyDynamics_IDLServer/autogenerated/wholeBodyDynamics_IDLServer_index.txt b/idl/wholeBodyDynamics_IDLServer/autogenerated/wholeBodyDynamics_IDLServer_index.txt deleted file mode 100644 index a45c9e0..0000000 --- a/idl/wholeBodyDynamics_IDLServer/autogenerated/wholeBodyDynamics_IDLServer_index.txt +++ /dev/null @@ -1,2 +0,0 @@ -include/wholeBodyDynamics_IDLServer.h -src/wholeBodyDynamics_IDLServer.cpp diff --git a/idl/wholeBodyDynamics_IDLServer/autogenerated/wholeBodyDynamics_IDLServer_thrift.cmake b/idl/wholeBodyDynamics_IDLServer/autogenerated/wholeBodyDynamics_IDLServer_thrift.cmake deleted file mode 100644 index 4c08752..0000000 --- a/idl/wholeBodyDynamics_IDLServer/autogenerated/wholeBodyDynamics_IDLServer_thrift.cmake +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) -# All rights reserved. -# -# This software may be modified and distributed under the terms of the -# BSD-3-Clause license. See the accompanying LICENSE file for details. - -## This is an automatically-generated file. -## It could get re-generated if the ALLOW_IDL_GENERATION flag is on - -set(headers include/wholeBodyDynamics_IDLServer.h) -set(sources src/wholeBodyDynamics_IDLServer.cpp)