Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bugfix] Copy mesh before scaling if it was passed in as a parameter #80

Merged

Conversation

amalnanavati
Copy link
Contributor

Description

#67 allowed users to pass in a preloaded mesh as a parameter, to avoid needing to keep reloading a mesh. That PR correctly realized that if the mesh is passed in as a parameter, we should copy it before scaling, to avoid destructively modifying the mesh that the user passed in. However, that PR had a bug in its implementation of that feature, resulting in it copying the mesh before scaling if the mesh was not passed in as a parameter. This PR addresses that.

Testing

I tested this PR on my local robot setup, where we pre-load a mesh and then add it multiple times with different scale values. Before the change, the mesh would keep scaling down until near-zero (because the pre-loaded mesh is what gets scaled). After the change, it properly applies the scale (because the pre-loaded mesh remains unmodified).

Let me know if you'd like me to create a test case within this repo / the simulated panda example for this PR. I figured since it is a one-word change, the above should be fine :)

Copy link
Owner

@AndrejOrsula AndrejOrsula left a comment

Choose a reason for hiding this comment

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

Thanks for the catch! This is great.

@AndrejOrsula AndrejOrsula merged commit 640bb85 into AndrejOrsula:master Nov 28, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants