I finally found the time to look into this problem again. Here are my findings:
- I increased the mass of the boxes and played around with their surface properties. I got stable contacts, but no matter what values I tried, the behavior would be exactly the same: the top box always stays unaffected when I pull the stack.
- Then I thought about trying to move the stack without the robot. I applied a force to the bottom box, and surely enough, the stack moved as expected.
- And then I thought about repeating the experiment with a robot, but this time, a simplified one. Once again, the stack moved as expected
C:\fakepath\box-stack-test.gif
So, the conclusion is that this isn't about surface properties, but it has to do with the robot model itself. I pull a stack by attaching a joint between the robot and the bottom box, thus the box becomes an extension of the robot. So, both cases (stack-pull and shelf-rotation) exhibit the same problem: a moving link on the robot doesn't transfer forces to the (top) box. I'm still not sure what's going on, but if I had to guess, I'd say this has to do with inertias.
Edit:
I figured it out. It turns out, this has nothing to do with either contact or model properties. (I even tried to play around with the inertias of the links, but it made no difference)
At some point, I noticed that the velocity of the joints on the robot is always close to zero. That led me to believe that the state of the links is not properly propagated to the boxes, so that's why the boxes don't move. After some digging, I was pointed to the control of the joints. I have been using position controllers. I thought that having the robot hw sim directly call Joint::SetPosition might be the culprit. So I added pid gains for the joints to change the control mode to POSITION_PID (thus doing effort control), and suddenly everything worked as expected (the stack can be manipulated, the box rotates with the shelf link on the robot, and the joint velocities are reported properly).
Originally posted by nlamprian with karma: 833 on 2020-03-01
This answer was ACCEPTED on the original site
Post score: 0
Original comments
Comment by azeey on 2020-03-11:
I did a quick test on this where I put a prismatic joint between the world and the bottom box. The boxes move together (as expected).
I pull a stack by attaching a joint between the robot and the bottom box, thus the box becomes an extension of the robot.
Are you setting the joint velocity of the joint between the robot and the bottom box or is this a fixed joint?
An sdf file that reproduces the problem would be very helpful if you can create one.
Comment by matteolucchi on 2020-07-01:
"So I added pid gains for the joints to change the control mode to POSITION_PID (thus doing effort control)"
@nlamprian How did you do this ?
Comment by nlamprian on 2020-07-01:
Upload the pid configs under the /gazebo_ros_control/pid_gains/joint_name
namespace. See here.
FYI That did not solve all my problems. I now do have to work with the surface parameters, and fix issues like, for example, where the boxes are sliding by themselves, while at the same time, the gripper on the robot is unable to move them (even with high effort and pid gains)