From df185585a7b58cbc04bbf772e4e5c81abff18a47 Mon Sep 17 00:00:00 2001 From: Lionel Gulich Date: Tue, 15 Oct 2024 09:57:40 +0200 Subject: [PATCH] Adds better error message for MISSING value --- .../omni/isaac/lab/actuators/actuator_base.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/source/extensions/omni.isaac.lab/omni/isaac/lab/actuators/actuator_base.py b/source/extensions/omni.isaac.lab/omni/isaac/lab/actuators/actuator_base.py index 4d53fc048b..67926fce31 100644 --- a/source/extensions/omni.isaac.lab/omni/isaac/lab/actuators/actuator_base.py +++ b/source/extensions/omni.isaac.lab/omni/isaac/lab/actuators/actuator_base.py @@ -221,7 +221,10 @@ def _parse_joint_parameter( # note: need to specify type to be safe (e.g. values are ints, but we want floats) param[:, indices] = torch.tensor(values, dtype=torch.float, device=self._device) else: - raise TypeError(f"Invalid type for parameter value: {type(cfg_value)}. Expected float or dict.") + raise TypeError( + f"Invalid type for parameter value: {type(cfg_value)} for " + + f"actuator on joints {self.joint_names}. Expected float or dict." + ) elif default_value is not None: if isinstance(default_value, (float, int)): # if float, then use the same value for all joints @@ -230,7 +233,10 @@ def _parse_joint_parameter( # if tensor, then use the same tensor for all joints param[:] = default_value.float() else: - raise TypeError(f"Invalid type for default value: {type(default_value)}. Expected float or Tensor.") + raise TypeError( + f"Invalid type for default value: {type(default_value)} for " + + f"actuator on joints {self.joint_names}. Expected float or Tensor." + ) else: raise ValueError("The parameter value is None and no default value is provided.")