Closed arjung128 closed 2 years ago
Sorry for the late reply.
Yes, self.planning_world.collide_full()
check for collisions with the pointcloud added using update_point_cloud()
.
update_point_cloud()
takes in pointcloud of the obstacles only (please manually remove the robot points). The point cloud should be in the robot base frame.
For your example, your provided point cloud includes the robot points. Please remove them and try to put the point clouds in the robot base frame.
I didn't see you call planning_world.collide_full()
in the provided code. Also, goal_pose
in planner.plan()
should be a 7-dim vector (3-dim translation + 4-dim quaternion), not a np.zeros(9)
. Could you update your code?
FYI, a correct usage of check for collision is:
planner.planning_world.set_use_point_cloud(True)
planner.update_point_cloud(pc) #obstacle points only
planner.robot.set_qpos(qpos, True)
collisions = planner.planning_world.collide_full()
Please let me know if you have any other questions.
Does
self.planning_world.collide_full()
(from here) check for collisions with the pointcloud added usingupdate_point_cloud
(from here), or does it just check for collisions between links of the robot? Additionally,update_point_cloud
takes in pointcloud from the robot, as is obtained using the gym environment but centered around the robot's base, correct?I tried to construct the following simple example: Here, the scene simply consists of a robot and a box (loaded using a custom .obj file -- I know the Sapien collision avoidance tutorial creates the box directly, but I want to be able to do this using custom .obj files). I place the robot to be in collision with the box, and I would like to detect this collision. I obtain a 360 degree pointcloud (as done in the ManiSkill gym environment), center the pointcloud to be around the robot's base, and then use
update_point_cloud
, but somehowself.planning_world.collide_full()
is still empty:With the collision detection portion at the end commented out, we can see in the viewer that the robot is clearly in collision with the box. However, when we uncomment this part, we see that
self.planning_world.collide_full()
is still empty -- this is not the expected behavior, is it?For completeness,
box.urdf
:and
box.obj
:Apologies for the incredibly long post.