Skip to content

Instantly share code, notes, and snippets.

View patrickelectric's full-sized avatar
🏡
Working from home

Patrick José Pereira patrickelectric

🏡
Working from home
View GitHub Profile
@patrickelectric
patrickelectric / zenoh_shm_check.py
Created November 3, 2026 16:04
Test zenohd with SHM enabled
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.9"
# dependencies = ["eclipse-zenoh==1.10.1"]
# ///
"""Check that a running zenohd router really moves payloads over shared memory.
Usage:
zenohd --adminspace-permissions r &
./zenoh_shm_check.py [endpoint]
@patrickelectric
patrickelectric / dicionario.txt
Last active October 18, 2026 23:32
Dicionario 1155 do et
- lata:
- gap: Humilhado pela lata
- seco seco seco:
- liso liso liso:
- games:
- jogos:
- pacotada: Pacotes em demasia enviado no lombo do modem
- lenha:
- gargalo: Uma peça que não trabalha em harmonia com as outras
- sovar:
@patrickelectric
patrickelectric / main.py
Created September 18, 2026 11:36
Test navigator V3
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.9"
# dependencies = ["bluerobotics_navigator>=0.2.0"]
# ///
import os
import platform
import bluerobotics_navigator as navigator
from bluerobotics_navigator import AdcChannel, NavigatorVersion, Raspberry, UserLed
@patrickelectric
patrickelectric / mermaid.md
Created August 18, 2026 16:17
BR release
flowchart TD
    A(["Release candidate ready"]) --> B["Notify Software team: repository, scope, version, and planned time"]
    B --> C["Hold release for 12 or 24 hours"]
    C --> D{"Any objection?"}

    D -- Yes --> E["Resolve, revise, or postpone"]
    E --> B

    D -- No --> F["Create draft GitHub release using generated notes"]
@patrickelectric
patrickelectric / main.py
Created March 2, 2026 14:02
UV Project to test zenoh example in ardupilot
import threading
import time
import zenoh
def listener(sample):
print(f"[SUB] {sample.key_expr} => {sample.payload.to_string()}")
@patrickelectric
patrickelectric / video_udp.cpp
Last active December 16, 2025 14:20
Get video udp h264 with gstreamer and opencv
/**
* Based on:
* https://stackoverflow.com/questions/10403588/adding-opencv-processing-to-gstreamer-application
*/
// Include atomic std library
#include <atomic>
// Include gstreamer library
#include <gst/gst.h>
@patrickelectric
patrickelectric / ros.md
Created January 29, 2025 17:27
Individual motor control

Individual motor control

ROS

  1. Configure servo\d_function to RC_IN, one for each channel

IQboSywxAiTgRiJeoO55--ixADaCd7ujxmmWNy7KzFo=

@patrickelectric
patrickelectric / video_udp.py
Last active July 17, 2025 13:41
Get video from gstreamer udp with python and visualize with OpenCV
#!/usr/bin/env python
import cv2
import gi
import numpy as np
gi.require_version('Gst', '1.0')
from gi.repository import Gst
@patrickelectric
patrickelectric / main.rs
Created May 6, 2025 20:59
Failed example of sending data from Zenoh to ROS2DDS
use byteorder::LittleEndian;
use cdr_encoding::from_bytes;
use serde::{Deserialize, Serialize};
use zenoh;
#[derive(Serialize, Deserialize, Debug, Default)]
struct Quaternion {
x: f64,
y: f64,
@patrickelectric
patrickelectric / t200.csv
Last active February 3, 2025 17:30
t200.csv
thrust 16V rpm 16V power 16V current 16V voltage 16V pwm 16V thrust (kgf) 16V efficiency (g/w) 16V thrust 12V rpm 12V power 12V current 12V voltage 12V pwm 12V thrust (kgf) 12V efficiency (g/w) 12V
-9 3200 344.48 21.53 14.98 1100 -4.082336185 11.85072046 -6.62 2960 182.2 15.4 11.83 1100 -3.00278506 16.48070835
-8.9 2767 341.92 21.37 15.25 1110 -4.082336185 11.93944836 -6.58 2870 181.03 15.19 11.92 1110 -2.984641344 16.48699853
-8.7 3245 328.96 20.56 15.33 1120 -4.086872114 12.42361416 -6.34 2837 169.05 14.25 11.86 1120 -2.875779046 17.0114111
-8.44 3269 305.12 19.07 15.35 1130 -3.828324156 12.54694597 -6.09 2784 160.31 13.48 11.89 1130 -2.762380818 17.2314941
-8.23 3269 289.12 18.07 15.35 1140 -3.733069645 12.91183469 -5.8 2750 146.97 12.38 11.87 1140 -2.630838875 17.90051626
-7.98 3186 272.16 17.01 15.35 1150 -3.619671417 13.2997921 -5.59 2693 138.13 11.66 11.85 1150 -2.535584364 18.35650738
-7.59 3141 254.56 15.91 15.35 1160 -3.442770183 13.52439575 -5.23 2655 129.74 10.95 11.85 1160 -2.372290916 18.2849615