Genesis-Embodied-AI/genesis-world · error · DeprecationError
This method has been removed because links invweights are su
Error message
This method has been removed because links invweights are supposed to be a by-product.
What it means
set_links_invweight() was removed for the same reason as its dof counterpart: link inverse weights are a by-product of mass, center of mass, inertia and dof armatures. The removed stub's docstring directs users to write one of those derived-from properties instead.
Source
Thrown at genesis/engine/entities/rigid_entity/rigid_entity.py:4546
Parameters
----------
mass : array_like, shape (n_links,) or (n_envs, n_links)
The mass of each link, in kg. Per-environment values require `RigidOptions.batch_links_info=True`.
links_idx_local : None | array_like, optional
The indices of the links. If None, all links are considered. Defaults to None.
envs_idx : None | array_like, optional
The indices of the environments. If None, all environments will be considered. Defaults to None.
"""
links_idx = self._get_global_idx(links_idx_local, self.n_links, self._link_start, unsafe=True)
self._solver.set_links_mass(mass, links_idx, envs_idx)
@gs.assert_built
def set_links_invweight(self, invweight, links_idx_local=None, envs_idx=None):
"""
Removed: Genesis computes the inverse weights of a link from its mass, its center of mass, its inertia and
the armature of the degrees of freedom above it, so write one of those instead.
"""
raise DeprecationError("This method has been removed because links invweights are supposed to be a by-product.")
@gs.assert_built
def set_links_COM(self, com, links_idx_local=None, envs_idx=None):
"""
Set the center of mass (COM) of the given links, as an offset in their local frame.
Parameters
----------
com : array_like, shape (n_links, 3) or (n_envs, n_links, 3)
The center of mass of each link. Per-environment values require `RigidOptions.batch_links_info=True`.
links_idx_local : None | array_like, optional
The indices of the links. If None, all links are considered. Defaults to None.
envs_idx : None | array_like, optional
The indices of the environments. If None, all environments will be considered. Defaults to None.
"""
links_idx = self._get_global_idx(links_idx_local, self.n_links, self._link_start, unsafe=True)
self._solver.set_links_COM(com, links_idx, envs_idx)
View on GitHub (pinned to 56e4aa5d82)
Solutions
- Use `set_links_mass`, `set_links_COM`, `set_links_inertia` (and `set_dofs_armature` for the DOFs above the link) to shape the computed invweight.
- Grep for `set_links_invweight` and migrate every call site.
Example fix
# before entity.set_links_invweight(invweight, links_idx_local=[2]) # after entity.set_links_mass(new_mass, links_idx_local=[2]) entity.set_links_inertia(new_inertia, links_idx_local=[2])
Defensive patterns
Strategy: validation
Validate before calling
if not callable(getattr(type(entity), "set_links_invweight", None)) or isinstance(getattr(type(entity), "set_links_invweight", None), property):
pass # removed; must use set_links_mass / set_links_COM / set_links_inertia Try / catch
try:
entity.set_links_invweight(w, links_idx_local=[0])
except DeprecationError:
entity.set_links_mass(m, links_idx_local=[0]) Prevention
- Tune mass/COM/inertia/armature instead of invweights.
- Codemod old call sites away when migrating Genesis versions.
When it happens
Trigger: Calling `entity.set_links_invweight(invweight, links_idx_local=..., envs_idx=...)` on a built RigidEntity, typically from legacy code or old tuning scripts.
Common situations: Version upgrade removing the setter; scripts that stabilized simulation by clamping link invweights now failing at runtime.
Related errors
- This method has been removed because dof invweights are supp
- This method has been removed. Please use 'get_AABB()' instea
- Python module 'uipc' is required by IPCCoupler but is not in
- `morph` in hybrid entity should be either URDF or Mesh
- Cannot handle soft material {material_soft}
AI-assisted analysis of Genesis-Embodied-AI/genesis-world@56e4aa5d82 (2026-08-28).
Data as JSON: /api/errors/1e5caf8ec4bdedc6.
Report an issue: GitHub.