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

Integrate joint limit enforcement into ros2_control framework functional with Async controllers and components #2047

Open
wants to merge 32 commits into
base: master
Choose a base branch
from

Conversation

saikishor
Copy link
Member

Address #1466

I've tested the changes with Example 2 : DiffBot. It is working as expected

With enforce_command_limits parameter to false


---
header:
  stamp:
    sec: 1736346475
    nanosec: 876075833
  frame_id: ''
name:
- right_wheel_joint
- left_wheel_joint
position:
- 2465.0275847635803
- 2408.3609160969136
velocity:
- 570.0017813333335
- 563.3351146666668
effort:
- .nan
- .nan
---

With enforce_command_limits parameter to true

---
header:
  stamp:
    sec: 1736346517
    nanosec: 219967158
  frame_id: ''
name:
- right_wheel_joint
- left_wheel_joint
position:
- 24.49999652
- 24.49999652
velocity:
- 1.0
- 1.0
effort:
- .nan
- .nan
---

@saikishor
Copy link
Member Author

Tested with cart example of gazebo_ros2_control_demos and the following are the results of the command of 15.0 m with soft limits added in the URDF

    <limit effort="1000.0" lower="-15" upper="15" velocity="1.0"/>
    <safety_controller k_position="0.01" k_velocity="10.0" soft_lower_limit="-12" soft_upper_limit="12"/>

Without limit enforcement (enforce_command_limits parameter to false):

Screenshot from 2025-01-09 23-24-34
Screenshot from 2025-01-09 23-14-11

With limit enforcement (enforce_command_limits parameter to true):
Screenshot from 2025-01-09 23-24-05
Screenshot from 2025-01-09 23-15-16

@saikishor saikishor force-pushed the integrate/async/joint_limits branch from bad761b to 6efd5b0 Compare February 11, 2025 22:12
Copy link

codecov bot commented Feb 11, 2025

Codecov Report

Attention: Patch coverage is 81.60920% with 48 lines in your changes missing coverage. Please review.

Project coverage is 89.27%. Comparing base (3e253fc) to head (16023b4).

Files with missing lines Patch % Lines
hardware_interface/src/resource_manager.cpp 60.37% 36 Missing and 6 partials ⚠️
...re_interface/include/hardware_interface/handle.hpp 62.50% 3 Missing ⚠️
controller_manager/src/controller_manager.cpp 87.50% 0 Missing and 1 partial ⚠️
hardware_interface/test/test_handle.cpp 98.00% 0 Missing and 1 partial ⚠️
...e_interface_testing/test/test_resource_manager.cpp 98.63% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2047      +/-   ##
==========================================
- Coverage   89.39%   89.27%   -0.13%     
==========================================
  Files         139      139              
  Lines       14982    15239     +257     
  Branches     1286     1315      +29     
==========================================
+ Hits        13393    13604     +211     
- Misses       1110     1148      +38     
- Partials      479      487       +8     
Flag Coverage Δ
unittests 89.27% <81.60%> (-0.13%) ⬇️

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

Files with missing lines Coverage Δ
.../include/controller_manager/controller_manager.hpp 96.87% <ø> (ø)
...est_controller_manager_hardware_error_handling.cpp 100.00% <100.00%> (ø)
...t_controllers_chaining_with_controller_manager.cpp 99.23% <100.00%> (+<0.01%) ⬆️
...ace_testing/test/test_components/test_actuator.cpp 87.27% <100.00%> (+0.99%) ⬆️
joint_limits/src/joint_limits_helpers.cpp 91.78% <100.00%> (+0.23%) ⬆️
controller_manager/src/controller_manager.cpp 76.13% <87.50%> (-0.03%) ⬇️
hardware_interface/test/test_handle.cpp 99.11% <98.00%> (-0.89%) ⬇️
...e_interface_testing/test/test_resource_manager.cpp 99.39% <98.63%> (-0.08%) ⬇️
...re_interface/include/hardware_interface/handle.hpp 75.00% <62.50%> (+1.19%) ⬆️
hardware_interface/src/resource_manager.cpp 73.30% <60.37%> (-1.70%) ⬇️

... and 2 files with indirect coverage changes

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