Skip to content

Instantly share code, notes, and snippets.

@keionbis
keionbis / minkowskiAPI.groovy
Created August 18, 2017 17:19 — forked from madhephaestus/.gitignore
Minkowski opperation examples
CSG startCube = new Cube(100).toCSG()
CSG cubeToFit = new Sphere(50/2).toCSG()
.movez(startCube.getMaxZ())
.setColor(javafx.scene.paint.Color.RED)
// This performs an intersection of the 2 parts, then minkowski the intersection,then cut the reslult from the base shape
// Use this function to make cut outs that will be 3d printed
CSG clearenceFit = startCube
.minkowskiDifference(
cubeToFit,// the part we want to fit into a cutout
@keionbis
keionbis / HIDBowlerDevice.groovy
Created August 19, 2017 16:29 — forked from madhephaestus/HIDBowlerDevice.groovy
Bowler HID device wrapper
//@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{
ByteOrder be =ByteOrder.LITTLE_ENDIAN;
int packetSize = 64
@keionbis
keionbis / sample.groovy
Created October 19, 2017 17:48
Adding new file from BowlerStudio
//Your code here
@keionbis
keionbis / javaCad.groovy
Created October 19, 2017 20:47 — forked from madhephaestus/.gitignore
JavaCadExample
class SampleMaker implements IParameterChanged{//collection of parts
ArrayList<CSG> parts = null;
boolean loading=false;
ArrayList<CSG> makeSamples(){
if(parts !=null){
return parts
}
loading=true;
double myStartSize = 40;
@keionbis
keionbis / DefaultDhSolver.groovy
Created November 16, 2017 00:13 — forked from madhephaestus/DefaultDhSolver.groovy
jaguar copy of DogRobot
import java.util.ArrayList;
import com.neuronrobotics.sdk.addons.kinematics.DHChain;
import com.neuronrobotics.sdk.addons.kinematics.DHLink;
import com.neuronrobotics.sdk.addons.kinematics.DhInverseSolver;
import com.neuronrobotics.sdk.addons.kinematics.math.TransformNR;
import com.neuronrobotics.sdk.common.Log;
import Jama.Matrix;
return new DhInverseSolver() {
//If your DyIO is using a lower voltage power source, you need to disable the brownout detect
def myDyIO =DeviceManager.getSpecificDevice( "dyio",{
//If the device does not exist, prompt for the connection
SerialConnection s =new SerialConnection("/dev/ttyACM0");
DyIO m = new DyIO(s)
return m
})
myDyIO.setServoPowerSafeMode(false);
int [] vals = dyio.getAllChannelValues();
//Set up the array of channels
ArrayList<ServoChannel> chans = new ArrayList<ServoChannel>();
Log.enableDebugPrint();
float time = 5;
for(int i=0;i<12;i++){
chans.add(new ServoChannel(dyio.getChannel(i)));
}
//Set the DyIO into cached mode
dyio.setCachedMode(true);
package com.neuronrobotics.test.nrdk;
import com.neuronrobotics.sdk.genericdevice.GenericDevice;
import com.neuronrobotics.sdk.serial.SerialConnection;
public class SimpleConnection {
/**
* @param args
*/
@keionbis
keionbis / hidApiTest.groovy
Last active May 15, 2018 16:32 — 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;
@keionbis
keionbis / gist:1eb1d3d480a6f6bf586045ae6e584e59
Created December 15, 2017 03:36
Yaml files for turtlebot 3
obstacle_range: 2.5
raytrace_range: 3.5
#footprint: [[-0.110, -0.090], [-0.110, 0.090], [0.041, 0.090], [0.041, -0.090]]
robot_radius: 0.105
inflation_radius: 0.15
cost_scaling_factor: 0.5
map_type: costmap
transform_tolerance: 5
observation_sources: scan
scan: {data_type: LaserScan, topic: scan, marking: true, clearing: true}