Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update nws/nwc naming convention #367

Merged
merged 15 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed
- Naming convention from `wrapper`\ `server` to `nws`\ `nwc` (https://github.com/robotology/human-dynamics-estimation/pull/367).

## [2.9.0] - 2023-10-17

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ add_subdirectory(msgs)
add_subdirectory(interfaces)
add_subdirectory(devices)
add_subdirectory(modules)
add_subdirectory(wrappers)
add_subdirectory(remappers)
add_subdirectory(servers)
add_subdirectory(clients)
add_subdirectory(publishers)
add_subdirectory(HumanDynamicsEstimationLibrary)

Expand Down
7 changes: 7 additions & 0 deletions clients/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# SPDX-FileCopyrightText: Fondazione Istituto Italiano di Tecnologia (IIT)
# SPDX-License-Identifier: BSD-3-Clause

add_subdirectory(HumanState_nwc_yarp)
add_subdirectory(HumanDynamics_nwc_yarp)
add_subdirectory(HumanWrench_nwc_yarp)
add_subdirectory(WearableTargets_nwc_yarp)
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
# SPDX-FileCopyrightText: Fondazione Istituto Italiano di Tecnologia (IIT)
# SPDX-License-Identifier: BSD-3-Clause

yarp_prepare_plugin(human_dynamics_remapper
TYPE hde::devices::HumanDynamicsRemapper
INCLUDE HumanDynamicsRemapper.h
yarp_prepare_plugin(human_dynamics_nwc_yarp
TYPE hde::devices::HumanDynamics_nwc_yarp
INCLUDE HumanDynamics_nwc_yarp.h
CATEGORY device
ADVANCED
DEFAULT ON)

yarp_add_plugin(HumanDynamicsRemapper
HumanDynamicsRemapper.cpp
HumanDynamicsRemapper.h)
yarp_add_plugin(HumanDynamics_nwc_yarp
HumanDynamics_nwc_yarp.cpp
HumanDynamics_nwc_yarp.h)

target_include_directories(HumanDynamicsRemapper PUBLIC
target_include_directories(HumanDynamics_nwc_yarp PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)

target_link_libraries(HumanDynamicsRemapper PUBLIC
target_link_libraries(HumanDynamics_nwc_yarp PUBLIC
IHumanDynamics
HumanDynamicsMsg
YARP::YARP_OS
YARP::YARP_dev
YARP::YARP_init)

yarp_install(
TARGETS HumanDynamicsRemapper
TARGETS HumanDynamics_nwc_yarp
COMPONENT runtime
LIBRARY DESTINATION ${YARP_DYNAMIC_PLUGINS_INSTALL_DIR}
ARCHIVE DESTINATION ${YARP_STATIC_PLUGINS_INSTALL_DIR}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: Fondazione Istituto Italiano di Tecnologia (IIT)
// SPDX-License-Identifier: BSD-3-Clause

#include "HumanDynamicsRemapper.h"
#include "HumanDynamics_nwc_yarp.h"

#include <hde/msgs/HumanDynamics.h>

Expand All @@ -11,16 +11,16 @@
#include <iostream>
#include <mutex>

const std::string RemapperName = "HumanDynamicsRemapper";
const std::string LogPrefix = RemapperName + " :";
const std::string ClientName = "HumanDynamics_nwc_yarp";
const std::string LogPrefix = ClientName + " :";

using namespace hde::devices;

// ==============
// IMPL AND UTILS
// ==============

class HumanDynamicsRemapper::impl
class HumanDynamics_nwc_yarp::impl
{
public:
std::mutex mtx;
Expand All @@ -34,18 +34,18 @@ class HumanDynamicsRemapper::impl
};

// =======================
// IHUMANDYNAMICS REMAPPER
// IHUMANDYNAMICS CLIENT
// =======================

HumanDynamicsRemapper::HumanDynamicsRemapper()
HumanDynamics_nwc_yarp::HumanDynamics_nwc_yarp()
: PeriodicThread(1)
, pImpl{new impl()}
{}

HumanDynamicsRemapper::~HumanDynamicsRemapper() = default;
HumanDynamics_nwc_yarp::~HumanDynamics_nwc_yarp() = default;

// parsing the configuration file and connect ports
bool HumanDynamicsRemapper::open(yarp::os::Searchable& config)
bool HumanDynamics_nwc_yarp::open(yarp::os::Searchable& config)
{
// ===============================
// CHECK THE CONFIGURATION OPTIONS
Expand Down Expand Up @@ -103,10 +103,10 @@ bool HumanDynamicsRemapper::open(yarp::os::Searchable& config)
return true;
}

void HumanDynamicsRemapper::threadRelease()
void HumanDynamics_nwc_yarp::threadRelease()
{}

bool HumanDynamicsRemapper::close()
bool HumanDynamics_nwc_yarp::close()
{
pImpl->terminationCall = true;

Expand All @@ -117,13 +117,13 @@ bool HumanDynamicsRemapper::close()
return true;
}

void HumanDynamicsRemapper::run()
void HumanDynamics_nwc_yarp::run()
{
return;
}

// data are read from the port and saved in buffer variables
void HumanDynamicsRemapper::onRead(hde::msgs::HumanDynamics& humanDynamicsData)
void HumanDynamics_nwc_yarp::onRead(hde::msgs::HumanDynamics& humanDynamicsData)
{
std::lock_guard<std::mutex> lock(pImpl->mtx);
if(!pImpl->terminationCall) {
Expand All @@ -134,19 +134,19 @@ void HumanDynamicsRemapper::onRead(hde::msgs::HumanDynamics& humanDynamicsData)
}

// method of IHumanDynamics interface expose the buffer variables data
std::vector<std::string> HumanDynamicsRemapper::getJointNames() const
std::vector<std::string> HumanDynamics_nwc_yarp::getJointNames() const
{
std::lock_guard<std::mutex> lock(pImpl->mtx);
return pImpl->jointNames;
}

size_t HumanDynamicsRemapper::getNumberOfJoints() const
size_t HumanDynamics_nwc_yarp::getNumberOfJoints() const
{
std::lock_guard<std::mutex> lock(pImpl->mtx);
return pImpl->jointTorques.size();
}

std::vector<double> HumanDynamicsRemapper::getJointTorques() const
std::vector<double> HumanDynamics_nwc_yarp::getJointTorques() const
{
std::lock_guard<std::mutex> lock(pImpl->mtx);
return pImpl->jointTorques;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-FileCopyrightText: Fondazione Istituto Italiano di Tecnologia (IIT)
// SPDX-License-Identifier: BSD-3-Clause

#ifndef HDE_DEVICES_HUMANDYNAMICSREMAPPER
#define HDE_DEVICES_HUMANDYNAMICSREMAPPER
#ifndef HDE_DEVICES_HUMANDYNAMICS_NEC_YARP
#define HDE_DEVICES_HUMANDYNAMICS_NEC_YARP

#include <hde/interfaces/IHumanDynamics.h>

Expand All @@ -17,10 +17,10 @@ namespace hde::msgs {
class HumanDynamics;
} // namespace hde::msgs
namespace hde::devices {
class HumanDynamicsRemapper;
class HumanDynamics_nwc_yarp;
} // namespace hde::devices

class hde::devices::HumanDynamicsRemapper final
class hde::devices::HumanDynamics_nwc_yarp final
: public yarp::dev::DeviceDriver
// inherite from the interface to be exposed
, public hde::interfaces::IHumanDynamics
Expand All @@ -34,8 +34,8 @@ class hde::devices::HumanDynamicsRemapper final
std::unique_ptr<impl> pImpl;

public:
HumanDynamicsRemapper();
~HumanDynamicsRemapper() override;
HumanDynamics_nwc_yarp();
~HumanDynamics_nwc_yarp() override;



Expand All @@ -58,5 +58,5 @@ class hde::devices::HumanDynamicsRemapper final
std::vector<double> getJointTorques() const override;
};

#endif // HDE_DEVICES_HUMANDYNAMICSREMAPPER
#endif // HDE_DEVICES_HUMANDYNAMICS_NEC_YARP

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE robot PUBLIC "-//YARP//DTD yarprobotinterface 3.0//EN" "http://www.yarp.it/DTD/yarprobotinterfaceV3.0.dtd">
<robot name="Human-Dynamics-Client" build=0 portprefix="">


<device type="human_dynamics_nwc_yarp" name="HumanDynamics_nwc_yarp">
<param name="humanDynamicsDataPort">/HDE/HumanDynamics_nws_yarp/torques:o</param>
</device>



</robot>
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
# SPDX-FileCopyrightText: Fondazione Istituto Italiano di Tecnologia (IIT)
# SPDX-License-Identifier: BSD-3-Clause

yarp_prepare_plugin(human_state_wrapper
TYPE hde::wrappers::HumanStateWrapper
INCLUDE HumanStateWrapper.h
yarp_prepare_plugin(human_state_nwc_yarp
TYPE hde::devices::HumanState_nwc_yarp
INCLUDE HumanState_nwc_yarp.h
CATEGORY device
ADVANCED
DEFAULT ON)

yarp_add_plugin(HumanStateWrapper
HumanStateWrapper.cpp
HumanStateWrapper.h)
yarp_add_plugin(HumanState_nwc_yarp
HumanState_nwc_yarp.cpp
HumanState_nwc_yarp.h)

target_include_directories(HumanStateWrapper PUBLIC
target_include_directories(HumanState_nwc_yarp PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)

target_link_libraries(HumanStateWrapper PUBLIC
target_link_libraries(HumanState_nwc_yarp PUBLIC
IHumanState
HumanStateMsg
YARP::YARP_OS
YARP::YARP_dev
YARP::YARP_init)

yarp_install(
TARGETS HumanStateWrapper
TARGETS HumanState_nwc_yarp
COMPONENT runtime
LIBRARY DESTINATION ${YARP_DYNAMIC_PLUGINS_INSTALL_DIR}
ARCHIVE DESTINATION ${YARP_STATIC_PLUGINS_INSTALL_DIR}
Expand Down
Loading
Loading