Skip to content

Commit 38a73a0

Browse files
committed
add a setter for the positions
1 parent ff10b2f commit 38a73a0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/main/java/org/mujoco/MuJoCoModelManager.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,14 @@ public HashMap<String, Double> getAllJointPositions() {
176176
}
177177
return positions;
178178
}
179+
public void setAllJointPositions(HashMap<String, Double> putPositions) {
180+
check();
181+
for (String jointName:putPositions.keySet()) {
182+
int i = getJointIndex(jointName);
183+
double position =putPositions.get(jointName);
184+
data.qpos().put(i, position);
185+
}
186+
}
179187
public HashMap<String, Double> getControlInstance() {
180188
return setEfforts;
181189
}

0 commit comments

Comments
 (0)