Skip to content

Instantly share code, notes, and snippets.

@acamilo
acamilo / MoveLimb.groovy
Created June 5, 2019 16:26 — forked from madhephaestus/.gitignore
Move a limb attached to a MobileBase
import org.apache.commons.io.IOUtils;
import com.neuronrobotics.bowlerstudio.physics.*;
import com.neuronrobotics.bowlerstudio.threed.*;
def base;
//Check if the device already exists in the device Manager
if(args==null){
base=DeviceManager.getSpecificDevice( "MediumKat",{
return ScriptingEngine.gitScriptRun( "https://github.com/OperationSmallKat/SmallKat_V2.git",
"loadRobot.groovy",
[ "https://github.com/OperationSmallKat/greycat.git",
@acamilo
acamilo / TFTtouch35.groovy
Last active September 14, 2018 21:11
Model of a TFT LCD disokay
// test
float display_screenwidth = 48.96;
float display_screenheight = 73.44;
float display_thickness = 5;
float display_bodywidth = 54.56;
float display_bodyheight = 84.70;
float display_screen_to_body_h_offset = 2.96
display_viewable_cutout = 3;
@groovy.transform.InheritConstructors
class Bell {
double belltop = 50;
double bellbottom = 100;
double height = 150;
double topheight = 10;
double bellthickness = 10;
int facets = 16;
float moduleHeight = 30;
float LCDThickness = 6.3;
CSG cube = new Cube( 157.300,// X dimention
126.300,// Y dimention
moduleHeight// Z dimention
).toCSG().movez(moduleHeight/2)// this converts from the geometry to an object we can work with
@acamilo
acamilo / VitaminsExample.groovy
Created February 1, 2017 21:20 — forked from madhephaestus/VitaminsExample.groovy
An example using hardware vitamins.
import com.neuronrobotics.bowlerstudio.vitamins.Vitamins;
import eu.mihosoft.vrl.v3d.parametrics.*;
// to add your own viatamins, fork https://github.com/madhephaestus/Hardware-Dimensions and make your modifications there.
class allViataminMaker implements IParameterChanged{
ArrayList <CSG> examples = null
ArrayList <CSG> getParts(){
if(examples!=null)
return examples
examples = new ArrayList<>()
@acamilo
acamilo / Haro.xml
Last active February 1, 2017 04:03
Haro copy of CarlTheWalkingRobot
<root>
<mobilebase>
<cadEngine>
<git>https://github.com/madhephaestus/carl-the-hexapod.git</git>
<file>LinkedCadEngine.groovy</file>
</cadEngine>
<driveEngine>
<git>https://github.com/madhephaestus/carl-the-hexapod.git</git>
<file>WalkingDriveEngine.groovy</file>
</driveEngine>
import com.neuronrobotics.bowlerstudio.creature.ICadGenerator;
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("bcb4760a449190206170","CarlTheRobot.xml")[0];
println "Loading the robot"
MobileBase base=null;
if(DeviceManager.getSpecificDevice(MobileBase.class, "CarlTheWalkingRobot")==null){
BowlerStudio.speak("Connecting CarlTheWalkingRobot.");
base = new MobileBase(IOUtils.toInputStream(xmlContent, "UTF-8"));
double size =40;
CSG cube = new Cube( size,// X dimention
size,// Y dimention
size// Z dimention
).toCSG()
//create a sphere
CSG sphere = new Sphere(size/20*12.5).toCSG()
// perform a union
CSG cubePlusSphere = cube.difference(sphere);
import com.neuronrobotics.bowlerstudio.vitamins.Vitamins;
import eu.mihosoft.vrl.v3d.parametrics.*;
int sphereRadius = 125;
int flapRadius = 65;
CSG body = new Sphere(sphereRadius,40,40)// Spheres radius
.toCSG()// convert to CSG to display
CSG cavity = new Sphere(sphereRadius-5,40,40)// Spheres radius
.toCSG()// convert to CSG to display
@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>()