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
from math import pi
def rect_interia(b,h):
return (1/12.0)*b*h**3
def circ_interia(ro,ri):
@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 / walking_model.m
Created January 12, 2018 03:37
dynamic model of a 7 link biped
clear all
close all
clc
syms q1(t) q2(t) q3(t) q4(t) q5(t) q6(t) px py g
l = sym('l_%d', [1 7]);
m = sym('m_%d', [1 7]);
qd = sym('qd', [1 6]);
qdd = sym('qdd', [1 6]);
P = [px;py];
"""
This cacluclates the jacobian for the seires elastic arm.
The link parameters are taken from https://github.com/nag92/SeriesElasticActuator/blob/master/walkingSEA.xml
"""
import numpy as np
def get_jacobian_matricies(theta_1,theta_2,theta_3):
"""
:param robot:
:return:
"""
This cacluclates the jacobian for the seires elastic arm.
The link parameters are taken from https://github.com/nag92/SeriesElasticActuator/blob/master/walkingSEA.xml
"""
import numpy as np
def get_jacobian_matricies(theta_1,theta_2,theta_3):
"""
:param robot:
:return:
clear all
obj = udp('localhost',9876) ;
obj.ByteOrder = 'littleEndian';
fopen(obj)
data = zeros(15,1,'single');
time = 100;
for i = 1:2
@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){