-
Notifications
You must be signed in to change notification settings - Fork 36
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
Feature/urdf to mjcf #309
Feature/urdf to mjcf #309
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice nice, some requests, i will take a look at this later and merge
store/app/crud/urdf.py
Outdated
if mesh_names: | ||
raise BadArtifactError(f"Mesh files uploaded were not referenced: {mesh_names}") | ||
|
||
logger.info("refs", mesh_references) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can remove this i think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we dont want redundancy tho
store/app/routers/urdf.py
Outdated
@@ -89,10 +89,11 @@ async def set_urdf( | |||
|
|||
# Gets the compression type from the file content type and filename. | |||
compression_type = get_compression_type(file.content_type, file.filename) | |||
if compression_type not in ("tgz", "zip"): | |||
|
|||
if compression_type not in ("tgz", "zip", "tar.gz"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compression_type
is a python string literal, tar.gz
shouldn't be an option (it gets mapped to tgz
compression type)
store/app/utils/convert.py
Outdated
from store.app.utils.formats import mjcf | ||
|
||
|
||
def contains_urdf_or_mjcf(folder_path: Path) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is gonna seem even more neurotic but you can do this instead. the reason is that the type checker will then be able to detect string typos
def contains_urdf_or_mjcf(folder_path: Path) -> str: | |
from typing import MeshType | |
MeshType = Literal["urdf", "mjcf"] | |
def contains_urdf_or_mjcf(folder_path: Path) -> MeshType: |
# HACK | ||
# mujoco has a hard time reading meshes | ||
_copy_stl_files(self.output_dir / "meshes", self.output_dir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should probably do this correctly
What does this PR do?
This should be a short, one-line description.
What issues does this PR fix or reference?
If relevant, please include a reference to the issue here.
If this PR changes the UI, include a screenshot below.
Otherwise, feel free to delete this section.