Skip to content

Instantly share code, notes, and snippets.

View michalpelka's full-sized avatar

Michał Pełka michalpelka

View GitHub Profile
[Unit]
Description=Forward /dev/ttyUSB0 to TCP with socat
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/socat -d -d tcp-listen:8000,reuseaddr,fork file:/dev/ttyUSB0,nonblock,waitlock=/var/run/tty0.lock,b115200,raw,echo=0
Restart=always
[Install]
@michalpelka
michalpelka / draw-extrinsics.py
Created December 13, 2020 09:59
Draws 4x4 numpy txt in Blender as Empties
import bpy
import numpy as np
import glob
fn = "/home/michal/Desktop/render4/*_extrinsics.txt"
fns = glob.glob(fn)
fns = sorted(fns)
i = 0
for f in fns:
import bpy
import random
import numpy as np
blender_camera = np.array([[1,0,0,0], [0,-1,0,0], [0,0,-1,0], [0,0,0,1]])
np.set_printoptions(precision=2)
np.set_printoptions(suppress=True)
def getCameraMatrixIntrinsic(obj):
# get resolution:
res_x = bpy.context.scene.render.resolution_x * bpy.context.scene.render.resolution_percentage / 100.0
res_y = bpy.context.scene.render.resolution_y * bpy.context.scene.render.resolution_percentage / 100.0
import numpy as np
import cv2
import matplotlib.pyplot as plt
from numpy.linalg import inv
def getHarrisPoints(img):
ker_x = np.array([[-1,0,1],[-1,0,1],[-1,0,1]])
ker_y = np.array([[ 1,1,1],[0,0,0],[-1,-1,-1]])
I_x = cv2.filter2D(img,cv2.CV_32F,ker_x)
Michał Pełka Robert Chodyniecki
DynDNS:
https://www.noip.com/support/knowledgebase/how-to-configure-ddns-in-router/
Port fowarding in router
https://www.lifewire.com/how-to-port-forward-4163829
Stworzenie klucza SSH i instalacja na Raspberry PI:
https://blog.botland.com.pl/bezpieczne-logowanie-bez-hasla-raspberry-pi
Przekierowanie portów SSH na Putty:
# This example assumes we have a mesh object selected
import bpy
import bmesh
import numpy as np
def update_mesh(obj, matrix):
# Get the active mesh
me = obj.data
# This example assumes we have a mesh object selected
import bpy
import bmesh
import numpy as np
# Get the active mesh
me = bpy.context.object.data
# Get a BMesh representation
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import math"
]
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import math"
]