Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@valgur
valgur / elb_elevation.py
Created May 17, 2023 09:58
Data provider for elevation data from Estonian Land Board
import os
from pathlib import Path
import numpy as np
import rasterio
import requests
from scipy.interpolate import RectBivariateSpline
from tqdm.auto import tqdm
@valgur
valgur / Dockerfile
Last active November 6, 2023 16:26
Test a Conan recipe in isolation
FROM conanio/gcc11-ubuntu16.04:latest
USER root
RUN pip install -U conan
COPY <<EOF /root/.conan2/profiles/default
[settings]
arch=x86_64
build_type=Release
@valgur
valgur / init_cc_package.sh
Last active May 9, 2023 19:53
Create a recipe skeleton for a new conan-center-index package.
#!/bin/bash
set -eu -o pipefail
name=$1
version=$2
template=${3:-"cmake_package"}
echo Copying sources...
root=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
pkg_dir=$root/recipes/$name
# Defines the following helper functions:
# - print_target_properties()
# - print_vars()
# - get_all_targets()
# Adapted from https://stackoverflow.com/a/68881024/2997179
# Print all properties of CMake target.
function(print_target_properties target)
if(NOT TARGET ${target})
@valgur
valgur / hdl64e_s3_calib_data.m
Last active May 4, 2023 15:24
Appendix D: MATLAB Sample Code, from "63‐HDL64ES3 REV K", Velodyne 2013
% Matlab sample code to read calibration data from sensor output.
fileFilter = '*.pcap';
[File_name, Directory] = uigetfile(fileFilter, 'Open a .pcap file');
Filename = [Directory File_name];
fid = fopen(Filename);
ttc = fread(fid, 40);
ttc = fread(fid, 42);
ttc = fread(fid, inf, '1206*uint8=>uint8', 58);
fclose(fid);
import av
# packets = [H.264 packets as byte arrays]
codec = av.CodecContext.create('h264', 'r')
for packet in packets:
for avpacket in codec.parse(packet):
frames = codec.decode(avpacket)
print(frames)
# Or, can also simply do
@valgur
valgur / baseline velodyne_decoder vs VeloView.ipynb
Created January 9, 2023 14:33
velodyne_decoder v2.3.0 validation against VeloView test datasets
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@valgur
valgur / velodyne_decoder vs VeloView ground truth.ipynb
Last active January 12, 2023 09:45
velodyne_decoder v3.0.0 validation against VeloView test datasets
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.