Layout Config
GenManip provides many layout presets and exposes them through layout_config. Two basic keys in a layout_config are:
- ignored_objects: a list of object names/UIDs that should be excluded from layouting.
- type: a string specifying the layout type.
Below we describe supported layout types.
None is the simplest layout: respect the scene’s original layout and do not randomize. Use this when your scene is already positioned as you want.
Note: objects added via add_additional_object_from_path or load_object_from_path are by default not placed into a None layout (they are placed away from the table). Use another layout type to place them on the table.
random_all
Section titled “random_all”random_all randomly places all objects on the table while avoiding collisions. All objects except those listed in ignored_objects will be tiled randomly on the table.
random_custom_tableset
Section titled “random_custom_tableset”random_custom_tableset allows you to define a per-object placement type. Add a custom_tableset dict where each key is a meta-object name and the value is a dict describing that object’s placement.
Example overall structure:
layout_config: ignored_objects: [] type: random_custom_tableset in_order: true # whether to place objects in the order of custom_tableset custom_tableset: "apple": type: global_range random_range_angle: 360 random_range_h: 0.7 random_range_w: 0.4 random_range_x: -0.2 random_range_y: -0.35 "plate": type: global_range random_range_angle: 360 random_range_h: 0.7 random_range_w: 0.4 random_range_x: -0.2 random_range_y: -0.35 "banana": type: global_range random_range_angle: 360 random_range_h: 20 random_range_w: 20 random_range_x: -10 random_range_y: -10Common placement types per object:
-
global_range: place the object within a global XYWH rectangle (in world coordinates), put the object’s bottom on the table (height is set accordingly). XYWH region is defined byrandom_range_x,random_range_y,random_range_w,random_range_h. The object is also randomly rotated within[0, random_range_angle]degrees. The placement is intersected with the table area. The object’s edge must be inside the bbox — if the bbox is smaller than the object, placement may fail. (random_allis equivalent toglobal_rangewith a bbox covering the table.)Example:
"apple":type: global_rangerandom_range_angle: 360random_range_h: 0.7random_range_w: 0.4random_range_x: -0.2random_range_y: -0.35 -
fixed_global_range: place the object at a fixed XY position (pos_x,pos_y), put the object’s bottom on the table (height is set accordingly). The object will still have random rotation in[0, random_range_angle]unlessrandom_range_angleis 0. You can specifypos_zto fix z explicitly. Collision avoidance is not guaranteed.Example:
"bread":pos_x: -0.17217pos_y: -0.45642random_range_angle: 0type: fixed_global_range -
centric_range: randomly place the object within a neighborhood around some center while avoiding collisions. The neighborhood is computed from the object’s bounding box expanded byh/2andw/2. Rotation is sampled from[0, angle]; ifangle_bilateral=true, rotation is sampled from[-angle, +angle].Example:
"box":w: 0.05h: 0.05angle: 0angle_bilateral: falsetype: centric_range
All layout types support the following optional parameters:
additional_height: float, place the objectadditional_heightmeters above the table.reset_orientation: bool, whether to reset object orientation at the start. Default reset quaternion is[0.5, 0.5, 0.5, 0.5].orientation: specify an orientation to override the default reset orientation.