Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Structured configs #1069

Draft
wants to merge 50 commits into
base: og-develop
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
b55d664
feat: Add structured config dataclasses for OmniGibson using OmegaConf
cgokmen Dec 31, 2024
3f8a578
feat: Migrate Environment config to OmegaConf structured configs
cgokmen Dec 31, 2024
7698c06
refactor: Implement structured configs for robot, object, and prim cl…
cgokmen Dec 31, 2024
e6dc817
refactor: Enhance object configuration with comprehensive config classes
cgokmen Dec 31, 2024
6bfbf66
refactor: Update BaseObject and StatefulObject to use structured configs
cgokmen Dec 31, 2024
a1d1097
refactor: Update object classes to use structured configs
cgokmen Dec 31, 2024
272844c
refactor: Introduce config objects for prim classes with base configu…
cgokmen Jan 2, 2025
c55c071
refactor: Update prim classes to use config objects
cgokmen Jan 2, 2025
72c9f45
refactor: Update MaterialPrim to use config object pattern
cgokmen Jan 2, 2025
e12f36e
feat: Import PrimConfig in material_prim.py to resolve undefined name…
cgokmen Jan 2, 2025
1cdcceb
refactor: Update prim classes to use config object pattern consistently
cgokmen Jan 2, 2025
1b5607e
refactor: Update prim classes to use config object pattern
cgokmen Jan 2, 2025
2c4a968
refactor: Fix config object handling in prim classes during refactoring
cgokmen Jan 2, 2025
9dc32bf
refactor: Update prim creation method to use PrimConfig
cgokmen Jan 2, 2025
eb42e5c
refactor: Add Hydra config objects for robot and controller configura…
cgokmen Jan 2, 2025
4dbddac
refactor: Create separate config classes for different robot types
cgokmen Jan 2, 2025
3bf0a9e
refactor: Update Husky robot to use HuskyConfig in constructor
cgokmen Jan 2, 2025
f12caae
Based on the changes, I'll generate a concise commit message that cap…
cgokmen Jan 2, 2025
98c3624
refactor: Add MISSING import from omegaconf for config validation
cgokmen Jan 2, 2025
9fbe387
refactor: Update LocomotionRobot with config-based validation and doc…
cgokmen Jan 2, 2025
61a2ef3
refactor: Update LocomotionRobot to use config-based base joint control
cgokmen Jan 2, 2025
4ec0bca
docs: Update docstring for LocomotionRobot configuration description
cgokmen Jan 2, 2025
14356c3
Some help from cline
cgokmen Jan 2, 2025
b0614f1
feat: Create structured config hierarchy for OmegaConf configuration
cgokmen Jan 2, 2025
53639a2
The changes look good. I've added the necessary imports and fixed the…
cgokmen Jan 2, 2025
30136a0
refactor: Update controller config imports and types in RobotConfig
cgokmen Jan 2, 2025
55df619
Remove useless and tricky copy method
cgokmen Jan 2, 2025
618b4d7
feat: Refactor PrimitiveObject to use structured configs and remove k…
cgokmen Jan 2, 2025
7d2d209
feat: Refactor StatefulObject to use structured config with type hint…
cgokmen Jan 2, 2025
bfbdd3d
refactor: Simplify StatefulObject initialization and type hint config…
cgokmen Jan 2, 2025
bb387d5
feat: Add import for StatefulObjectConfig to resolve undefined name e…
cgokmen Jan 2, 2025
1f060a5
refactor: Convert DatasetObject to use structured config with Hydra/O…
cgokmen Jan 2, 2025
0d96887
refactor: Add imports for DatasetObjectConfig and USDObjectConfig
cgokmen Jan 2, 2025
d84e2a8
refactor: Convert USDObject to use structured config with proper conf…
cgokmen Jan 2, 2025
f077cc8
refactor: Update USDObject to use structured USDObjectConfig
cgokmen Jan 2, 2025
aec3baf
refactor: Convert LightObject to use structured config with direct co…
cgokmen Jan 2, 2025
71560ba
refactor: Update LightObject to use structured config with import
cgokmen Jan 2, 2025
5369032
refactor: Migrate ControllableObject to use structured Hydra/OmegaCon…
cgokmen Jan 2, 2025
3d76e40
The changes look good. I'll generate a concise commit message for the…
cgokmen Jan 2, 2025
528e49d
refactor: Migrate ControllableObject to use structured configs and re…
cgokmen Jan 2, 2025
a35a1bf
fix: Remove unused subsume controller code and update controller conf…
cgokmen Jan 3, 2025
fd36ce0
refactor: Simplify ControllableObject config handling and controller …
cgokmen Jan 3, 2025
39cc75a
refactor: Improve structured config handling in ControllableObject
cgokmen Jan 3, 2025
e284b56
feat: Add import for ControllableObjectConfig in controllable_object.py
cgokmen Jan 3, 2025
e5515f6
feat: Refactor object classes to use config object directly
cgokmen Jan 3, 2025
cdff843
refactor: Update primitive_type access from self._primitive_type to s…
cgokmen Jan 3, 2025
a04ae8c
refactor: Update PrimitiveObject to use structured config pattern
cgokmen Jan 3, 2025
0119a6b
refactor: Add import for PrimitiveObjectConfig in primitive_object.py
cgokmen Jan 3, 2025
32edd89
Read primitive type
cgokmen Jan 3, 2025
80806e3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: Update prim classes to use config object pattern
cgokmen committed Jan 2, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 1b5607e320aafc0f35a92d26889736f28cc700ed
5 changes: 2 additions & 3 deletions omnigibson/prims/cloth_prim.py
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@
from functools import cached_property

import torch as th
from omnigibson.configs.prim_config import ClothPrimConfig

import omnigibson as og
import omnigibson.lazy as lazy
@@ -63,9 +64,7 @@ def __init__(

# Run super init
super().__init__(
relative_prim_path=relative_prim_path,
name=name,
load_config=load_config,
config=config,
)

def _post_load(self):
3 changes: 2 additions & 1 deletion omnigibson/prims/entity_prim.py
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@

import networkx as nx
import torch as th
from omnigibson.configs.prim_config import EntityPrimConfig

import omnigibson as og
import omnigibson.lazy as lazy
@@ -60,7 +61,7 @@ def __init__(

# This needs to be initialized to be used for _load() of PrimitiveObject
self._prim_type = (
load_config["prim_type"] if load_config is not None and "prim_type" in load_config else PrimType.RIGID
config.load_config["prim_type"] if config.load_config is not None and "prim_type" in config.load_config else PrimType.RIGID
)
assert self._prim_type in iter(PrimType), f"Unknown prim type {self._prim_type}!"

1 change: 1 addition & 0 deletions omnigibson/prims/geom_prim.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from functools import cached_property

import torch as th
from omnigibson.configs.prim_config import GeomPrimConfig, CollisionGeomPrimConfig

import omnigibson as og
import omnigibson.lazy as lazy
1 change: 1 addition & 0 deletions omnigibson/prims/joint_prim.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from collections.abc import Iterable

import torch as th
from omnigibson.configs.prim_config import JointPrimConfig

import omnigibson as og
import omnigibson.lazy as lazy
5 changes: 2 additions & 3 deletions omnigibson/prims/rigid_prim.py
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
from typing import Literal

import torch as th
from omnigibson.configs.prim_config import RigidPrimConfig
from scipy.spatial import ConvexHull

import omnigibson as og
@@ -77,9 +78,7 @@ def __init__(

# Run super init
super().__init__(
relative_prim_path=relative_prim_path,
name=name,
load_config=load_config,
config=config,
)

def _post_load(self):
1 change: 1 addition & 0 deletions omnigibson/prims/xform_prim.py
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
from typing import Literal

import torch as th
from omnigibson.configs.prim_config import XFormPrimConfig

import omnigibson as og
import omnigibson.lazy as lazy