Add light color temperature variation#885
Conversation
- Update test_arena_env_builder_cfg to the renamed --no_solve_relations flag (the hyphenated form was failing the no-camera CI job). - Collapse set_intensity/set_orientation docstrings to a single line; drop the redundant explicit DistantLightCfg angle (0.53 is already the default). - Remove RST double-backticks from the quaternion helper docstring. - Inline the single-use test variation name; use non-zero test azimuth/elevation so the applied direction differs from the identity default. - Revert the droid_pnp_variations_config.json eval config changes. Signed-off-by: alex <amillane@nvidia.com>
- Inline single-use test constants and pass the color into build_test_light. - Drop superfluous asserts and RST backticks in docstrings. Signed-off-by: alex <amillane@nvidia.com>
- Sample a white-point color temperature (Kelvin) and apply it to the dome and directional lights via a new set_color_temperature on LightBase. Signed-off-by: alex <amillane@nvidia.com>
| """Uniform distribution over color temperature in Kelvin, from warm (low) to cool (high).""" | ||
|
|
||
|
|
||
| class LightColorTemperatureVariation(BuildTimeVariationBase): |
There was a problem hiding this comment.
🔵 This class is structurally identical to LightIntensityVariation (sample one scalar → call a setter), differing only in the cfg's default range and which setter it invokes. With intensity and now temperature following the same shape, is it worth collapsing the single-scalar cases into one generic variation parameterized by the setter + default range (thin Cfg subclasses, or just cfg instances)? Not a blocker — more a question of whether this family is now large enough to earn a shared base rather than a third near-copy.
🤖 Isaac Lab-Arena Review BotSummaryAdds a build-time Findings🔵 Improvement: Test CoverageStrong. VerdictShip it |
Greptile SummaryThis PR adds a new
Confidence Score: 4/5Safe to merge; the new variation correctly wires into both DomeLight and DirectionalLight using the established build-time pattern, and the tests cover the disabled and enabled paths end-to-end. The implementation is consistent with sibling variations and correctly delegates to the validated set_color_temperature API. The only gap is that the default sampler range starts at 2000 K while the API it calls accepts values down to 1000 K, leaving the warmest tones unreachable via the default configuration without an explicit override. isaaclab_arena/variations/light_color_temperature_variation.py — the default sampler lower bound. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[LightColorTemperatureVariation.apply] --> B{sampler set?}
B -- No --> C[AssertionError]
B -- Yes --> D[sampler.sample num_samples=1]
D --> E[color_temperature = float result 0,0]
E --> F[LightBase.set_color_temperature]
F --> G{1000 <= temp <= 10000?}
G -- No --> H[AssertionError]
G -- Yes --> I[spawner_cfg.enable_color_temperature = True]
I --> J[spawner_cfg.color_temperature = value]
J --> K[object_cfg = _init_object_cfg]
subgraph Registration
L[DomeLight.__init__] --> M[add_variation LightColorTemperatureVariation]
N[DirectionalLight.__init__] --> M
end
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[LightColorTemperatureVariation.apply] --> B{sampler set?}
B -- No --> C[AssertionError]
B -- Yes --> D[sampler.sample num_samples=1]
D --> E[color_temperature = float result 0,0]
E --> F[LightBase.set_color_temperature]
F --> G{1000 <= temp <= 10000?}
G -- No --> H[AssertionError]
G -- Yes --> I[spawner_cfg.enable_color_temperature = True]
I --> J[spawner_cfg.color_temperature = value]
J --> K[object_cfg = _init_object_cfg]
subgraph Registration
L[DomeLight.__init__] --> M[add_variation LightColorTemperatureVariation]
N[DirectionalLight.__init__] --> M
end
Reviews (1): Last reviewed commit: "Add light color temperature variation" | Re-trigger Greptile |
| class LightColorTemperatureVariationCfg(VariationBaseCfg): | ||
| """Configuration for LightColorTemperatureVariation.""" | ||
|
|
||
| sampler_cfg: UniformSamplerCfg = field(default_factory=lambda: UniformSamplerCfg(low=[2000.0], high=[10000.0])) |
There was a problem hiding this comment.
The default sampler lower bound is 2000 K while
set_color_temperature documents and validates the full range [1000, 10000] K. With this default, the warmest tones (1000–2000 K — candlelight, incandescent bulbs) can never be sampled unless the caller explicitly overrides sampler_cfg. Aligning the default to 1000 K makes the variation self-consistent with the API it calls.
| sampler_cfg: UniformSamplerCfg = field(default_factory=lambda: UniformSamplerCfg(low=[2000.0], high=[10000.0])) | |
| sampler_cfg: UniformSamplerCfg = field(default_factory=lambda: UniformSamplerCfg(low=[1000.0], high=[10000.0])) |
| self.object_cfg = self._init_object_cfg() | ||
|
|
||
| def set_color_temperature(self, color_temperature: float) -> None: | ||
| """Enable and set the light's white-point color temperature in Kelvin, in [1000, 10000].""" |
There was a problem hiding this comment.
Is there a reason to constrain it to 1000, 10000?
Summary
Adds a light color variation.
Detailed description