Skip to content

Instantly share code, notes, and snippets.

@okalachev
okalachev / flip.ino
Last active February 29, 2024 19:34
Code for making an automatic flip for Flix drone (draft) https://github.com/okalachev/flix. See the video at https://t.me/opensourcequadcopter/21
// Copyright (c) 2024 Oleg Kalachev <okalachev@gmail.com>
// Flip controller for the Flix drone https://github.com/okalachev/flix
// Video and details: https://t.me/opensourcequadcopter/21
#define BOUNCE_TIME 0.6
#define ACCELERATE_TIME 0.07
#define BRAKE_TIME ACCELERATE_TIME
enum {
@okalachev
okalachev / tiny_rc.py
Last active March 13, 2023 10:29
Read and parse USB data from KingKong/LDARC Tiny X8 2.4G 8CH/16CH Radio Transmitter
#!/usr/bin/env python3
# Read and parse USB data from KingKong/LDARC Tiny X8 2.4G 8CH Radio Transmitter
# Usage: ./tiny_rc.py <device_path>
# Example: ./tiny_rc.py /dev/tty.usbserial-210
# Author: Oleg Kalachev <okalachev@gmail.com>
# https://github.com/okalachev
@okalachev
okalachev / groundtruth_pose.py
Last active July 28, 2022 00:11
Publish groundtruth pose in Clover simulator
#!/usr/bin/env python3
import rospy
from geometry_msgs.msg import PoseStamped
from gazebo_msgs.msg import LinkStates, ModelStates
rospy.init_node('groundtruth_pose')
pose_pub = rospy.Publisher('groundtruth', PoseStamped, queue_size=1)
# uncomment to loop groundtruth pose to vision pose input:
@okalachev
okalachev / mavlink_monitor.py
Last active March 30, 2023 13:33
MAVLink monitor tool
@okalachev
okalachev / http-client.py
Last active November 15, 2023 11:25
Networking examples
import requests
r = requests.get('http://192.168.11.136:5000', params={'foo': 123})
print(r.text)
@okalachev
okalachev / stars.py
Last active September 17, 2022 08:16
Keep track of who stars and unstars your repos 😈
#!/usr/bin/env python3
# Fetch all GitHub repo stargazers
# Usage: REPO=<username>/<repo> ./stars.py
# Results are saved in JSON and TXT format into ./<username>-<repo>/ directory (by timestamp)
import os, os.path
from datetime import datetime
import requests
import json
@okalachev
okalachev / remove_tag.sh
Last active July 28, 2021 02:29
git: remove local and remote tag
TAG=<tag_name> && git tag -d $TAG && git push --delete origin $TAG
@okalachev
okalachev / README.md
Last active January 13, 2024 02:42
Show high CPU usage process (xbar plugin)

Show high CPU usage process

The plugin for xbar, thath detects a high CPU consuming process (>50% CPU by default) and shows it in the top menu bar. If there is no high CPU usage the plugin stays quiet.

@okalachev
okalachev / copy
Created May 16, 2021 09:21
Generate scp command for copying a file to host
#!/usr/bin/env bash
# Usage: copy <filename>
SSH=($SSH_CONNECTION)
echo scp $1 $(whoami)@${SSH[2]}:$(pwd)
@okalachev
okalachev / README.md
Last active January 4, 2023 15:00
DT overlay to run OV7251 camera on CAM0 port of Compute Module 4

Device Tree overlay to run OV7251 camera on CAM0 port of Compute Module 4

This will work on Raspberry Pi OS 2021-01-12 (related DT files were changed in later release).

Copy the binary device tree overlay file to /boot/overlays/:

sudo cp ov7251cam0.dtbo /boot/overlays/ov7251cam0.dtbo