Skip to content

Instantly share code, notes, and snippets.

@vo
vo / solo-services.md
Last active February 19, 2017 23:34
Solo Network Services / Ports

3DR Solo Network Services / Ports

  • 5005 - Radio control joystick data - pixrc process on the Solo listens to this for rc joystick messages
  • 5010 - Config Stick Axes Msg
  • 5011 - Param Stored Values Msg
  • 5012 - sysDestPort?
  • 5013 - pairReqPort - stm32 process on Artoo listens to pair requests from the pair_server process
  • 5014 - pairReqDestPort - stm32 process on Artoo sends to this port on the pair_server process
  • 5015 - mavDestPort - stm32 process receives telemetry from the telem_ctrl process here
  • 5016 - buttonEventPort (TCP) - Subscribe to button events on the Artoo (pause, home, A, B, etc) by connecting to this port on the Artoo.
@vo
vo / xrandr_setup_triplemonitor.sh
Created February 16, 2017 18:43
Triple monitor xrandr setup with 1 HiDPI and 2 LoDPI monitors
#!/bin/sh
xrandr --output HDMI-0 --mode 1920x1080 --scale 1.5x1.5 --panning 2880x1620+0+0 --output DP-4 --mode 3840x2160 --panning 3840x2160+2880+0 --scale 1x1 --output DVI-I-1 --mode 1920x1080 --scale 1.5x1.5 --panning 2880x1620+6720+0
@vo
vo / p13105.cpp
Last active January 16, 2017 15:43
Programming Practice: Alliances in Hogwarts
#include <iostream>
#include <vector>
class DisjointSet {
private:
std::vector<int> parent, rank;
public:
DisjointSet(int n) : parent(2 * n, -1), rank(2 * n, -1) {
@vo
vo / p10792.cpp
Created December 24, 2016 02:31
Programming Practice: The Laurel-Hardy Story
#include <iostream>
#include <cmath>
#include <iomanip>
double compute_h2(double r, double d, double h1) {
double t = -2.0 * std::acos((r - d) / r);
double x = std::sqrt(r * r - (r - h1) * (r - h1));
return ((h1 - r) * std::cos(t)) + (x * std::sin(t)) + r;
}
@vo
vo / trim-and-reencode.sh
Created September 30, 2016 18:41
examples of trimming and re-encoding video using ffmpeg on the command line
# examples for trimming without re-encoding
ffmpeg -ss 01:48:12 -i in.ogv -t 00:02:37 -c copy out.ogv
# examples for trimming a video
ffmpeg -ss 00:12:30 -i in.ogv -t 00:12:55 -filter:v "crop=1774:999:16:42" -c:v libx264 -preset slow out1.mp4
ffmpeg -ss 01:48:12 -i in.ogv -t 00:02:37 -filter:v "crop=1763:999:0:51" -c:v libx264 -preset slow out2.mp4
@vo
vo / supermajority.c
Created August 17, 2016 19:42
Programming Practice: Finding supermajority character in a string
#include <iostream>
char findSuperMajority(const std::string &str)
{
const size_t len(str.length());
int count(0);
char val(str[0]);
for (char c : str) {
if (count == 0) {
@vo
vo / 70-persistent-net.rules
Last active August 8, 2016 14:57
setup network namespaces for multiple solo mavlink
# Example UDEV rules to make the wlan devices look nicer
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="00:c0:ca:5a:5a:cb", NAME="wlan0"
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="00:c0:ca:84:a1:f7", NAME="wlan1"
@vo
vo / prog.sh
Last active July 5, 2016 02:53
Program WW-11 Boards
# THESE STEPS ARE FOR A FRESH BOARD
# If you are trying to reprogram a board, you need to remove the solder bridge on R7
# and use high voltage programming mode (HVSP) to reset the fuses
# See http://www.rickety.us/2010/03/arduino-avr-high-voltage-serial-programmer/
# for an example of how to make a DIY HVSP rig, or you can use
# a genuine AVR Dragon programmer to reset the fuses.
# set lower fuses
avrdude -c usbasp -p t85 -u -U lfuse:w:0xe2:m
/*------------------------------------------------------------------------------
* Open a serial port to the MAV with the given port name and baud rate.
* returns: the file descriptor, or < 0 if error.
*/
static int mav_serial_open(const char *port_name, uint32_t const baud_rate)
{
// attempt to open the port.
int fd = open(port_name, O_RDWR | O_NOCTTY | O_NDELAY);
if (fd < 0) {
fprintf(stderr, "ERROR: Could not open() serial port %s.\n", port_name);
ZDC WASHINGTON (ARTCC),DC.
!FDC 6/2069 ZDC PART 1 OF 8 SECURITY...SPECIAL SECURITY INSTRUCTIONS,
WASHINGTON, DC, EFFECTIVE 1602100501 UTC UNTIL FURTHER NOTICE.
SPECIAL SECURITY INSTRUCTIONS FOR UNMANNED AIRCRAFT OPERATIONS (UAS)
IN THE DC SPECIAL FLIGHT RULES AREA (SFRA), INCLUDING THE DC FLIGHT
RESTRICTED ZONE (FRZ), ARE IN EFFECT PURSUANT TO 14 CODE OF FEDERAL
REGULATIONS (CFR) SECTIONS 93.335, 93.337, 93.339, 93.341, AND 99.7,
AND 49 UNITED STATES CODE (USC) SECTION 40103(B)(3). THIS NOTAM