Skip to content

Commit

Permalink
make sure to clear out references to the manager as soon as it is closed
Browse files Browse the repository at this point in the history
  • Loading branch information
madhephaestus committed Mar 20, 2024
1 parent 6ab93b3 commit 18c270d
Showing 1 changed file with 3 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ public void close() {
asset = null;
if(getmRuntime()!=null)
getmRuntime().close();
mRuntime=null;
mapNameToCSG.clear();
gearRatios.clear();
}
Expand Down Expand Up @@ -332,37 +333,8 @@ public boolean checkLinkPhysics(MobileBaseCadManager cadMan,LinkConfiguration co

public double computeLowestPoint(MobileBase cat) {
MobileBaseCadManager cadMan = MobileBaseCadManager.get(cat);
Double lowest =null;
Affine l =(Affine) cat.getRootListener();
TransformNR tmp = TransformFactory.affineToNr(l);
Transform baseloc = TransformFactory.nrToCSG(tmp);
for(CSG c:cadMan.getBasetoCadMap().get(cat)) {

CSG moved = c.transformed(baseloc);
double low = moved.getMinZ();
if(lowest==null)
lowest=low;
if(low<lowest)
lowest=low;
}
for(DHParameterKinematics k:cat.getAllDHChains()) {
for(int i=0;i<k.getNumberOfLinks();i++) {
DHLink dhLink = k.getChain().getLinks().get(i);
Affine a = (Affine) dhLink.getListener();
TransformNR tmpl = TransformFactory.affineToNr(a);
Transform t=TransformFactory.nrToCSG(tmpl);
LinkConfiguration conf= k.getLinkConfiguration(i);
for(CSG c:cadMan.getLinktoCadMap().get(conf)) {
CSG moved = c.transformed(t);
double low = moved.getMinZ();
if(lowest==null)
lowest=low;
if(low<lowest)
lowest=low;
}
}
}
return lowest;

return cadMan.computeLowestPoint().z;
}
public void loadBase(MobileBase cat, Builder<?> actuators) throws IOException {
if(contacts==null)
Expand Down

0 comments on commit 18c270d

Please sign in to comment.