Skip to content

Commit

Permalink
Merge branch 'master' into update_HumanLogger
Browse files Browse the repository at this point in the history
  • Loading branch information
davidegorbani authored Oct 30, 2023
2 parents 4c07913 + 77c7a02 commit 1f4cb8b
Show file tree
Hide file tree
Showing 83 changed files with 652 additions and 596 deletions.
56 changes: 8 additions & 48 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ on:
- cron: '0 2 * * *'

env:
vcpkg_robotology_TAG: v0.10.1
YCM_TAG: v0.15.3
YARP_TAG: v3.8.1
iDynTree_TAG: v9.0.0
Expand All @@ -23,8 +22,6 @@ env:
OsqpEigen_TAG: v0.8.1
matioCpp_TAG: v0.2.2
robometry_TAG: v1.2.1
# Overwrite the VCPKG_INSTALLATION_ROOT env variable defined by Github Actions to point to our vcpkg
VCPKG_INSTALLATION_ROOT: C:\robotology\vcpkg

jobs:
build:
Expand All @@ -40,38 +37,22 @@ jobs:
# Clone the repository in $GITHUB_WORKSPACE
- uses: actions/checkout@master

# Use conda for Windows dependencies
- uses: conda-incubator/setup-miniconda@v2
if: contains(matrix.os, 'windows')
# Use mamba for Windows dependencies
- uses: mamba-org/setup-micromamba@v1
if: matrix.os == 'windows-latest' || matrix.os == 'macOS-latest'
with:
mamba-version: "*"
channels: conda-forge,robotology,defaults
environment-file: ci_env.yml
channel-priority: true
environment: human-dynamics-estimation
python-version: 3.8

# Print the environment variables to simplify development and debugging
- name: Environment Variables
# Use bash in order to have same basic commands in all OSs
if: matrix.os == 'ubuntu-latest'
shell: bash
run: env

# Remove apt repos on Ubuntu that are known to break from time to time
# See https://github.com/actions/virtual-environments/issues/323
- name: Remove broken apt repos [Ubuntu]
if: matrix.os == 'ubuntu-latest'
run: |
for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done

# ============
# DEPENDENCIES
# ============


- name: Dependencies [macOS]
if: matrix.os == 'macOS-latest'
run: |
brew install ccache eigen ace tinyxml gsl irrlicht libmatio boost glfw sdl2

- name: Dependencies [Ubuntu]
if: matrix.os == 'ubuntu-latest'
Expand All @@ -80,27 +61,9 @@ jobs:
sudo apt install git build-essential cmake libace-dev coinor-libipopt-dev libboost-system-dev libboost-filesystem-dev \
libboost-thread-dev liborocos-kdl-dev libeigen3-dev swig qtbase5-dev qtdeclarative5-dev qtmultimedia5-dev libqt5charts5-dev \
libxml2-dev liburdfdom-dev libtinyxml-dev liburdfdom-dev liboctave-dev python3-dev valgrind libassimp-dev libirrlicht-dev libmatio-dev libglfw3-dev
- name: Cache Source-based dependencies [Ubuntu/macOS]
if: steps.cache-source-deps.outputs.cache-hit != 'true' && (contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macOS'))
id: cache-source-deps
uses: actions/cache@v1
with:
path: ${{ github.workspace }}/install/deps
# Including ${{ runner.temp }} is a workaround for https://github.com/robotology/whole-body-estimators/issues/60
key: source-deps-${{runner.os}}-${{runner.temp}}-vcpkg-robotology-${{env.vcpkg_robotology_TAG}}-ycm-${{env.YCM_TAG}}-yarp-${{env.YARP_TAG}}-iDynTree-${{env.iDynTree_TAG}}-wearables-${{env.wearables_TAG}}-icub_main-${{env.icub_main_TAG}}-OsqpEigen-${{env.OsqpEigen_TAG}}-matioCpp-${{env.matioCpp_TAG}}-robometry-${{env.robometry_TAG}}
- name: Dependencies (using conda) [Windows]
if: steps.cache-source-deps.outputs.cache-hit != 'true' && contains(matrix.os, 'windows')
shell: bash -l {0}
run: |
# Compilation related dependencies
mamba install cmake compilers make ninja pkg-config
# Actual dependencies
mamba install yarp icub-main wearables idyntree matio-cpp robometry osqp-eigen
- name: Source-based Dependencies [Ubuntu/macOS]
if: steps.cache-source-deps.outputs.cache-hit != 'true' && (matrix.os == 'ubuntu-latest' || matrix.os == 'macOS-latest')
- name: Source-based Dependencies [Ubuntu]
if: steps.cache-source-deps.outputs.cache-hit != 'true' && matrix.os == 'ubuntu-latest'
shell: bash
run: |
# YCM
Expand Down Expand Up @@ -216,7 +179,7 @@ jobs:
- name: Configure [Ubuntu/macOS]
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macOS-latest'
shell: bash
shell: bash -l {0}
run: |
mkdir -p build
cd build
Expand All @@ -231,9 +194,6 @@ jobs:
shell: bash
run: |
cd build
# Attempt of fix for using YARP idl generators (that link ACE) in Windows
# See https://github.com/robotology/idyntree/issues/569
export PATH=$PATH:${GITHUB_WORKSPACE}/install/bin:${VCPKG_INSTALLATION_ROOT}/install/x64-windows/bin:${VCPKG_INSTALLATION_ROOT}/installed/x64-windows/debug/bin
cmake --build . --config ${{matrix.build_type}}
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,18 @@ 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).
- HumanLogger device to be compatible with the `robot-log-visualizer` (https://github.com/robotology/human-dynamics-estimation/pull/372).

## [2.9.0] - 2023-10-17

### Fixed
- [`HumanControlBoard`] Fix attach method (https://github.com/robotology/human-dynamics-estimation/pull/365).

### Added
- Added `HumanWrenchWrapper` and `HumanWrenchRemapper` (https://github.com/robotology/human-dynamics-estimation/pull/362/files).
- Added `IHumanWrench` to `HumanLogger` (https://github.com/robotology/human-dynamics-estimation/pull/363).

## [2.8.0] - 2023-09-06

### Added
Expand Down
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
cmake_minimum_required(VERSION 3.5)
project(HumanDynamicsEstimation
LANGUAGES CXX
VERSION 2.8.0)
VERSION 2.9.0)

# =====================
# PROJECT CONFIGURATION
Expand Down 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
17 changes: 17 additions & 0 deletions ci_env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: human-dynamics-estimation
channels:
- conda-forge
- robotology
dependencies:
- cmake
- compilers
- make
- ninja
- pkg-config
- yarp
- icub-main
- wearables
- idyntree
- libmatio-cpp
- robometry
- osqp-eigen
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>
Loading

0 comments on commit 1f4cb8b

Please sign in to comment.