Skip to content

Commit 85917f5

Browse files
Fix YarpRobotLoggerDevice if YARP_ROBOT_NAME is not defined (#701)
1 parent 87345b5 commit 85917f5

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ All notable changes to this project are documented in this file.
44
## [unreleased]
55
### Fixed
66
- Fix python bindings compilation when toml is not installed (https://github.com/ami-iit/bipedal-locomotion-framework/pull/700)
7+
- Fix `YarpRobotLoggerDevice` if `YARP_ROBOT_NAME` is not defined (https://github.com/ami-iit/bipedal-locomotion-framework/pull/701)
78

89
## [0.14.0] - 2023-07-04
910
### Added

devices/YarpRobotLoggerDevice/src/YarpRobotLoggerDevice.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,12 @@ bool YarpRobotLoggerDevice::setupTelemetry(
449449
}
450450

451451
robometry::BufferConfig config;
452-
config.yarp_robot_name = std::getenv("YARP_ROBOT_NAME");
452+
char* tmp = std::getenv("YARP_ROBOT_NAME");
453+
// if the variable does not exist it points to NULL
454+
if (tmp != NULL)
455+
{
456+
config.yarp_robot_name = tmp;
457+
}
453458
config.filename = "robot_logger_device";
454459
config.auto_save = true;
455460
config.save_periodically = true;

0 commit comments

Comments
 (0)