ami-iit / bipedal-locomotion-framework

Suite of libraries for achieving bipedal locomotion on humanoid robots
https://ami-iit.github.io/bipedal-locomotion-framework/
BSD 3-Clause "New" or "Revised" License
132 stars 36 forks source link

Understand how to handle rpc readings (e.g., the motor temperature) in YarpSensorbridge #819

Open GiulioRomualdi opened 3 months ago

GiulioRomualdi commented 3 months ago

@isorrentino opened https://github.com/ami-iit/bipedal-locomotion-framework/pull/813 to add the motor temperature reading in the sensor bridge and the associated YarpRobotLoggerDevice.

However, as @traversaro noticed, the motor temperature reading is done via an RPC call. Moreover, as @valegagge and @MSECode suggested https://github.com/ami-iit/bipedal-locomotion-framework/pull/813#discussion_r1511339493, we should use getTemperature instead of getTemperatures since the second method returns a non-complete vector if one of the motor temperature reading returns an error.

This has the consequence of needing to make n RPC calls, where n is the number of motors (e.g., 23), every 100ms (for the logger) - 500ms (for the walking controller). This may lead to unexpected behavior in the entire pipeline.

The desired approach would be to add the temperature reading in the stream, similar to the joint encoders or the motor PWM. In the meantime, we may consider splitting the reading of the RPC messages into a separate thread that runs at a lower frequency (e.g., once per second), but still, I think we should keep using getTemperatures and modify the logic there.

This issue aims to find a solution to enable correct temperature reading within the framework so the walking controller can react in case of issues with the motors.

GiulioRomualdi commented 3 months ago

cc @S-Dafarra @DanielePucci