Skip to content

Instantly share code, notes, and snippets.

@SebastianBitsch
SebastianBitsch / rdt.py
Last active March 31, 2024 11:31
RDT (Rapidly-exploring Dense Tree) algorithm Python
import numpy as np
def project_point_to_linesegment(start: np.ndarray, end: np.ndarray, p: np.ndarray) -> np.ndarray:
"""
Vectorized operation for projecting a point onto on array of line segments.
Follows the procedure outlined in: https://stackoverflow.com/a/1501725/19877091
Parameters:
start (np.ndarray) (N, 2): Starting point of the line segments.
end (np.ndarray) (N, 2): Ending point of the line segments.
@SebastianBitsch
SebastianBitsch / README.md
Last active April 9, 2024 12:51
ROS2 + Gazebo Installation for ARM64 Mac M1

Installing ROS2 + Gazebo natively on ARM M1 Mac

The setup makes use of Robostack to install ROS2 and Gazebo natively in a Conda environment - without the need for Docker-containers, Parallels, VMs, etc.

Steps

1. Update Xcode + OS

to version 14.x which is required by RoboStack. This in turn requires macOS Sonoma. Update your system to match

2. Install Homebrew

The default install directory for Homebrew on Apple Silicon is /opt/homebrew/. This doesn't work for our use, make sure to install brew at /usr/localand NOT at /opt/homebrew/

@SebastianBitsch
SebastianBitsch / _README.md
Last active April 4, 2024 09:53
Jupyter server for DTU HPC/3D-imaging-center

Jupyter server for DTU HPC/3D-imaging-center

This gist is a small guide for getting a Jupyter server running on DTU HPC on a GPU node.

@SebastianBitsch
SebastianBitsch / QuadTree.py
Created January 7, 2023 15:51
A simple Python quad tree as seen on wikipedia: https://en.wikipedia.org/wiki/Quadtree
# A simple no dependency Python implementation of the Quadtree
# pseudocode on Wikipedia: https://en.wikipedia.org/wiki/Quadtree
from dataclasses import dataclass, field
@dataclass
class Point:
x: float
y: float