ucsdarclab / dVRL

Contains Reinforcement Learning environments for the da Vinci Surgical System
55 stars 11 forks source link

How is the grasping controlled? #12

Closed Cladett closed 4 years ago

Cladett commented 4 years ago

Hello, I have been playing around with the pick task. And I have few questions...

1) Based on what I have understood, the object position is controlled by the dummies. So also the grasp refers to it. What is not clear to me is why there is no threshold that defines when the grasping is successful or not. If i have understood correctly, inside _PsmEnvpositioning.py the line 113 self.obj.isGrasped(ignoreError = True, initialize= True) Here i am basically declaring this so that the object isGrasped for all the methods inside the file rather than __resetsim() where in line 268 removeGrasped is called correct?

2) In simObjects.py the are the definition of removeGrasped adn isGrasped From what i can understand

removeGrasped sets the object parentless since parenthandle=-1 isGrasped always returns false because has the control with not(object is parentless) Is this correct? Opening the .ttt file with vrep i can see the the obj is decleare already without any parents. So I am a bit confused on why the control of the grasp is based on checking the parent of the object.

3) Once the EE actually grasps the object. It's not clear to me how the movement of the object is actuated. Because inside _set_action(action) the only position that is controlled/set is the one of the EE while setObjectPosition is never called. So how does the object movements take place?

Thanks, Cheers

bango123 commented 4 years ago

The grasping simulation is programmed into the V-REP scene and done in the following way:

  1. The object is first detected by the proximity sensor to indicate the object is in the gripper
  2. Then the gripper value must be less than a set threshold to declare it is grasping
  3. If both 1 and 2 hold true, the object is then rigidly attached to the kinematic chain of the end-effector.

So in the python code, only the parent object needs to be checked to see if the object is grasped or not.

Cladett commented 4 years ago

Thank you for you answer.

Where does point 1, 2, 3 are implemented in the code? Mainly, where is the set threshold of point 2 declared in the code?

So based on point 3 once the object is grasped the the arm becomes the parent which is why you check that for checking the grasp ?

Thank you

bango123 commented 4 years ago

Yes that is correct. And the code for all of this is in the V-REP *.ttt files which is located in dVRL/dVRL_simulator/environments/pick_ee_dockerfile. Then it should be a child script in the PSM model. I forget which exact component it is a part of, and I can check later if you do not find it (I am unable to check right now).

Cladett commented 4 years ago

Thank you very much. I found them!