Add set_scale to Arena and MujocoObject - #643
Merged
Merged
Conversation
set_scale to Arena and MujocoObject
Member
|
Any reason why you can't just move the code to a parent class? Seems like its repeated across 3 classes. |
…into enable-scale-setting-arena
…into enable-scale-setting-arena
…into enable-scale-setting-arena
Contributor
Author
|
Refactored @Abhiram824 could you please take a look? |
Abhiram824
reviewed
Jul 10, 2025
| # Choose what to do based on elements type | ||
| if isinstance(elements, str): | ||
| # We simply return the value of this single element | ||
| assert element_type in { |
Abhiram824
reviewed
Jul 10, 2025
| scale_array = normalize_scale_array(scale) | ||
|
|
||
| # Scale geoms | ||
| geom_pairs = get_geoms_func(obj) |
Member
There was a problem hiding this comment.
why do we need to treat geoms differently with the get_geoms_func? why cant we just do get_elements_func(obj, "geom") Also should we move the _get_elements to mjcf_utils.py?
Abhiram824
requested changes
Jul 10, 2025
Abhiram824
left a comment
Member
There was a problem hiding this comment.
Looks mostly good, left some comments mainly to refactor code
ShahRutav
pushed a commit
to ShahRutav/robosuite
that referenced
this pull request
Dec 31, 2025
* Add scale setting and saving in arena * Require obj param for set_scale in arena * Update interface of set_scale in arena * Update set_scale object indexing * Format * Improve logging if invalid object to scale * Add option to set_scale of MujocoObjects * Format * Refactor scale setting code * format * refactor * re-add assert to get_ids * Format * Format
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.
What this does
Add ability to
set_scaleof bodies in arena, as well asset_scaleforMujocoObjects; previously onlyMujocoXMLObjecthad these functions.How to test
In _load_arena() add something like:
scale=0.5

scale=1.5
