Repository navigation
Conversation
Since isaac-sim#4470, height_field_to_mesh requires generators to return (height_field, origin). A generator that still returns only the height field failed inside the decorator with "ValueError: too many values to unpack (expected 2)", which names neither the generator nor the contract change, and left cfg.size shrunk. Check the generator's return value; if it is not a 2-tuple, restore cfg.size and raise a TypeError that names the generator and the expected (height_field, origin) return. Signed-off-by: Daniel Florea <daniel.florea@tum.de>
dfloreaa
requested review from
AntoineRichard,
StafaH,
fatimaanes,
kellyguo11,
ooctipus and
pbarejko
as code owners
November 4, 2026 13:48
Contributor
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryThe PR gives custom height-field generators a clearer error when they omit the origin.
Reviews (1) · Last reviewed commit: "Raise a clear error for height-field gen..." · Reviewed by Greptile |
Contributor
There was a problem hiding this comment.
Isaac Lab Review Bot
Needs attention: Design and architecture (1), Compatibility and deprecation (1), Test quality (1). Other reviewed categories look good.
- PR description: The body matches the guard, documentation, changelog, and regression test, but “non-breaking” is inaccurate because the tuple-only check rejects previously accepted two-item iterables; disclose that narrowing.
- Design and architecture: The new exceptional restore duplicates success-path cleanup and still leaks temporary
cfg.sizewhen the generator or border assignment raises; restore it once withtry/finally. - Scope and over-engineering: No over-engineering issues.
- API: API changes look good.
- Compatibility and deprecation: Breaking changes: the tuple-only guard rejects two-item lists and other iterable returns previously accepted by unpacking; preserve iterable unpacking or provide a complete deprecation bridge.
- Implementation: Implementation looks good.
- Style consistency: Style consistency looks good.
- Test quality: The regression test covers the error and restored size, but its unused pixel calculations repeat production logic; return any array directly and remove the extra import.
Minor fixes needed. Posted 3 inline findings.
Automated review; human maintainers own approval decisions.
Address review feedback on the height-field return check: - Unpack the generator's result and turn only an unpacking failure into the TypeError, so two-item iterables such as lists keep working as before instead of being rejected by a tuple check. - Restore cfg.size once in a finally block, which also covers a generator that raises and a failing border assignment. - Drop the unused shape setup from the regression test. Signed-off-by: Daniel Florea <daniel.florea@tum.de>
AntoineRichard
approved these changes
Nov 5, 2026
AntoineRichard
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for the fix @dfloreaa LGTM!
Collaborator
|
run-ci |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Since #4470, a function decorated with
height_field_to_meshmust return the height field together with the terrain origin, and the decorator unpacks the result directly:A custom generator written against the previous contract returns only the height field, so terrain generation fails inside the decorator with
The error names neither the generator nor the contract change, and it comes after the decorator has already shrunk
cfg.sizefor the generator without restoring it. We hit this with downstream height-field generators when moving a project fromrelease/3.0.0-beta2tomain.This turns a failure to unpack the generator's result into a
TypeErrorthat names the generator and the expected(height_field, origin)return. Any two-item return that unpacked before, such as a list, still works. The decorator now restorescfg.sizein afinallyblock, so the size is also restored when the generator or the border assignment raises. The decorator's docstring now lists both errors it raises in aRaises:section. Generators that already return a tuple are unchanged, which covers all six built-in height-field terrains.release/3.0.0does not contain #4470, so no backport is needed.Type of change
Checklist
pre-commitchecks withuv run isaaclab --formatsource/<pkg>/changelog.d/for every touched package (do not editCHANGELOG.rstor bump package versions — CI handles that)CONTRIBUTORS.mdor my name already exists thereTesting
test_height_field_generator_without_origin_raises_type_errortotest/terrains/test_terrain_generator.py: a decorated generator that returns only the height field must raise theTypeErrorand leavecfg.sizeunchanged. It fails onmainwith theValueErrorabove and passes with the fix.test_terrain_generator.pypasses locally (28 passed).uv run isaaclab --formatpasses, including the changelog-fragment check.