jrl-umi3218 / mc_panda

Panda's RobotModule and extensions for mc_rtc
BSD 2-Clause "Simplified" License
8 stars 6 forks source link

Create a passiv joint #12

Closed Viv276 closed 2 years ago

Viv276 commented 2 years ago

We are trying to create a passive joint in a new part of the robot. In the .urdf we use a "revolute" joint with an effort="0", but in the simulation the joint is acutated. First we try to set the joint stiffness to 0, this has no impact. We found the possibilty to set unactive joints and this works, but the joint is rigid. We want to have a free-swinging joint, like a pendulum.

Could you help us to create a passive joint?

Thanks for any help in advance!

ndehio commented 2 years ago

Hi @gergondet

this student is affiliated with my former lab in Germany. I am not sure if mcrtc currently allows specifying kinematic chains with single non-actuated (passive) joints, similar to the floating-base of legged robots? Maybe this pendulum-link can be treated as a separate free-floating robot (like a box) but then we would need some advanced constraint (representing the passive joint) to connect the pendulum-link to the panda end-effector.

@Viv276 one option you might consider is simulating "joint friction" through control, by applying a posture-task (using "unactive" for the 7 normal panda joints) with zero stiffness and a small damping value. The robot controller then decelerates the passive joint. This avoids your pendulum to swing forever.

gergondet commented 2 years ago

Hello @Viv276

Sorry it took me so long to get back to you on this but I wanted to find the time to try some things out. I didn't but I'll leave an answer anyway since it's been so long already.

In the .urdf we use a "revolute" joint with an effort="0", but in the simulation the joint is acutated.

This is only half of the solution. The other half is to make sure you are using a dynamics constraints and not a kinematics constraint. Otherwise the effort is not used anywhere in the problem formulation and in fact it is the same as any actuated joint as far as the controller is concerned. Having a torque limit of zero (i.e. effort="0" in the URDF) and a dynamics constraint (which mainly adds the equation of motion to the constraints) should do the trick (unfortunately I couldn't find time to test it out)

First we try to set the joint stiffness to 0, this has no impact. We found the possibilty to set unactive joints and this works, but the joint is rigid.

These are only acting on the task so they won't really affect the "nature" of the joint.

ndehio commented 2 years ago

I think this issue can be closed now.