Skip to content

Commit

Permalink
updating the locations to ensure that objects that pulled back fromm the
Browse files Browse the repository at this point in the history
edge are themselves written at the reset point
  • Loading branch information
madhephaestus committed Jun 13, 2023
1 parent c7cb802 commit ec922c8
Show file tree
Hide file tree
Showing 19 changed files with 122 additions and 37 deletions.
46 changes: 35 additions & 11 deletions MarcosCad.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -265,15 +265,6 @@ class cadGenMarcos implements ICadGenerator,IgenerateBed{
if(d.getRobotToFiducialTransform().getX()>0) {
front=true;
}
TransformNR dGetRobotToFiducialTransform = d.getRobotToFiducialTransform()
if(!isDummyGearWrist) {
dGetRobotToFiducialTransform.setY(numbers.BodyServoCenterWidth/2.0*(left?1.0:-1.0))
dGetRobotToFiducialTransform.setX(numbers.BodyServoCenterLength/2.0*(front?1.0:-1.0))
}else {
dGetRobotToFiducialTransform.setY((numbers.BodyServoCenterWidth/2.0-6.5)*(left?1.0:-1.0))
dGetRobotToFiducialTransform.setX((numbers.BodyServoCenterLength/2.0+7.5)*(front?1.0:-1.0))
}
d.setRobotToFiducialTransform(dGetRobotToFiducialTransform)
// read motor typ information out of the link configuration
LinkConfiguration conf = d.getLinkConfiguration(linkIndex);
// load the vitamin for the servo
Expand Down Expand Up @@ -357,8 +348,7 @@ class cadGenMarcos implements ICadGenerator,IgenerateBed{
cache.clear()
DHParameterKinematics dh = arg0.getLegs().get(0);

TransformNR dGetRobotToFiducialTransform = dh.getRobotToFiducialTransform()
double zCenterLine = dGetRobotToFiducialTransform.getZ()+numbers.ServoThickness/2.0
double zCenterLine = dh.getRobotToFiducialTransform().getZ()+numbers.ServoThickness/2.0

CSG body = Vitamins.get(ScriptingEngine.fileFromGit(
"https://github.com/OperationSmallKat/Marcos.git",
Expand Down Expand Up @@ -412,6 +402,40 @@ class cadGenMarcos implements ICadGenerator,IgenerateBed{
back.addAll([top, bottom])
println "ServoCover's for "+left?"Left":"Right"+front?"Front":"Back"
}
// Set the location of the limbs based on the CSV in the body loader
for(DHParameterKinematics d:arg0.getAllDHChains()) {
boolean left=false;
boolean front=false;
boolean isDummyGearWrist = false;
if(d.getScriptingName().startsWith("Dummy")) {
isDummyGearWrist=true;
}
if(d.getRobotToFiducialTransform().getY()>0) {
left=true;
}
if(d.getRobotToFiducialTransform().getX()>0) {
front=true;
}
TransformNR dGetRobotToFiducialTransform = d.getRobotToFiducialTransform()
def legTOSHoulderX = 7.5
def legTOSHoulderY = 6.5

double xval=(numbers.BodyServoCenterLength/2.0+legTOSHoulderX)*(front?1.0:-1.0)
if(!isDummyGearWrist) {
if(arg0.getLegs().contains(d)) {
dGetRobotToFiducialTransform.setY(numbers.BodyServoCenterWidth/2.0*(left?1.0:-1.0))
dGetRobotToFiducialTransform.setX(numbers.BodyServoCenterLength/2.0*(front?1.0:-1.0))
}
if(d.getScriptingName().startsWith("Head")||d.getScriptingName().startsWith("Tail")) {
dGetRobotToFiducialTransform.setX(xval)
}
}else {
dGetRobotToFiducialTransform.setY((numbers.BodyServoCenterWidth/2.0-legTOSHoulderY)*(left?1.0:-1.0))
dGetRobotToFiducialTransform.setX(xval)

}
d.setRobotToFiducialTransform(dGetRobotToFiducialTransform)
}

bodyCOver.setName("BodyCover")
bodyCOver.addAssemblyStep(2, new Transform().movez(80))
Expand Down
1 change: 1 addition & 0 deletions PrintBedLayout.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ class PrintBedObject{
globalPose.translateY(-maxYTest)
if(maxXTest>0)
globalPose.translateX(-maxXTest)
currentPose=globalPose.copy()
println "Update "+name+" to "+((int)globalPose.getX())+" : "+((int)globalPose.getY())
Platform.runLater({
TransformFactory.nrToAffine(globalPose,manipulator)
Expand Down
4 changes: 2 additions & 2 deletions print_bed_location_Body.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"x": -30.245428686587484,
"y": 259.10924645417634,
"x": 0.0,
"y": 261.0,
"z": 0.0,
"rotation": {
"storage": {
Expand Down
15 changes: 15 additions & 0 deletions print_bed_location_Resin Horn 0 DummyLeftFront.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[
{
"x": 8.131727983645316,
"y": 6.0,
"z": 0.0,
"rotation": {
"storage": {
"q0": 1.0,
"q1": 0.0,
"q2": 0.0,
"q3": 0.0
}
}
}
]
15 changes: 15 additions & 0 deletions print_bed_location_Resin Horn 0 DummyLeftRear.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[
{
"x": 8.131727983645314,
"y": 6.0,
"z": 0.0,
"rotation": {
"storage": {
"q0": 1.0,
"q1": 0.0,
"q2": 0.0,
"q3": 0.0
}
}
}
]
15 changes: 15 additions & 0 deletions print_bed_location_Resin Horn 0 DummyRightFront.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[
{
"x": 8.131727983645298,
"y": 6.000000000000001,
"z": 0.0,
"rotation": {
"storage": {
"q0": 1.0,
"q1": 0.0,
"q2": 0.0,
"q3": 0.0
}
}
}
]
15 changes: 15 additions & 0 deletions print_bed_location_Resin Horn 0 DummyRightRear.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[
{
"x": 8.131727983645296,
"y": 6.0,
"z": 0.0,
"rotation": {
"storage": {
"q0": 1.0,
"q1": 0.0,
"q2": 0.0,
"q3": 0.0
}
}
}
]
4 changes: 2 additions & 2 deletions print_bed_location_Resin Horn 0 LeftFront.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"x": 0.0,
"y": 0.0,
"x": 8.131727983645316,
"y": 6.0,
"z": 0.0,
"rotation": {
"storage": {
Expand Down
4 changes: 2 additions & 2 deletions print_bed_location_Resin Horn 0 LeftRear.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"x": 0.0,
"y": 0.0,
"x": 8.131727983645314,
"y": 6.0,
"z": 0.0,
"rotation": {
"storage": {
Expand Down
4 changes: 2 additions & 2 deletions print_bed_location_Resin Horn 0 RightFront.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"x": 0.0,
"y": 0.0,
"x": 8.131727983645316,
"y": 6.0,
"z": 0.0,
"rotation": {
"storage": {
Expand Down
4 changes: 2 additions & 2 deletions print_bed_location_Resin Horn 0 RightRear.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"x": 0.0,
"y": 0.0,
"x": 8.131727983645296,
"y": 6.0,
"z": 0.0,
"rotation": {
"storage": {
Expand Down
4 changes: 2 additions & 2 deletions print_bed_location_Resin Horn 1 LeftFront.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"x": 0.0,
"y": 0.0,
"x": 8.131727983645309,
"y": 6.0,
"z": 0.0,
"rotation": {
"storage": {
Expand Down
4 changes: 2 additions & 2 deletions print_bed_location_Resin Horn 1 LeftRear.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"x": 0.0,
"y": 0.0,
"x": 8.131727983645309,
"y": 6.0,
"z": 0.0,
"rotation": {
"storage": {
Expand Down
4 changes: 2 additions & 2 deletions print_bed_location_Resin Horn 1 RightFront.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"x": 0.0,
"y": 0.0,
"x": 8.131727983645305,
"y": 6.0,
"z": 0.0,
"rotation": {
"storage": {
Expand Down
4 changes: 2 additions & 2 deletions print_bed_location_Resin Horn 1 RightRear.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"x": 0.0,
"y": 0.0,
"x": 8.131727983645296,
"y": 6.0,
"z": 0.0,
"rotation": {
"storage": {
Expand Down
4 changes: 2 additions & 2 deletions print_bed_location_Resin Horn 2 LeftFront.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"x": 0.0,
"y": 0.0,
"x": 8.131727983645295,
"y": 6.0,
"z": 0.0,
"rotation": {
"storage": {
Expand Down
4 changes: 2 additions & 2 deletions print_bed_location_Resin Horn 2 LeftRear.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"x": 0.0,
"y": 0.0,
"x": 8.131727983645295,
"y": 6.0,
"z": 0.0,
"rotation": {
"storage": {
Expand Down
4 changes: 2 additions & 2 deletions print_bed_location_Resin Horn 2 RightFront.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"x": 0.0,
"y": 0.0,
"x": 8.131727983645295,
"y": 6.0,
"z": 0.0,
"rotation": {
"storage": {
Expand Down
4 changes: 2 additions & 2 deletions print_bed_location_Resin Horn 2 RightRear.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"x": 0.0,
"y": 0.0,
"x": 8.131727983645296,
"y": 6.0,
"z": 0.0,
"rotation": {
"storage": {
Expand Down

0 comments on commit ec922c8

Please sign in to comment.