Skip to content

Instantly share code, notes, and snippets.

View PeterMitrano's full-sized avatar
🔬

Peter Mitrano PeterMitrano

🔬
View GitHub Profile
@PeterMitrano
PeterMitrano / naive_random_tree.py
Created February 21, 2021 03:41
Naive Random Tree Animation
import matplotlib
import matplotlib.pyplot as plt
from matplotlib import cm
import numpy as np
from matplotlib.animation import FuncAnimation
N = 100
a_max = 0.1
s = 1
@PeterMitrano
PeterMitrano / thread_test.py
Last active February 6, 2021 17:44
Example of a class with a thread
#!/usr/bin/env python
import threading
import time
import weakref
class BadRobot:
def __init__(self):
self.should_disconnect = False
@PeterMitrano
PeterMitrano / setup_script.py
Last active November 29, 2020 19:05
ROS Noetic via conda workspace setup
#!/bin/env python
import argparse
from multiprocessing import Process
import contextlib
import os
import pathlib
from subprocess import run
import requests
import yaml
@PeterMitrano
PeterMitrano / conda-ros-noetic-env.yml
Last active November 28, 2020 23:12
conda-ros-noetic-env.yml
name: peter
channels:
- defaults
- conda-forge
- robostack
dependencies:
- cmake=3.18
- log4cxx=0.10.0
- protobuf=3.11.4
- python
@PeterMitrano
PeterMitrano / mednafen
Last active November 16, 2020 02:21
mednafen
sound.driver sdl
sound.volume 10

Install

sudo snap install chromium
sudo apt install -y g++ build-essential cmake git htop tree tmux curl openssh-server imagemagick maim vim-gtk3 i3 python3-pip python3-virtualenv libappindicator3-dev castxml qt5-style-plugins trash-cli checkinstall gparted net-tools rename  libreadline-dev imagemagick policykit-1-gnome
sudo snap install pycharm-professional --classic
sudo snap install clion --classic
# https://linuxconfig.org/how-to-install-the-nvidia-drivers-on-ubuntu-20-04-focal-fossa-linux
sudo ubuntu-drivers autoinstall
# https://linuxconfig.org/how-to-install-cuda-on-ubuntu-20-04-focal-fossa-linux
sudo apt install -y nvidia-cuda-toolkit
CATKIN_WHITELIST_PACKAGES:STRING=shape_completion_training;link_bot_data;link_bot_pycommon;peter_msgs;link_bot_classifiers;state_space_dynamics;ros_numpy;gazebo_msgs;moonshine;link_bot_planning;link_bot_gazebo_python;jsk_recognition_msgs;mps_shape_completion_msgs;tf;angles;tf2_ros;tf2;tf2_msgs;tf2_py;victor_hardware_interface_msgs;arm_video_recorder;victor
#!/usr/bin/env bash
pip install pyplusplus pygccxml
sudo apt install castxml
cmake -D CMAKE_BUILD_TYPE=Release -D OMPL_BUILD_PYBINDINGS:BOOL=ON -D OMPL_BUILD_PYTESTS:BOOL=OFF -D OMPL_BUILD_TESTS:BOOL=OFF -D OMPL_BUILD_DEMOS:BOOL=OFF -DOMPL_REGISTRATION=OFF
make -j `nproc` update_bindings
make -j `nproc`
make install
@PeterMitrano
PeterMitrano / my_catkin_make
Created June 21, 2020 17:36
my_catkin_make
#!/bin/sh
catkin_make --cmake-args \
-DQt5_DIR:PATH=/home/pmitrano/.local/opt/anaconda3/envs/merrrt2/lib/cmake/Qt5 \
-DQt5Core_DIR:PATH=/home/pmitrano/.local/opt/anaconda3/envs/merrrt2/lib/cmake/Qt5Core \
-DQt5Gui_DIR:PATH=/home/pmitrano/.local/opt/anaconda3/envs/merrrt2/lib/cmake/Qt5Gui \
-DQt5Widgets_DIR:PATH=/home/pmitrano/.local/opt/anaconda3/envs/merrrt2/lib/cmake/Qt5Widgets \
-DPYTHON_EXECUTABLE=/home/pmitrano/.local/opt/anaconda3/envs/merrrt2/bin/python \
-DPYTHON_INCLUDE_DIR=/home/pmitrano/.local/opt/anaconda3/envs/merrrt2/include/python3.7m \
-DPYTHON_LIBRARY=/home/pmitrano/.local/opt/anaconda3/envs/merrrt2/lib/libpython3.7m.so \
@PeterMitrano
PeterMitrano / name_experiment.py
Created November 29, 2018 20:28
Tensorflow Experiment Naming
import os
from datetime import datetime
import git
import argparse
def make_log_path(args):
repo = git.Repo(search_parent_directories=True)
sha = repo.head.object.hexsha
stamp = "{:%B_%d_%H:%M:%S}".format(datetime.now())
log_subdir = args.log