Confusion: sensors in Ant example

In the ant.py. def _create_envs(). the env_senors are appends to the self.sensors right after a new sensor is appended to env_sensors.

         env_sensors = []
            for extr in extremity_names:
                extr_handle = self.gym.find_actor_rigid_body_handle(env_ptr, ant_handle, extr)
                env_sensors.append(self.gym.create_force_sensor(env_ptr, extr_handle, sensor_pose))
                self.sensors.append(env_sensors)

Should the last line be outside the for-loop? Or it is an intended design that I do not understand?

Yes, I believe you are correct. The last line should be outside of the for loop. We will have an update to the force sensors API in the next release and resolve the issue there. Thanks!

1 Like