Skip to content

fix(controllers): safe interface map check#233

Merged
domire8 merged 3 commits intomainfrom
fix/out-of-range
Feb 27, 2026
Merged

fix(controllers): safe interface map check#233
domire8 merged 3 commits intomainfrom
fix/out-of-range

Conversation

@domire8
Copy link
Member

@domire8 domire8 commented Feb 27, 2026

Description

Quick fix: if a URDF for some reason contains state_interfaces on a joint level that we don't know for our state_representation::JointState (e.g. not one of position, velocity, acceleration or torque), this interface_map.at() will throw an uncaught exception. This simple check avoids that

Review guidelines

Estimated Time of Review: 3 minutes

Checklist before merging:

  • Confirm that the relevant changelog(s) are up-to-date in case of any user-facing changes

@domire8 domire8 requested review from SprGrf and yrh012 February 27, 2026 05:42
@domire8 domire8 requested a review from eeberhard as a code owner February 27, 2026 05:42
Copy link

@yrh012 yrh012 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense!

Copy link

@SprGrf SprGrf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice addition! Did you meet a case where this was required?

@domire8
Copy link
Member Author

domire8 commented Feb 27, 2026

Nice addition! Did you meet a case where this was required?

Yes, the arm from Duatic has a lot of state interfaces: https://github.com/Duatic/duatic_dynaarm_driver/blob/1b501a976cfdca3f3ca366390b65b91fff5ac934/duatic_dynaarm_driver/duatic_dynaarm_driver/urdf/dynaarm.ros2control.xacro#L38

@domire8 domire8 merged commit f9538c8 into main Feb 27, 2026
4 checks passed
@domire8 domire8 deleted the fix/out-of-range branch February 27, 2026 10:12
@github-actions github-actions bot locked and limited conversation to collaborators Feb 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants