Skip to content

Instantly share code, notes, and snippets.

Avatar

Sebastian Wallkötter FirefoxMetzger

View GitHub Profile
@FirefoxMetzger
FirefoxMetzger / project-3d-camera-info.py
Created Mar 24, 2021
An example on performing a 3D projection using Ignitionrobotics, gym-ignition and ropy.
View project-3d-camera-info.py
from scenario import gazebo as scenario_gazebo
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Circle
from scipy.spatial.transform import Rotation as R
import ropy.transform as tf
import ropy.ignition as ign
def camera_parser(msg):
View git_clone.strace
12026 execve("/usr/bin/git", ["git", "clone", "--sparse", "https://github.com/microsoft/WSL"...], 0x7fff95630170 /* 22 vars */) = 0
12026 brk(NULL) = 0x5565d9152000
12026 arch_prctl(0x3001 /* ARCH_??? */, 0x7ffd1d104450) = -1 EINVAL (Invalid argument)
12026 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
12026 openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
12026 fstat(3, {st_mode=S_IFREG|0644, st_size=97898, ...}) = 0
12026 mmap(NULL, 97898, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f4cfd2b5000
12026 close(3) = 0
12026 openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libpcre2-8.so.0", O_RDONLY|O_CLOEXEC) = 3
12026 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340\"\0\0\0\0\0\0"..., 832) = 832
@FirefoxMetzger
FirefoxMetzger / ThresholdArm.ipynb
Created Nov 22, 2020
Automatically select a crop to threshold an arm
View ThresholdArm.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View config.yml
# vouch config
# bare minimum to get vouch running with OpenID Connect (such as okta)
vouch:
logLevel: debug
testing: true
listen: 0.0.0.0
port: 9090
allowAllUsers: true
View gist:c7dfaea6a8717b4469db34aab81f0d08
# vouch config
# bare minimum to get vouch running with OpenID Connect (such as okta)
vouch:
logLevel: debug
testing: true
listen: 0.0.0.0
port: 9090
allowAllUsers: true
@FirefoxMetzger
FirefoxMetzger / setup.py
Created Aug 12, 2020
Updated setup.py to use correct openMP flag for msvc
View setup.py
#! /usr/bin/env python
import os
import sys
import tempfile
import shutil
import builtins
import textwrap
import setuptools
View random_profile.py
import timeit
number = 10000
numpy_time = timeit.timeit("[np.random.rand() for _ in range(int(1e3))]", "import numpy as np", number=number)
random_time = timeit.timeit("[random.random() for _ in range(int(1e3))]", "import random", number=number)
numpy_batch_time = timeit.timeit("np.random.rand(int(1e3))", "import numpy as np", number=number)
print("Timings")
print("=======")
print(f"Numpy Single: {numpy_time:.3f}")
View RandomDropin.py
import numpy as np
random_numbers = np.random.rand(int(2e8)).tolist()
def random():
try:
return random_numbers.pop()
except IndexError:
raise IndexError("Out of random numbers; generate more next time.")
View superd.py
from multiprocessing import Pool, cpu_count
from itertools import islice, count
def is_special(n, d):
tofind = str(d) * d
return tofind in str(d * n ** d)
def superd(d, N=10000):
View custom_posture.py
from naoqi import ALBroker
from naoqi import ALProxy
from pprint import pprint
# start a local broker that connects to the NAO
robot_ip = "love"
myBroker = ALBroker("myBroker", "0.0.0.0", 0, robot_ip, 9559)
# get a handle to the module