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 (backport #1232) #1235

Merged
merged 2 commits into from
Aug 1, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jul 31, 2024

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!


This is an automatic backport of pull request #1232 done by [Mergify](https://mergify.com).

Copy link

codecov bot commented Jul 31, 2024

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.

Project coverage is 87.31%. Comparing base (1cdaacb) to head (1d69718).

Files Patch % Lines
...dmittance_controller/src/admittance_controller.cpp 0.00% 2 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             iron    #1235      +/-   ##
==========================================
+ Coverage   87.29%   87.31%   +0.01%     
==========================================
  Files          92       92              
  Lines        8408     8405       -3     
  Branches      701      702       +1     
==========================================
- Hits         7340     7339       -1     
+ Misses        812      808       -4     
- Partials      256      258       +2     
Flag Coverage Δ
unittests 87.31% <0.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...ntroller/test/test_trajectory_controller_utils.hpp 84.00% <ø> (ø)
...dmittance_controller/src/admittance_controller.cpp 74.39% <0.00%> (ø)

... and 2 files with indirect coverage changes

@bmagyar bmagyar merged commit 18234ac into iron Aug 1, 2024
10 of 11 checks passed
@bmagyar bmagyar deleted the mergify/bp/iron/pr-1232 branch August 1, 2024 08:13
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.

2 participants