-
Notifications
You must be signed in to change notification settings - Fork 303
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
saikishor
wants to merge
67
commits into
ros-controls:master
Choose a base branch
from
pal-robotics-forks:add/sw_joint_limiter
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
67 commits
Select commit
Hold shift + click to select a range
ff13549
make JointTrajectoryPoint as an input through the template argument
saikishor ad50d3c
check for node parameter interface before declaring and getting the p…
saikishor 560b1f4
Added methods to check is the parameter and logging interfaces are se…
saikishor 82f368a
add an init method parsing the limits directly in the init method
saikishor e7425d9
update the joint state limiter to use template typename in the header…
saikishor 097004b
check the size of the joint limits and the joint names in the init me…
saikishor 2340866
added joint range limiter library for individual joints control
saikishor a6f9e74
added compute_effort_limits method
saikishor a8e8fdd
update the velocity limits based on the position of the joint
saikishor c462fb6
fix the limits clamping in the methods
saikishor 19b2fcc
Add proper acceleration limits bounding
saikishor 47ddcfb
remove the enforce methods of the double vector as it can be handled …
saikishor f70a63d
Added comments to the has_logging_interface and has_parameter_interfa…
saikishor 1822da5
remove the joint range limiter header and reuse it from the joint sat…
saikishor 9706cf7
rename the plugin names to be more consistent with the types the use …
saikishor 0a99d3a
Add first version of tests into the joint range limiter
saikishor e29ecab
fix the init check bug
saikishor b2197da
Apply formatting changes
saikishor 6d7f4a5
update the joint range limiter test with case of only desired positio…
saikishor 1dfb3b6
Added some minor fixes in the joint range limiter
saikishor ee0dbb7
Fill the data of actual or desired fields into the previous commands
saikishor f4cf1e0
reset the prev_data_ on initialization
saikishor 9368deb
add test cases of the actual and desired position cases
saikishor a8f4538
Add tests for the case of no position limits
saikishor 099f72d
add initial test cases for desired velocity only cases
saikishor 1e0c4ee
Enforce wrt to the position limits only when the actual position valu…
saikishor b311570
change some asserts to expects
saikishor a5ae76b
Use lambdas for better testing
saikishor edaf362
If the joint is outside the position range, then don't let the joint …
saikishor 11badf6
extend tests of acceleration limits also with and without actual posi…
saikishor 526fcff
Add tests for the case of actuators with actual position state and ac…
saikishor 3ffe034
remove unused test cases
saikishor ecbc1dd
pass by const reference and parse the optional actual position and ve…
saikishor 06f9a21
Added tests for the effort case
saikishor 75b1164
better conditioning for the acceleration limits enforcement
saikishor da8466f
Added tests for the desired acceleration case
saikishor 48fcf8e
Add tests for the desired jerk test cases
saikishor 66fa5b1
consider also the acceleration limits when computing the position lim…
saikishor 834a9f6
Fix minor bug in the limit enforcement
saikishor 9e58d61
better computation of the position limits
saikishor 6471d5b
better combined desired references test
saikishor 770820f
Remove LimitsType template from JointLimiterInterface
adriaroig 9b8dbd4
Add SoftJointLimits in JointLimiterInterface
adriaroig e88ff9b
Move joint limits computation in a separate library
adriaroig eb0680e
Implement SoftJointLimiter class
adriaroig 4bbdd48
Export JointInterfacesSoftLimiter in the joint_limiters.xml
adriaroig 9948adb
Fix linking problem in test_joint_range_limiter
adriaroig 3e17275
Create test_soft_joint_limiter.cpp
adriaroig ab2b9b2
Fix typo in plugins definition
adriaroig 4459577
Rm soft_joint_limiter.hpp
adriaroig 572a9a5
Derive SoiftJointLimiter from JointSaturationLimiter<JointControlInte…
adriaroig 05d414f
Test SofJointLimiter in position
adriaroig b86fafa
Solve issues in SoftJointLimiter when prev_command is not defined
adriaroig 91d3bfb
Test SoftJointLimiter in position and effort
adriaroig 474ff5a
Test uses cases for SoftJointLimiter in velocity interface
adriaroig 901381d
Format changes
adriaroig 339e4d1
change copyright to PAL
saikishor 58e5de8
add pre-comitting fixes
saikishor 872c7ef
Add intermediate tests to fix the transition bug
saikishor b22ac9e
Fix the undefined behavior when lower bound is greater than upper bound
saikishor cdd0ef9
Add some documentation to the helpers
saikishor 4c71c32
rename of SoftJointLimiter to JointSoftLimiter and some minor changes
saikishor 80e7418
enable moving out of position limit if velocity is in "right" direction
mamueluth 2977f57
warn everytime we reach the limit
mamueluth b724528
update the loguic to check if the actual position is within bounds an…
saikishor 2a346b8
Remove unnecessary debug prints
saikishor 2f91440
fix the soft limiting logic and add respective tests
saikishor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
joint_limits/include/joint_limits/joint_limiter_struct.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// Copyright 2024 PAL Robotics S.L. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
/// \author Sai Kishor Kothakota | ||
|
||
#ifndef JOINT_LIMITS__JOINT_LIMITER_STRUCT_HPP_ | ||
#define JOINT_LIMITS__JOINT_LIMITER_STRUCT_HPP_ | ||
|
||
#include <memory> | ||
#include <optional> | ||
#include <string> | ||
|
||
namespace joint_limits | ||
{ | ||
|
||
struct JointControlInterfacesData | ||
{ | ||
std::string joint_name; | ||
std::optional<double> position = std::nullopt; | ||
std::optional<double> velocity = std::nullopt; | ||
std::optional<double> effort = std::nullopt; | ||
std::optional<double> acceleration = std::nullopt; | ||
std::optional<double> jerk = std::nullopt; | ||
|
||
bool has_data() const | ||
{ | ||
return has_position() || has_velocity() || has_effort() || has_acceleration() || has_jerk(); | ||
} | ||
|
||
bool has_position() const { return position.has_value(); } | ||
|
||
bool has_velocity() const { return velocity.has_value(); } | ||
|
||
bool has_effort() const { return effort.has_value(); } | ||
|
||
bool has_acceleration() const { return acceleration.has_value(); } | ||
|
||
bool has_jerk() const { return jerk.has_value(); } | ||
}; | ||
|
||
struct JointInterfacesCommandLimiterData | ||
{ | ||
std::string joint_name; | ||
JointControlInterfacesData actual; | ||
JointControlInterfacesData command; | ||
JointControlInterfacesData prev_command; | ||
JointControlInterfacesData limited; | ||
|
||
bool has_actual_data() const { return actual.has_data(); } | ||
|
||
bool has_command_data() const { return command.has_data(); } | ||
}; | ||
|
||
} // namespace joint_limits | ||
#endif // JOINT_LIMITS__JOINT_LIMITER_STRUCT_HPP_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.