Skip to content

Instantly share code, notes, and snippets.

@dbaldwin
dbaldwin / gist:351cd33710e212cbe274757b411f9f76
Last active June 19, 2023 18:01
MAVROS Experimentation w/ Pi and Nano
# PX4 launch command
roslaunch mavros px4.launch
# PX4 launch file (default fcu_url worked fine for Pi 4 running Ubuntu server)
https://github.com/mavlink/mavros/blob/master/mavros/launch/px4.launch
If using the mini USB connector on Pi 4 you can use the default fcu_url
<arg name="fcu_url" default="/dev/ttyACM0:57600" />
If using the telemetry 2 port on Pixhawk you need this.
#!/bin/sh
sed "
s/title\s*=\s*{\(.*\)},*/%T \1/I
s/author\s*=\s*{\(.*\)},*/%A \1/I
s/publisher\s*=\s*{\(.*\)},*/%I \1/I
s/doi\s*=\s*{\(.*\)},*/%K \1/I
s/journal\s*=\s*{\(.*\)},*/%J \1/I
s/volume\s*=\s*{\(.*\)},*/%V \1/I
s/number\s*=\s*{\(.*\)},*/%N \1/I
s/pages\s*=\s*{\(.*\)},*/%P \1/I
@AlexisTM
AlexisTM / mavros_gcs.py
Created November 23, 2018 15:49
Mavros GCS heartbeat simulation => Have status_recv message allowing calibration.
#!/usr/bin/env python2
from __future__ import division
import os
import glob
import rospy
from pymavlink import mavutil
from threading import Thread
from mavros_msgs.msg import Mavlink, StatusText
from mavros import mavlink
@FrankBuss
FrankBuss / emulator.cpp
Last active June 20, 2024 19:05
RISC-V emulator (RV32I only) in one C++ file
/*
See https://gitlab.com/nedopc/npc5/blob/master/emu-rv32i.c for the latest version, with more features and less bugs :-)
RISCV emulator for the RV32I architecture
based on TinyEMU by Fabrice Bellard, see https://bellard.org/tinyemu/
stripped down for RV32I only, all "gotos" removed, and fixed some bugs for the compliance test
by Frank Buss, 2018
Requires libelf-dev:
@vo
vo / display-video.sh
Last active May 22, 2020 09:47
Raspberry Pi 3 B+ Auvidea B101 Gstreamer Pipeline Example
#!/bin/bash
gst-launch-1.0 udpsrc port=5801 ! 'application/x-rtp,payload=96,encoding-name=H264,clock-rate=(int)90000' ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! autovideosink sync=false
@vo
vo / forwarder.py
Last active May 22, 2020 09:47
mavlink packet inspector
from pymavlink import mavutil
import threading
connection = mavutil.mavlink_connection("udp:0.0.0.0:14592")
local = mavutil.mavlink_connection("udpout:127.0.0.1:14593")
def on_msg_from_uas(msg):
buf = msg.get_msgbuf()
local.write(buf)
@JamesHagerman
JamesHagerman / DisassembleARMBinaryInR2.md
Last active March 30, 2023 06:43
Some quick notes on disassembling 16bit ARM (STM32F4) code using radare2

Disassembling 1bitsy examples using radare2

Note that because radare2 uses Capstone to disassemble ARM code, there are issues with the disassembly. arm-none-eabi-objdump -d compiledbinary.elf actually does a better job in some cases. For example, msr isn't decompiled correctly...

First, you have to either strip the default ELF binaries the default Makefiles build when you run make OR you need to just compile .bin files using something like:

make binaryname.bin
@vo
vo / quad_video_wall.sh
Last active July 5, 2020 09:37
basic gstreamer quad video wall.
#!/bin/bash
# Basic gstreamer quad video wall application.
# Displays 4 videos.
# They have to be synced to eachother and playing for this to work.
PARAMS_NEEDED=4
if [ $# -ne $PARAMS_NEEDED ]
then
@fitz123
fitz123 / job_gen.sh
Last active May 24, 2019 19:27
Supervisor ffmpeg transcoding job and HLS playlist generator
#!/bin/bash
###############################################################################
#
# Description:
# Script generates Nimble session-friendly playlists
# (parent playlist with sub-playlists inside) and supervisor program/job
# of ffmpeg process which pulls from provided source address $ch_source and
# pushes to localhost nibmle-origin server as a name $ch_res for later HLS transmuxing
#