-
Notifications
You must be signed in to change notification settings - Fork 314
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
[bug] Gazebo gripper control is broken #172
Comments
Hi @rickstaa, thanks for working on this and the whole moveit integration. The problem with this approach is the way how the grasping works. You probably already noticed the statemachine logic inside franka_ros/franka_gazebo/src/franka_gripper_sim.cpp Lines 147 to 191 in 1922fc9
Right now, the target width With your solution, as soon as the fingers reach the desired width +/- threshold they would stop and don't hold the object tight! Our original solution with the ternary operator was to specify widths beyond the desired width (i.e. 0 or 8cm) and use the width from the goal only after the grasp was established to check if the action succeeded or failed: franka_ros/franka_gazebo/src/franka_gripper_sim.cpp Lines 457 to 469 in 1922fc9
Please correct me if this is not the indented way how this gripper command action is supposed to work, though. |
@gollth Thanks again for your quick and concise answer! I apologize in advance for the lengthy discussion below. I tried to be as brief as possible, but it amounts to a long read.
I tried debugging my code, but I could not reproduce this behaviour. I can not find any code that transfers the state machine to franka_ros/franka_gazebo/src/franka_gripper_sim.cpp Lines 149 to 168 in 1922fc9
I, however, discovered two other problems that are present in my solution. First, please allow me to explain my motivation. I opened this issue to make sure the gripper behaviour in the simulation is as close as possible to that of the real robot. If I remember correctly, when using MoveIt on the real robot, I could set both a specific width and grasp objects (please correct me if I'm wrong, I haven't tried this behaviour in the last months). Also, when I checked the franka_ros codebase, and I noticed that the franka_gripper node handles the My investigationI quickly checked the codebase of the franka_gripper package. To my current understanding, in the
In this case, the gripper keeps moving, even when an object is encountered, applying the force needed to lift the object. The ' grasp ' action is executed when the gripper width is more significant than the current width.
I can't look into the FCI, but I think this action tries to apply the requested force. Current problemsInstabilities in the gazebo velocities due to arm or hand PID GainsI think this is related to our discussion in #161 and possibly #160. When the arm shakes a bit due to the non-perfect PID gains of its controllers, the finger joint velocities are affected. As a result, they do not become lower than the In the old codebase, this behaviour goes unnoticed since the gripper only moves between the open and closed positions due to the ternary expression. In these positions, the gripper is in contact with the external world, which damps out the instabilities caused by the high derivative gain. MoveIt doesn't send the max_effortI noticed that MoveIt currently doesn't allow users to set the This is not a problem with your API but a feature request that should be opened on the MoveIt repository. |
Hi @rickstaa,
Yes your are absolutely right, I was confusing things in my mind. Sorry about that. So #173 should work and bring Regarding the problem you have with getting stuck in # File: franka_gazebo/config/franka_hw_sim.yaml
franka_gripper:
type: franka_gazebo/FrankaGripperSim
arm_id: $(arg arm_id)
finger1:
gains: { p: 1000, i: 0, d: 0 }
finger2:
gains: { p: 1000, i: 0, d: 0 }
grasp:
resting_threshold: 0.05
consecutive_samples: 10 (I'm think we should even move the So I suggest we discuss in #173 about how to merge that and hopefully you can continue with these gains with the MoveIt update. How does that sound? |
This commit improves the gripper PID gains since the old gains caused the gripper to oscillate around a given setpoint (see frankaemika#172).
base ns This commit mose the 'resting_threshold' and 'consecutive_samples' to the base ns since they also apply to the 'gripper_action' action server (see frankaemika#172).
base ns This commit mose the `resting_threshold` and `consecutive_samples` to the base ns since they also apply to the `gripper_action` action server (see frankaemika#172).
This commit improves the gripper PID gains since the old gains caused the gripper to oscillate around a given setpoint (see frankaemika#172).
base ns This commit mose the `resting_threshold` and `consecutive_samples` to the base ns since they also apply to the `gripper_action` action server (see frankaemika#172).
This commit improves the gripper PID gains since the old gains caused the gripper to oscillate around a given setpoint (see frankaemika#172).
As stated in #180 (comment) I think the behaviour that was pointed out by @rhaschke in #173 (comment) would be the desired behaviour to solve this issue.
|
@gollth, @marcbone Thanks a lot for improving the grasping behaviour! I performed some grasping tests using the new development branch, and I think you are close to solving this issue. I, however, found the following problems. Move actionThe move action gives some peculiar behaviour when moving the gripper beyond the stone object boundary. This is not too problematic since the move action is not meant to grasp objects. I, however, wanted to make you aware of this issue since it might confuse people when they try out the tutorial. In the gif below, I first close the gripper using the Stone: <?xml version='1.0'?>
<sdf version='1.7'>
<model name='stone'>
<pose frame=''>0.000286 -0.221972 0.475172 7.5e-05 3.5e-05 0.003179</pose>
<scale>1 1 1</scale>
<link name='link'>
<pose frame=''>0.000286 -0.221972 0.475172 7.5e-05 3.5e-05 0.003179</pose>
<velocity>0 0 0 0 -0 0</velocity>
<acceleration>0 0 -9.8 0 -0 0</acceleration>
<wrench>0 0 -0.49 0 -0 0</wrench>
</link>
</model>
</sdf> My cube:
Gripper actionIn the current form, the gripper action still is unable to grasp objects (see gif). rostopic pub --once /franka_gripper/gripper_action/goal control_msgs/GripperCommandActionGoal "goal: {command: {position: 0.0, max_effort: 5}}" Grasp actionThe grasp action works! rostopic pub --once /franka_gripper/grasp/goal franka_gripper/GraspActionGoal "goal: { width: 0.03, epsilon:{ inner: 0.005, outer: 0.005 }, speed: 0.1, force: 5.0}" |
This is kind of expected, when you pass a gripper command position of 0.0. When you check the result of the action or the documentation of franka_gripper you will find out why. For the same reason, grasping works in your example above |
Thanks @rickstaa for finding that out. Would you mind a PR? |
@gollth I'm happy to create a pull request. I however have to know which materials you want to use. Maybe stone for the stone and wood for the trays. |
Stone made of stone material, sounds legit =D |
For future reference, part of the discussion of this topic is found in #173. |
To summarize. My bug report is related to closely related issues:
|
This commit reverts to using the old gripper PID gains since these make sure that the Move action works. These gains however break the grasp action. This fix will be applied till frankaemika#172 has been fixed. The downside of this fix is that the grasp action does timout.
This commit reverts to using the old gripper PID gains since these make sure that the Move action works. These gains however break the grasp action. This fix will be applied till frankaemika#172 has been fixed. The downside of this fix is that the grasp action does timout. Without this fix however the gripper is not able to work when it is not horizontal.
This commit reverts to using the old gripper PID gains since these make sure that the Move action works. These gains however break the grasp action. This fix will be applied till frankaemika#172 has been fixed. The downside of this fix is that the grasp action does timout. Without this fix however the gripper is not able to work when it is not horizontal.
* commit '6aaa08926fc686b1492d8b36f985eb6f260b3de5': CHANGE: Reformat CHANGELOG ADD: franka_gazebo as dependency to franka_ros meta package
Bug Report: Gripper Simulation IssuesFeedback and InvestigationI received user feedback regarding issues with the gripper simulation, as reported in GitHub issue #33. To address these concerns, I investigated whether the problems had been resolved upstream. Below are my findings: Current Gripper Simulation StatusThe simulated gripper has seen improvements since the initial report. However, two critical bugs persist:
Proposed ImprovementsAddressing these issues will enhance the usability of the Panda simulation for RL research. Specifically, it allows users to specify a gripper width with a max force, enabling the gripper to apply that force to encountered objects. Gripper Simulation InvestigationOverview
[1] This is possible when increasing the Move Action InvestigationThe Move action:
Grasp Action:
Gripper Action InvestigationThe Move action:
Grasp Action:
Grasp ActionThe Grasp The /franka_gripper/grasp/goal action successfully grasps objects when the correct gripper width or the inner epsilon is configured to match the gripper width. |
@gollth, following my investigation, I've revised the issue body to include my latest proposed improvements. Feel free to tag me if you have any questions. |
Old bug report
In the current version, when working with the gazebo simulation, the gripper width that is sent to the
/panda/franka_gripper/gripper_action/goal
topic is not handled correctly. The problem is caused by the following code:franka_ros/franka_gazebo/src/franka_gripper_sim.cpp
Line 436 in 054af53
Due to this, the desired gripper with now becomes
0
when the gripper width is smaller than the current gripper width and0.08
when it is bigger than the current gripper width. Consequently, users can now only open/close the gripper.I created #173 to address this problem.
Steps to reproduce
libfranka
library.roslaunch panda_moveit_config demo_gazebo.launch
.Updated bug report
The gazebo gripper actions are not functioning as expected. This makes them less useful than they could be. The simulated gripper has improved since this bug report was initially posted (see the
Old bug report
item above). Two critical bugs persist:Gripper PID Gains:
/franka_gripper/gripper_action/goal
Action to set the gripper width accurately when the gripper is vertical.Gripper Action Behavior:
/franka_gripper/gripper_action/goal
action should be enhanced. It should enable position control when measured efforts are belowmax_effort
and switch to force control otherwise to maintain the desired grasp force.Proposed Improvements
Addressing these issues will enhance the usability of the Panda simulation for RL research. Specifically, it allows users to specify a gripper width with a max force, enabling the gripper to apply that force to encountered objects.
The text was updated successfully, but these errors were encountered: