本文整理汇总了Python中pcl.load方法的典型用法代码示例。如果您正苦于以下问题:Python pcl.load方法的具体用法?Python pcl.load怎么用?Python pcl.load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pcl
的用法示例。
在下文中一共展示了pcl.load方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: display_gripper_on_object
# 需要导入模块: import pcl [as 别名]
# 或者: from pcl import load [as 别名]
def display_gripper_on_object(obj_, grasp_):
"""display both object and gripper using mayavi"""
# transfer wrong was fixed by the previews comment of meshpy modification.
# gripper_name = 'robotiq_85'
# home_dir = os.environ['HOME']
# gripper = RobotGripper.load(gripper_name, home_dir + "/code/grasp-pointnet/dex-net/data/grippers")
# stable_pose = self.dataset.stable_pose(object.key, 'pose_1')
# T_obj_world = RigidTransform(from_frame='obj', to_frame='world')
t_obj_gripper = grasp_.gripper_pose(gripper)
stable_pose = t_obj_gripper
grasp_ = grasp_.perpendicular_table(stable_pose)
Vis.figure(bgcolor=(1, 1, 1), size=(1000, 1000))
Vis.gripper_on_object(gripper, grasp_, obj_,
gripper_color=(0.25, 0.25, 0.25),
# stable_pose=stable_pose, # .T_obj_world,
plot_table=False)
Vis.show()
示例2: open_pickle_and_obj
# 需要导入模块: import pcl [as 别名]
# 或者: from pcl import load [as 别名]
def open_pickle_and_obj(name_to_open_):
pickle_names_ = get_pickle_file_name(home_dir + "/code/grasp-pointnet/dex-net/apps/generated_grasps")
suggestion_pickle = fuzzy_finder(name_to_open_, pickle_names_)
if len(suggestion_pickle) != 1:
print("Pickle file suggestions:", suggestion_pickle)
exit("Name error for pickle file!")
pickle_m_ = pickle.load(open(suggestion_pickle[0], 'rb'))
file_dir = home_dir + "/dataset/ycb_meshes_google/objects"
file_list_all = get_file_name(file_dir)
new_sug = re.findall(r'_\d+', suggestion_pickle[0], flags=0)
new_sug = new_sug[0].split('_')
new_sug = new_sug[1]
suggestion = fuzzy_finder(new_sug, file_list_all)
# very dirty way to support name with "-a, -b etc."
if len(suggestion) != 1:
new_sug = re.findall(r'_\d+\W\w', suggestion_pickle[0], flags=0)
new_sug = new_sug[0].split('_')
new_sug = new_sug[1]
suggestion = fuzzy_finder(new_sug, file_list_all)
if len(suggestion) != 1:
exit("Name error for obj file!")
object_name_ = suggestion[0][len(file_dir) + 1:]
ply_name_ = suggestion[0] + "/google_512k/nontextured.ply"
if not check_pcd_grasp_points:
of = ObjFile(suggestion[0] + "/google_512k/nontextured.obj")
sf = SdfFile(suggestion[0] + "/google_512k/nontextured.sdf")
mesh = of.read()
sdf = sf.read()
obj_ = GraspableObject3D(sdf, mesh)
else:
cloud_path = home_dir + "/code/grasp-pointnet/pointGPD/data/ycb_rgbd/" + object_name_ + "/clouds/"
pcd_files = glob.glob(cloud_path + "*.pcd")
obj_ = pcd_files
obj_.sort()
return pickle_m_, obj_, ply_name_, object_name_
示例3: load_pc_from_pcd
# 需要导入模块: import pcl [as 别名]
# 或者: from pcl import load [as 别名]
def load_pc_from_pcd(pcd_path):
"""Load PointCloud data from pcd file."""
p = pcl.load(pcd_path)
return np.array(list(p), dtype=np.float32)