-
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
Fixes franka_gripper_sim GripperCommand action #173
Fixes franka_gripper_sim GripperCommand action #173
Conversation
13b62de
to
68f4978
Compare
Please check the |
68f4978
to
b2a1582
Compare
@gollth I went ahead and apply your suggestion in #172 for the change of namespace. If you want, we can merge rickstaa#6 into #173 or create a new pull request. The related doc change can be found in frankaemika/docs#13. |
@gollth There still appears to be an issue with the state machine when the PID gains you gave in #172. It still does not transfer from the
In the related comment (#172 (comment)), during testing you use the config/franka_hw_sim.yaml to increase both the Please let me know where you want to add these values or apply them yourself using |
I did one last investigation into the behaviour under different PID gains. I did this both for the Gripper_action step responseOld PID gainsNew PID gainsMove action sinusoid responseOld PID gainsNew PID gainsConclusionFrom these experiments, you can see that although with the new PID gains the resting velocities are lower, the overall behaviour is a lot worse. This is expected since no derivative gain is added to smooth out the motion and no integral gain to get rid of a steady-state error. Unfortunately, I therefore think the old gains are closer to the optimal gains. For the state machine to transfer from Further tuningI tried to tune the gains manually again, but I keep getting gains close to the old ones (i.e., Furthermore, I also tried using MATLAB to tune the PID gains (see https://www.youtube.com/watch?v=ENhFepqjFOY and the zip below) this however gives me a wide range of gains. I think this is since I'm not directly controlling the joint, but sending commands to the action server. As a result a lot of the control commands get cancelled. |
@gollth To ensure the velocities are not resulting from the arm controller, I also checked the old PID gains while running the
Incorrect PID gainsFor my investigation, see #173 (comment). Incorrect dynamicsI quickly investigated the effect of the dynamic parameters.
I interchanged the inertias you provided by the ones used in the justagist/franka_panda_description repository. If we keep the mass the same (i.e. To me, To conclude, I think the oscillations are caused by an interplay between the PID gains and the dynamic properties. Maybe you can verify the finger weight such that we can try to retune the PID gains again. If that doesn't help, we can create a question on the ROS or gazebo forms to see if somebody encountered this behaviour on other robots. Bugs in gazeboI checked the gazebo repo but only found issues with the velocity calculation when a joint is in contact with an object (i.e. gazebosim/gazebo-classic#622 and gazebosim/gazebo-classic#634). Further, given the fact that we can actually see the fingers shake, I don't think this problem is caused by a bug in Gazebo. |
55fbfcc
to
286feb6
Compare
This commit makes sure that users can also send gripper widths between 0.0 and 0.08. In the old version the gripper would only open and close based on whether the set gripper width was smaller or bigger than the current width.
286feb6
to
a706b12
Compare
This commit adds a temporary fix for the problems explained in frankaemika/franka_ros#161. This fixed can be removed when frankaemika/franka_ros#173 is merged.
@marcbone Thanks for your comment. I see what you mean the franka_ros/franka_gripper/src/franka_gripper.cpp Lines 54 to 55 in ac1e07d
In that case, closing this pull request makes sense since we want the simulation to mimic the actual robot behaviour. However, there is one downside with this: users can not set a specific with using MoveIt. They have to use the Ideally, there would be another @rhaschke Do you think not having the ability to set a specific width using MoveIt is a significant problem? |
@marcbone, so the real hand doesn't allow to drive the gripper to a specific position (different from fully opened / closed)? In any case, the simulation should, of course, reflect real robot behavior. |
@rhaschke On the real robot, I normally set the gripper to a specific position using the franka_gripper::MoveAction(width, speed) action. This action is found on the The main problem is that MoveIt, to my knowledge, only works with the control_msgs.msg.GripperCommand msg while the franka_ros/franka_gripper/action/Move.action Lines 1 to 6 in ac1e07d
As a result, people can not set the gripper width using MoveIt since the |
Indeed, MoveIt can only interact with |
Is there a trajectory controller available for the gripper? |
We can offer you to change the gripper command so that if the max_effort is 0 we use the gripper.move() command instead. Would that work for you? You could then move gripper to a desired width and would still be able to grasp an object with a certain force. There is no trajectory controller available for the gripper since all gripper commands are blocking. |
That sounds reasonable. |
@marcbone I think your proposed solution is more intuitive and gives us a way to implement both the @rhaschke When @marcbone implements his solution. Until we implement a solution at our end I think we have to increase the |
I will open an issue on https:/ros-planning/moveit when @marcbone solution has been merged into the |
@rickstaa, I think you can start development at the MoveIt side already. Currently, a non-zero gripper effort can be specified via the trajectory. I think we should add the possibility to
|
@rhaschke I created moveit/moveit#2956. I can not give an ETA when I have time to implement this but please add me under assignees so that I don't forget. |
Thinking about the issue a little deeper, I think that your GripperAction misbehaves. Please correct me, @marcbone, if I'm wrong.
As far as I understand, the current implementation kind of ignores the position argument of that message, but either attempts to fully open or fully close the hand depending on whether the current position is smaller or larger than the commanded position. |
For the record, it was really a problem with poorly tuned gains for the gripper sim. With drastically reduced I + D gains the behavior is much more stable: |
Good idea @rhaschke! However we tried to stick as close to the implementation of the |
@gollth I will answer #172 (comment) here to keep the discussion in one place.
I indeed expected the
As discussed earlier, this ternary expression makes it so that MoveIt can only franka_ros/franka_gazebo/src/franka_gripper_sim.cpp Lines 467 to 468 in 414bcb1
This behaviour can also be observed in the rostopic pub --once /franka_gripper/grasp/goal franka_gripper/GraspActionGoal "goal: { width: 0.0, epsilon:{ inner: 0.005, outer: 0.005 }, speed: 0.1, force: 5.0}"
I fully understand that you want to stick as close to implementing the real I think @marcbone's suggestion together with moveit/moveit#2956 would solve the
Additionally, @rhaschke suggestion would allow us also to grasp objects. I will leave the actual implementation to you, but I just wanted to sketch which problems we are experiencing from the MoveIt side. |
I just noticed that we could make MoveIt grasp by setting the franka_ros/franka_gazebo/src/franka_gripper_sim.cpp Lines 29 to 30 in 414bcb1
Together with @marcbone suggestion, this would allow MoveIt to both move and grasp. @rhaschke are you okay with using that ROS parameter for MoveIt? |
Correction, it appears that setting the franka_ros/franka_gazebo/src/franka_gripper_sim.cpp Lines 466 to 469 in 414bcb1
Setting it to a value greater than the gripper width (i.e.
We have to set the max_effort to be negative: rostopic pub --once /franka_gripper/gripper_action/goal control_msgs/GripperCommandActionGoal "goal: {command:{position: 0.0, max_effort: -5.0}}" |
Why adjust the tolerance instead of the actual desired grasping position? When you want to plan a grasping motion you should have an idea of the size you want to grasp no? |
@gollth Oh, I see. Sorry for being unclear in my previous comment. My comment above was about how I can hack the
This is true when you have information about the grasping object, and you can use this information to get a grasping Pose. I also have use-cases where I don't care about the object width, but I want the gripper to close while making sure that it keeps applying a force without the force exceeding the To conclude, I think the current implementation of the grasping service is perfect since it allows the user to specify a specific grasp. I, however, think that the
By doing this, users can now both move and grasp in MoveIt (on the real and simulated robot). I also think this makes more sense given the structure of the GripperCommand message. I also don't think this change removes functionalities since you already supply a |
@gollth, I tested your new gains, and I'm sorry, but they do not work correctly on the simulated robot. They seem to work when the hand is horizontal since there is no gravity being applied to the fingers. However, when I turn the gripper by some degrees (i.e. 90 in the example below), the low gains cannot move the fingers up (see gif 1). I improved the behaviour by increasing both the P, I and D values again (see gif 2/3). The velocities now stay in the |
* commit 'b7a8cb1bcbca55fedbca0d215ce304f30cd9cb7b': increase grasp counter to fix going into holding state at low speeds CHANGE: Refactor finger collision models to macro ADD: Changelog entry FIX: Tune parameter for fingers to grasp successful in franka_gazebo FIX: Also apply forces in correct direction for "opening" grasps CHANGE: Finger collision meshes to primitive boxes FIX: Add slight offset between fingers in initial positions
@gollth I just realized that I checked the It is, however strange that these velocities are not present when using the moving service. The oscillations are, therefore, closely related to the logic you use for the GRASP state. This is because the current logic assumes that the gripper comes into contact with another object which helps dampen out the velocity oscillations of the fingers. |
* commit 'c5e0f61aacdcb3b8ef08adec03c78114b741d0ec': bump version
This commit makes sure that users can also send gripper widths between
0.0
and0.08
. In the old version the gripper would only open and close based on whether the set gripper width was smaller or bigger than the current width.I explained the problem in #172.