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

Support capsule and better error messages? #589

Open
dementrock opened this issue Jan 16, 2025 · 4 comments
Open

Support capsule and better error messages? #589

dementrock opened this issue Jan 16, 2025 · 4 comments

Comments

@dementrock
Copy link

Is there any plan to support capsule as one of the primitive geoms? So that there's better feature parity with Mujoco.

Also right now, loading URDF with capsule geom gives a cryptic error message like below:

  File "/opt/conda/envs/ros_env/lib/python3.11/site-packages/genesis/ext/urdfpy/urdf.py", line 144, in _parse_simple_elements
    v = [t._from_xml(n, path) for n in vs]
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/ros_env/lib/python3.11/site-packages/genesis/ext/urdfpy/urdf.py", line 144, in <listcomp>
    v = [t._from_xml(n, path) for n in vs]
         ^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/ros_env/lib/python3.11/site-packages/genesis/ext/urdfpy/urdf.py", line 1001, in _from_xml
    kwargs = cls._parse(node, path)
             ^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/ros_env/lib/python3.11/site-packages/genesis/ext/urdfpy/urdf.py", line 168, in _parse
    kwargs.update(cls._parse_simple_elements(node, path))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/ros_env/lib/python3.11/site-packages/genesis/ext/urdfpy/urdf.py", line 136, in _parse_simple_elements
    v = t._from_xml(v, path)
        ^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/ros_env/lib/python3.11/site-packages/genesis/ext/urdfpy/urdf.py", line 188, in _from_xml
    return cls(**cls._parse(node, path))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/ros_env/lib/python3.11/site-packages/genesis/ext/urdfpy/urdf.py", line 662, in __init__
    raise ValueError("At least one geometry element must be set")

Would be better if it more explicitly says capsules are not supported yet.

@zhouxian
Copy link
Collaborator

is capsule a standard element in URDF? In my understanding it's actually not
let me know if there's any reference

@dementrock
Copy link
Author

@zhouxian ah good point. Indeed it was not mentioned in https://wiki.ros.org/urdf/XML/link. However, we have seen it in some of the robot definitions (perhaps the vendor just used urdf as format but imported it to mujoco?). A bit tricky for me to find public examples, but one was referenced in https://github.com/bulletphysics/bullet3/blob/e9c461b0ace140d5c73972760781d94b7b5eee53/data/capsule.urdf#L16

@Genesis-Embodied-AI
Copy link
Owner

ok i see
we used urdfpy for parsing urdfs, i think we should be able to add capsule

@dementrock
Copy link
Author

Thanks @Genesis-Embodied-AI ! Also thanks for reminding me that actually the mujoco import supports capsule. I am unblocked right now so this is not urgent for me, but seems like good to support if easy so there's more parity with mujoco.

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

No branches or pull requests

3 participants