Skip to content

Commit 7b252ba

Browse files
Merge pull request #580 from ami-iit/GiulioRomualdi-patch-1
Use std::int64_t instead of long in TextLoggingEntry class
2 parents c5112ab + db37ad4 commit 7b252ba

File tree

5 files changed

+18
-5
lines changed

5 files changed

+18
-5
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ env:
2626
tomlplusplus_TAG: v2.5.0
2727
icub_models_TAG: v1.23.3
2828
UnicyclePlanner_TAG: d3f6c80afe21a9958da769c8dd8a2bbfee5ea922
29-
telemetry_TAG: v0.5.1
29+
telemetry_TAG: v1.2.0
3030

3131
# Overwrite the VCPKG_INSTALLATION_ROOT env variable defined by GitHub Actions to point to our vcpkg
3232
VCPKG_INSTALLATION_ROOT: C:\robotology\vcpkg

.github/workflows/conda-forge-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
# Compilation related dependencies
3838
mamba install cmake compilers make ninja pkg-config
3939
# Actual dependencies
40-
mamba install "idyntree>=8.0.0" "yarp>=3.5.0" libmatio libmatio-cpp \
40+
mamba install "idyntree>=8.0.0" "yarp>=3.5.0" libmatio libmatio-cpp librobometry \
4141
liblie-group-controllers eigen qhull "casadi>=3.5.5" cppad spdlog "catch2=2" \
4242
nlohmann_json manif manifpy pybind11 numpy pytest scipy opencv pcl \
4343
tomlplusplus libunicycle-footstep-planner "icub-models>=1.23.4" \

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ All notable changes to this project are documented in this file.
77
### Changed
88

99
### Fix
10+
- Fix the compilation of the `YarpRobotLoggerDevice` in `Windows` and `macOS` (https://github.com/ami-iit/bipedal-locomotion-framework/pull/580)
1011

1112
## [0.11.0] - 2022-12-17
1213
### Added

devices/YarpRobotLoggerDevice/include/BipedalLocomotion/YarpTextLoggingUtilities.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#define BIPEDAL_LOCOMOTION_FRAMEWORK_YARP_ROBOT_LOGGER_DEVICE_YARP_TEXT_LOGGING_UTILITIES_H
88

99
#include <string>
10+
#include <cstdint>
1011

1112
#include <yarp/os/Bottle.h>
1213

@@ -29,7 +30,7 @@ struct TextLoggingEntry
2930
std::string cmd;
3031
std::string args;
3132
int pid{0};
32-
long thread_id{0};
33+
std::int64_t thread_id{0};
3334
std::string component;
3435
std::string id;
3536
double systemtime{0.0};

devices/YarpRobotLoggerDevice/src/YarpRobotLoggerDevice.cpp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,10 +554,21 @@ bool YarpRobotLoggerDevice::attachAll(const yarp::dev::PolyDriverList& poly)
554554

555555
if (ok)
556556
{
557-
for (auto& [cameraName, writer] : m_videoWriters)
557+
// using C++17 it is not possible to use a structured binding in the for loop, i.e. for
558+
// (auto& [key, val] : m_videoWriters) since Lambda implicit capture fails with variable
559+
// declared from structured binding.
560+
// As explained in http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0588r1.html
561+
// If a lambda-expression [...] captures a structured binding (explicitly or
562+
// implicitly), the program is ill-formed.
563+
// you can find further information here:
564+
// https://stackoverflow.com/questions/46114214/lambda-implicit-capture-fails-with-variable-declared-from-structured-binding
565+
// Note if one day we will support c++20 we can use structured binding see
566+
// https://en.cppreference.com/w/cpp/language/structured_binding
567+
for (auto iter = m_videoWriters.begin(); iter != m_videoWriters.end(); ++iter)
558568
{
559569
// start a separate the thread for each camera
560-
writer.videoThread = std::thread([&] { this->recordVideo(cameraName, writer); });
570+
iter->second.videoThread
571+
= std::thread([this, iter] { this->recordVideo(iter->first, iter->second); });
561572
}
562573
}
563574
}

0 commit comments

Comments
 (0)