Rotatitng a buch of geoms at once

Discussion in 'Feature Requests' started by florianw, Jan 22, 2019.

  1. Some of my models are made up of a fair bunch of static geometries attached to the worldbody.
    The only way of translating the geometries at once such that their relative positioning remains the same, is grouping them in a separate body that is welded to the worldbody and than shifted and rotated using the "pos" and "quat" element of <body>. From my understanding, this results in a performance loss due to the additional constraints.

    A xml thing that goes like this:

    <transform pos quat>
    <geom pos= quat= ...>
    <geom pos= quat= ...>
    <geom pos= quat= ...>
    <geom pos= quat= ...>
    ....
    </transform>

    or

    some additional geom property such as
    pretransform="t1"
    where t1 is somehow userdefined in the way materials are userdefined

    I'd consider that quite useful.
     
    Last edited: Jan 22, 2019
  2. Emo Todorov

    Emo Todorov Administrator Staff Member

    You can create a static body under world (i.e. a body with no joints), and define the geoms in that body. You could even make it a mocap body so it can be moved at runtime without changing the model. The performance hit will be negligible; you are adding just one extra spatial frame.

    Note that if you create a floating body and define a weld constraint, that is slower compared to the above approach.

    There is also a new compiler option in MuJoCo 2.0 that removes static bodies automatically and reassigns their elements to the parent body. But I wouldn't bother in your case.

    Also, it is better to post in the Priority section of the Forum (given that you have access to it). I no longer have time to answer all questions in the public section.