Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Generating scene pointcloud from meshes #771

Open
pvskand opened this issue Dec 26, 2024 · 5 comments
Open

[Feature] Generating scene pointcloud from meshes #771

pvskand opened this issue Dec 26, 2024 · 5 comments

Comments

@pvskand
Copy link

pvskand commented Dec 26, 2024

The gen_scene_pcd function, which generates the point cloud by sampling points from the meshes of the rigid bodies was something that was implemented in MS2 but for MS3 it's marked as a TODO.

I've already implemented it for MS3 for my research (although I use a slightly different variant) and wanted to see a PR for the same would be of interest.

cc: @StoneT2000 as we briefly talked about it on discord.

@StoneT2000
Copy link
Member

A PR would be greatly appreciated! Thank you so much

@pvskand
Copy link
Author

pvskand commented Jan 7, 2025

@StoneT2000 I was able to generate scene point clouds (see L1327-L1365). I wasn't aware that my previous code was only working for a singe environment i.e when num_envs=1, so I ended up fixing that for it to work for num_envs>1. See the attached rollout video of 4 environments on PickCube task with a random policy.

Current drawbacks:

  1. Doesn't work for multi-robot tasks: TwoRobotPickCube-v1 and TwoRobotStackCube-v1. This is because I'm using assuming self.robot_uids is a str and not a List. (See L1339). This should be an relatively easy fix which I'll address tomorrow.

  2. I am unable to get the color for geoms. So right now the colors are defaulted to Trimesh's default colors (while creating a mesh). I'm not sure how can I get the colors for the geoms in get_component_meshes (https://github.com/pvskand/ManiSkill/blob/main/mani_skill/utils/geometry/trimesh_utils.py#L12) which is called at L1335 and L1350. I couldn't find any clues on how to move forward while going through the Sapien documentation -- any leads on this end would be helpful.

PickCube.mov

@fbxiang
Copy link
Contributor

fbxiang commented Jan 7, 2025

For 2. I have something you may find useful for sampling colors and visual materials. It is not complete but may give you an idea on how to implement this.

@pvskand
Copy link
Author

pvskand commented Jan 7, 2025

Thanks @fbxiang -- that would be super helpful if you can point me to the code if it's on github or if you need me to reach out to you via email or the MS discord -- I can do that as well.

@fbxiang
Copy link
Contributor

fbxiang commented Jan 7, 2025

Sorry somehow my link went missing.
Here it is https://github.com/fbxiang/sapien-sample-points

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants