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) #1234

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.34%. Comparing base (66df39f) to head (ec78930).

Files Patch % Lines
...dmittance_controller/src/admittance_controller.cpp 0.00% 2 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           humble    #1234      +/-   ##
==========================================
+ Coverage   87.33%   87.34%   +0.01%     
==========================================
  Files          92       92              
  Lines        8495     8494       -1     
  Branches      705      708       +3     
==========================================
  Hits         7419     7419              
+ Misses        815      811       -4     
- Partials      261      264       +3     
Flag Coverage Δ
unittests 87.34% <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.46% <ø> (ø)
...dmittance_controller/src/admittance_controller.cpp 74.90% <0.00%> (ø)

... and 1 file with indirect coverage changes

@bmagyar bmagyar merged commit 60010c6 into humble Aug 1, 2024
10 of 11 checks passed
@bmagyar bmagyar deleted the mergify/bp/humble/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