This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//#include "Eigen/Dense" | |
#include "Eigen/Sparse" | |
static Eigen::VectorXf Solve_GaussSeidel (Eigen::MatrixXf & A, Eigen::VectorXf & b, Eigen::VectorXf & lo,Eigen::VectorXf & hi,int kMax = 5) | |
{ | |
//A is a m-n matrix, m rows, n columns | |
if (A.rows() != b.rows()) | |
return b; | |
int i, j, n = A.rows(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This is taken from https://www.reddit.com/r/Dobot/comments/45ilan/controlling_dobot_with_ramps_14 | |
#include <AccelStepper.h> | |
#define X_STEP_PIN 54 | |
#define X_DIR_PIN 55 | |
#define X_ENABLE_PIN 38 | |
#define X_MIN_PIN 3 | |
#define X_MAX_PIN 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pybullet as p | |
import time | |
p.connect(p.GUI) | |
#disable rendering during loading speeds it up | |
p.configureDebugVisualizer(p.COV_ENABLE_RENDERING,0) | |
p.configureDebugVisualizer(p.COV_ENABLE_TINY_RENDERER,0) | |
p.loadURDF("ground.urdf",useMaximalCoordinates=True) | |
for i in range (10): | |
for j in range (10): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" ?> | |
<robot name="ground"> | |
<link name="ground"> | |
<visual> | |
<geometry> | |
<mesh filename="ground.obj" scale="2 2 0.1" /> | |
</geometry> | |
<material name="white"> | |
<color rgba="1 1 1 1"/> | |
</material> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""This file implements the gym environment of minitaur. | |
""" | |
import os, inspect | |
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) | |
parentdir = os.path.dirname(os.path.dirname(currentdir)) | |
os.sys.path.insert(0,parentdir) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pybullet as p | |
import time | |
usePhysX = True | |
if usePhysX: | |
p.connect(p.PhysX) | |
p.loadPlugin("eglRendererPlugin") | |
else: | |
p.connect(p.GUI) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import usb.core | |
VENDOR_ID = 0x0922 | |
PRODUCT_ID = 0x8003 | |
# find USB devices | |
devices = list(usb.core.find(find_all=True, idVendor=VENDOR_ID, | |
idProduct=PRODUCT_ID)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Bullet Continuous Collision Detection and Physics Library | |
Copyright (c) 2015 Google Inc. http://bulletphysics.org | |
This software is provided 'as-is', without any express or implied warranty. | |
In no event will the authors be held liable for any damages arising from the use of this software. | |
Permission is granted to anyone to use this software for any purpose, | |
including commercial applications, and to alter it and redistribute it freely, | |
subject to the following restrictions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pycuda cuda interop inspired by | |
#https://gist.github.com/victor-shepardson/5b3d3087dc2b4817b9bffdb8e87a57c4 | |
#and https://discuss.pytorch.org/t/create-edit-pytorch-tensor-using-opengl/42111/5 | |
#pip install pytinydiffsim, pycuda, numpy, matplotlib, PyQt5 | |
#visit https://pytorch.org/get-started/locally to install cuda-enabled pytorch | |
#git clone https://github.com/erwincoumans/tiny-differentiable-simulator.git | |
#cd tiny-differentiable-simulator/python/examples | |
import pytinydiffsim as tds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#See Aras' post, https://twitter.com/aras_p/status/1579383862165405696 | |
import time | |
import bpy | |
print("hello world") | |
mesh = bpy.data.meshes['Cube'] | |
start = time.time() | |
for z in range (0,7,3): | |
for x in range(-9,10): | |
for y in range(-9,10): | |
ob = bpy.data.objects.new("Gen", object_data=mesh) |