-
Notifications
You must be signed in to change notification settings - Fork 276
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
Joint Controllers not working properly when joint limits are specified #1684
Comments
@ahcorde based on your answer I decided to check if everything works. I am using dart version 6.12, and still the joint control in velocity mode fails once the joint reaches position limit. |
Not sure if its strictly related, but I had a similar weird issue. When using the component JointVelocityCmd and setting the velocity close to the velocity limit, the command was completely ignored. Using JointVelocityReset didnt have this issue. Moreover, multiplying with 0.99 solved the issue before sending the command (99% of the velocity limit) but multiplying with 99.9% didn't, implying there might be some rounding error somewhere ? I would expect that if the command is above the limit that a warning is printed if its ignored, and that even if the command is equal or less to the limit it would be executed. Even potentially capping it to the limit and printing a warning, not just ignoring it. I am using Ubuntu 22.04, packages from October Humble sync and Garden with ODE physics. |
Add links in README to the mimic joints isssue & work around. - Upstream Issue: gazebosim/gz-sim#1684 - Work Around PR: ros-controls/gz_ros2_control#86 - Tracking Issue: PickNikRobotics/ros2_robotiq_gripper#7 Signed-off-by: Alexander Moriarty <alex.moriarty@picknik.ai>
Add links in README to the mimic joints isssue & work around. - Upstream Issue: gazebosim/gz-sim#1684 - Work Around PR: ros-controls/gz_ros2_control#86 - Tracking Issue: PickNikRobotics/ros2_robotiq_gripper#7 Signed-off-by: Alexander Moriarty <alex.moriarty@picknik.ai>
Add links in README to the mimic joints isssue & work around. - Upstream Issue: gazebosim/gz-sim#1684 - Work Around PR: ros-controls/gz_ros2_control#86 - Tracking Issue: PickNikRobotics/ros2_robotiq_gripper#7 Signed-off-by: Alexander Moriarty <alex.moriarty@picknik.ai>
Hi, My setup: |
I was able to reproduce the problem and it looks like it's a bug in DART. The following patch to the diff --git a/dart/constraint/JointConstraint.cpp b/dart/constraint/JointConstraint.cpp
index faa072d8f21a..bf032f0ffb2a 100644
--- a/dart/constraint/JointConstraint.cpp
+++ b/dart/constraint/JointConstraint.cpp
@@ -238,7 +238,7 @@ void JointConstraint::update()
// the position error.
const double C1 = mErrorAllowance * A1;
- double bouncing_vel = -std::max(B1, C1) / timeStep;
+ double bouncing_vel = -std::min(B1, C1) / timeStep;
assert(bouncing_vel >= 0);
bouncing_vel = std::min(bouncing_vel, mMaxErrorReductionVelocity);
@@ -280,7 +280,7 @@ void JointConstraint::update()
// the position error.
const double C2 = mErrorAllowance * A2;
- double bouncing_vel = -std::min(B2, C2) / timeStep;
+ double bouncing_vel = -std::max(B2, C2) / timeStep;
assert(bouncing_vel <= 0);
bouncing_vel = std::max(bouncing_vel, -mMaxErrorReductionVelocity);
Without this change |
dartsim/dart#1774 has been merged upstream. This will be available for Harmonic at some point, but will not be fixed for Fortress and Garden. @j-rivero Can we get a release of dart-6.13? |
Has this been fixed in Harmonic? I'm using ROS2 Humble and updated my gazebo to Harmonic in hope to fix this problem, yet it still exists. I'm using the |
Yes, a new version of DART (6.13.1) is now available which should fix this problem, so make sure you've updated DART on your system. |
I have DART(6.13.2) yet still having the same issue. I am using |
I tested it locally following the reproduction steps in the PR description (changing @ufrhaidar can you try to reproduce the steps above? Or do you have an example that can demonstrate your issue? |
I am not using the Both plugins set a
I assumed the DART issue was shared between them both (which it is), but it looks like there might be other issues happening after. @azeey thanks for your help. I'll workaround the issue for now on my end. Will look into the issue furthermore when I have more time. |
@azeey the integral gain issue you mentioned is possibly caused by the |
if you were to use this sdf example.sdf.txt and start the sim
Then wait for the joint to reach the limit and command a negative velocity
does it not get stuck? @livanov93 @ahcorde any updates on this issue? 2024-06-25_17-46-57.mp4 |
I was able to reproduce the issue as well. It seems whether it gets stuck at the joint limit depends on the commanded velocity. In the |
@azeey Yes that was interesting. If you command it before the When I was looking at it last time, i noticed that it was getting stuck in the velocity limit bound section in |
Hi, |
Environment
Description
joint_controller_demo
while the Force mode joint controller is stalling - accumulates the error in the integral component (unless we specify manually some small value - absolute values fori_max
andi_min
) which means the anti-windup clamping method default parameters are too high - at least there should be some "good guess" explanation for the users ofignition::math::PID
and directions on how it works with the transfer function of the joint. The only situation in which Force mode joint controller works without the problem is when the sequential commanded velocities are of similar absolute value with opposite sign.Steps to reproduce
~/.../gz-sim/examples/worlds/joint_controller.sdf
and for modeljoint_controller_demo
and its jointj1
under the<axis>
section add following:Do the same for joint
j1
for modeljoint_controller_demo_2
.make && sudo make install
.ign gazebo joint_controller.sdf -v
ign topic -t "/model/joint_controller_demo/joint/j1/cmd_vel" -m ignition.msgs.Double -p "data: -5.0"
j1
of modeljoint_controller_demo
will not moveign topic -t "/model/joint_controller_demo_2/joint/j1/cmd_vel" -m ignition.msgs.Double -p "data: 5.0"
ign topic -t "/model/joint_controller_demo_2/joint/j1/cmd_vel" -m ignition.msgs.Double -p "data: -0.5"
j1
of modeljoint_controller_demo_2
will stall and start moving after > 30 secondsOutput
joint_controller.mp4
The text was updated successfully, but these errors were encountered: