Skip to content

Instantly share code, notes, and snippets.

View dbaldwin's full-sized avatar

Dennis Baldwin dbaldwin

View GitHub Profile
@dbaldwin
dbaldwin / gist:2625ecea3fd03168e504801840d77cbc
Created January 16, 2024 20:54
fffmpeg convert webm to mp4 using Docker
# From ~/Videos/Screencasts
docker run -v $(pwd):/config linuxserver/ffmpeg -i /config/mavlink_shell.webm -c:v libx264 -c:a aac -vf "pad=ceil(iw/2)*2:ceil(ih/2)*2" /config/mavlink_shell.mp4
@dbaldwin
dbaldwin / gist:193026e305397a604b6bb2cca208acdc
Created November 17, 2023 20:12
VMC Sandbox w/ April Tag
# Here we import our own MQTT library which takes care of a lot of boilerplate
# code related to connecting to the MQTT server and sending/receiving messages.
# It also helps us make sure that our code is sending the proper payload on a topic
# and is receiving the proper payload as well.
from bell.avr.mqtt.client import MQTTModule
from bell.avr.mqtt.payloads import (
AvrFcmVelocityPayload,
AvrApriltagsRawPayload
)
@dbaldwin
dbaldwin / gist:2b10af0f50fa3b5f8facf0a620b8dc3d
Last active December 8, 2023 20:19
MAVSDK Box Mission Test
# On Raspberry Pi to Windows PC running MAVSDK server
sudo mavproxy.py --master=/dev/serial0 --baudrate 57600 --out 192.168.86.29:14550
# On RPi4 with telemetry cable
mavproxy.py --master=/dev/ttyAMA0 --baudrate 57600 --out 192.168.11.116:14550
# On Windows PC
.\mavsdk_server_win32.exe udp://:14550
# Modified from MAVSDK script
@dbaldwin
dbaldwin / gist:4c0f469a7f5c0873bc6cebccefe71ecd
Created May 16, 2023 20:32
BeagleBone Blue Wifi Disconnect
debian@beaglebone:~$ dmesg
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.19.94-ti-r42 (voodoo@x3-am57xx-beagle-x15-2gb) (gcc version 8.3.0 (Debian 8.3.0-6)) #1buster SMP PREEMPT Tue Mar 31 19:38:29 UTC 2020
[ 0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] OF: fdt: Machine model: TI AM335x BeagleBone Blue
[ 0.000000] Memory policy: Data cache writeback
[ 0.000000] cma: Reserved 48 MiB at 0x9c800000
[ 0.000000] On node 0 totalpages: 130560
[ 0.000000] Normal zone: 1148 pages used for memmap
@dbaldwin
dbaldwin / gist:401dff6f61a83de30955a1dcc495e239
Last active April 13, 2023 14:37
mavp2p px4 mini connected to pi zero via usb port (not usb power port)
# Run the following on Pi Zero attached to Pixhawk 4 Mini via USB
# Sends to windows desktop
./mavp2p serial:/dev/ttyACM0:57600 udpc:192.168.86.32:14550
# Pi Zero m2r with Pixhawk 4 Mini connected via USB
mavlink2rest -c serial:/dev/ttyACM0:57600
# Connected over UART
./mavp2p serial:/dev/serial0:921600 udpc:192.168.86.32:14550
@dbaldwin
dbaldwin / example_static_pose.py
Created March 30, 2023 00:30
Go1 Static Pose Example
#!/usr/bin/python
import sys
import time
import math
import numpy as np
sys.path.append('../lib/python/amd64')
import robot_interface as sdk
@dbaldwin
dbaldwin / gist:e05df6ffea978ac97074577deeccc60f
Created March 22, 2023 19:05
goto_location_ned fcm error
fcm_1 | 2023-03-22 18:58:03.637 | ERROR | __main__:action_dispatcher:180 - ERROR IN MAIN LOOP
fcm_1 | Traceback (most recent call last):
fcm_1 |
fcm_1 | File "/app/fcc_control.py", line 443, in <module>
fcm_1 | asyncio.run(control.run())
fcm_1 | │ │ │ └ <function ControlManager.run at 0x7f8253cb80>
fcm_1 | │ │ └ <__main__.ControlManager object at 0x7f825937c0>
fcm_1 | │ └ <function run at 0x7f847c4ee0>
fcm_1 | └ <module 'asyncio' from '/usr/local/lib/python3.9/asyncio/__init__.py'>
fcm_1 |
@dbaldwin
dbaldwin / mission.json
Last active October 23, 2023 22:49
Dennis AVR 2023 Waypoint Mission Test
# Launch AVR Sim
root@ubuntu:~/AVR-2022/VMC# ./start.py -s -l run simulator mqtt fcm web
# Publish to FCM topic on MQTT Broker
avr/fcm/actions
# Absolute
{"action":"upload_mission","payload":{"waypoints":[{"type":"takeoff", "lat": 32.8085506, "lon": -97.1563441, "alt": 3},{"type":"goto","lat":32.8085769115908,"lon":-97.15634413537362,"alt":2},{"type":"goto","lat":32.808576911586705,"lon":-97.15631207121733,"alt":2},{"type":"goto","lat":32.80854996212819,"lon":-97.15631207121733,"alt":2},{"type":"goto","lat":32.80854996212411,"lon":-97.15634413536391,"alt":2},{"type":"land", "lat":32.80854996212411,"lon":-97.15634413536391, "alt": 0}]}}
# Relative
# Update CMakeLists in ~/catkin_ws/src/unitree_ros/unitree_controller
catkin_install_python(PROGRAMS scripts/joint_mover.py
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
#!/usr/bin/env python
import rospy
from sensor_msgs.msg import JointState
from std_msgs.msg import Header