Skip to content

Instantly share code, notes, and snippets.

import rosbag_pandas
import glob
for f in glob.glob('*.bag'):
print(f'convert bag file {f} to csv...')
df = rosbag_pandas.bag_to_dataframe(f, exclude=['/rosout', '/rosout_agg'])
df.to_csv(f'{f[:-4]}.zip')
print(' ok')
@herzig
herzig / gist:1087d84c2532d77b3f72b23b3c4135a9
Created September 16, 2020 11:47
udev rules for teensy, create symlinks with serial numbers
# UDEV Rules for Teensy boards, http://www.pjrc.com/teensy/
#
# The latest version of this file may be found at:
# http://www.pjrc.com/teensy/49-teensy.rules
#
# This file must be placed at:
#
# /etc/udev/rules.d/49-teensy.rules (preferred location)
# or
# /lib/udev/rules.d/49-teensy.rules (req'd on some broken systems)
@herzig
herzig / esp-idf_i2c_scan
Created August 9, 2019 10:12
esp32 i2c scan (esp-idf)
// setup i2c master
static esp_err_t i2c_master_init()
{
i2c_config_t conf;
conf.mode = I2C_MODE_MASTER;
conf.sda_io_num = I2C_SDA_PIN;
conf.scl_io_num = I2C_SCL_PIN;
conf.sda_pullup_en = GPIO_PULLUP_ENABLE;
conf.scl_pullup_en = GPIO_PULLUP_ENABLE;
conf.master.clk_speed = I2C_MASTER_FREQ_HZ;
@herzig
herzig / geometry.js
Last active February 6, 2021 23:24
3D circle-circle intersection in Javascript. Intersection of two circles that share the same plane (in 3D). Convenient use with three.js vectors
function IntersectTHREE() {};
// intersection of two 3d circles
// c1,n1,c2,n2 are the center points and normal directions as 3d vectors (ex: {x: 1, y: 2, z: 3} )
IntersectTHREE.circleCircle = function(c1, n1, r1, c2, n2, r2)
{
let r = Intersect.circleCircle(
c1.x, c1.y, c1.z, n1.x, n1.y, n1.z, r1,
c2.x, c2.y, c2.z, n2.x, n2.y, n2.z, r2);