Skip to content

Instantly share code, notes, and snippets.

View cohnt's full-sized avatar

Thomas Cohn cohnt

View GitHub Profile
@cohnt
cohnt / mesh_vs_limits_upstream.py
Last active September 1, 2026 14:43
RB-Y1 Joint Limits Auditor
#!/usr/bin/env python3
"""Check every declared revolute joint limit in the RB-Y1 description against
the link geometry that joint moves.
A joint limit that reaches past the angle at which the two links either side of
it physically interfere is invisible to everything downstream. Links that share
a joint are filtered from collision checking in *any* collision checker --
correctly, since they are in contact at the bearing in every configuration -- so
the joint limit is the only thing that can keep them apart. A wrong limit
therefore propagates straight through IK, sampling-based planning, trajectory
@cohnt
cohnt / benchmark.py
Last active August 26, 2026 20:24
Drake KinematicTrajectoryOptimization PathConstraint Autodiff Benchmark
"""Time the real PathConstraint from KinematicTrajectoryOptimization.
Obtains the actual internal PathConstraint (anonymous namespace, not directly
constructible) via the public AddPathPositionConstraint() API, then times its
double-scalar Eval(). The measured call is identical before and after the
commit -- a plain float64 array in, a plain float64 array out -- so the pydrake
marshalling cost is the same in both builds and cancels in the comparison.
"""
import os, sys, time
import numpy as np
@cohnt
cohnt / RB-Y1 Box Pickup Swept Volume.md
Last active August 12, 2026 19:23
RB-Y1 Box Pickup Swept Volume

Box-transport swept-motion figure

Code for a chronophotography-style still: a mobile dual-arm robot carrying a cardboard box horizontally across a table, composited from a single fixed-camera video. Dense semi-transparent ghosts of the arms, a handful of box positions, no overlaid path graphics.

RB-Y1 design notes.md covers why it looks this way, what was measured, and which approaches were tried and rejected — including a few that failed and why.

@cohnt
cohnt / convert.sh
Last active August 16, 2026 19:18
Steam Clip Conversion Script
#!/bin/bash
# Configuration
mkdir -p processed
mkdir -p to_delete
PROCESSED_ROOT=$(realpath processed)
TO_DELETE_ROOT=$(realpath to_delete)
# Iterate through each clip folder
for clip_dir in clips/*/; do
@cohnt
cohnt / maximize_logdet_Jacobian.py
Last active March 19, 2026 19:20
Maximize Manipulability
import numpy as np
from pydrake.all import (
AddMultibodyPlantSceneGraph,
DiagramBuilder,
Parser,
MathematicalProgram,
Solve,
RigidTransform,
JacobianWrtVariable,
log,
@cohnt
cohnt / curvature.py
Created August 17, 2025 14:19
Calculation of scalar curvature of an embedded submanifold with JAX
# Vibecoded with ChatGPT
import jax
import jax.numpy as jnp
def scalar_curvature_projector(f, x0, n, k, rtol=1e-8):
"""
Compute the scalar curvature of M = {x : f(x) = 0} at x0,
using the projector formula (basis-free Gauss equation).
@cohnt
cohnt / count_lines.py
Created July 17, 2025 22:20
Plot Your Lines of Code Added to a Repo
import subprocess
import datetime
from collections import defaultdict
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import os
import sys
import mplcursors
import re
@cohnt
cohnt / foo
Created June 9, 2025 02:37
Steam System Information
"LD_* scout runtime" information:
{
"steam-runtime-system-info" : {
"version" : "0.20250408.0+srt1",
"path" : "/home/tommy/.steam/debian-installation/ubuntu12_32/steam-runtime/amd64/usr/bin/steam-runtime-system-info"
},
"can-write-uinput" : true,
"steam-installation" : {
"path" : "/home/tommy/.steam/debian-installation",
"data_path" : "/home/tommy/.steam/debian-installation",
@cohnt
cohnt / steam-218230.log
Created June 9, 2025 02:33
Planetside 2 Crash Proton Log
This file has been truncated, but you can view the full file.
======================
Proton: 1748966679 experimental-10.0-20250603b
SteamGameId: 218230
Command: ['/mnt/9e35f787-a028-48b8-8f0e-9eda11669830/SteamLibrary/steamapps/common/PlanetSide 2/LaunchPad.exe', 'Updates:enable=0', 'Updates:PatchSelf=1', 'campaignID=1063272', 'promoID=146', 'launchPoint=steam', 'launchArgs=STEAM_ENABLED=1']
Options: {'forcelgadd'}
depot: 3.0.20250408.124536
pressure-vessel: 0.20250408.0 scout
scripts: 0.20250408.0
sniper: 3.0.20250408.124536 sniper 3.0.20250408.124536
@cohnt
cohnt / parse.py
Created May 12, 2025 02:38
Filter Out Emails of People Who RSVPed Yes (Aisle Planner)
import csv
# File paths (change these if needed)
parties_file = 'parties.csv'
guests_file = 'guests.csv'
output_file = 'yes_rsvp_emails.txt'
# Step 1: Collect RSVP IDs for guests who RSVPed yes
yes_rsvp_ids = set()