-
Notifications
You must be signed in to change notification settings - Fork 2
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
Updating MoveIt! to get demo working in master! #175
Merged
Merged
Changes from 22 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
ff59009
Test script for ICP.
giuschio c4c14d8
Test script for ICP.
giuschio b57f8ca
realsense error about hardware, added reset flag
nikhileshalatur 4e96a33
changing default panda xacros
nikhileshalatur ec620dc
new panda_moveit_config for our panda_arm.xacro
nikhileshalatur 838f8dc
changing default controller, and grasp demo params
nikhileshalatur 1a25a2a
changing demo params, offset on EE
nikhileshalatur 392a5c0
fixing root modifications
nikhileshalatur 6394a6f
removing old moveit
nikhileshalatur 56e4db3
New RS for static Panda wrist cam.
luceharris e6be335
WIP Getting GraspDemo to work again on master.
luceharris 5660b85
Revert back to old Transform utils.
nikhileshalatur fc79183
New calibration for static Panda wrist cam.
luceharris 699b064
realsense error about hardware, added reset flag
luceharris 1ba45a0
changing default panda xacros
luceharris e2c2684
new panda_moveit_config for our panda_arm.xacro
luceharris 06c6119
changing default controller, and grasp demo params
luceharris 551821a
changing demo params, offset on EE
luceharris 0ed5fc4
fixing root modifications
luceharris 6bdad1a
removing old moveit
luceharris 1c04d91
new demo works with parameters -not perfect but ok
luceharris c96db33
merging cherry pick changes
luceharris 9fb5996
Update grasp_demo.launch
luceharris File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import open3d as o3d | ||
import copy | ||
import numpy as np | ||
from scipy.spatial.transform import Rotation as R | ||
|
||
def draw_registration_result_original_color(source, target, transformation): | ||
source_temp = copy.deepcopy(source) | ||
source_temp.transform(transformation) | ||
o3d.visualization.draw_geometries([source_temp, target], | ||
zoom=0.5, | ||
front=[-0.2458, -0.8088, 0.5342], | ||
lookat=[1.7745, 2.2305, 0.9787], | ||
up=[0.3109, -0.5878, -0.7468]) | ||
|
||
print("1. Load two point clouds and show initial pose") | ||
# source = o3d.io.read_point_cloud("/root/data/run_1/rs_435_2.pcd") | ||
# target = o3d.io.read_point_cloud("/root/data/run_1/rs_435_3.pcd") | ||
# source = o3d.io.read_point_cloud("/root/data/run_2/rs_435_2.pcd") | ||
# target = o3d.io.read_point_cloud("/root/data/run_2/rs_435_3.pcd") | ||
source = o3d.io.read_point_cloud("/root/data/run_3/rs_435_2.pcd") | ||
target = o3d.io.read_point_cloud("/root/data/run_3/rs_435_3.pcd") | ||
|
||
# draw initial alignment | ||
translation = [-0.340, -0.096, 0.014] # Example translation | ||
quaternion = [-0.028, 0.063, 0.997, -0.039] # Example quaternion (x, y, z, w) | ||
rotation_matrix = R.from_quat(quaternion).as_matrix() | ||
current_transformation = np.eye(4) | ||
current_transformation[:3, :3] = rotation_matrix | ||
current_transformation[:3, 3] = translation | ||
# current_transformation = np.identity(4) | ||
|
||
draw_registration_result_original_color(source, target, current_transformation) | ||
|
||
# initial_pcd = o3d.geometry.PointCloud(source) # Copy using the constructor | ||
# initial_pcd = initial_pcd.transform(current_transformation) | ||
# draw_registration_result_original_color(source, target, current_transformation) | ||
|
||
# # point to plane ICP | ||
# print("2. Point-to-plane ICP registration is applied on original point") | ||
# print(" clouds to refine the alignment. Distance threshold 0.02.") | ||
# result_icp = o3d.pipelines.registration.registration_icp( | ||
# source, target, 0.02, current_transformation, | ||
# o3d.pipelines.registration.TransformationEstimationPointToPoint()) | ||
# print(result_icp) | ||
# draw_registration_result_original_color(source, target, | ||
# result_icp.transformation) | ||
|
||
print("3. Colored point cloud registration") | ||
voxel_radius = [0.04, 0.02, 0.01, 0.05] | ||
max_iter = [50, 30, 14, 50] | ||
for scale in range(3): | ||
iter = max_iter[scale] | ||
radius = voxel_radius[scale] | ||
print([iter, radius, scale]) | ||
|
||
print("3-1. Downsample with a voxel size %.2f" % radius) | ||
source_down = source.voxel_down_sample(radius) | ||
target_down = target.voxel_down_sample(radius) | ||
|
||
print("3-2. Estimate normal.") | ||
source_down.estimate_normals( | ||
o3d.geometry.KDTreeSearchParamHybrid(radius=radius * 2, max_nn=30)) | ||
target_down.estimate_normals( | ||
o3d.geometry.KDTreeSearchParamHybrid(radius=radius * 2, max_nn=30)) | ||
|
||
print("3-3. Applying colored point cloud registration") | ||
result_icp = o3d.pipelines.registration.registration_colored_icp( | ||
source_down, target_down, radius, current_transformation, | ||
o3d.pipelines.registration.TransformationEstimationForColoredICP(), | ||
o3d.pipelines.registration.ICPConvergenceCriteria(relative_fitness=1e-6, | ||
relative_rmse=1e-6, | ||
max_iteration=iter)) | ||
|
||
# result_icp = o3d.pipelines.registration.registration_icp( | ||
# source_down, target_down, 0.02, current_transformation, | ||
# o3d.pipelines.registration.TransformationEstimationPointToPlane()) | ||
|
||
|
||
current_transformation = result_icp.transformation | ||
print(result_icp) | ||
draw_registration_result_original_color(source, target, | ||
result_icp.transformation) |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this file still exist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, lets get rid of the line