(self, object_id, object_type)
return util.to_native_string(ctypes.string_at(name_ptr))
Returns the name associated with a MuJoCo object ID, if there is one.

    Args:
      object_id: Integer ID.
      object_type: The type of the object. Can be either a lowercase string
        (e.g. 'body', 'geom') or an `mjtObj` enum value.

    Returns:
      A string containing the object name, or an empty string if the object ID
      either doesn't exist or has no name.

    Raises:
      Error: If `object_type` is not a valid MuJoCo object type.
Returns the name associated with a MuJoCo object ID, if there is one.
Returns the name associated with a MuJoCo object ID if there is one .
def id2name(self, object_id, object_type):
    """Returns the name associated with a MuJoCo object ID, if there is one.

    Args:
      object_id: Integer ID.
      object_type: The type of the object. Can be either a lowercase string
        (e.g. 'body', 'geom') or an `mjtObj` enum value.

    Returns:
      A string containing the object name, or an empty string if the object ID
      either doesn't exist or has no name.

    Raises:
      Error: If `object_type` is not a valid MuJoCo object type.
    """
    if not isinstance(object_type, int):
      object_type = _str2type(object_type)
    name_ptr = mjlib.mj_id2name(self.ptr, object_type, object_id)
    if not name_ptr:
      return ""
    return util.to_native_string(ctypes.string_at(name_ptr))
def id2name ( self , object_id , object_type ) : if not isinstance ( object_type , int ) : object_type = _str2type ( object_type ) name_ptr = mjlib . mj_id2name ( self . ptr , object_type , object_id ) if not name_ptr : return "" return util . to_native_string ( ctypes . string_at ( name_ptr ) )