I am attempting to generate a list of rigid objects in isaac lab, but receive the error that a list does not have the property “{ENV_REGEX_EX}”. Some example code is below.
I add the “objects” as
objects: [RigidObjectCfg] = MISSING in the lift_env_cfg.py file for franka-reach.
Is there someway to do this without manually creating all scene objects and defining them in lift_env_cfg.py?
i.e self.scene.object_1 = RigidObjectCfg()
self.scene.object_2 = RigidObectjCfg()
With each object defined as missing in lift_env_cfg.py
object_1: RigidObjectCfg = MISSING
object_2: RigidObjectCfg = MISSING
Example list code:
self.sphere_sizes = np.random.uniform(0.01, 0.1, 10)
self.scene.objects = []
num_objects = 20
for obj_dex in range(1, num_objects + 1):
obj = RigidObjectCfg(
prim_path="{ENV_REGEX_NS}/Object_" + str(obj_dex),
init_state=RigidObjectCfg.InitialStateCfg(pos=[0.7, 0, 0.055], rot=[1, 0, 0, 0]),
spawn=UsdFileCfg(
usd_path=f"/home/kevin/HD_2/Data/Code/IsaacLab/sphere/sphere/sphere.usd",
scale=(self.sphere_sizes[obj_dex - 1], self.sphere_sizes[obj_dex - 1], self.sphere_sizes[obj_dex - 1]),
rigid_props=RigidBodyPropertiesCfg(
solver_position_iteration_count=16,
solver_velocity_iteration_count=1,
max_angular_velocity=1000.0,
max_linear_velocity=100.0,
max_depenetration_velocity=5.0,
disable_gravity=False,
),
),
)
self.scene.objects.append(obj)