[Error] Failed to create force sensor: invalid body

Hi!

I am trying to run train.py (humanoid task) which is given in the Isaac-Gym repository, with a URDF file instead of the MJCF file, which is given by default. Although the program does run with the MJCF actor loaded, the same does not happen with the URDF. Without any change in the program except for the path name, I first get this error:

Traceback (most recent call last):

  • File “train.py”, line 35, in *
  • train()*
  • File “train.py”, line 19, in train*
  • task, env = parse_task(args, cfg, cfg_train, sim_params)*
  • File “/home/spyd66/isaacgym/python/rlgpu/utils/parse_task.py”, line 65, in parse_task*
  • task = eval(args.task)(*
  • File “/home/spyd66/isaacgym/python/rlgpu/tasks/humanoid.py”, line 53, in init*
  • super().init(cfg=self.cfg)*
  • File “/home/spyd66/isaacgym/python/rlgpu/tasks/base/base_task.py”, line 79, in init*
  • self.create_sim()*
  • File “/home/spyd66/isaacgym/python/rlgpu/tasks/humanoid.py”, line 107, in create_sim*
  • self._create_envs(self.num_envs, self.cfg[“env”][‘envSpacing’], int(np.sqrt(self.num_envs)))*
  • File “/home/spyd66/isaacgym/python/rlgpu/tasks/humanoid.py”, line 153, in _create_envs*
  • self.max_motor_effort = max(motor_efforts)*
    ValueError: max() arg is an empty sequence

and the lines of code responsible for this is as given below:

actuator_props = self.gym.get_asset_actuator_properties(humanoid_asset)
motor_efforts = [prop.motor_effort for prop in actuator_props]
self.max_motor_effort = max(motor_efforts)

Instead of retrieving the actuator information by using get_asset_actuator_properties, I manually entered the information as a list instead. This problem gets fixed but another error pops up:

[Error] [carb.gym.plugin] Failed to create force sensor: invalid body
[Error] [carb.gym.plugin] Failed to create force sensor: invalid body


[Error] [carb.gym.plugin] Failed to create force sensor: invalid body
[Error] [carb.gym.plugin] Failed to create force sensor: invalid body
[Error] [carb.gym.plugin] Failed to create force sensor: invalid body
[Error] [carb.gym.plugin] Failed to create force sensor: invalid body
**** Can’t create empty tensor*
Traceback (most recent call last):

  • File “train.py”, line 35, in *
  • train()*
  • File “train.py”, line 19, in train*
  • task, env = parse_task(args, cfg, cfg_train, sim_params)*
  • File “/home/spyd66/isaacgym/python/rlgpu/utils/parse_task.py”, line 65, in parse_task*
  • task = eval(args.task)(*
  • File “/home/spyd66/isaacgym/python/rlgpu/tasks/humanoid.py”, line 66, in init*
  • self.vec_sensor_tensor = gymtorch.wrap_tensor(sensor_tensor).view(self.num_envs, sensors_per_env * 6)*
    AttributeError: ‘NoneType’ object has no attribute ‘view’

Although the error takes place in a different point in code, the error is similar, i.e., I am not able to use functions to retrieve information from the URDF and the tensors returned seem to be empty. It would be great if anyone can provide insight on what I am doing wrong here, thanks in advance!

Note: There is no issue in loading the URDF actor (both .dae/.obj mesh files).

Hi,

Does your URDF file contain the exact same body names as the MJCF file? The force sensors are created at certain bodies that are retrieved by name in the code (i.e. “right_foot” and “left_foot”).

1 Like

@kellyg Thank you for your reply. I renamed the bodies to the names that are given in the URDF and now it seems to be working fine. Thanks again!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.