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

Add joint limiter interface plugins to enforce limits defined in the URDF #1526

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

Conversation

saikishor
Copy link
Member

This PR includes the changes of the PR from @destogl #971, and on top of that it extends the proposed methods to be able to integrate and be able to provide an interface that will allow enforcing the joint limits in position, velocity, effort, acceleration, etc. The proposed interface can accept different types of data in the enforce methods with the help of templating and this can be helpful to extend to different applications in the future.

This PR is done as a part of #1466 to be able to integrate the limiters within the ResourceManager

Closes #971

Copy link

codecov bot commented May 7, 2024

Codecov Report

Attention: Patch coverage is 94.98408% with 63 lines in your changes missing coverage. Please review.

Project coverage is 87.78%. Comparing base (0433960) to head (2f91440).

Files with missing lines Patch % Lines
...s/include/joint_limits/joint_limiter_interface.hpp 32.50% 23 Missing and 4 partials ⚠️
joint_limits/src/joint_soft_limiter.cpp 87.50% 12 Missing and 4 partials ⚠️
joint_limits/src/joint_range_limiter.cpp 84.12% 5 Missing and 5 partials ⚠️
joint_limits/src/joint_limits_helpers.cpp 91.30% 2 Missing and 4 partials ⚠️
joint_limits/test/test_joint_soft_limiter.cpp 99.63% 0 Missing and 2 partials ⚠️
...limits/include/joint_limits/joint_soft_limiter.hpp 92.85% 1 Missing ⚠️
joint_limits/test/test_joint_limiter.hpp 98.18% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1526      +/-   ##
==========================================
+ Coverage   86.83%   87.78%   +0.94%     
==========================================
  Files         121      129       +8     
  Lines       11542    12730    +1188     
  Branches     1054     1104      +50     
==========================================
+ Hits        10023    11175    +1152     
- Misses       1144     1167      +23     
- Partials      375      388      +13     
Flag Coverage Δ
unittests 87.78% <94.98%> (+0.94%) ⬆️

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

Files with missing lines Coverage Δ
...mits/include/joint_limits/joint_limiter_struct.hpp 100.00% <100.00%> (ø)
joint_limits/include/joint_limits/joint_limits.hpp 97.22% <100.00%> (-2.78%) ⬇️
.../include/joint_limits/joint_saturation_limiter.hpp 100.00% <100.00%> (ø)
joint_limits/src/joint_saturation_limiter.cpp 85.63% <100.00%> (+0.13%) ⬆️
joint_limits/test/test_joint_range_limiter.cpp 100.00% <100.00%> (ø)
...oint_limits/test/test_joint_saturation_limiter.cpp 91.23% <ø> (+0.28%) ⬆️
...oint_limits/test/test_joint_saturation_limiter.hpp 96.55% <100.00%> (ø)
...limits/include/joint_limits/joint_soft_limiter.hpp 92.85% <92.85%> (ø)
joint_limits/test/test_joint_limiter.hpp 98.18% <98.18%> (ø)
joint_limits/test/test_joint_soft_limiter.cpp 99.63% <99.63%> (ø)
... and 4 more

... and 1 file with indirect coverage changes

Copy link
Contributor

mergify bot commented May 11, 2024

This pull request is in conflict. Could you fix it @saikishor?

Copy link
Contributor

mergify bot commented Jul 4, 2024

This pull request is in conflict. Could you fix it @saikishor?

* @param dt The time step.
* @return The position limits.
*/
std::pair<double, double> compute_position_limits(
Copy link
Contributor

@mateusmenezes95 mateusmenezes95 Jul 19, 2024

Choose a reason for hiding this comment

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

I have a suggestion from a code reader's point of view. What do you think about creating a struct with the min and max members instead? Using std::pair results later in the use of first and second accessors, which does not describe the purpose of the variable.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hello!

As these are helper methods alone. I want to keep them simple. Making a new struct and passing them around is something I wanted to avoid. That's the main reason I avoided using such new structs

Copy link
Contributor

mergify bot commented Jul 21, 2024

This pull request is in conflict. Could you fix it @saikishor?

@@ -70,55 +70,58 @@ class JointLimiterInterface
// TODO(destogl): get limits from URDF
Copy link
Member

Choose a reason for hiding this comment

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

I think this is not needed anymore. Am I right? Do we want to get here limits from URDF? This might make sense to parse URDF limits also in the controller if this are required.

joint_limits/src/joint_limits_helpers.cpp Outdated Show resolved Hide resolved
return eff_limits;
}

std::pair<double, double> compute_acceleration_limits(
Copy link
Member

Choose a reason for hiding this comment

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

Don't we have to consider here position and velocity limits too?

joint_limits/src/joint_range_limiter.cpp Outdated Show resolved Hide resolved
saikishor and others added 29 commits October 11, 2024 14:29
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.

5 participants