gazebosim / gazebo-classic

Gazebo classic. For the latest version, see https://github.com/gazebosim/gz-sim
http://classic.gazebosim.org/
Other
1.19k stars 480 forks source link

Joint velocities are high when the joint link is in contact and the joint is not rotating #622

Open osrf-migration opened 11 years ago

osrf-migration commented 11 years ago

Original report (archived issue) by Jesper Smith (Bitbucket: jespersmith).

The original report had attachments: handState.png, jointAngleVelocityJ1.png, jointAngleVelocityJ2.png, Screenshot from 2013-05-09 09:14:34.png, Screenshot from 2013-05-09 09:14:39.png, VelocityTestCase.png


When a torque is applied on a joint and the joint link is in contact with an object such that the joint is stationary, the joint velocity is non-zero and can be quite large depending on the force.

I did a simple test using the sandia hands grabbing a cylinder. I've attached a screenshot of the state of the robot. On the joints left_f0_j1 and left_f0_j2 I applied an open loop force of 1.0 Nm using joint->setForce(0, 1.0) in a model plugin.

For this test I set the damping of the fingers to 0.1 and disabled the velocity limits. The physics are done using the standard parameters.

When the finger contacts the cyclinder and is in a steady state, the angle is constant and the corresponding joint velocity should also be zero. However, the joint angles and velocities in steady state are

left_f0_j1
  - Angle: 0.9 rad
  - Velocity: 5 rad/s
left_f0_j2
  - Angle: 1 rad
  - Velocity: 8 rad/s

I've attached the graphs of the test over 6 seconds to this bug report as well.

If P(I)D control is used to control the finger angle, it can easily become unstable when the finger hits an object. Depending how the velocity limits are implemented this could also lead to instabilities.

All tests are done using the gazebo_1.5 branch.

osrf-migration commented 11 years ago

Original comment by Jesper Smith (Bitbucket: jespersmith).


Joint velocities of left_f0_j1 vs joint angles

osrf-migration commented 11 years ago

Original comment by Jesper Smith (Bitbucket: jespersmith).


Joint velocities of left_f0_j2 vs joint angles

osrf-migration commented 11 years ago

Original comment by Jesper Smith (Bitbucket: jespersmith).


osrf-migration commented 11 years ago

Original comment by Jesper Smith (Bitbucket: jespersmith).


osrf-migration commented 11 years ago

Original comment by Jesper Smith (Bitbucket: jespersmith).


osrf-migration commented 11 years ago

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


Is that cylinder static? I'm working on replicating the bug.

osrf-migration commented 11 years ago

Original comment by Jesper Smith (Bitbucket: jespersmith).


No, the cylinder is a 10kg object in world. I've pushed my world file here

https://bitbucket.org/jespersmith/gazebostatecommunicator/src/4b84fd75562c009abccd8465fdc8d8edf94c9638/launch/models/hand.world?at=default

The hand on box model I use (with the reduced inertias for the hand) is in

https://bitbucket.org/jespersmith/gazebostatecommunicator/src/4b84fd75562c/launch/models/gazebo_models/sandia_left_hand_on_box?at=default

osrf-migration commented 11 years ago

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


I think that's a private repo, I get access denied messages.

osrf-migration commented 11 years ago

Original comment by Jesper Smith (Bitbucket: jespersmith).


My bad, you should be able to access it now

osrf-migration commented 11 years ago

Original comment by John Hsu (Bitbucket: hsu, GitHub: hsu).


Hi Jesper, how are you computing the joint angle and velocity? John

osrf-migration commented 11 years ago

Original comment by Jesper Smith (Bitbucket: jespersmith).


John, I use a Gazebo model plugin with JointPtr->GetAngle(0).Radian() and JointPtr->GetVelocity(0). I did not apply any filtering on the angular velocities.

I've differentiated the angle for testing purposes and when the joint is in contact the joint velocity is zero.

osrf-migration commented 11 years ago

Original comment by John Hsu (Bitbucket: hsu, GitHub: hsu).


osrf-migration commented 11 years ago

Original comment by John Hsu (Bitbucket: hsu, GitHub: hsu).


This is largely due to the non-convergence of contact solution. One way to mitigate this problem was by having very large joint viscous damping values (stabilizing solution with cfm damping) for example, in qual 2, if one were to grasp the cordless drill:

qual 2 grasp cordles drill

Increasing joint damping from 1 to 30 Nms/rad:

rosservice call /sandia_hands/set_joint_damping "damping_coefficients: [30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0,
  30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0]" 

results in the residual joint velocity drops as shown in plot below:

joint velocity during grasp

simulation is more stable in this case, but you're familiar with the down side :)

osrf-migration commented 11 years ago

Original comment by Nate Koenig (Bitbucket: Nathan Koenig).


If this is a nonblocking issue, can we put it on hold until after the VRC?

osrf-migration commented 11 years ago

Original comment by Jesper Smith (Bitbucket: jespersmith).


We are succesfully working around it ( integrating position)

osrf-migration commented 11 years ago

Original comment by Jesper Smith (Bitbucket: jespersmith).


osrf-migration commented 11 years ago

Original comment by Jesper Smith (Bitbucket: jespersmith).


Now the VRC is over, I'm re-opening this bug. During the competition we found that this bug also affected us when sitting in the vehicle (or just touching the mud layer). The joint velocities of stationary joints where not reported as zero, making it necessary to avoid the seat altogether (see picture).

osrf-migration commented 11 years ago

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


@jespersmith Can you advise us on constructing a simple model / world file that illustrates this bug? I'd like to build a regression test for it, but we need a test case. We can start with the Sandia Hand test case, but it would be instructive to see if we can reproduce it with simpler models, ie. sandia-hand with only two fingers, then one finger, then a double pendulum or single pendulum.

osrf-migration commented 11 years ago

Original comment by Jesper Smith (Bitbucket: jespersmith).


It is probably reproducible with a 2 link, 1 rotational joint model. First link is fixed, second link resting on a stop. I added a simple schematic, probably if you put a torque on J1 you can see this behaviour. If not, I'll try to make a test case coming Thursday.

osrf-migration commented 11 years ago

Original comment by Jesper Smith (Bitbucket: jespersmith).


Proposal for simple testcase

osrf-migration commented 11 years ago

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


osrf-migration commented 8 years ago

Original comment by Nate Koenig (Bitbucket: Nathan Koenig).