NVlabs / curobo

CUDA Accelerated Robot Library
https://curobo.org
Other
796 stars 125 forks source link

remove_obstacle() function seems to fail work #373

Open linhy97 opened 3 months ago

linhy97 commented 3 months ago

Hello, when i try to use remove_obstacle() to update the world model, since i need to consider attach an object to the robot, and set the object invisible, it seems fail.

A simple example is listed below:

obstacle_table = Cuboid(name="obs_table", pose=[0, -0.35, -0.15, 1, 0, 0, 0], dims=[0.85, 1.2, 0.78])
list_obstacle_cube = [obstacle_table]
world_model_base = WorldConfig(cuboid=list_obstacle_cube)
print("Number of cuboids:", len(world_model_base.cuboid))

world_model_base.remove_obstacle(obstacle_table)
print("Number of cuboids after remove:", len(world_model_base.cuboid))
world_model_base.remove_obstacle('obs_table')
print("Number of cuboids after remove:", len(world_model_base.cuboid))

The corresponding output is:

Number of cuboids: 1
Number of cuboids after remove: 1
Number of cuboids after remove: 1

I am confused about the results after executing remove_obstacle() function. If the obstacle "obs_table" is removed, the number will change to zero? Hope for your help~

will-44 commented 20 hours ago

Hello, I have the same problem. Did you manage to solve it?

balakumar-s commented 20 hours ago

Our current implementation of collision checking only accesses WorldConfig.objects to parse the obstacles. The remove_obstacle() currently only removes it from objects. It doesn't remove from each obstacle type. Check world_model_base.objects for the correct number of obstacles.

will-44 commented 18 hours ago

Thank you for your answer ! I was able to remove an obstacle thanks to your advice.