@@ -1372,10 +1372,16 @@ def test_setting_velocity_limit_explicit(sim, num_articulations, device, vel_lim
13721372@pytest .mark .parametrize ("num_articulations" , [1 , 2 ]) 
13731373@pytest .mark .parametrize ("device" , ["cuda:0" , "cpu" ]) 
13741374@pytest .mark .parametrize ("effort_limit_sim" , [1e5 , None ]) 
1375- @pytest .mark .parametrize ("effort_limit" , [1e2 , None ]) 
1375+ @pytest .mark .parametrize ("effort_limit" , [1e2 , 80.0 ,  None ]) 
13761376@pytest .mark .isaacsim_ci  
13771377def  test_setting_effort_limit_implicit (sim , num_articulations , device , effort_limit_sim , effort_limit ):
1378-     """Test setting of the effort limit for implicit actuators.""" 
1378+     """Test setting of effort limit for implicit actuators. 
1379+ 
1380+     This test verifies the effort limit resolution logic for actuator models implemented in :class:`ActuatorBase`: 
1381+     - Case 1: If USD value == actuator config value: values match correctly 
1382+     - Case 2: If USD value != actuator config value: actuator config value is used 
1383+     - Case 3: If actuator config value is None: USD value is used as default 
1384+     """ 
13791385    articulation_cfg  =  generate_articulation_cfg (
13801386        articulation_type = "single_joint_implicit" ,
13811387        effort_limit_sim = effort_limit_sim ,
@@ -1419,10 +1425,18 @@ def test_setting_effort_limit_implicit(sim, num_articulations, device, effort_li
14191425@pytest .mark .parametrize ("num_articulations" , [1 , 2 ]) 
14201426@pytest .mark .parametrize ("device" , ["cuda:0" , "cpu" ]) 
14211427@pytest .mark .parametrize ("effort_limit_sim" , [1e5 , None ]) 
1422- @pytest .mark .parametrize ("effort_limit" , [1e2 , None ]) 
1428+ @pytest .mark .parametrize ("effort_limit" , [80.0 ,  1e2 , None ]) 
14231429@pytest .mark .isaacsim_ci  
14241430def  test_setting_effort_limit_explicit (sim , num_articulations , device , effort_limit_sim , effort_limit ):
1425-     """Test setting of effort limit for explicit actuators.""" 
1431+     """Test setting of effort limit for explicit actuators. 
1432+ 
1433+     This test verifies the effort limit resolution logic for actuator models implemented in :class:`ActuatorBase`: 
1434+     - Case 1: If USD value == actuator config value: values match correctly 
1435+     - Case 2: If USD value != actuator config value: actuator config value is used 
1436+     - Case 3: If actuator config value is None: USD value is used as default 
1437+ 
1438+     """ 
1439+ 
14261440    articulation_cfg  =  generate_articulation_cfg (
14271441        articulation_type = "single_joint_explicit" ,
14281442        effort_limit_sim = effort_limit_sim ,
@@ -1436,6 +1450,9 @@ def test_setting_effort_limit_explicit(sim, num_articulations, device, effort_li
14361450    # Play sim 
14371451    sim .reset ()
14381452
1453+     # usd default is 80 
1454+     usd_default  =  80.0 
1455+ 
14391456    # collect limit init values 
14401457    physx_effort_limit  =  articulation .root_physx_view .get_dof_max_forces ().to (device )
14411458    actuator_effort_limit  =  articulation .actuators ["joint" ].effort_limit 
@@ -1452,8 +1469,9 @@ def test_setting_effort_limit_explicit(sim, num_articulations, device, effort_li
14521469        # check physx effort limit does not match the one explicit actuator has 
14531470        assert  not  (torch .allclose (actuator_effort_limit , physx_effort_limit ))
14541471    else :
1455-         # check actuator effort_limit is the same as the PhysX default 
1456-         torch .testing .assert_close (actuator_effort_limit , physx_effort_limit )
1472+         # When effort_limit is None, actuator should use USD default values 
1473+         expected_actuator_effort_limit  =  torch .full_like (physx_effort_limit , usd_default )
1474+         torch .testing .assert_close (actuator_effort_limit , expected_actuator_effort_limit )
14571475
14581476    # when using explicit actuators, the limits are set to high unless user overrides 
14591477    if  effort_limit_sim  is  not   None :
@@ -1462,6 +1480,7 @@ def test_setting_effort_limit_explicit(sim, num_articulations, device, effort_li
14621480        limit  =  ActuatorBase ._DEFAULT_MAX_EFFORT_SIM   # type: ignore 
14631481    # check physx internal value matches the expected sim value 
14641482    expected_effort_limit  =  torch .full_like (physx_effort_limit , limit )
1483+     torch .testing .assert_close (actuator_effort_limit_sim , expected_effort_limit )
14651484    torch .testing .assert_close (physx_effort_limit , expected_effort_limit )
14661485
14671486
0 commit comments