Skip to content

Commit d040e41

Browse files
Update test to set position of body with only translation
1 parent 5f7cdf2 commit d040e41

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/simulation/mujocoDynamics/_GeneralModuleFiles/_UnitTest/test_ball.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33

44
<worldbody>
55
<body name="ball">
6-
<freejoint/>
6+
<!-- We can use three slider joints for translational-only scenarios -->
7+
<joint name="ball_x" type="slide" axis="1 0 0"/>
8+
<joint name="ball_y" type="slide" axis="0 1 0"/>
9+
<joint name="ball_z" type="slide" axis="0 0 1"/>
10+
711
<site name="center" />
812
<geom size="1" rgba="1 0 0 1"/>
913
</body>

src/simulation/mujocoDynamics/_GeneralModuleFiles/_UnitTest/test_mass_update.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ def test_continuouslyChangingMass(showPlots: bool = False):
9494
scSim.AddModelToTask("test", posRec)
9595

9696
scSim.InitializeSimulation()
97+
98+
# initial position should not matter
99+
ballBody.setPosition([0, 1, 0])
100+
97101
scSim.ConfigureStopTime(macros.sec2nano(tf))
98102
scSim.ExecuteSimulation()
99103

0 commit comments

Comments
 (0)