Skip to content

Commit

Permalink
incorporated all the code from open robotics
Browse files Browse the repository at this point in the history
  • Loading branch information
rjgriffin42 committed Oct 28, 2024
1 parent 20ef706 commit b3a1b17
Show file tree
Hide file tree
Showing 26 changed files with 49 additions and 131 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Top level files to ignore
gradlew
gradlew.bat

# Top level directories to ignore
/gradle
/build
/classes
/bin
Expand Down
8 changes: 7 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,11 @@ graphvizDependencies {
yovariablesDependencies {
api(ihmc.sourceSetProject("main"))

api("us.ihmc:ihmc-yovariables:0.12.2")
api("us.ihmc:ihmc-yovariables:0.13.1")
}

yovariablesFiltersDependencies {
api(ihmc.sourceSetProject("yovariables"))

api("us.ihmc:ihmc-yovariables-filters:0.13.1")
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
title = Mecano
extraSourceSets = ["test", "graphviz", "yovariables"]
extraSourceSets = ["test", "graphviz", "yovariables", "yovariables-filters"]
compositeSearchHeight = 0
excludeFromCompositeBuild = false
39 changes: 0 additions & 39 deletions mecano-update/build.gradle.kts

This file was deleted.

5 changes: 0 additions & 5 deletions mecano-update/gradle.properties

This file was deleted.

21 changes: 0 additions & 21 deletions mecano-update/settings.gradle.kts

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package us.ihmc.mecano;
package us.ihmc.mecano.algorithms;

import java.util.LinkedHashMap;

import org.ejml.data.DMatrixRMaj;
import org.ejml.dense.row.CommonOps_DDRM;

import us.ihmc.euclid.referenceFrame.ReferenceFrame;
import us.ihmc.mecano.algorithms.InverseDynamicsCalculator;
import us.ihmc.mecano.algorithms.interfaces.MassMatrixCalculator;
import us.ihmc.mecano.multiBodySystem.interfaces.JointBasics;
import us.ihmc.mecano.multiBodySystem.interfaces.RigidBodyBasics;
import us.ihmc.mecano.spatial.SpatialForce;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package us.ihmc.mecano;
package us.ihmc.mecano.algorithms;

import java.util.ArrayList;
import java.util.Arrays;
Expand All @@ -13,7 +13,6 @@
import org.ejml.dense.row.factory.LinearSolverFactory_DDRM;
import org.ejml.interfaces.linsol.LinearSolverDense;

import us.ihmc.mecano.algorithms.CompositeRigidBodyMassMatrixCalculator;
import us.ihmc.mecano.multiBodySystem.interfaces.FloatingJointBasics;
import us.ihmc.mecano.multiBodySystem.interfaces.JointBasics;
import us.ihmc.mecano.multiBodySystem.interfaces.RigidBodyBasics;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package us.ihmc.mecano;
package us.ihmc.mecano.algorithms;

import org.ejml.data.DMatrixRMaj;
import org.ejml.dense.row.CommonOps_DDRM;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package us.ihmc.mecano;
package us.ihmc.mecano.algorithms;

import java.util.ArrayList;
import java.util.Collection;
Expand All @@ -12,8 +12,6 @@
import us.ihmc.euclid.referenceFrame.exceptions.ReferenceFrameMismatchException;
import us.ihmc.euclid.referenceFrame.interfaces.FrameTuple3DReadOnly;
import us.ihmc.euclid.tuple3D.interfaces.Tuple3DReadOnly;
import us.ihmc.mecano.algorithms.InverseDynamicsCalculator;
import us.ihmc.mecano.algorithms.SpatialAccelerationCalculator;
import us.ihmc.mecano.algorithms.interfaces.RigidBodyAccelerationProvider;
import us.ihmc.mecano.frames.MovingReferenceFrame;
import us.ihmc.mecano.multiBodySystem.interfaces.JointBasics;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package us.ihmc.mecano;
package us.ihmc.mecano.algorithms;

import java.util.ArrayList;
import java.util.Random;
Expand All @@ -7,7 +7,7 @@

import us.ihmc.euclid.referenceFrame.ReferenceFrame;
import us.ihmc.euclid.tuple3D.Vector3D;
import us.ihmc.mecano.algorithms.CompositeRigidBodyMassMatrixCalculator;
import us.ihmc.mecano.algorithms.interfaces.MassMatrixCalculator;
import us.ihmc.mecano.multiBodySystem.RevoluteJoint;
import us.ihmc.mecano.multiBodySystem.RigidBody;
import us.ihmc.mecano.multiBodySystem.interfaces.JointBasics;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package us.ihmc.mecano;
package us.ihmc.mecano.algorithms;

import java.util.stream.Stream;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package us.ihmc.mecano;
package us.ihmc.mecano.algorithms;

import org.ejml.data.DMatrix;
import org.ejml.data.DMatrixRMaj;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package us.ihmc.mecano;
package us.ihmc.mecano.algorithms.interfaces;

import org.ejml.data.DMatrixRMaj;

Expand Down
20 changes: 20 additions & 0 deletions src/main/java/us/ihmc/mecano/tools/MultiBodySystemTools.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import us.ihmc.mecano.multiBodySystem.interfaces.*;
import us.ihmc.mecano.multiBodySystem.iterators.SubtreeStreams;
import us.ihmc.mecano.spatial.SpatialInertia;
import us.ihmc.mecano.spatial.interfaces.SpatialInertiaReadOnly;

import java.lang.reflect.Array;
import java.util.ArrayList;
Expand Down Expand Up @@ -34,6 +35,24 @@ public static SpatialInertia computeSubtreeInertia(JointReadOnly joint)
return computeSubtreeInertia(joint.getSuccessor());
}

/**
* Computes the mass of all the links contained in the subtree of {@param rootBody}
* @param rootBody
* @return subtree mass
*/
public static double computeSubTreeMass(RigidBodyReadOnly rootBody)
{
SpatialInertiaReadOnly inertia = rootBody.getInertia();
double ret = inertia == null ? 0.0 : inertia.getMass();

for (int i = 0; i < rootBody.getChildrenJoints().size(); i++)
{
ret += computeSubTreeMass(rootBody.getChildrenJoints().get(i).getSuccessor());
}

return ret;
}

/**
* Sums the inertia of all the rigid-bodies composing the subtree that originates at
* {@code rootBody} including {@code rootBody}.
Expand Down Expand Up @@ -1736,4 +1755,5 @@ public static List<JointReadOnly> sortLoopClosureInChildrenJoints(RigidBodyReadO
}
return childrenJoints;
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package us.ihmc.mecano;
package us.ihmc.mecano.algorithms;

import static org.junit.jupiter.api.Assertions.assertEquals;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package us.ihmc.mecano;
package us.ihmc.mecano.algorithms;

import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
Expand All @@ -16,7 +16,6 @@

import us.ihmc.euclid.tools.EuclidCoreIOTools;
import us.ihmc.euclid.tools.EuclidCoreRandomTools;
import us.ihmc.mecano.algorithms.InverseDynamicsCalculator;
import us.ihmc.mecano.multiBodySystem.Joint;
import us.ihmc.mecano.multiBodySystem.OneDoFJoint;
import us.ihmc.mecano.multiBodySystem.PrismaticJoint;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package us.ihmc.mecano;
package us.ihmc.mecano.algorithms;


import java.util.ArrayList;
Expand All @@ -14,7 +14,7 @@
import us.ihmc.euclid.referenceFrame.ReferenceFrame;
import us.ihmc.euclid.referenceFrame.tools.ReferenceFrameTools;
import us.ihmc.euclid.tuple3D.Vector3D;
import us.ihmc.mecano.algorithms.CompositeRigidBodyMassMatrixCalculator;
import us.ihmc.mecano.algorithms.interfaces.MassMatrixCalculator;
import us.ihmc.mecano.multiBodySystem.RevoluteJoint;
import us.ihmc.mecano.multiBodySystem.RigidBody;
import us.ihmc.mecano.multiBodySystem.interfaces.JointBasics;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package us.ihmc.mecano;
package us.ihmc.mecano.algorithms;

import java.util.ArrayList;
import java.util.Random;
Expand All @@ -15,7 +15,6 @@
import us.ihmc.euclid.tools.EuclidCoreTestTools;
import us.ihmc.euclid.transform.RigidBodyTransform;
import us.ihmc.euclid.tuple3D.Vector3D;
import us.ihmc.mecano.algorithms.CentroidalMomentumCalculator;
import us.ihmc.mecano.frames.CenterOfMassReferenceFrame;
import us.ihmc.mecano.multiBodySystem.PrismaticJoint;
import us.ihmc.mecano.multiBodySystem.RevoluteJoint;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package us.ihmc.mecano;
package us.ihmc.mecano.algorithms;

import org.ejml.data.DMatrixRMaj;
import org.junit.jupiter.api.Test;
Expand Down

0 comments on commit b3a1b17

Please sign in to comment.