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 #1989

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

Conversation

saikishor
Copy link
Member

Address #1466

@saikishor
Copy link
Member Author

This PR is ready as how it is, but needs to be tested with the real hardware or with the demos

@saikishor
Copy link
Member Author

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 saikishor force-pushed the integrate/joint_limits branch from c761a77 to c4d023c Compare January 8, 2025 20:45
Copy link

codecov bot commented Jan 8, 2025

Codecov Report

Attention: Patch coverage is 96.57534% with 5 lines in your changes missing coverage. Please review.

Project coverage is 89.41%. Comparing base (b329679) to head (5b00b44).

Files with missing lines Patch % Lines
hardware_interface/src/resource_manager.cpp 95.23% 0 Missing and 3 partials ⚠️
controller_manager/src/controller_manager.cpp 87.50% 0 Missing and 1 partial ⚠️
...e_interface_testing/test/test_resource_manager.cpp 98.52% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1989      +/-   ##
==========================================
+ Coverage   89.33%   89.41%   +0.07%     
==========================================
  Files         130      130              
  Lines       14516    14660     +144     
  Branches     1258     1275      +17     
==========================================
+ Hits        12968    13108     +140     
+ Misses       1083     1079       -4     
- Partials      465      473       +8     
Flag Coverage Δ
unittests 89.41% <96.57%> (+0.07%) ⬆️

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 100.00% <ø> (ø)
...est_controller_manager_hardware_error_handling.cpp 100.00% <100.00%> (ø)
...t_controllers_chaining_with_controller_manager.cpp 99.23% <100.00%> (+<0.01%) ⬆️
controller_manager/src/controller_manager.cpp 76.19% <87.50%> (-0.10%) ⬇️
...e_interface_testing/test/test_resource_manager.cpp 99.39% <98.52%> (-0.08%) ⬇️
hardware_interface/src/resource_manager.cpp 76.51% <95.23%> (+1.48%) ⬆️

... and 7 files with indirect coverage changes

@saikishor saikishor marked this pull request as ready for review January 9, 2025 08:32
@github-actions github-actions bot requested a review from rosterloh January 9, 2025 08:44
@saikishor saikishor requested a review from bmagyar January 9, 2025 09:14
@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/joint_limits branch from c292555 to efa76b3 Compare January 9, 2025 22:58
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.

1 participant