Skip to content

Commit a2903d0

Browse files
committed
setting body script
1 parent b4784c2 commit a2903d0

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

Bowler/cadEngine.groovy

+13-3
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,22 @@ import org.apache.commons.io.IOUtils;
44
import com.neuronrobotics.bowlerstudio.vitamins.*;
55
import java.nio.file.Paths;
66
import eu.mihosoft.vrl.v3d.FileUtil;
7-
import javafx.scene.transform.*;
7+
import eu.mihosoft.vrl.v3d.Transform;
8+
import javafx.scene.transform.Affine;
9+
import com.neuronrobotics.bowlerstudio.physics.TransformFactory;
810
println "Loading STL file"
911
// Load an STL file from a git repo
1012
// Loading a local file also works here
1113

1214
return new ICadGenerator(){
15+
16+
private CSG moveDHValues(CSG incoming,DHLink dh ){
17+
TransformNR step = new TransformNR(dh.DhStep(0)).inverse()
18+
Transform move = TransformFactory.nrToCSG(step)
19+
return incoming.transformed(move)
20+
21+
}
22+
1323
@Override
1424
public ArrayList<CSG> generateCad(DHParameterKinematics d, int linkIndex) {
1525
File legFile = null
@@ -44,7 +54,7 @@ return new ICadGenerator(){
4454

4555
ArrayList<CSG> allCad=new ArrayList<>();
4656
// Load the .CSG from the disk and cache it in memory
47-
CSG body = Vitamins.get(legFile)
57+
CSG body = moveDHValues(Vitamins.get(legFile),dh)
4858

4959
body.setManipulator(manipulator);
5060
body.setColor(javafx.scene.paint.Color.WHITE)
@@ -61,7 +71,7 @@ return new ICadGenerator(){
6171

6272
File mainBodyFile = ScriptingEngine.fileFromGit(
6373
"https://github.com/keionbis/SmallKat.git",
64-
"STLs/Body.STL");
74+
"STLs/BodyV2.STL");
6575

6676
// Load the .CSG from the disk and cache it in memory
6777
CSG body = Vitamins.get(mainBodyFile)

Bowler/cat.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<root>
22
<mobilebase>
33
<cadEngine>
4-
<git>https://gist.github.com/17f2da51abe25e043043946d91610ddd.git</git>
5-
<file>LinkedCadEngine.groovy</file>
4+
<git>https://github.com/keionbis/SmallKat.git</git>
5+
<file>Bowler/cadEngine.groovy</file>
66
</cadEngine>
77
<driveEngine>
88
<git>https://gist.github.com/17f2da51abe25e043043946d91610ddd.git</git>

CSGdatabase.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"500",
66
"0.01"
77
],
8-
"value": 395150
8+
"value": 30000
99
},
1010
"Bolt Size": {
1111
"name": "Bolt Size",
@@ -160,7 +160,7 @@
160160
"M18",
161161
"Inch-1_4-20"
162162
],
163-
"strValue": "M3"
163+
"strValue": "M5"
164164
},
165165
"lockNut Default": {
166166
"name": "lockNut Default",
@@ -231,7 +231,7 @@
231231
"180",
232232
"10"
233233
],
234-
"value": 14240
234+
"value": 10000
235235
},
236236
"hobbyServo Default": {
237237
"name": "hobbyServo Default",

0 commit comments

Comments
 (0)