blenderproc.python.modules.object.ObjectPoseSamplerModule module

class blenderproc.python.modules.object.ObjectPoseSamplerModule.ObjectPoseSamplerModule(config)[source]

Bases: blenderproc.python.modules.main.Module.Module

Samples positions and rotations of selected object inside the sampling volume while performing mesh and bounding box collision checks.

Example 1: Sample poses (locations and rotations) for objects with a suctom property sample_pose set to True.

{
  "module": "object.ObjectPoseSampler",
  "config":{
    "max_iterations": 1000,
    "objects_to_sample": {
      "provider": "getter.Entity",
      "condition": {
        "cp_sample_pose": True
      }
    },
    "pos_sampler":{
      "provider": "sampler.Uniform3d",
      "max": [5,5,5],
      "min": [-5,-5,-5]
    },
    "rot_sampler": {
      "provider": "sampler.Uniform3d",
      "max": [0,0,0],
      "min": [6.28,6.28,6.28]
    }
  }
}
Parameter Description Type
objects_to_sample Here call an appropriate Provider (Getter) in order to select objects. Default: all mesh objects. Provider
objects_to_check_collisions Here call an appropriate Provider (Getter) in order to select objects that you want to check collisions with. Default: all mesh objects. Provider
max_iterations Amount of tries before giving up on an object and moving to the next one. Default: 1000. int
pos_sampler Here call an appropriate Provider (Sampler) in order to sample position (XYZ 3d vector) for each object. Provider
rot_sampler Here call an appropriate Provider (Sampler) in order to sample rotation (Euler angles 3d vector) for each object. Provider
run()[source]

Samples positions and rotations of selected object inside the sampling volume while performing mesh and bounding box collision checks in the following steps: 1. While we have objects remaining and have not run out of tries - sample a point. 2. If no collisions are found keep the point.