@@ -201,6 +201,11 @@ def _build_lstm_onnx(
201201# ---------------------------------------------------------------------------
202202
203203
204+ # Regularize the fixtures' idealized point masses without changing their
205+ # effective dynamics from the inertia that validation previously synthesized.
206+ _POINT_MASS_INERTIA = wp .mat33 (1.0e-6 , 0.0 , 0.0 , 0.0 , 1.0e-6 , 0.0 , 0.0 , 0.0 , 1.0e-6 )
207+
208+
204209def _write_dof_values (
205210 model : newton .Model ,
206211 array : wp .array [float ],
@@ -222,8 +227,7 @@ def _build_pendulum(device: wp.Device, worlds: int = 1) -> newton.Model:
222227 worlds: Number of identical worlds to replicate the pendulum into.
223228 """
224229 template = newton .ModelBuilder (gravity = (0.0 , 0.0 , 0.0 ))
225- body = template .add_link (mass = 1.0 )
226- template .body_com [body ] = wp .vec3 (0.5 , 0.0 , 0.0 )
230+ body = template .add_link (com = wp .vec3 (0.5 , 0.0 , 0.0 ), inertia = _POINT_MASS_INERTIA , mass = 1.0 )
227231 joint = template .add_joint_revolute (parent = - 1 , child = body , axis = newton .Axis .Z )
228232 template .add_articulation ([joint ])
229233 if worlds == 1 :
@@ -244,11 +248,10 @@ def _two_link_builder(armature: float = 0.0, dummy_body: bool = False) -> newton
244248 """
245249 builder = newton .ModelBuilder (gravity = (0.0 , 0.0 , 0.0 ))
246250 if dummy_body :
247- builder .add_joint_revolute (parent = - 1 , child = builder .add_link (mass = 1.0 ), axis = newton .Axis .Z )
248- base = builder .add_link (mass = 2.0 )
249- tip = builder .add_link (mass = 1.0 )
250- builder .body_com [base ] = wp .vec3 (0.3 , 0.0 , 0.0 )
251- builder .body_com [tip ] = wp .vec3 (0.25 , 0.0 , 0.0 )
251+ dummy = builder .add_link (inertia = _POINT_MASS_INERTIA , mass = 1.0 )
252+ builder .add_joint_revolute (parent = - 1 , child = dummy , axis = newton .Axis .Z )
253+ base = builder .add_link (com = wp .vec3 (0.3 , 0.0 , 0.0 ), inertia = _POINT_MASS_INERTIA , mass = 2.0 )
254+ tip = builder .add_link (com = wp .vec3 (0.25 , 0.0 , 0.0 ), inertia = _POINT_MASS_INERTIA , mass = 1.0 )
252255 j0 = builder .add_joint_revolute (parent = - 1 , child = base , axis = newton .Axis .Z , armature = armature )
253256 j1 = builder .add_joint_revolute (
254257 parent = base ,
0 commit comments