transition_rules
AbilityFilter
AndFilter
BaseFilter
Defines a filter to apply to objects.
Source code in omnigibson/transition_rules.py
__call__(obj)
abstractmethod
__new__(*args, **kwargs)
classmethod
Initializes the cached state for this filter if it doesn't already exist
update()
classmethod
BaseTransitionRule
Defines a set of categories of objects and how to transition their states.
Source code in omnigibson/transition_rules.py
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 |
|
requires_group_filters
property
Returns:
Name | Type | Description |
---|---|---|
bool | Whether this transition rule requires any group filters |
requires_individual_filters
property
Returns:
Name | Type | Description |
---|---|---|
bool | Whether this transition rule requires any specific filters |
__init__(individual_filters=None, group_filters=None)
abstractmethod
TransitionRule ctor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
individual_filters |
None or dict
|
Individual object filters that this filter cares about. For each name, filter key-value pair, the global transition rule step will produce tuples of valid filtered objects such that the cross product over all individual filter outputs occur. For example, if the individual filters are:
the transition rule step will produce all 2-tuples of valid (apple, knife) combinations:
based on the current instances of each object type in the scene and pass them to @self.condition as the @individual_objects entry. If None is specified, then no filter will be applied |
None
|
group_filters |
None or dict
|
Group object filters that this filter cares about. For each name, filter key-value pair, the global transition rule step will produce a single dictionary of valid filtered objects. For example, if the group filters are:
the transition rule step will produce the following dictionary:
based on the current instances of each object type in the scene and pass them to @self.condition as the @group_objects entry. If None is specified, then no filter will be applied |
None
|
Source code in omnigibson/transition_rules.py
condition(individual_objects, group_objects)
abstractmethod
Returns True if the rule applies to the object tuple.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
individual_objects |
dict
|
Dictionary mapping corresponding keys from @individual_filters to individual object instances where the filter is satisfied. Note: if @self.individual_filters is None or no values satisfy the filter, then this will be an empty dictionary |
required |
group_objects |
dict
|
Dictionary mapping corresponding keys from @group_filters to a list of individual object instances where the filter is satisfied. Note: if @self.group_filters is None or no values satisfy the filter, then this will be an empty dictionary |
required |
Returns:
Name | Type | Description |
---|---|---|
bool | Whether the condition is met or not |
Source code in omnigibson/transition_rules.py
process(individual_objects, group_objects)
Processes this transition rule at the current simulator step. If @condition evaluates to True, then @transition will be executed.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
individual_objects |
dict
|
Dictionary mapping corresponding keys from @individual_filters to individual object instances where the filter is satisfied. Note: if @self.individual_filters is None or no values satisfy the filter, then this will be an empty dictionary |
required |
group_objects |
dict
|
Dictionary mapping corresponding keys from @group_filters to a list of individual object instances where the filter is satisfied. Note: if @self.group_filters is None or no values satisfy the filter, then this will be an empty dictionary |
required |
Returns:
Type | Description |
---|---|
2-tuple: - bool: Whether @self.condition is met - None or TransitionResults: Output from @self.transition (None if it was never executed) |
Source code in omnigibson/transition_rules.py
transition(individual_objects, group_objects)
abstractmethod
Rule to apply for each set of objects satisfying the condition.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
individual_objects |
dict
|
Dictionary mapping corresponding keys from @individual_filters to individual object instances where the filter is satisfied. Note: if @self.individual_filters is None or no values satisfy the filter, then this will be an empty dictionary |
required |
group_objects |
dict
|
Dictionary mapping corresponding keys from @group_filters to a list of individual object instances where the filter is satisfied. Note: if @self.group_filters is None or no values satisfy the filter, then this will be an empty dictionary |
required |
Returns:
Name | Type | Description |
---|---|---|
TransitionResults | results from the executed transition |
Source code in omnigibson/transition_rules.py
BlenderRule
Bases: BaseTransitionRule
Source code in omnigibson/transition_rules.py
545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 |
|
__init__(output_system, particle_requirements=None, obj_requirements=None)
Transition rule to apply when objects are blended together
Parameters:
Name | Type | Description | Default |
---|---|---|---|
output_system |
str
|
Name of the physical particle to generate once all the input ingredients are blended |
required |
particle_requirements |
None or dict
|
If specified, should map physical particle system name to the minimum number of physical particles required in order to successfully blend |
None
|
obj_requirements |
None or dict
|
If specified, should map object category names to minimum number of that type of object rqeuired in order to successfully blend |
None
|
Source code in omnigibson/transition_rules.py
CategoryFilter
ContainerGarbageRule
Bases: BaseTransitionRule
Rule to apply to a container to turn what remain inside into garbage.
This rule is used as a catch-all rule for containers to turn objects inside the container that did not match any other legitimate rules all into a single garbage object.
Source code in omnigibson/transition_rules.py
467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 |
|
__init__(garbage_obj_attrs, container_filter)
Ctor for ContainerGarbageRule.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
garbage_obj_attrs |
(ObjectAttrs) a namedtuple containing the attributes of garbage objects to be created. |
required | |
container_filter |
(BaseFilter) a filter for the container. |
required |
Source code in omnigibson/transition_rules.py
ContainerRule
Bases: BaseTransitionRule
Rule to apply to a container and a set of objects that may be inside.
Source code in omnigibson/transition_rules.py
DicingRule
Bases: BaseTransitionRule
Transition rule to apply to diceable / slicer object pairs.
Source code in omnigibson/transition_rules.py
GenericTransitionRule
Bases: BaseTransitionRule
A generic transition rule template used typically for simple rules.
Source code in omnigibson/transition_rules.py
OrFilter
SlicingRule
Bases: BaseTransitionRule
Transition rule to apply to sliced / slicer object pairs.
Source code in omnigibson/transition_rules.py
249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 |
|
StateFilter
Bases: BaseFilter
Filter for object states.