Skip to content

Instantly share code, notes, and snippets.

View madhephaestus's full-sized avatar

Kevin Harrington madhephaestus

View GitHub Profile
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];
//new Thread(){
//
// public void run(){
// ThreadUtil.wait(2000);
// TransformNR start = model.getCurrentTaskSpaceTransform();
// double x= start.getX();
@madhephaestus
madhephaestus / KickOff.groovy
Last active August 29, 2015 14:22 — forked from MazonDel/RoverStartup.groovy
Nasa Sample Return Challenge Code
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);
@madhephaestus
madhephaestus / gameController.groovy
Last active August 29, 2015 14:28 — forked from acamilo/gameController.groovy
Bowler Studio Game Controllers
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;
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);
(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))
(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)))
int i = 1;
boolean goLoop=true
while ( goLoop)
{
System.out.println(i);
i+=(Math.random()*30);
if(i>1000){
goLoop=false;
}
}
int i = 1;
do
{
System.out.println(i);
i+=2;
} while (i <= 1001);
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");
}