Skip to content

Instantly share code, notes, and snippets.

View tomas789's full-sized avatar

Tomas Krejci tomas789

  • Ampiato.com
  • Czech Republic, Europe
View GitHub Profile
@tomas789
tomas789 / README.md
Last active January 29, 2025 16:44
ADS1263 on Raspberry PI 5 (C++)

Code is intended for the Waveshare High-Precision AD HAT

It is adopted from the manufacturer's repo

I have added passive waiting for the ready signal. The original code implements active waiting which means that one core is always at 100% load. With the pasive waiting I ran read 7200 SPS at around 24% load of a single core.

Test sampling rates

@tomas789
tomas789 / Dockerfile
Last active December 6, 2024 10:15
CloudNativePG with Citus
FROM ghcr.io/cloudnative-pg/postgresql:16.6-11-bullseye@sha256:dc7bd9127c1b7055760a1201efda181ef16903326597935796591cbc5e13a73b
USER root
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
postgresql-server-dev-16 \
build-essential \
autoconf flex git libcurl4-gnutls-dev libicu-dev \
libkrb5-dev liblz4-dev libpam0g-dev libreadline-dev \
@tomas789
tomas789 / linkedin_extract_datetime.py
Last active June 30, 2023 07:40
LinkedIn: Extract datetime from post URL.
import datetime
from urllib.parse import urlparse
def linkedin_post_datetime(url: str) -> datetime.datetime:
"""
Convert LinkedIN post URL to datetime of when the post was created.
You can gen the post URL by clicking tripple dots in upper right corner of the post
and then selecting "Copy link to post".
(env) tomaskrejci @ Tomass-MBP-2.RD ➜ pymsckf git:(replay-from-app) ✗ docker run -v ~/ios_recordings:/data -v ~/Developer/pymsckf/examples:/examples -v `pwd`/calibration_output:/output --security-opt seccomp:unconfined -it -e DISPLAY=docker.for.mac.localhost:0 -w /output pymsckf_calibration kalibr_calibrate_imu_camera --bag /data/ios_recording_101.bag --cam /output/camchain-dataios_recording_96.yaml --imu /examples/imu_vins_mobile.yaml --target /examples/april_6x6_50x50cm.yaml
importing libraries
Initializing IMUs:
Update rate: 100.0
Accelerometer:
Noise density: 0.02
Noise density (discrete): 0.2
Random walk: 0.002
Gyroscope:
Noise density: 0.02
(env) tomaskrejci @ Tomass-MBP-2.RD ➜ pymsckf git:(replay-from-app) ✗ docker run -v ~/ios_recordings:/data -v ~/Developer/pymsckf/examples:/examples -v `pwd`/calibration_output:/output --security-opt seccomp:unconfined -it -e DISPLAY=docker.for.mac.localhost:0 -w /output pymsckf_calibration kalibr_calibrate_imu_camera --bag /data/ios_recording_100.bag --cam /output/camchain-dataios_recording_96.yaml --imu /examples/imu_vins_mobile.yaml --target /examples/april_6x6_50x50cm.yaml
importing libraries
Initializing IMUs:
Update rate: 100.0
Accelerometer:
Noise density: 0.02
Noise density (discrete): 0.2
Random walk: 0.002
Gyroscope:
Noise density: 0.02
cam0:
T_cam_imu:
- [0.005397773388641874, -0.9998572413908012, 0.016011273554103707, 0.09315162124446877]
- [-0.999983932903204, -0.0054247971439093275, -0.0016448438801904336, 0.016759819073606755]
- [0.0017314669756124, -0.016002137804896704, -0.9998704584133825, -0.007388480810763209]
- [0.0, 0.0, 0.0, 1.0]
cam_overlaps: []
camera_model: pinhole
distortion_coeffs: [0.03745064619036303, -0.05696336726790861, 0.0014705393416119647,
0.003161343303012978]
Calibration results
====================
Camera-system parameters:
cam0 (/cam0/image_raw):
type: <class 'aslam_cv.libaslam_cv_python.DistortedPinholeCameraGeometry'>
distortion: [ 0.03745065 -0.05696337 0.00147054 0.00316134] +- [ 0.00352425 0.00648838 0.00070408 0.00066755]
projection: [ 524.58054214 525.4382302 327.07092587 229.298555 ] +- [ 1.3060177 1.25092538 1.07929177 1.27724979]
reprojection error: [-0.000002, 0.000002] +- [0.229364, 0.214071]
pymsckf convert_kalibr -d ~/Downloads/ios_recording_96.sqlite -o ~/ios_recordings/ios_recording_96
#Accelerometers
accelerometer_noise_density: 0.02 #Noise density (continuous-time)
accelerometer_random_walk: 0.002 #Bias random walk
#Gyroscopes
gyroscope_noise_density: 0.02 #Noise density (continuous-time)
gyroscope_random_walk: 4.0e-5 #Bias random walk
rostopic: /imu0 #the IMU ROS topic
update_rate: 100.0 #Hz (for discretization of the values above)
V2_02_medium (20 FPS) V2_03_difficult (20 FPS) V2_02_medium (10 FPS) V2_03_difficult (10 FPS)
Frame rate 20 FPS 20 FPS 10 FPS 10 FPS
Simulation time 80 s 80 s 80 s 80 s
Execution time 114.39 72.89 54.79 34.99
Real-time factor 0.70 1.10 1.46 2.29
RMSE 0.2711 m 0.4309 m 0.7339 m 14.5115 m
Final error 0.334 m (0.57 %TTD) 0.549 m (0.94 %TTD) 1.364 m (2.35 %TTD) 11.826 m (20.33 %TTD)