This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.neuronrobotics.sdk.addons.kinematics.DHParameterKinematics; | |
import com.neuronrobotics.sdk.addons.kinematics.math.RotationNR | |
import com.neuronrobotics.sdk.addons.kinematics.math.TransformNR; | |
import com.neuronrobotics.sdk.util.ThreadUtil; | |
import com.neuronrobotics.bowlerstudio.creature.CreatureLab; | |
import org.apache.commons.io.IOUtils; | |
//Create the kinematics model from the xml file describing the D-H compliant parameters. | |
String xmlContent = ScriptingEngine.codeFromGistID("2b0cff20ccee085c9c36","TrobotLinks.xml")[0]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//new Thread(){ | |
// | |
// public void run(){ | |
// ThreadUtil.wait(2000); | |
// TransformNR start = model.getCurrentTaskSpaceTransform(); | |
// double x= start.getX(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.File; | |
import com.neuronrobotics.bowlerstudio.robots.FormacarumRover; | |
import com.neuronrobotics.bowlerstudio.scripting.ScriptingEngineWidget; | |
import com.neuronrobotics.sdk.common.DeviceManager; | |
import com.neuronrobotics.sdk.dyio.DyIO; | |
import com.neuronrobotics.sdk.util.ThreadUtil; | |
//run the rover initialization scripts, ignore the display returns | |
ScriptingEngineWidget.inlineFileScriptRun(new File(System.getProperty("user.home")+"/git/9bbfbcae11130cdd4c3d/RoverStartup.groovy"), null); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.neuronrobotics.sdk.addons.gamepad.IJInputEventListener; | |
import net.java.games.input.Component; | |
import net.java.games.input.Event; | |
ServoChannel srvdrive = new ServoChannel (dyio.getChannel(9)); | |
ServoChannel neck = new ServoChannel (dyio.getChannel(10)); | |
IJInputEventListener listener = new IJInputEventListener() { | |
@Override public void onEvent(Component comp, Event event1,float value, String eventString) { | |
int front,drive; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.neuronrobotics.sdk.addons.kinematics.MobileBase; | |
import com.neuronrobotics.sdk.addons.kinematics.DHParameterKinematics; | |
import org.apache.commons.io.IOUtils; | |
import java.awt.image.BufferedImage; | |
import com.neuronrobotics.imageprovider.Detection; | |
import java.util.List; | |
OpenCVImageProvider eye=null; | |
if(DeviceManager.getSpecificDevice(OpenCVImageProvider.class, "eye")==null){ | |
eye= new OpenCVImageProvider(0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(import '[eu.mihosoft.vrl.v3d CSG Cube Sphere Transform])) | |
(defn translate-x | |
"Translates a csg in the x direction" | |
[csg n] | |
(.transformed csg (. (Transform/unity) translateX n))) | |
(defn union-all | |
[& objs] | |
(reduce (fn [a b] (.union a b)) objs)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(import '[eu.mihosoft.vrl.v3d STL Cube Cylinder Extrude RoundedCube Sphere Vector3d Transform]) | |
(defn move-x | |
[obj n] | |
(.transformed obj (.translateX (Transform/unity) n))) | |
(defn move-y | |
[obj n] | |
(.transformed obj (.translateY (Transform/unity) n))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int i = 1; | |
boolean goLoop=true | |
while ( goLoop) | |
{ | |
System.out.println(i); | |
i+=(Math.random()*30); | |
if(i>1000){ | |
goLoop=false; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int i = 1; | |
do | |
{ | |
System.out.println(i); | |
i+=2; | |
} while (i <= 1001); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int i = 1; | |
if (i < 2) | |
{ | |
System.out.println("This is an if statement that works"); | |
} | |
i = 4; | |
if (i < 2) | |
{ | |
System.out.println("This is an if statement that doesn't work"); | |
} |
OlderNewer