Skip to content

Conversation

@pascal-roth
Copy link
Collaborator

Description

Removes dependency on

from isaacsim.core.utils.carb import get_carb_setting, set_carb_setting

Replaces set_carb_setting(carb_settings, <setting-name>, <setting-value> with direct carb call carb_settings.set_string(<setting-name>, <setting-value>), ...set_int..., ...set_bool..., ...set_float.... And replaces get_carb_setting with carb_settings.get()

Type of change

  • Dependency removal

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with ./isaaclab.sh --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the changelog and the corresponding version in the extension's config/extension.toml file
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

@pascal-roth pascal-roth self-assigned this Nov 3, 2025
@github-actions github-actions bot added enhancement New feature or request isaac-lab Related to Isaac Lab team labels Nov 3, 2025
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Overview

Greptile Summary

Replaces wrapper functions set_carb_setting and get_carb_setting from isaacsim.core.utils.carb with direct carb API calls to remove the dependency. The changes systematically replace the generic wrapper with type-specific methods (set_bool, set_int, set_float, set_string) and direct get() calls.

Key Changes:

  • Removed imports of set_carb_setting and get_carb_setting from 8 files
  • Added explicit type checking using isinstance() to determine which type-specific setter to use
  • Replaced get_carb_setting(settings, key) with settings.get(key)
  • Type checking order is correct (bool before int, since bool is a subclass of int in Python)

Issue Found:

  • Two additional files still use the deprecated imports but were not updated in this PR:
    • source/isaaclab/isaaclab/sim/utils.py (uses get_carb_setting)
    • scripts/tools/check_instanceable.py (uses set_carb_setting)

Confidence Score: 3/5

  • Safe to merge but incomplete - two files still use the deprecated imports
  • The refactoring is technically sound with proper type checking and correct implementation. However, the migration is incomplete as two files still import and use the deprecated carb utility functions that this PR aims to remove. This creates an inconsistent state where some code uses the new approach while other code still depends on the old utilities.
  • Pay attention to source/isaaclab/isaaclab/sim/utils.py and scripts/tools/check_instanceable.py which still use deprecated imports

Important Files Changed

File Analysis

Filename Score Overview
source/isaaclab/isaaclab/sim/simulation_context.py 4/5 Replaced carb utils with direct API calls and added type-specific setter methods with proper type checking order
source/isaaclab/isaaclab/app/app_launcher.py 5/5 Simple replacement of set_carb_setting with type-specific carb API calls for rendering and animation recording

Sequence Diagram

sequenceDiagram
    participant App as AppLauncher
    participant Sim as SimulationContext
    participant Carb as carb.settings
    
    Note over App,Carb: Before: Using wrapper functions
    App->>Carb: set_carb_setting(settings, key, value)
    Note over Carb: Type inference in wrapper
    Carb-->>App: Setting applied
    
    Note over App,Carb: After: Direct API calls
    App->>App: Check isinstance(value, bool/int/float/str)
    App->>Carb: settings.set_bool/set_int/set_float/set_string(key, value)
    Carb-->>App: Setting applied
    
    Sim->>Sim: _apply_render_settings_from_cfg()
    Sim->>Sim: Type check preset values
    Sim->>Carb: settings.set_bool/set_int/set_float/set_string(key, value)
    Carb-->>Sim: Setting applied
    
    Note over Sim: Uses settings.get() instead of get_carb_setting()
    Sim->>Carb: settings.get(key)
    Carb-->>Sim: Return value
Loading

8 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@pascal-roth pascal-roth moved this to In review in Isaac Lab Nov 3, 2025
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Overview

Greptile Summary

Replaced deprecated set_carb_setting and get_carb_setting utility functions with direct carb API calls throughout the codebase.

  • Removed dependency on isaacsim.core.utils.carb
  • Updated all call sites to use type-specific carb methods (set_bool, set_int, set_float, set_string, get)
  • Added type detection logic in simulation_context.py to correctly route dynamic values to appropriate setter methods
  • Type checking correctly handles bool before int (since bool is subclass of int in Python)

Confidence Score: 4/5

  • Safe to merge after addressing two remaining files that still use deprecated imports
  • The changes are straightforward and correctly implemented, but the PR is incomplete as two files (source/isaaclab/isaaclab/sim/utils.py and scripts/tools/check_instanceable.py) still import and use the deprecated carb utility functions. These must be updated for consistency.
  • source/isaaclab/isaaclab/sim/utils.py and scripts/tools/check_instanceable.py still use deprecated functions and must be updated

Important Files Changed

File Analysis

Filename Score Overview
source/isaaclab/isaaclab/app/app_launcher.py 5/5 Removed deprecated carb utility imports and replaced with direct carb API calls using appropriate type-specific methods (set_string, set_bool, set_float).
source/isaaclab/isaaclab/sim/simulation_context.py 5/5 Replaced deprecated carb utility functions with direct carb API calls. Added type checking logic to route values to appropriate set_bool/set_int/set_float/set_string methods. Boolean check correctly precedes int check.

Sequence Diagram

sequenceDiagram
    participant App as AppLauncher/SimulationContext
    participant Old as isaacsim.core.utils.carb
    participant Carb as carb.settings
    
    Note over App,Carb: Before (Deprecated Pattern)
    App->>Old: set_carb_setting(settings, key, value)
    Old->>Carb: Auto-detect type & call appropriate setter
    
    Note over App,Carb: After (Direct API Pattern)
    App->>App: Type check (bool/int/float/str)
    App->>Carb: set_bool(key, value)
    App->>Carb: set_int(key, value)
    App->>Carb: set_float(key, value)
    App->>Carb: set_string(key, value)
    
    Note over App,Carb: Getter Pattern
    App->>Carb: get(key)
    Carb-->>App: value
Loading

8 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@ooctipus ooctipus force-pushed the feature/remove-carb-utils branch from 5b00942 to 4eaaf6b Compare November 10, 2025 19:09
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Overview

Greptile Summary

This PR removes dependency on deprecated isaacsim.core.utils.carb utilities by replacing wrapper functions with direct carb API calls.

Key changes:

  • Replaced set_carb_setting(settings, key, value) with type-specific methods: settings.set_bool(), settings.set_int(), settings.set_float(), settings.set_string()
  • Replaced get_carb_setting(settings, key) with direct settings.get(key) calls
  • Added type dispatch logic in simulation_context.py to handle dynamic value types from config files (lines 733-742, 755-764, 776-785)
  • Properly checks isinstance(value, bool) before isinstance(value, int) to avoid Python's bool-as-int type hierarchy issue

Issues found:

  • Two files still use the deprecated utilities and weren't updated: source/isaaclab/isaaclab/sim/utils.py:23,1075 and scripts/tools/check_instanceable.py:70,99

Confidence Score: 3/5

  • PR is mostly safe but incomplete - two files still use deprecated utilities
  • The refactoring is technically correct with proper type handling, but the migration is incomplete. Two files (sim/utils.py and scripts/tools/check_instanceable.py) still import and use the deprecated functions, which undermines the goal of removing this dependency
  • Pay attention to source/isaaclab/isaaclab/sim/utils.py and scripts/tools/check_instanceable.py which still use deprecated utilities

Important Files Changed

File Analysis

Filename Score Overview
source/isaaclab/isaaclab/app/app_launcher.py 5/5 Replaced set_carb_setting with type-specific carb API calls (set_string, set_bool, set_float) - straightforward migration with correct types
source/isaaclab/isaaclab/sim/simulation_context.py 4/5 Replaced get_carb_setting and set_carb_setting with direct carb calls, added type dispatch logic for handling different value types - complex changes with proper bool-before-int checking

Sequence Diagram

sequenceDiagram
    participant Code as Application Code
    participant OldAPI as isaacsim.core.utils.carb
    participant CarbSettings as carb.settings
    
    Note over Code,CarbSettings: Before (Deprecated Approach)
    Code->>OldAPI: set_carb_setting(settings, key, value)
    OldAPI->>CarbSettings: Infers type and calls appropriate method
    
    Note over Code,CarbSettings: After (Direct API Calls)
    Code->>Code: Check value type (bool/int/float/str)
    alt bool value
        Code->>CarbSettings: settings.set_bool(key, value)
    else int value
        Code->>CarbSettings: settings.set_int(key, value)
    else float value
        Code->>CarbSettings: settings.set_float(key, value)
    else string value
        Code->>CarbSettings: settings.set_string(key, value)
    end
    
    Note over Code,CarbSettings: Read Operations
    Code->>CarbSettings: settings.get(key)
    CarbSettings-->>Code: Returns value
Loading

8 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@ooctipus ooctipus force-pushed the feature/remove-carb-utils branch from 4eaaf6b to c80d57e Compare November 10, 2025 19:14
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Overview

Greptile Summary

Removes dependency on isaacsim.core.utils.carb helper functions by replacing set_carb_setting() and get_carb_setting() with direct carb API calls.

Key changes:

  • Modified set_setting() method to route values through typed carb setters (set_bool, set_int, set_float, set_string) based on Python type inspection
  • Updated get_setting() to use carb_settings.get() directly
  • Replaced all 14 call sites in simulation_context.py to use the updated methods
  • Type checking order is correct (bool before int, since bool is a subclass of int)

Note: A previous comment correctly identified that two other files (source/isaaclab/isaaclab/sim/utils.py:1075 and scripts/tools/check_instanceable.py:99) still use the deprecated carb utils and weren't updated in this PR.

Confidence Score: 5/5

  • This PR is safe to merge - it's a straightforward refactoring that removes a dependency on deprecated helper functions
  • The implementation correctly uses typed carb setters with proper type checking order (bool before int is critical since bool is a subclass of int in Python). All call sites in simulation_context.py were updated consistently. The refactoring maintains the same functionality while removing the intermediate helper layer.
  • No files in this PR require special attention, though note that other files in the codebase still use the deprecated utilities (already flagged in previous comments)

Important Files Changed

File Analysis

Filename Score Overview
source/isaaclab/isaaclab/sim/simulation_context.py 5/5 Replaced deprecated set_carb_setting/get_carb_setting helper functions with direct carb API calls using typed setters (set_bool, set_int, set_float, set_string) and get(). Implementation is correct with proper type checking order (bool before int).

Sequence Diagram

sequenceDiagram
    participant Caller
    participant SimulationContext
    participant TypeChecker
    participant CarbSettings

    Note over Caller,CarbSettings: Before (using deprecated helpers)
    Caller->>SimulationContext: set_setting(name, value)
    SimulationContext->>CarbSettings: set_carb_setting(settings, name, value)
    CarbSettings->>CarbSettings: set(name, value)

    Note over Caller,CarbSettings: After (direct carb API)
    Caller->>SimulationContext: set_setting(name, value)
    SimulationContext->>TypeChecker: isinstance checks
    TypeChecker-->>SimulationContext: type determined
    alt value is bool
        SimulationContext->>CarbSettings: set_bool(name, value)
    else value is int
        SimulationContext->>CarbSettings: set_int(name, value)
    else value is float
        SimulationContext->>CarbSettings: set_float(name, value)
    else value is str
        SimulationContext->>CarbSettings: set_string(name, value)
    else unsupported type
        SimulationContext-->>Caller: ValueError
    end

    Note over Caller,CarbSettings: Get setting flow
    Caller->>SimulationContext: get_setting(name)
    SimulationContext->>CarbSettings: get(name)
    CarbSettings-->>Caller: value
Loading

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@ooctipus ooctipus force-pushed the feature/remove-carb-utils branch from c80d57e to ec8a841 Compare November 10, 2025 19:28
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Nov 10, 2025

Greptile Overview

Greptile Summary

This PR removes dependencies on Isaac Sim's get_carb_setting and set_carb_setting utility wrapper functions in favor of direct carb API calls. The changes systematically replace wrapper calls with typed carb setter methods (set_bool, set_int, set_float, set_string) across 8 files.

Key changes:

  • app_launcher.py: Replaced 4 set_carb_setting calls with typed setters
  • simulation_context.py: Enhanced set_setting() method to route values through typed setters based on Python type, replaced all wrapper usage
  • Test files: Updated 6 test files to use direct _settings.set_bool() calls
  • test_simulation_render_config.py: Replaced get_carb_setting with direct .get() call

Note: Two files still use the deprecated wrappers (as mentioned in previous comments):

  • source/isaaclab/isaaclab/sim/utils.py:24,1079 - imports and uses get_carb_setting
  • scripts/tools/check_instanceable.py:70,99 - imports and uses set_carb_setting

The refactor is clean and improves type safety by using explicit typed setters instead of the generic wrapper.

Confidence Score: 5/5

  • This PR is safe to merge - it's a straightforward dependency removal refactor with proper type handling
  • The changes are purely mechanical replacements of wrapper functions with direct API calls, maintaining identical functionality while removing a dependency layer. The new set_setting method adds proper type routing for common types (bool, int, float, str, list, tuple) and includes error handling for unsupported types. All test files were updated consistently.
  • No files in this PR require special attention. However, note that two files outside this PR (utils.py and check_instanceable.py) still use the deprecated wrappers and should be updated in a follow-up.

Important Files Changed

File Analysis

Filename Score Overview
source/isaaclab/isaaclab/app/app_launcher.py 5/5 Removed set_carb_setting imports and replaced with typed carb API calls (set_string, set_bool, set_float) - clean refactor
source/isaaclab/isaaclab/sim/simulation_context.py 5/5 Replaced carb utility wrappers with direct API calls, added set_setting method with type routing for bool/int/float/str/list/tuple types

Sequence Diagram

sequenceDiagram
    participant App as AppLauncher/Tests
    participant SimCtx as SimulationContext
    participant CarbSettings as carb.settings
    
    Note over App,CarbSettings: Before (using wrapper functions)
    App->>SimCtx: set_carb_setting(settings, key, value)
    SimCtx->>CarbSettings: settings.set(key, value)
    
    Note over App,CarbSettings: After (direct API calls)
    App->>CarbSettings: settings.set_bool(key, bool_value)
    App->>CarbSettings: settings.set_int(key, int_value)
    App->>CarbSettings: settings.set_float(key, float_value)
    App->>CarbSettings: settings.set_string(key, str_value)
    
    Note over SimCtx: New set_setting() method
    App->>SimCtx: set_setting(key, value)
    SimCtx->>SimCtx: Route by type (bool/int/float/str/list/tuple)
    SimCtx->>CarbSettings: settings.set_<type>(key, value)
    
    Note over App,CarbSettings: Reading settings
    App->>CarbSettings: settings.get(key)
    CarbSettings-->>App: value
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@ooctipus ooctipus force-pushed the feature/remove-carb-utils branch from ec8a841 to 54d523e Compare November 10, 2025 20:23
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@ooctipus ooctipus force-pushed the feature/remove-carb-utils branch from f1d0b10 to 4478305 Compare November 12, 2025 20:42
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@kellyguo11 kellyguo11 merged commit 82d1f33 into isaac-sim:main Nov 12, 2025
9 checks passed
@github-project-automation github-project-automation bot moved this from In review to Done in Isaac Lab Nov 12, 2025
@ooctipus ooctipus deleted the feature/remove-carb-utils branch November 12, 2025 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request isaac-lab Related to Isaac Lab team

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants