-
Notifications
You must be signed in to change notification settings - Fork 310
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
72
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
72 commits
Select commit
Hold shift + click to select a range
011fabe
make JointTrajectoryPoint as an input through the template argument
saikishor 9f34da1
check for node parameter interface before declaring and getting the p…
saikishor cd7abd0
Added methods to check is the parameter and logging interfaces are se…
saikishor 797076d
add an init method parsing the limits directly in the init method
saikishor 8301b59
update the joint state limiter to use template typename in the header…
saikishor d80929d
check the size of the joint limits and the joint names in the init me…
saikishor ea9bda4
added joint range limiter library for individual joints control
saikishor 42fb8c7
added compute_effort_limits method
saikishor a780465
update the velocity limits based on the position of the joint
saikishor 088fa6d
fix the limits clamping in the methods
saikishor 28f7e3e
Add proper acceleration limits bounding
saikishor 0944328
remove the enforce methods of the double vector as it can be handled …
saikishor dfda4b2
Added comments to the has_logging_interface and has_parameter_interfa…
saikishor 87714fb
remove the joint range limiter header and reuse it from the joint sat…
saikishor 7a4ce74
rename the plugin names to be more consistent with the types the use …
saikishor 98122ea
Add first version of tests into the joint range limiter
saikishor 02796bf
fix the init check bug
saikishor 55bb040
Apply formatting changes
saikishor eab6689
update the joint range limiter test with case of only desired positio…
saikishor 7fe2336
Added some minor fixes in the joint range limiter
saikishor 9269842
Fill the data of actual or desired fields into the previous commands
saikishor f94efc2
reset the prev_data_ on initialization
saikishor fa90bfa
add test cases of the actual and desired position cases
saikishor b9918e5
Add tests for the case of no position limits
saikishor 59b697d
add initial test cases for desired velocity only cases
saikishor 372b0d4
Enforce wrt to the position limits only when the actual position valu…
saikishor 560d1bc
change some asserts to expects
saikishor 5b2c0b4
Use lambdas for better testing
saikishor 0dde6a9
If the joint is outside the position range, then don't let the joint …
saikishor 80308b3
extend tests of acceleration limits also with and without actual posi…
saikishor 92d153e
Add tests for the case of actuators with actual position state and ac…
saikishor a2d7258
remove unused test cases
saikishor c1e29c9
pass by const reference and parse the optional actual position and ve…
saikishor 3746584
Added tests for the effort case
saikishor 1eb5bad
better conditioning for the acceleration limits enforcement
saikishor 5c86100
Added tests for the desired acceleration case
saikishor 90cd75e
Add tests for the desired jerk test cases
saikishor 71d311d
consider also the acceleration limits when computing the position lim…
saikishor ffe9aeb
Fix minor bug in the limit enforcement
saikishor cd60d88
better computation of the position limits
saikishor bde797a
better combined desired references test
saikishor 1d2faa9
Remove LimitsType template from JointLimiterInterface
adriaroig 4645773
Add SoftJointLimits in JointLimiterInterface
adriaroig 3192bc6
Move joint limits computation in a separate library
adriaroig c9f36b0
Implement SoftJointLimiter class
adriaroig 1e5dbf0
Export JointInterfacesSoftLimiter in the joint_limiters.xml
adriaroig 02f5760
Fix linking problem in test_joint_range_limiter
adriaroig 6f02f9f
Create test_soft_joint_limiter.cpp
adriaroig c4ea119
Fix typo in plugins definition
adriaroig 9f31c6a
Rm soft_joint_limiter.hpp
adriaroig b58bd10
Derive SoiftJointLimiter from JointSaturationLimiter<JointControlInte…
adriaroig 00eb01d
Test SofJointLimiter in position
adriaroig 2c6d1bd
Solve issues in SoftJointLimiter when prev_command is not defined
adriaroig 764d68b
Test SoftJointLimiter in position and effort
adriaroig f30ce41
Test uses cases for SoftJointLimiter in velocity interface
adriaroig c8d9eec
Format changes
adriaroig 7d6ea96
change copyright to PAL
saikishor b828b13
add pre-comitting fixes
saikishor 45328dd
Add intermediate tests to fix the transition bug
saikishor b2ee4d8
Fix the undefined behavior when lower bound is greater than upper bound
saikishor 8d147a1
Add some documentation to the helpers
saikishor a4567d4
rename of SoftJointLimiter to JointSoftLimiter and some minor changes
saikishor a42c972
enable moving out of position limit if velocity is in "right" direction
mamueluth 46395e3
warn everytime we reach the limit
mamueluth dc64739
update the loguic to check if the actual position is within bounds an…
saikishor 415f535
Remove unnecessary debug prints
saikishor 2a258cf
fix the soft limiting logic and add respective tests
saikishor 226a855
Apply suggestions from code review
saikishor 08f09eb
Rename the joint_limiter_struct.hpp to data_structures.hpp
saikishor 296f992
improve documentation of the helper methods
saikishor fffd7e4
Merge branch 'master' into add/sw_joint_limiter
saikishor 753133d
Fix other visibility macros and pre-commit fixes
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
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__DATA_STRUCTURES_HPP_ | ||
#define JOINT_LIMITS__DATA_STRUCTURES_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__DATA_STRUCTURES_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
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.