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

Passing a shorter vector to `set_references` results in Aborted in Python #851

Closed giotherobot closed 3 weeks ago

giotherobot commented 3 weeks ago

Testing a very simple position control in python.

Executing:

robot_control.set_references([0, 0, 0, 0], blf.robot_interface.YarpRobotControl.PositionDirect)

in a jupyter notebook results in a Kernel crash, in a python script the sudden stop of the script with Aborted.

The problem is that I am passing a 4 element vector and the size of the joint_list is 7 in my case. I would expect an error though, not a complete crash.

The problem does not happen if the size is greater, and the function executes anyway without errors or warnings.

traversaro commented 3 weeks ago

If you want to look this yourself, the call path is:

I guess adding a check on jointValues size around https://github.com/ami-iit/bipedal-locomotion-framework/blob/8057e2f452e3c758ca75ffc5cc4a2f7ace2c53d7/src/RobotInterface/YarpImplementation/src/YarpRobotControl.cpp#L471 may be sufficient to solve the issue.