Skip to content

Instantly share code, notes, and snippets.



View GitHub Profile
erwincoumans / BasicDemo.cpp
Created Oct 21, 2020
Kinematic btRigidBody example
View BasicDemo.cpp
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2015 Google Inc.
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:
erwincoumans /
Created Mar 29, 2019
DYMO usb scale reading (multiple scales)
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,
View pybullet_physx
import pybullet as p
import time
usePhysX = True
if usePhysX:
erwincoumans /
Created Oct 29, 2017
minitaur gym environment with bunny on its back
"""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))
erwincoumans / ground.urdf
Created Oct 28, 2017
pybullet URDF example of a static concave triangle mesh (non-moving)
View ground.urdf
<?xml version="1.0" ?>
<robot name="ground">
<link name="ground">
<mesh filename="ground.obj" scale="2 2 0.1" />
<material name="white">
<color rgba="1 1 1 1"/>
erwincoumans /
Created Oct 28, 2017
pybullet concave collision test
import pybullet as p
import time
#disable rendering during loading speeds it up
for i in range (10):
for j in range (10):
erwincoumans / dobot.ino
Created Mar 17, 2016
Dobot control using RAMPS 1.4 shield with Arduino Mega
View dobot.ino
//This is taken from
#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
erwincoumans / gist:6666160
Last active Sep 19, 2021
Example how to create the A matrix and b vector and solve the LCP using Projected Gauss Seidel for Bullet 2.x. Requires Eigen lib and Bullet 2.82. Note that one of the differences between plain projected Gauss Seidel and the Bullet iterative solver is that the friction limits are computed at each iterations, from the related normal force. (This …
View gist:6666160
//#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();