Skip to content

Instantly share code, notes, and snippets.

View jgibbard's full-sized avatar

James jgibbard

View GitHub Profile
@jgibbard
jgibbard / timesheet.ipynb
Last active January 23, 2023 21:29
Timesheet calculator
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jgibbard
jgibbard / map_gen.py
Last active January 22, 2023 21:46
Generate a PNG map image from a shapefile
#!/usr/bin/env python3
import math
import shapefile
from PIL import Image, ImageDraw
# Longitude range to display in degrees
x_range = [-180,180]
# Latitude range to display in degrees
y_range = [-90,90]
@jgibbard
jgibbard / cartesian_to_lat_lon.py
Created November 19, 2023 21:43
Geodesic Calculations Checker
#!/usr/bin/env python3
# Tested with python3.11, geographiclib==2.0, matplotlib==3.8.2, numpy==1.26.2
import math
import numpy as np
import csv
import argparse
def get_x_y_data(filename):
@jgibbard
jgibbard / lidar_test.py
Created April 28, 2024 20:06
LD19 LIDAR Sensor Test Code
#!/usr/bin/env python3
import numpy as np
import matplotlib.pyplot as plt
import serial
from enum import Enum
import struct
# ----------------------------------------------------------------------
# System Constants
@jgibbard
jgibbard / main.cpp
Last active May 3, 2024 10:58
Recursive variadic class template example
#include <iostream>
#include "protocol_stack.hpp"
#include "protocol.hpp"
#include "protocol1.hpp"
#include "protocol2.hpp"
#include "protocol3.hpp"
int main() {
ProtocolStack<Protocol1> example1;