I try to implement a custom robot model to grasp a cube object base on FrankaCabinet Example.
I want to present the action of the gripper with open/close instead of the continuous joint state.Is there some example that using the 0/1 action tensor?
I have tried doing that by multiplying -1 or 1 to the gripper joint position according to the action tensor like this:
I think it’s a totally valid way of doing it. Some tuning of the position controller (motor) parameters - stiffness, damping, max force (effort), joint friction as well as of sia5_dof_speed_scales could be required to match the behaviour of the real robot, but overall it looks good.
In the example above, it seems that the fingers move independently. If one finger is obstructed and unable to reach the target position, the other finger will continue to move towards it’s own target position. Is it possible to create a constraint so that the gripper fingers to move and stop together?
It’s possible, but I think the above script makes the action of “2 gripper” the action of “1 gripper(finger?)”.
Therefore, it seems that abovescript have already achieved what you want to do.
Taking “franka_cabinet.py” as an example, it reduces the action of “rfinger” and makes “rfinger” follow “lfinger” in the opposite direction.
Below are some changes.