We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0d74277 commit cdb4ebbCopy full SHA for cdb4ebb
1 file changed
src/main/java/org/mujoco/MuJoCoModelManager.java
@@ -62,7 +62,7 @@ public double getCurrentSimulationTimeSeconds() {
62
return data.time();
63
}
64
public int getNumberOfJoints() {
65
- return model.nu();
+ return model.njnt();
66
67
public String getJointName(int i) {
68
if(i<0)
@@ -79,12 +79,14 @@ public int getNumberOfBodys() {
79
public String getBodyName(int i) {
80
81
throw new IndexOutOfBoundsException("Body index must be positive or zero");
82
- if(i>=getNumberOfJoints()) {
+ if(i>=getNumberOfBodys()) {
83
throw new IndexOutOfBoundsException("Body index must be less than "+i);
84
85
BytePointer byp = modelNames.getPointer(bodyNameIndex.getPointer(i).get());
86
return byp.getString();
87
88
+
89
90
public double getTimestepSeconds() {
91
return getOpt().timestep();
92
0 commit comments