Genesis-Embodied-AI/genesis-world · error · DeprecationError

This method has been removed because dof invweights are supp

Error message

This method has been removed because dof invweights are supposed to be a by-product of link properties (mass, pose, and inertia matrix), joint placements, and dof armatures. Please consider using the considering setters instead.

What it means

set_dofs_invweight() was removed because dof inverse weights are not free parameters: they are derived by the solver from link mass, pose, inertia, joint placements and dof armatures. Writing them directly could put the model in an inconsistent state, so the setter now only raises DeprecationError pointing at the property setters that legitimately influence invweights.

Source

Thrown at genesis/engine/entities/rigid_entity/rigid_entity.py:3885

            The lower bounds of the force range.
        upper : array_like
            The upper bounds of the force range.
        dofs_idx_local : None | array_like, optional
            The indices of the dofs to set. If None, all dofs will be set. Note that here this uses the local `q_idx`, not the scene-level one. Defaults to None.
        envs_idx : None | array_like, optional
            The indices of the environments. If None, all environments will be considered. Defaults to None.
        """
        dofs_idx = self._get_global_idx(dofs_idx_local, self.n_dofs, self._dof_start, unsafe=True)
        self._solver.set_dofs_force_range(lower, upper, dofs_idx, envs_idx)

    @gs.assert_built
    def set_dofs_stiffness(self, stiffness, dofs_idx_local=None, envs_idx=None):
        dofs_idx = self._get_global_idx(dofs_idx_local, self.n_dofs, self._dof_start, unsafe=True)
        self._solver.set_dofs_stiffness(stiffness, dofs_idx, envs_idx)

    @gs.assert_built
    def set_dofs_invweight(self, invweight, dofs_idx_local=None, envs_idx=None):
        raise DeprecationError(
            "This method has been removed because dof invweights are supposed to be a by-product of link properties "
            "(mass, pose, and inertia matrix), joint placements, and dof armatures. Please consider using the "
            "considering setters instead."
        )

    @gs.assert_built
    def set_dofs_armature(self, armature, dofs_idx_local=None, envs_idx=None):
        dofs_idx = self._get_global_idx(dofs_idx_local, self.n_dofs, self._dof_start, unsafe=True)
        self._solver.set_dofs_armature(armature, dofs_idx, envs_idx)

    @gs.assert_built
    def set_dofs_damping(self, damping, dofs_idx_local=None, envs_idx=None):
        dofs_idx = self._get_global_idx(dofs_idx_local, self.n_dofs, self._dof_start, unsafe=True)
        self._solver.set_dofs_damping(damping, dofs_idx, envs_idx)

    @gs.assert_built
    def set_dofs_frictionloss(self, frictionloss, dofs_idx_local=None, envs_idx=None):
        """

View on GitHub (pinned to 56e4aa5d82)

Solutions

  1. Set the underlying physical properties instead: `set_dofs_armature(...)`, `set_links_mass(...)`, `set_links_inertia(...)`, `set_links_COM(...)` and joint placement setters.
  2. If a specific dynamic behavior was achieved via invweight before, re-derive it by adjusting armature or inertia on the affected DOFs.

Example fix

# before
entity.set_dofs_invweight(invweight, dofs_idx_local=[0, 1])

# after
entity.set_dofs_armature(armature, dofs_idx_local=[0, 1])
entity.set_links_mass(mass, links_idx_local=[1])
Defensive patterns

Strategy: validation

Validate before calling

assert not hasattr(entity, "set_dofs_invweight") or getattr(type(entity).set_dofs_invweight, "__code__", None) is None, "setter removed; use set_dofs_armature / set_links_* instead"

Try / catch

try:
    entity.set_dofs_invweight(w, dofs_idx_local=[0])
except DeprecationError:
    entity.set_dofs_armature(w, dofs_idx_local=[0])

Prevention

When it happens

Trigger: Calling `entity.set_dofs_invweight(invweight, dofs_idx_local=..., envs_idx=...)` on a RigidEntity, e.g. code ported from an older Genesis version or scripts tuning dynamics via raw invweights.

Common situations: Upgrading Genesis after this setter was deleted; porting controller-tuning scripts that previously poked invweights directly to stabilize simulation.

Related errors


AI-assisted analysis of Genesis-Embodied-AI/genesis-world@56e4aa5d82 (2026-08-28). Data as JSON: /api/errors/ca5c21e7fa758d28. Report an issue: GitHub.