Skip to content

Instantly share code, notes, and snippets.

View nag92's full-sized avatar
🏠
Working from home

Nathaniel Goldfarb nag92

🏠
Working from home
View GitHub Profile
@nag92
nag92 / servoVitamin.groovy
Created January 26, 2018 14:58 — forked from madhephaestus/servoVitamin.groovy
Adding new file from BowlerStudio
import com.neuronrobotics.bowlerstudio.vitamins.Vitamins;
// Set a specific repository for the vitamins
Vitamins.setGitRepoDatabase("https://github.com/madhephaestus/Hardware-Dimensions.git")
ArrayList<String> types = Vitamins.listVitaminTypes()
println "\n\nAll availible types: "+types
CSG vitaminFromScript = Vitamins.get("hobbyServo","Dynam");
println "\n\nOptional servo sizes: "+Vitamins.listVitaminSizes("hobbyServo")
@nag92
nag92 / hidApiTest.groovy
Created October 23, 2017 23:54 — forked from madhephaestus/hidApiTest.groovy
Adding new file from BowlerStudio
@Grab(group='org.hid4java', module='hid4java', version='0.5.0')
import org.hid4java.*
import org.hid4java.event.*;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
class PacketProcessor{
HidDevice myHidDevice;
ByteOrder be =ByteOrder.LITTLE_ENDIAN;
@nag92
nag92 / hidApiTest.groovy
Created October 23, 2017 23:54 — forked from madhephaestus/hidApiTest.groovy
Adding new file from BowlerStudio
@Grab(group='org.hid4java', module='hid4java', version='0.5.0')
import org.hid4java.*
import org.hid4java.event.*;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
class PacketProcessor{
HidDevice myHidDevice;
ByteOrder be =ByteOrder.LITTLE_ENDIAN;
CSG simpleSyntax =new Cylinder(10,10,40,(int)30).toCSG() // a one line Cylinder
//create a Cylinder
height = 22.5
CSG wheel_body = new Cylinder(33, // Radius at the bottom
33, // Radius at the top
17.6, // Height
(int)30 //resolution
).toCSG().movez(height/2 - 17.6/2)
CSG hub = new Cylinder(14.3, // Radius at the bottom
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.
def file=["https://github.com/madhephaestus/carl-the-hexapod.git","CarlTheRobot.xml"]as String[]
String xmlContent = ScriptingEngine.codeFromGit(file[0],file[1])[0]
println "Loading the robot"
MobileBase base=null;
if(DeviceManager.getSpecificDevice(MobileBase.class, "CarlTheWalkingRobot")==null){