Skip to content

Refactor YarpRobotLoggerDevice for improved logging control#1034

Closed
GiulioRomualdi wants to merge 13 commits into
masterfrom
better_handle_start
Closed

Refactor YarpRobotLoggerDevice for improved logging control#1034
GiulioRomualdi wants to merge 13 commits into
masterfrom
better_handle_start

Conversation

@GiulioRomualdi
Copy link
Copy Markdown
Collaborator

This PR introduces new RPC commands for recording and stopping recordings, while reducing code duplication. Morover I added the possibility to avoid starting recording by default making possible to add the logger to a classical yarp robot interface asssociated to the robot

…C commands

- Replaced startLogging() with record() in YarpRobotLoggerDevice class.
- Introduced stopRecording() method to handle stopping the recording without saving data.
- Updated the internal state management to track if recording is prepared.
- Modified the logging behavior to reflect the new recording commands.
- Adjusted the test cases to validate the new RPC commands and their functionality.
- Added new XML configuration files for testing without auto-start logging.
…nce YarpRobotLoggerDevice for signal reconnections
@GiulioRomualdi GiulioRomualdi self-assigned this Apr 4, 2026
@GiulioRomualdi GiulioRomualdi marked this pull request as draft April 4, 2026 17:14
@GiulioRomualdi
Copy link
Copy Markdown
Collaborator Author

GiulioRomualdi commented Apr 4, 2026

This depends on #1032

@traversaro
Copy link
Copy Markdown
Collaborator

fyi @gbionics/team-phoenix I think this is a really great addition to the logger, as it permits to write a lerobot-record-like command (or even add the functionality to lerobot-record, not sure if that is possible) that on startup starts the logger, and on closure stop the logger and move the created file somewhere.

Base automatically changed from code_status_command to master April 7, 2026 08:01
Comment thread devices/YarpRobotLoggerDevice/src/YarpRobotLoggerDevice.cpp
Comment thread devices/YarpRobotLoggerDevice/src/YarpRobotLoggerDevice.cpp Outdated
Comment thread devices/YarpRobotLoggerDevice/src/YarpRobotLoggerDevice.cpp
@GiulioRomualdi GiulioRomualdi marked this pull request as ready for review April 7, 2026 09:44
@GiulioRomualdi
Copy link
Copy Markdown
Collaborator Author

In 7a7db20 I added again what @S-Dafarra mentioned in #1032 (comment)

@GiulioRomualdi GiulioRomualdi enabled auto-merge (squash) April 7, 2026 13:38
@GiulioRomualdi
Copy link
Copy Markdown
Collaborator Author

Memcheck fails :(

@S-Dafarra
Copy link
Copy Markdown
Collaborator

It seems there is an issue on the yarp side, but not realted to memory leaks. In release, I see the following errors

Release

  Error: 4-07 13:50:42.123] [thread: 16633] [blf] [error] [ClockBuilder::setFactory] The clock has been already called. Since the clock() returns a singleton it is not possible to set the factory anymore. Please call 'setFactory()' at the beginning of your application to avoid this problem.
...
  Error:  Cannot write to yarp name server
  [INFO] Logging data..
  Error:  Cannot write to yarp name server
...
  [INFO] |yarp.os.impl.PortCoreOutputUnit|/test/rpc:o| Removing output from /test/rpc:o to /yarp-robot-logger/commands/rpc:i
  [INFO] |yarp.os.impl.PortCoreInputUnit|/yarp-robot-logger/commands/rpc:i| Removing input from /test/rpc:o to /yarp-robot-logger/commands/rpc:i
  /home/runner/work/bipedal-locomotion-framework/bipedal-locomotion-framework/devices/YarpRobotLoggerDevice/tests/YarpRobotLoggerDeviceTest.cpp:356: FAILED:
    {Unknown expression after the reported line}
  due to a fatal error condition:
    SIGSEGV - Segmentation violation signal

Debug

  Error:  |yarp.os.Port|/yarp-robot-logger/commands/rpc:i| Port /yarp-robot-logger/commands/rpc:i failed to activate at tcp://127.0.0.1:10002/ (address conflict)
  Error: 4-07 13:51:46.707] [thread: 16523] [blf] [error] [YarpRobotLoggerDevice::open] Could not open
  Error:  |yarp.dev.PolyDriver|yarp-robot-logger| Driver <YarpRobotLoggerDevice> was found but could not open
  Warning:  Cannot open device yarp-robot-logger
  Warning:  Cannot open device yarp-robot-logger
  Warning:  There was some problem opening one or more devices. Please check the log and your configuration
  Error:  One or more devices failed opening... see previous log messages for more info
  [INFO] Closing device yarp-robot-logger
  [INFO] Closing device sim_imu
  [INFO] Closing device sim_controlboard

Maybe there is some cross talk between tests?

@S-Dafarra
Copy link
Copy Markdown
Collaborator

I had some struggle in the past with yarpserver in local mode. At this point, it might be worth simply running a yarpserver in background as in https://github.com/gbionics/isaac-sim-yarp-bridge/blob/main/.github/workflows/conda-forge-ci.yml#L81-L102

@GiulioRomualdi
Copy link
Copy Markdown
Collaborator Author

Development moved in #1036

auto-merge was automatically disabled May 5, 2026 10:51

Pull request was closed

@GiulioRomualdi GiulioRomualdi deleted the better_handle_start branch May 5, 2026 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants