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.cpp
Created October 7, 2024 02:24
Speed test with esp32-c3
#include <Arduino.h>
#include <WiFi.h>
#include <zenoh-pico.h>
#define SSID "aaa"
#define PASS "aaa"
// Client mode values
#define MODE "peer" // Change to "peer" or "client" as needed
#define CONNECT "" // If empty, it will scout in 'peer' mode
@patrickelectric
patrickelectric / main.cpp
Last active September 23, 2024 12:35
This is a Zenoh-pico test where my PC and the ESP32S2 waits for each other to publish data and to answer. The ESP32S2 waits for data in `demo/example/topic/0` than receives the values, increment +1, and send it back to the PC via `demo/example/topic/1`. The computer gets the data from `demo/example/topic/1` and publishes it back to `demo/example…
// This code runs in the ESP32S2
#include <Arduino.h>
#include <WiFi.h>
#include <zenoh-pico.h>
#define SSID "ssid"
#define PASS "PASS"
// Client mode values
@patrickelectric
patrickelectric / image_to_udpsink
Created April 3, 2024 13:02
Creates a h264 udpsink from a static image
multifilesrc location="example.jpeg" ! jpegdec ! videoconvert ! imagefreeze ! videobox ! video/x-raw,format=I420,width=240,height=480,framerate=30/1 ! x264enc ! rtph264pay config-interval=1 pt=96 ! udpsink host=192.168.0.55 port=5600
extern crate serde; // 1.0.79
#[macro_use]
extern crate serde_derive; // 1.0.79
extern crate serde_json; // 1.0.30, features = ["raw_value"]
#[derive(Serialize, Deserialize, Debug)]
struct DataBlob<'a> {
id: &'a str,
priority: u8,
payload: &'a serde_json::value::RawValue,
@patrickelectric
patrickelectric / image_processing.qml
Created December 21, 2023 16:14
Do edge filtering in qml
import QtQuick 2.7
import QtQuick.Controls 2.3
Rectangle {
color: "red"
anchors.fill: parent
AnimatedImage {
id: oldFrame
source: "https://cdn.pixabay.com/animation/2022/10/11/09/05/09-05-26-529_512.gif"
@patrickelectric
patrickelectric / main.py
Last active December 11, 2023 11:26
blueos screenshots pages
from selenium import webdriver
from PIL import Image
import time
from imageio import imwrite
url = "http://blueos-avahi.local"
paths = [
'/',
'/vehicle/autopilot',

Contributor Agreement

Entity Contributor Exclusive License Agreement

Thank you for your interest in contributing to Cockpit ("We" or "Us").

The purpose of this contributor agreement ("Agreement") is to clarify and document the rights granted by contributors to Us.

How to use this Contributor Agreement

@patrickelectric
patrickelectric / gist:1aaa4144a68a5af147a1dcaa30b5737c
Created November 1, 2023 18:06
steamdeck-for-developers.md
sudo systemctl enable sshd
sudo systemctl enable avahi-daemon
sudo nano /etc/avahi/avahi-daemon.conf
# make sure that: `publish-workstation=yes`

Contributor Agreement

Entity Contributor Exclusive License Agreement

Thank you for your interest in contributing to BlueOS ("We" or "Us").

The purpose of this contributor agreement ("Agreement") is to clarify and document the rights granted by contributors to Us.

How to use this Contributor Agreement

@patrickelectric
patrickelectric / bindings.h
Created August 7, 2023 15:13
Navigator 0.0.1 C++ bind documentation
#include <cstdarg>
#include <cstdint>
#include <cstdlib>
#include <ostream>
#include <new>
/**
* @brief Set of available options to select ADC's channel.
*/
enum class AdcChannel {