frankaemika / franka_ros

ROS integration for Franka research robots
https://frankaemika.github.io
Apache License 2.0
351 stars 308 forks source link

Gazebo model joints move by themselves #160

Open saalimperator opened 3 years ago

saalimperator commented 3 years ago

Hello!

I'm currently working with your Gazebo model to test my controller. To do this, I modified one of your example controllers so that all joints except the first one keep their current angle. The first one is waiting for input from my controller, which is applied directly to the joint using the ".setCommand(tau)" function.

Now for my problem: when I start Gazebo, it seems to maintain the initial state, but after a few seconds the first joint starts to move slightly counterclockwise without any input from me. Is this normal behavior of this joint when the input is set to zero? Or is there something wrong with the inertia, friction and damping of this joint. When I send some inputs to this joint, it starts to move, but it is not slowed down by friction or damping and just bounces back when it hits the joint limits.

Can you give me a hint where I am doing something wrong?

rickstaa commented 2 years ago

@gollth Although, I agree with you that the problem as it was originally described by @sallimperator has been fixed the underlying problem still is present. I however think we can close #160 and continue the discussion on this problem in #233.

rickstaa commented 2 years ago

Although franka_hw_sim_plugin handles the gravity compensation for the arm, there is no gravity compensation in franka_gripper_sim. This causes the gripper commands to not work correctly when the gripper fingers are not in the same horizontal plane. I had to completely disable gravity in the simulation to make the gripper work in such configurations.

@justagist Thanks for your comment! @marcbone I think this is closely related to my comment in #173 (comment). The gripper PID gains might be easier to tune when the gravity of the fingers is also compensated! I however do not think that this is the major cause of the drift we observe when the hand is attached when using the DART physics engine (see figure below).

See gif

I just double-checked and for the gripper joints the gravity is being compensated:

https://github.com/frankaemika/franka_ros/blob/30dc6b8cc3627a9687636dc8811c3409b58027fc/franka_gazebo/src/franka_hw_sim.cpp#L365-L377

Could still be that the component of the gravity of the finger and hand on the other arm joints is not being handled (see https://github.com/frankaemika/franka_ros/issues/160#issuecomment-1016346267).