qgallouedec / panda-gym

Set of robotic environments based on PyBullet physics engine and gymnasium.
MIT License
506 stars 109 forks source link

The gripper will pass through the object #3

Closed ZY-KK closed 3 years ago

ZY-KK commented 3 years ago

Hello, first of all, thank you for the work, but I have a question. When I create the robot and make robot grasp a object, the gripper will pass through the object, and the contact point detect is zero, could you please tell me why I met this?

qgallouedec commented 3 years ago

Hi, You should not encounter this behavior. Can you send a screenshot of the rendering? Can you publish the code to reproduce this behavior?

ZY-KK commented 3 years ago

I add a object in certain position, and when I try to control robot to grasp it , it pass through the object, and also the robot even can pass through the table I add, did I add wrongly? I just add object by using p.loadURDF

ZY-KK commented 3 years ago

image as the picture shows, the finger actually pass through the object and if I try to lift it, object will not be lifted

qgallouedec commented 3 years ago

Hi,

In order for me to work on this issue, I need to be able to reproduce it. The first step is to publish the minimal code that allows to reproduce it. (This is a good practice in solving issues on Github.)

With the little information you gave me, I wrote the following code, for which I don't observe any collision problem.

import panda_gym
from panda_gym.pybullet import PyBullet
from panda_gym.envs.robots.panda import Panda

sim  = PyBullet(render=True)
panda = Panda(sim, base_position=[0.0, 0.0, 0.6])
panda.reset()
sim.loadURDF(body_name='table', fileName='table/table.urdf', basePosition=[0.0, 0.0, 0.0])

while True:
    sim.step()
    panda.set_action([0.00, 0.00, -0.02, 0.00]) # going down, by 2 cm per step
    sim.render()

Screenshot 2021-06-22 at 11 28 18

Could you send me the minimal code for which you observe this problem?

ZY-KK commented 3 years ago

Thanks for your answer, I do not know the reason, but now it works, maybe because I modify some code. One question, when run the code, actually robot move slowly, could you please tell me how can accelerate the move speed?

qgallouedec commented 3 years ago

Reusing the previous code, you only need to modify the value of the action.

To go down, 2 cm per step:

action = [0.00, 0.00, -0.02, 0.00] # [speed_x, speed_y, speed_z, speed_fingers]
panda.set_action(action) 

If you want to discuss about the robot control, please open a new issue.