chrisjcc commited on
Commit
9a518dc
·
verified ·
1 Parent(s): f1c4b61

Stability Classification at End of Simulation

Browse files
Files changed (1) hide show
  1. tray_sim.py +6 -1
tray_sim.py CHANGED
@@ -46,7 +46,7 @@ def run_tray_simulation(seed=0, num_objects=N_OBJECTS, azimuth=45, elevation=-25
46
  tray_id = mujoco.mj_name2id(model, mujoco.mjtObj.mjOBJ_BODY, "tray")
47
 
48
  # Apply a transient force to the tray
49
- tray_force_applied = False # One-time trigger
50
 
51
  # Locate pusher DOF index (last one in qpos if you have 10 objects)
52
  # Compute DOF offsets
@@ -126,6 +126,11 @@ def run_tray_simulation(seed=0, num_objects=N_OBJECTS, azimuth=45, elevation=-25
126
 
127
  renderer.close()
128
 
 
 
 
 
 
129
  # Save to GIF
130
  gif_path = os.path.join(tempfile.gettempdir(), f"tray_sim_{seed}.gif")
131
  imageio.mimsave(gif_path, frames, fps=20)
 
46
  tray_id = mujoco.mj_name2id(model, mujoco.mjtObj.mjOBJ_BODY, "tray")
47
 
48
  # Apply a transient force to the tray
49
+ tray_force_applied = True # False # One-time trigger
50
 
51
  # Locate pusher DOF index (last one in qpos if you have 10 objects)
52
  # Compute DOF offsets
 
126
 
127
  renderer.close()
128
 
129
+ stability_flags = classify_stability(data, model)
130
+
131
+ # Optional: print or return
132
+ print("Stability:", stability_flags)
133
+
134
  # Save to GIF
135
  gif_path = os.path.join(tempfile.gettempdir(), f"tray_sim_{seed}.gif")
136
  imageio.mimsave(gif_path, frames, fps=20)