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 successfully removes the dependency on deprecated isaacsim.core.utils.carb utility functions (get_carb_setting and set_carb_setting) by replacing them with direct carb API calls.

Key Changes:

  • Replaces all set_carb_setting() calls with type-specific methods: set_bool(), set_int(), set_float(), set_string()
  • Replaces all get_carb_setting() calls with direct carb_settings.get()
  • Adds intelligent type routing in SimulationContext.set_setting() to handle different value types correctly
  • Updates 8 files across app launcher, simulation context, and test files
  • Properly orders type checks (bool before int) to avoid Python's bool-is-subclass-of-int issue

Note: As previously flagged, two files outside this PR still use the deprecated functions and should be updated:

  • source/isaaclab/isaaclab/sim/utils.py:24,1079
  • scripts/tools/check_instanceable.py:70,99

Confidence Score: 4/5

  • Safe to merge with minor follow-up work needed on remaining files
  • The refactoring is well-executed with correct type handling and comprehensive coverage of changed files. Score of 4 (not 5) because two files outside this PR still use deprecated functions, creating incomplete migration that should be addressed for consistency
  • source/isaaclab/isaaclab/sim/simulation_context.py has the most significant changes with type routing logic

Important Files Changed

File Analysis

Filename Score Overview
source/isaaclab/isaaclab/app/app_launcher.py 5/5 Removes deprecated carb utility imports and replaces with direct typed carb API calls (set_bool, set_float, set_string)
source/isaaclab/isaaclab/sim/simulation_context.py 4/5 Major refactor: removes deprecated imports, implements type-based routing in set_setting(), replaces all get_carb_setting/set_carb_setting calls with direct carb API

Sequence Diagram

sequenceDiagram
    participant App as Application Code
    participant Old as isaacsim.core.utils.carb
    participant New as carb.settings
    participant Carb as Carbonite Settings

    Note over App,Carb: Before (Deprecated)
    App->>Old: set_carb_setting(settings, name, value)
    Old->>Carb: settings.set(name, value)
    
    App->>Old: get_carb_setting(settings, name)
    Old->>Carb: settings.get(name)
    Carb-->>Old: value
    Old-->>App: value

    Note over App,Carb: After (Direct API)
    App->>New: settings.set_bool(name, value)
    New->>Carb: Set boolean setting
    
    App->>New: settings.set_int(name, value)
    New->>Carb: Set integer setting
    
    App->>New: settings.set_float(name, value)
    New->>Carb: Set float setting
    
    App->>New: settings.set_string(name, value)
    New->>Carb: Set string setting
    
    App->>New: settings.get(name)
    New->>Carb: Get setting
    Carb-->>New: value
    New-->>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

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: In review

Development

Successfully merging this pull request may close these issues.

4 participants