Skip to content

Commit

Permalink
Merge branch 'master' into ergocub_no_ifeel_teleop
Browse files Browse the repository at this point in the history
  • Loading branch information
lrapetti authored Nov 9, 2023
2 parents a60fb0c + e8b7cee commit 8d0d9d4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### 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).

### Added
- Added files for ergoCub teleoperation without using iFeel (https://github.com/robotology/human-dynamics-estimation/pull/374)

## [2.9.0] - 2023-10-17
Expand Down
23 changes: 19 additions & 4 deletions devices/HumanLogger/HumanLogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ void HumanLogger::run()
"human_state::base_velocity");
pImpl->bufferManager.push_back(pImpl->jointPositions,
timeNow,
"human_state::joint_positions");
"joints_state::positions");
pImpl->bufferManager.push_back(pImpl->jointVelocities,
timeNow,
"human_state::joint_velocities");
"joints_state::velocities");
}
}

Expand Down Expand Up @@ -265,6 +265,17 @@ bool HumanLogger::impl::loadSettingsFromConfig(yarp::os::Searchable& config)
bufferConfig.save_periodically = config.find(save_periodically.c_str()).asBool();
}

std::string yarpRobotName = "yarp_robot_name";
std::string defaultYarpRobotName = "human-gazebo";
if (config.check(yarpRobotName.c_str()) && config.find(yarpRobotName.c_str()).isString()) {
bufferConfig.yarp_robot_name = config.find(yarpRobotName.c_str()).asString();
}
else {
bufferConfig.yarp_robot_name = defaultYarpRobotName;
yInfo() << LogPrefix << " missing parameter: " << yarpRobotName
<< " using default value: " << defaultYarpRobotName;
}

if (bufferConfig.save_periodically) {
std::string save_period = "save_period";
if (config.check(save_period.c_str()) && config.find(save_period.c_str()).isFloat64()) {
Expand All @@ -286,6 +297,8 @@ bool HumanLogger::impl::loadSettingsFromConfig(yarp::os::Searchable& config)
bufferConfig.auto_save = config.find(auto_save.c_str()).asBool();
}

bufferConfig.mat_file_version = matioCpp::FileVersion::MAT7_3;

if (!(bufferConfig.auto_save || bufferConfig.save_periodically)) {
yError()
<< LogPrefix
Expand Down Expand Up @@ -332,8 +345,8 @@ bool HumanLogger::impl::configureBufferManager()
ok = ok && bufferManager.addChannel({"human_state::base_position", {3, 1}});
ok = ok && bufferManager.addChannel({"human_state::base_orientation", {4, 1}});
ok = ok && bufferManager.addChannel({"human_state::base_velocity", {6, 1}});
ok = ok && bufferManager.addChannel({"human_state::joint_positions", {jointNamesState.size(), 1}, jointNamesState});
ok = ok && bufferManager.addChannel({"human_state::joint_velocities", {jointNamesState.size(), 1}, jointNamesState});
ok = ok && bufferManager.addChannel({"joints_state::positions", {jointNamesState.size(), 1}, jointNamesState});
ok = ok && bufferManager.addChannel({"joints_state::velocities", {jointNamesState.size(), 1}, jointNamesState});
}
}
if (settings.logHumanDynamics)
Expand Down Expand Up @@ -472,6 +485,8 @@ bool HumanLogger::attachAll(const yarp::dev::PolyDriverList& driverList)
yError() << LogPrefix << "Failed to start the loop.";
return false;
}

pImpl->bufferManager.setDescriptionList(pImpl->jointNamesState);

yInfo() << LogPrefix << "Successfully attached all the required devices";

Expand Down

0 comments on commit 8d0d9d4

Please sign in to comment.