Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix admittance controller interface read/write logic #1232

Merged

Conversation

Nibanovic
Copy link
Contributor

Using ROS rolling and gazebo Harmonic, I've found two bugs while trying to control a robot using both velocity and position control.

  1. In write_state_to_hardware(), state_commanded.positions are mistakenly being written to both velocity and acceleration command interfaces.
  2. Both in write_state_to_hardware() and read_state_from_hardware(), checking whether the controller has pos/vel/acc interfaces is done using if-else clauses. This causes the block to exit upon first true condition, meaning, after confirming position interface exists, velocity and acceleration interfaces never get written to or read from

These fixes are verified in my use case, but seem obvious enough that no tests need to be written to verify these claims.

Nonetheless, let me know if you'd like some tests before merging.

Cheers!

Copy link
Member

@bmagyar bmagyar left a comment

Choose a reason for hiding this comment

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

This makes a lot of sense sir :D

@bmagyar bmagyar merged commit 33e35f0 into ros-controls:master Jul 31, 2024
17 of 19 checks passed
@bmagyar bmagyar added backport-humble This label should be used by maintaines only! Label triggers PR backport to ROS2 humble. backport-iron This label should be used by maintaines only! Label triggers PR backport to ROS2 Iron. labels Jul 31, 2024
@destogl destogl deleted the fix-admittance-interface-r/w branch July 31, 2024 18:05
mergify bot pushed a commit that referenced this pull request Jul 31, 2024
mergify bot pushed a commit that referenced this pull request Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-humble This label should be used by maintaines only! Label triggers PR backport to ROS2 humble. backport-iron This label should be used by maintaines only! Label triggers PR backport to ROS2 Iron.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants