Skip to content

Instantly share code, notes, and snippets.

// Starting with the connected camera from BowlerStudio
println(cameraCHDK)
//Create the default detector using "haarcascade_frontalface_default.xml"
IObjectDetector detector = new HaarDetector("haarcascade_smile.xml")
// Create the input and display images. The display is where the detector writes its detections overlay on the input image
Mat inputImage = new Mat()
Mat displayImage = new Mat()
// Loop checking the camera for faces
while(true){
cameraCHDK.getLatestImage(inputImage,displayImage); // capture image
@acamilo
acamilo / gameController.groovy
Last active August 29, 2015 14:28 — forked from madhephaestus/.gitignore
Bowler Studio Game Controllers
import com.neuronrobotics.sdk.addons.gamepad.IJInputEventListener;
import net.java.games.input.Component;
import net.java.games.input.Event;
ServoChannel srvfront = new ServoChannel (dyio.getChannel(0));
ServoChannel srvdrive = new ServoChannel (dyio.getChannel(11));
IJInputEventListener listener = new IJInputEventListener() {
@Override public void onEvent(Component comp, Event event1,float value, String eventString) {
int front,drive;
@acamilo
acamilo / gameController.groovy
Created February 3, 2016 20:51
Bowler Studio Game Controllers
import com.neuronrobotics.sdk.addons.gamepad.IJInputEventListener;
import com.neuronrobotics.sdk.addons.gamepad.BowlerJInputDevice;
import net.java.games.input.Component;
import net.java.games.input.Event;
import net.java.games.input.Controller;
import net.java.games.input.ControllerEnvironment;
BowlerJInputDevice g=null;// Create a variable to store the device
//Check if the device already exists in the device Manager
if(DeviceManager.getSpecificDevice(BowlerJInputDevice.class, "jogController")==null){
@acamilo
acamilo / CarlTheRobot.xml
Created April 8, 2016 01:22
Carl The Hexapod
<root>
<mobilebase>
<driveType>walking</driveType>
<cadEngine>
<git>https://gist.github.com/bcb4760a449190206170.git</git>
<file>ThreeDPrintCad.groovy</file>
</cadEngine>
<driveEngine>
<git>https://gist.github.com/bcb4760a449190206170.git</git>
@acamilo
acamilo / tabLaunch.groovy
Created April 20, 2016 02:26 — forked from madhephaestus/tabLaunch.groovy
BowlerStudio Tabs
import javafx.scene.text.Text;
// Create a tab
Tab myTab = new Tab();
//set the title of the new tab
myTab.setText("Whoh a tab!");
//add content to the tab
myTab.setContent(new Text(10, 50, "Oh my, how cool!"));
return myTab
@acamilo
acamilo / SimulatePhysics.groovy
Last active May 13, 2016 02:07 — forked from madhephaestus/.gitignore
Robot smashes through pile of bricks
import com.neuronrobotics.bowlerstudio.creature.CreatureLab;
import org.apache.commons.io.IOUtils;
import com.neuronrobotics.bowlerstudio.physics.*;
import com.neuronrobotics.bowlerstudio.threed.*;import java.util.ArrayList;
import java.util.HashMap;
import java.util.Set;
import javax.vecmath.Vector3f;
import com.bulletphysics.BulletGlobals;
@acamilo
acamilo / helloWorld.groovy
Created May 14, 2016 19:40 — forked from madhephaestus/.gitignore
BowlerStudio Hello World
//you print messages to the text output
println "Hello World From BowlerStudio Terminal!"
// or have it speak messages
BowlerKernel.speak("My copy")
@acamilo
acamilo / javaCad.groovy
Last active June 3, 2016 01:30 — forked from madhephaestus/.gitignore
JavaCadExample
import eu.mihosoft.vrl.v3d.STL;
import eu.mihosoft.vrl.v3d.RoundedCube;
import com.neuronrobotics.bowlerstudio.vitamins.*;
import eu.mihosoft.vrl.v3d.parametrics.*;
float len = 68;
float width = 70;
float height = 42;
float thickness = 6.35;
float dia = 15;
import eu.mihosoft.vrl.v3d.parametrics.*;
CSG makeCube(){
//Set up som parameters to use
LengthParameter xkey = new LengthParameter("X dimention",30,[120.0,1.0])
LengthParameter ykey = new LengthParameter("Y dimention",30,[130.0,2.0])
LengthParameter zkey = new LengthParameter("Z dimention",30,[140.0,3.0])
LengthParameter sphereSize = new LengthParameter("Sphere Size",30,[150.0,4.0])
//you can also create parametrics that are not used in creating primitives
LengthParameter offset = new LengthParameter("Sphere Offset Distance",15,[20,-5])
@acamilo
acamilo / shelfDividers.groovy
Last active August 18, 2016 14:21 — forked from madhephaestus/shelfDividers.groovy
A parametric shelf divider system
//Your code here
import eu.mihosoft.vrl.v3d.parametrics.*;
ArrayList<CSG> makeDividers(){
LengthParameter thickness = new LengthParameter("Material Thickness",6.2,[10,1])
LengthParameter foamThick = new LengthParameter("Foam Thickness",25,[40,1])
LengthParameter height = new LengthParameter("Divider Height",60,[200,1])
LengthParameter sheetX = new LengthParameter("sheetX",590,[914.4,1])// rows
LengthParameter sheetY = new LengthParameter("sheetY",590,[609.6,1])//columns
ArrayList<CSG> parts = new ArrayList<CSG>()