Skip to content

Instantly share code, notes, and snippets.

View fgolemo's full-sized avatar
:shipit:

Florian Golemo fgolemo

:shipit:
View GitHub Profile
@fgolemo
fgolemo / pygame-play-sound.py
Created September 30, 2017 14:49
pygame play sample on keypress
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import pygame
pygame.init()
pygame.mixer.init()
pygame.display.set_mode()
@fgolemo
fgolemo / pytorch-on-duckiebot.md
Created October 12, 2017 01:11
Installing/compiling PyTorch on Duckiebot - tutorial v1

How to install PyTorch on the Duckiebot

PyTorch is a Python deep learning library that's currently gaining a lot of traction, because it's a lot easier to debug and prototype (compared to TensorFlow / Theano).

To install PyTorch on the Duckietbot you have to compile it from source, because there is no pro-compiled binary for ARMv7 / ARMhf available. This guid will walk you through the required steps.

Step 1: install dependencies and clone repository

First you need to install some additional packages. You might already have installed. If you do, that's not a problem.

@fgolemo
fgolemo / installing-ocaml-with-atom.md
Created January 29, 2018 08:36
How to enable OCaml support in Atom text editor

How to install OCaml support for Atom editor on Debian/Ubuntu systems

Install Atom (obviously).

Assuming you are on a Debian/Ubuntu system install these system packages:

sudo apt-get install ocaml-core opam ocp-indent

Then install merlin and initialize it: (no sudo here)

@fgolemo
fgolemo / pytorch-on-raspberry-pi3.md
Created March 7, 2018 14:28
How to install PyTorch v0.3.1 on RaspberryPi 3B - Tutorial

How to install PyTorch v0.3.1 on RaspberryPi 3B

Prerequisites

Important I'd recommend you use at least a 16GB sd card. I tried it with an 8GB card and it baaaaarely fits. I had to uninstall a lot of packages and regularly clean up.

Go to https://www.raspberrypi.org/downloads/raspbian/ and download the Raspbian Stretch image (either one).

Use Etcher (from https://etcher.io/) to "burn" the image onto the SD card.

@fgolemo
fgolemo / realsense-d435i-test-speed.py
Last active February 7, 2019 20:54
RGB speed test for the Intel RealSense d435i
import time
import numpy as np
import pyrealsense2 as rs
pipeline = rs.pipeline()
config = rs.config()
config.enable_stream(rs.stream.color, 640, 480, rs.format.rgb8, 60)
pipeline.start(config)
tests = 100
### Keybase proof
I hereby claim:
* I am fgolemo on github.
* I am flogo (https://keybase.io/flogo) on keybase.
* I have a public key ASAS3pgaMErl34blInTy1Sr_EL5vEv2ZIJZedtf7WAfsMAo
To claim this, I am signing this object:
@fgolemo
fgolemo / xarm-controller.py
Created October 24, 2019 23:11
Originally written by @maximecb
"""
sudo apt-get install libhidapi-hidraw0 libhidapi-libusb0
pip3 install --user hid
Notes:
- servos_off will power off the servos
- sending a movement command wakes up unpowered servos
- position readouts are sadly pretty slow, they can take up to 450ms
"""
@fgolemo
fgolemo / 3d_rotate_reproject.py
Last active July 11, 2023 18:02
3D rotation and reprojection in pytorch, i.e. differentiable
import numpy as np
import math
import torch
from torchvision import datasets
import cv2 # OpenCV, this is only used for visualization, see bottom of file
def rotation_matrix(axis, theta):
"""
Generalized 3d rotation via Euler-Rodriguez formula, https://www.wikiwand.com/en/Euler%E2%80%93Rodrigues_formula
@fgolemo
fgolemo / pybullet_camera_example.py
Last active February 4, 2021 19:21
PyBullet shitty rendering sample
import time
import numpy as np
import pybullet_utils.bullet_client as bc
import pybullet
import pybullet_data
import matplotlib.pyplot as plt
from tqdm import trange
# simulator 0
p = bc.BulletClient(connection_mode=pybullet.DIRECT)
@fgolemo
fgolemo / autobot_toy.ipynb
Created February 19, 2021 05:48
autobot_toy.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.