-
Notifications
You must be signed in to change notification settings - Fork 317
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
Added joint_limits_interface - Direct port from ROS 1 #135
Added joint_limits_interface - Direct port from ROS 1 #135
Conversation
Co-authored-by: ddengster <[email protected]> Signed-off-by: ahcorde <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #135 +/- ##
=======================================
Coverage 43.54% 43.54%
=======================================
Files 42 42
Lines 1410 1410
Branches 761 761
=======================================
Hits 614 614
Misses 112 112
Partials 684 684
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
@v-lopez @jordan-palacios could you guys confirm whether the license on this could also be updated? |
Yes, no problem. |
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'd cleanup the test part before merging. Also made some minor suggestions.
joint_limits_interface/include/joint_limits_interface/joint_limits_interface.hpp
Outdated
Show resolved
Hide resolved
joint_limits_interface/include/joint_limits_interface/joint_limits_interface.hpp
Outdated
Show resolved
Hide resolved
joint_limits_interface/include/joint_limits_interface/joint_limits_interface.hpp
Outdated
Show resolved
Hide resolved
joint_limits_interface/include/joint_limits_interface/joint_limits_interface.hpp
Outdated
Show resolved
Hide resolved
joint_limits_interface/include/joint_limits_interface/joint_limits_interface.hpp
Outdated
Show resolved
Hide resolved
joint_limits_interface/include/joint_limits_interface/joint_limits_interface.hpp
Outdated
Show resolved
Hide resolved
joint_limits_interface/include/joint_limits_interface/joint_limits_interface.hpp
Outdated
Show resolved
Hide resolved
joint_limits_interface/include/joint_limits_interface/joint_limits_rosparam.hpp
Outdated
Show resolved
Hide resolved
Signed-off-by: ahcorde <[email protected]>
Sorry for the bad conditions of the package. I was just copying a version from other repo that it was just functional. I added
|
Signed-off-by: ahcorde <[email protected]>
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.
First part of the review.
double max_vel_limit_; | ||
}; | ||
|
||
#if 0 |
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.
It seems this code is never used. Do we still need it?
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.
added a TODO
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.
Also remove .pyc
file.
I have to do it one more time
@@ -0,0 +1,39 @@ | |||
<package format="2"> |
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.
Why not use format=3
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.
The other packages are version 2, I can update this one.
|
||
<maintainer email="[email protected]">Bence Magyar</maintainer> | ||
<maintainer email="[email protected]">Enrique Fernandez</maintainer> | ||
<maintainer email="[email protected]">Mathias Lüdtke</maintainer> |
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.
Add not-active maintainers as authors
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.
can you suggest me which are the authors and maintainer of this package?
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 Enrique and Mathias are not active so much here, so I would move them in authors. @bmagyar is clearly maintainer :)
This looks good to me. I believe using the new concept from #121 this code is only temporarily. If not so there are few more issues. I list them here just for the "documentation":
|
Signed-off-by: ahcorde <[email protected]>
Signed-off-by: ahcorde <[email protected]>
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.
It looks good!
// Copyright 2013, PAL Robotics S.L. All rights reserved. | ||
// All rights reserved. | ||
// | ||
// Software License Agreement (BSD License 2.0) |
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.
Is this potential issue in the ros2_control
repository? Currently, we have everything Apache2.0 licensed. If so, can we discuss this with PAL to change the license?
@bmagyar can you please take a look?
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.
If it is a problem we have no objections to change it to Apache2.0
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.
ok, I have a build working with the use of the new JointHandle (#134). I have also fixed up the tests and they are all passing. You can see my changes in: Should I create a new PR? Here is my review of the code. Most of the code is in the following joint limit policies:
There is also JointLimitsInterface<> that deals with creating these handles via ResourceManager that still needs porting to ROS2. I dont see any ResourceManager class so I think this is blocked on #164 and/or #141. Refactoring: Much of the LimitHandle classes are identical except for the enforceLimits() method. I refactored that common code out into JointSaturationLimitHandle. It's constructor takes joint position state and command handle and a JointLimits object, same as all the saturation limit policies did before. I then derived JointSoftLimitsHandle from the JointSaturationLimitHandle which just adds the SoftJointLimits argument to the constructor. All the policies then derive from one of these base classes and override the pure virtual enforceLimits(...) method. There is some common handling of state and derived velocity as well. This simplified the code a lot and made fixing up easier. These 2 bases classes are at the top of the file. Velocity Handle: The new generalized JointHandle no longer has a get_velocity() method, instead the user should construct a position and velocity handle separately. Therefor another constructor prototype was added that supports passing in position, velocity and command handles. If a velocity handle is not provided then velocity will be computed by position/time (saved previous state). User has a choice of estimating velocity by position deltas or using actual velocity via (ex) a speedometer. Open/Closed Loop: @bmagyar Since state and command handles now have the same interface (under change #134), in fact the new state/command handle arguments are of identical type now....so do we have an opportunity to convert these limit interfaces to support open or closed loop? Since the state handle could be either the position state or a position command handle. Currently the enforceLimits() initially takes from the state handle, but then there-after it compares to previous command and generates a new constrained command. I am not sure I agree with "start with a state value then switch to command value" logic but I am hesitant to change any logic since I am a ros_controls newbie. Plus this is limits, not PID/control logic or something so I may be way off base....thoughts? Did #134 present an opportunity for new behavior? If so, I can probably code it easily into the 2 common base classes above. |
@ahcorde can we close this PR an open the new one wir changes from @guru-florida? @guru-florida the changes in #134 are also kind of temporary since we will move everything to components in the future (when ResourceManager is finished - #164 and #147). Nevertheless, this restructuring you did is anyway needed since the logic behind is similar. Maybe you have some idea how to integrate the limits into components. The example implementation of the PositionJoint is in #140 |
Closing in favour of #181 |
As discussed yesterday in the ros2_control WG, I'm adding this package originally ported by @ddengster
I still need to copy from @ddengster repository the
transmmision_interface
package.@Karsten1987 @bmagyar
Co-authored-by: ddengster [email protected]
Signed-off-by: ahcorde [email protected]