Esempio n. 1
0
def sample_initial_pose(obj: bproc.types.MeshObject):
    obj.set_location(
        bproc.sampler.upper_region(objects_to_sample_on=room_planes[0:1],
                                   min_height=1,
                                   max_height=4,
                                   face_sample_range=[0.4, 0.6]))
    obj.set_rotation_euler(np.random.uniform([0, 0, 0], [0, 0, np.pi * 2]))
Esempio n. 2
0
def sample_pose(obj: bproc.types.MeshObject):
    # Sample the spheres location above the surface
    obj.set_location(
        bproc.sampler.upper_region(objects_to_sample_on=[surface],
                                   min_height=1,
                                   max_height=4,
                                   use_ray_trace_check=False))
    obj.set_rotation_euler(
        np.random.uniform([0, 0, 0], [np.pi * 2, np.pi * 2, np.pi * 2]))
Esempio n. 3
0
def sample_pose(obj: bproc.types.MeshObject):
    # Sample the location above the bin
    obj.set_location(np.random.uniform([-0.5, -0.5, 2], [0.5, 0.5, 5]))
    obj.set_rotation_euler(bproc.sampler.uniformSO3())
Esempio n. 4
0
 def sample_pose(obj: bproc.types.MeshObject):
     obj.set_location(np.random.uniform([-1, -1, 0], [1, 1, 2]))
     obj.set_rotation_euler(bproc.sampler.uniformSO3())
Esempio n. 5
0
def sample_pose_func(obj: bproc.types.MeshObject):
    obj.set_location(np.random.uniform([-0.2, -0.2, -0.2],[0.2, 0.2, 0.2]))
    obj.set_rotation_euler(bproc.sampler.uniformSO3())
Esempio n. 6
0
def sample_pose_func(obj: bproc.types.MeshObject):
    min = np.random.uniform([-0.3, -0.3, 0.0], [-0.2, -0.2, 0.0])
    max = np.random.uniform([0.2, 0.2, 0.4], [0.3, 0.3, 0.6])
    obj.set_location(np.random.uniform(min, max))
    obj.set_rotation_euler(bproc.sampler.uniformSO3())
Esempio n. 7
0
def sample_pose(obj: bproc.types.MeshObject):
    obj.set_location(np.random.uniform([-5, -5, -5], [5, 5, 5]))
    obj.set_rotation_euler(
        np.random.uniform([0, 0, 0], [np.pi * 2, np.pi * 2, np.pi * 2]))