added scaling features to wall texture #382
Merged
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.
Signed-off-by: xiyuoh [email protected]
New feature implementation
Implemented feature
This PR follows #343 to add scalability to downloaded textures from URL.
Implementation description
As mentioned in #342 the custom textures may be stretched in simulation as their height-to-width ratio may not be coherent with the wall dimensions (walls expect a 2.5m x 1m texture size). This feature implemented allows users to customize texture scales by adding parameters to define these scales.
Before implementation:
You can observe the texture stretching by comparing the wall and floor textures.
After implementation:
The scaling is controlled by three parameters:
texture_height
,texture_width
andtexture_scale
:texture_height
andtexture_width
: dimensions of the texture image. It does not need to be absolute as only their ratio will be calculated, i.e. for square textures, you can enter 1 for both parameters.But for images where the ratio may not be easy to compute, users can enter the absolute dimensions directly.
texture_scale
: how 'zoomed in' you want your texture to be (default is 1)For example, if you want your texture width to be 1m, enter 1. If you want your texture width to be 2m, enter 2. The height will be scaled accordingly.
Special case: If you want your texture image to fit the full wall (texture height = wall height), enter 0.
See some examples below!
For
texture_scale = 2
with square texturesFor
texture_scale = 0
with complicated texture dimensionsTesting the PR
traffic_editor
building_map_generator.py gazebo
on your yaml map and open the mesh files in gazebo.