Skip to content

Instantly share code, notes, and snippets.

View dbaldwin's full-sized avatar

Dennis Baldwin dbaldwin

View GitHub Profile
@dbaldwin
dbaldwin / gist:df58544fae360e84f5c9d8ab371500f5
Last active May 15, 2024 06:47
Unitree Low Level and ROS Low Level Control from Windows with Docker
# From Windows terminal
docker run -p 6080:80 --shm-size=512m --name ros_go1 -d tiryoh/ros-desktop-vnc:melodic
# Access the instance through the url
http://localhost:6080
# From home directory in Docker
mkdir -p catkin_ws/src
# Go into catkin workspace
@dbaldwin
dbaldwin / gist:b31835f87f16450a956cf3c89e15a289
Last active April 25, 2024 17:15
Unitree Go1 Wireless Network Setup for Low Level Control with Windows and Docker
# From Windows terminal
docker run -p 6080:80 --shm-size=512m --name ros_go1 -d tiryoh/ros-desktop-vnc:melodic
# Access the instance through the url
http://localhost:6080
# From home directory in Docker
mkdir -p catkin_ws/src
# Go into catkin workspace
@dbaldwin
dbaldwin / PX4_VIO.md
Last active March 23, 2024 09:46
PX4 VIO w/ Jetson Nano, Intel T2654, and Pixhawk (NXP Version)

Overview

I've put this documentation to supplement the awesome VIO repo from Auterion. While the VIO code performs very well it does take quite a bit of work to get up and running. So I'm covering this in my YouTube video and this gist.

Install ROS on Jetson Nano (YouTube Link)

Automatic Addison has great tutorials on ROS. His installation guide is the most concise out there. This section contains the commands from Addison's ROS installation guide.

  • sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
  • sudo apt update
  • sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
  • sudo apt-get update
docker run -p 6080:80 --shm-size=512m tiryoh/ros2-desktop-vnc:foxy
# Go to http://localhost:6080 and open a terminal
# Menu > System Tools > MATE Terminal
sudo apt update
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src
@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: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: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 / 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
docker run -p 6080:80 --shm-size=512m --name ros_go1 -d tiryoh/ros-desktop-vnc:melodic
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
sudo apt update
sudo apt install ros-melodic-joint-state-publisher-gui
mkdir -p ~/catkin_ws/src
# 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