Skip to content

control_layer: skip controllers whose ControlSignal size mismatches t… - #328

Open
valerio98-lab wants to merge 1 commit into
mainfrom
fix/control-layer-torque-size-check
Open

control_layer: skip controllers whose ControlSignal size mismatches t…#328
valerio98-lab wants to merge 1 commit into
mainfrom
fix/control-layer-torque-size-check

Conversation

@valerio98-lab

Copy link
Copy Markdown

The gather loop was bounded by the controller's message size but wrote into an accumulator sized from pRobot->getNJOINTS(). A controller publishing more torques than the robot has joints wrote out of bounds, at 1 kHz, inside the SCHED_DEADLINE thread, with no error raised.

Mismatching controllers are now skipped rather than truncated and logged once each. std::min is kept on the loop as a backstop.

…he robot

The gather loop was bounded by the controller's message size but wrote into an accumulator sized from pRobot->getNJOINTS(). A controller publishing more torques than the robot has joints wrote out of bounds, at 1 kHz, inside the SCHED_DEADLINE thread, with no error raised.

Mismatching controllers are now skipped rather than truncated - contributing torques to part of a legged robot is worse than contributing none - and logged once each. std::min is kept on the loop as a backstop.
@valerio98-lab
valerio98-lab requested a review from MMarcus95 as a code owner July 29, 2026 08:23
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.

1 participant