Add an example of using point cloud for motion planning in Python#94
Merged
zkingston merged 7 commits intoKavrakiLab:mainfrom Feb 26, 2026
Merged
Add an example of using point cloud for motion planning in Python#94zkingston merged 7 commits intoKavrakiLab:mainfrom
zkingston merged 7 commits intoKavrakiLab:mainfrom
Conversation
Contributor
WeihangGuo
commented
Feb 24, 2026
e36506e to
3d1f4d4
Compare
add161b to
712ba32
Compare
zkingston
requested changes
Feb 25, 2026
scripts/filter_point_cloud_capt.py
Outdated
Comment on lines
+37
to
+48
| def sample_sphere_surface(center, radius, n_points): | ||
| # Random spherical coordinates | ||
| phi = np.random.uniform(0, 2 * np.pi, n_points) | ||
| cos_theta = np.random.uniform(-1, 1, n_points) | ||
| theta = np.arccos(cos_theta) | ||
|
|
||
| x = radius * np.sin(theta) * np.cos(phi) | ||
| y = radius * np.sin(theta) * np.sin(phi) | ||
| z = radius * np.cos(theta) | ||
|
|
||
| points = np.vstack((x, y, z)).T | ||
| return points + center |
Collaborator
There was a problem hiding this comment.
We already have this function in
Line 29 in 9b7ece5
scripts/filter_point_cloud_capt.py
Outdated
Comment on lines
+76
to
+80
| 10, # max_range | ||
| [0.0, 0.0, 0.0], # origin | ||
| [-2.0, -2.0, -2.0], # workcell_min | ||
| [2.0, 2.0, 2.0], # workcell_max | ||
| True # cull |
Collaborator
There was a problem hiding this comment.
Should these perhaps be exposed as command line args if this script is supposed to demonstrate the filtering of the PC?
scripts/sphere_cage_example_capt.py
Outdated
| ] | ||
|
|
||
|
|
||
| def sample_sphere_surface(center, radius, n_points): |
scripts/sphere_cage_example_capt.py
Outdated
| [sample_sphere_surface(center, obstacle_radius, points_per_sphere) for center in problem] | ||
| ) | ||
| point_cloud_colors = np.random.randint(100, 200, (point_cloud.shape[0], 3)) | ||
| # point_cloud_colors = np.tile((255, 192, 203), (point_cloud.shape[0], 1)) |
scripts/sphere_cage_example_capt.py
Outdated
Comment on lines
+73
to
+78
| tf = np.identity(4) | ||
| tf[:3, 3] = np.array([0, 0, attachment_offset]) | ||
| attachment = vamp.Attachment(tf) | ||
|
|
||
| # Add a single sphere to the attachment - spheres are added in the attachment's local frame | ||
| attachment.add_spheres([vamp.Sphere([0, 0, 0], attachment_radius)]) |
Collaborator
There was a problem hiding this comment.
Is the attachment stuff necessary for this script as well?
…sphere_sample_surface()` in the capt pointcloud demo
…n the capt pointcloud demo
…achment-related code in capt sphere cage example
Contributor
Author
|
@zkingston Thank you for reviewing. I have addressed the comments. |
zkingston
approved these changes
Feb 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.