Skip to content
Snippets Groups Projects
Commit b602090b authored by Amanda Ghassaei's avatar Amanda Ghassaei
Browse files

end effector origin

parent 9aa23445
No related branches found
No related tags found
No related merge requests found
...@@ -265,7 +265,7 @@ OneBitBot.prototype._buildMeshes = function(callback){ ...@@ -265,7 +265,7 @@ OneBitBot.prototype._buildMeshes = function(callback){
return geometry; return geometry;
} }
function meshPrep(geometry, name){ function meshPrep(geometry, name){
geometry.applyMatrix(new THREE.Matrix4().makeTranslation(-10,-12.8,0)); geometry.applyMatrix(new THREE.Matrix4().makeTranslation(-10-1.3919,-12.8,-1.9685));
var mesh = new THREE.Mesh(geometry, new THREE.MeshLambertMaterial({color:0xaaaaaa, shading: THREE.FlatShading})); var mesh = new THREE.Mesh(geometry, new THREE.MeshLambertMaterial({color:0xaaaaaa, shading: THREE.FlatShading}));
meshes[name] = mesh; meshes[name] = mesh;
if (allLoaded()) callback(meshes); if (allLoaded()) callback(meshes);
...@@ -313,55 +313,3 @@ OneBitBot.prototype._moveAxis = function(startingPos, target, axis, speed, callb ...@@ -313,55 +313,3 @@ OneBitBot.prototype._moveAxis = function(startingPos, target, axis, speed, callb
} }
this._animateObjects(_.values(this.meshes).concat(this.cell), axis, speed, startingPos, target, callback); this._animateObjects(_.values(this.meshes).concat(this.cell), axis, speed, startingPos, target, callback);
}; };
\ No newline at end of file
OneBitBot.prototype.postProcess = function(data, exporter){//override in subclasses
var rapidHeight = dmaGlobals.assembler.get("rapidHeight");
var safeHeight = dmaGlobals.assembler.get("safeHeight");
var wcs = dmaGlobals.assembler.get("originPosition");
var stockPosition = dmaGlobals.assembler.get("stockPosition");
var stockNum = 0;//position of stock in stock array
var multStockPositions = dmaGlobals.assembler.get("multipleStockPositions");
var stockSeparation = dmaGlobals.assembler.get("stockSeparation");
var stockArraySize = dmaGlobals.assembler.get("stockArraySize");
var self = this;
dmaGlobals.lattice.rasterCells(dmaGlobals.assembler._getOrder(dmaGlobals.assembler.get("camStrategy")), function(cell){
if (!cell) return;
var thisStockPosition = _.clone(stockPosition);
if (multStockPositions) {
thisStockPosition.x += stockNum % stockArraySize.y * stockSeparation;
thisStockPosition.y -= Math.floor(stockNum / stockArraySize.y) * stockSeparation;
stockNum += 1;
if (stockNum >= stockArraySize.x * stockArraySize.y) stockNum = 0;
}
data += self._postPickUpStock(exporter, thisStockPosition, rapidHeight, wcs, safeHeight);
data += self._postReleaseStock(cell, exporter, rapidHeight, wcs, safeHeight);
data += "\n";
});
return data;
};
OneBitBot.prototype._postPickUpStock = function(exporter, stockPosition, rapidHeight, wcs, safeHeight){
var data = "";
data += exporter.rapidXY(stockPosition.x-wcs.x, stockPosition.y-wcs.y);
data += exporter.rapidZ(stockPosition.z-wcs.z+safeHeight);
data += exporter.moveZ(stockPosition.z-wcs.z);
data += exporter.addComment("get stock");
data += exporter.moveZ(stockPosition.z-wcs.z+safeHeight);
data += exporter.rapidZ(rapidHeight);
return data;
};
OneBitBot.prototype._postReleaseStock = function(cell, exporter, rapidHeight, wcs, safeHeight){
var data = "";
var cellPosition = cell.getPosition();
data += exporter.rapidXY(cellPosition.x-wcs.x, cellPosition.y-wcs.y);
data += exporter.rapidZ(cellPosition.z-wcs.z+safeHeight);
data += exporter.moveZ(cellPosition.z-wcs.z);
data += exporter.addComment(JSON.stringify(cell.indices));
data += exporter.moveZ(cellPosition.z-wcs.z+safeHeight);
data += exporter.rapidZ(rapidHeight);
return data;
};
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment