Skip to content

Instantly share code, notes, and snippets.

View tstellanova's full-sized avatar
💭
growing excited

Todd Stellanova tstellanova

💭
growing excited
  • N6FFF
  • Berkeley, CA
View GitHub Profile
@tstellanova
tstellanova / start_ssh_agent.sh
Created September 7, 2014 15:54
Start ssh-agent at startup on ubuntu
# typically you'd add this at the end of eg .bashrc
# setup ssh-agent
SSH_ENV=$HOME/.ssh/environment
# start the ssh-agent
function start_agent {
echo "Initializing new SSH agent..."
# spawn ssh-agent
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
@tstellanova
tstellanova / trapezoid_numeric_integration.c
Last active August 29, 2015 14:09
trap rule numeric integration
static void integrate_gyro(FlowData_t* flow_data)
{
uint8_t idx = flow_data->gyro_integ_idx;
if (idx >= NUM_GYRO_INTEG_STEPS) {
//shuffle newer data down to oldest buckets
size_t buck_size = sizeof(flow_data->gyro_x_traps[0]);
size_t total_size = (NUM_GYRO_INTEG_STEPS -1)*buck_size;
memcpy( (flow_data->gyro_x_traps), (flow_data->gyro_x_traps + buck_size), total_size);
@tstellanova
tstellanova / F450-build-tstellanova.md
Last active May 14, 2018 07:09
Notes on my F450 quadcopter builds

20141130 F450 build notes Todd Stellanova

Flight Controller

Pixhawk PX4FMU v2.4.5 or later with an appropriate 3s-6 power module (depending on your battery choice)

My current favorite is the HobbyKing "HKPilot32" which is HobbyKing's Pixhawk 2.4.5 build. I've had good results with their quality, though you can only sometimes get them from the HobbyKing USA warehouse,

@tstellanova
tstellanova / LockfreeQueue.hpp
Created March 13, 2015 20:09
Lockfree queue using only C++0x features (g++ 4.6)
/**
* A lock-free queue for sharing messages across threads
* Requires C++0x but nothing later (as many current such things do)
* ref: Herb Sutter, "A Corrected One-Producer, One-Consumer Lock-Free Queue"
* http://www.drdobbs.com/parallel/writing-lock-free-code-a-corrected-queue/210604448
*/
template <typename T>
class LockFreeQueue {
#include <uuid/uuid.h>
#include <time.h>
#include <stdio.h>
#include <ctime>
int main(void)
{
uuid_t blob = {};
clock_t startTime = clock();
@tstellanova
tstellanova / radar.py
Created December 20, 2015 20:37 — forked from cnelson/radar.py
Display radar.weather.gov images on APA102c LEDs via /dev/spidev
#!/usr/bin/env python
"""Display radar.weather.gov images on APA102c LEDs via /dev/SpiDev"""
# stdlib
import argparse
import colorsys
import datetime
import cStringIO as StringIO
import os.path
import sys

Keybase proof

I hereby claim:

  • I am tstellanova on github.
  • I am thrusty (https://keybase.io/thrusty) on keybase.
  • I have a public key whose fingerprint is 678B D550 A3F3 5EEC E851 A7CE F7BD BD6C 4CC0 7B82

To claim this, I am signing this object:

@tstellanova
tstellanova / sdlog_dump_howto.md
Last active February 25, 2022 13:27
Extracting fields from px4log files using sdlog_dump

To extract ALL vision fields from px4log:

python sdlog2_dump.py 00_44_21.px4log -t TIME -m TIME -m VISN > 00_44_21_VISN.csv

To extract a particular subset of fields from px4log:

python sdlog2_dump.py 00_44_21.px4log -t TIME -m TIME -m VISN_VX,VY,VZ > 00_44_21_VISN.csv

  • (the bit I found confusing from the docs is the way that fields are specified)
@tstellanova
tstellanova / stm32f0-discover-OSX.md
Last active December 22, 2019 15:05
Setup stm32f0-discovery on Mac OS X
  • brew install stlink
  • which st-flash
  • arm-none-eabi-gdb
  • brew install openocd
On OS X you can persist keys in ssh-agent by storing them in the built in "Keychain" application by using the -K option to ssh-add
ssh-add -K /path/to/key