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 / multiple-components.py
Last active April 19, 2024 19:17
Example of using asyncio to run multiple mavlink components
import asyncio
from pymavlink import mavutil
PORT = 6666
CONNECTION_STRING = f'udpout:127.0.0.1:{PORT}'
CONNECTIONS = {}
def get_mavlink_connection(system_id: int, component_id: int):
def create(system_id: int, component_id: int):
return mavutil.mavlink_connection(
@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
@patrickelectric
patrickelectric / video_udp.py
Last active March 16, 2024 20:28
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
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 / video_udp.cpp
Last active January 2, 2024 22:00
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 / 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

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 / 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`