Skip to content

Attach of FlexComp gives repeated name error and doesn't generate Flex Equality #2977

@physical-graphics

Description

@physical-graphics

Intro

Hi!

I am an automotive engineer and technical artist experimenting with Mujoco as the physics engine for real-time visualisation. Previously I have been using Bullet for this, but looking for better support of soft bodies in Mujoco.

You can see the state of my Bullet-based demo here: https://www.linkedin.com/posts/alan-ramsay-a50a8a5_autodesk-vred-bulletphysics-activity-7396634112872116224-JgRF?utm_source=share&utm_medium=member_desktop&rcm=ACoAAAEMmVwBk8WU7q3HVFdlZ90RkRU-gm0rSSU

My setup

Mujoco version 3.3.7
Using simulation.exe to test model development
Ryzen 9 9950X, Windows 11 Pro 25H2

What's happening? What did you expect?

Issue Observed:

  • Using attach to add a flexcomp to my model gives a 'repeated name' error if another element with the same name has already been attached or included
  • If there is no previous name to clash and prevent attachment, the attach does not generate the specified flex equality constraint for the bodies.
  • I expect the prefix element of the attach to prevent name clashes, and for the flex equality constraint to be generated.

Possible Solution:

  • Adding call mjCBase::NameSpace(m); in mjCFlex::Namespace on line 4033 of user_mesh.cc appears to solve this, let me know if I should submit a PR for that.

issue_flex_attach.zip

Image

Steps for reproduction

  1. Load my_model.xml from the .zip using simulate.exe
  2. Comment out selected includes or attaches to see the interaction between them
  3. See summary in README.txt
  4. generated_softbody_include.xml shows successful parsing and generation of flexcomp by include
  5. generated_softbox_attach.xml shows the absence of prefixing and flex equality generated by attach

Minimal model for reproduction

Since this is specifically a multi-file issue, I've included xml files for reproduction in the attached .zip, please advise if there is a better way to provide this.

Code required for reproduction

N/A - using simulate.exe

Confirmations

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions