Skip to content

Instantly share code, notes, and snippets.

View dagar's full-sized avatar

Daniel Agar dagar

View GitHub Profile
@dagar
dagar / linux_sdcard_test_and_format.sh
Last active November 23, 2021 10:41
linux_sdcard_test_and_format.sh
#! /bin/bash
# assumes /dev/sdb is sd card
# make sure it's not mounted
sudo udisksctl unmount --block-device /dev/sdb
sudo time badblocks -svw -t random /dev/sdb
sudo time f3probe --destructive --time-ops /dev/sdb
sudo parted --script /dev/sdb mklabel msdos
@dagar
dagar / mavlink_common.lua
Created December 14, 2018 15:10
Wireshark mavlink plugin
@dagar
dagar / gist:b248fab4597c0e55d623ebefb250b7c8
Created December 28, 2017 15:05
PX4 Firmware build using docker_run.sh
dagar@dagar-desktop ~/git/Firmware
% ./Tools/docker_run.sh 'make posix_sitl_default'
guessing PX4_DOCKER_REPO based on input
PX4_DOCKER_REPO: px4io/px4-dev-nuttx:2017-10-23
Starting with UID : 1000
-- Build Type: RelWithDebInfo
-- PX4 VERSION: v1.7.2-17-g370da89
-- CONFIG: posix_sitl_default
-- Build Type: RelWithDebInfo
-- The CXX compiler identification is GNU 5.4.0
---
Language: Cpp
# BasedOnStyle: Google
AccessModifierOffset: -1
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: true
#! /usr/bin/env python
"""
This is a simple helper for running pixhawk onboard unit tests.
The script returns 0 if the tests successfully pass, or -1 otherwise.
"""
from __future__ import print_function
>>> Executing mission
>>> Takeoff to 10.0 meters above home
Waiting for vehicle to arm...
INFO [commander] home: 47.3977421, 8.5455937, 488.01
INFO [tone_alarm] positive
INFO [commander] home: 47.3977421, 8.5455937, 488.01
INFO [tone_alarm] arming
>>> ARMED by arm/disarm component command
INFO [commander] Takeoff detected
>>> Takeoff detected
#! /usr/bin/env python
"""
This is a simple helper for running pixhawk onboard unit tests.
The script returns 0 if the tests successfully pass, or -1 otherwise.
"""
from __future__ import print_function
[ROSTEST]-----------------------------------------------------------------------
[px4.rosunit-mission_test_new_1/test_mission][FAILURE]--------------------------
(vtol_new_1.txt) took too long to get to position lat: 47.397732, lon: 8.543269, alt: 500.126000, xy off: 5.000000, z off: 5.000000, timeout: 600, index: 0, pos_d: 174.935106, alt_d: 12.026000
File "/usr/lib/python2.7/unittest/case.py", line 331, in run
testMethod()
File "/job/catkin/src/px4/integrationtests/python_src/px4_it/mavros/mission_test.py", line 275, in test_mission
self.reach_position(waypoint.x_lat, waypoint.y_long, alt, 600, index)
File "/job/catkin/src/px4/integrationtests/python_src/px4_it/mavros/mission_test.py", line 174, in reach_position
(self.mission_name, lat, lon, alt, xy_radius, z_radius, timeout, index, self.last_pos_d, self.last_alt_d)))
@dagar
dagar / latency.markdown
Created October 9, 2016 01:48 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

QML debugging is enabled. Only use this in a safe environment.
QML debugging is enabled. Only use this in a safe environment.
Settings location "/home/dagar/.config/QGroundControl.org/QGroundControl.ini" Is writable?: true
Settings location "/home/dagar/.config/QGroundControl.org/QGroundControl.ini" Is writable?: true
Filter rules "qt.network.ssl.warning=false\n*Log.debug=false\nRadioComponentControllerLog.debug=true\n"
Filter rules "qt.network.ssl.warning=false\n*Log.debug=false\nRadioComponentControllerLog.debug=true\n"
Map Cache in: "/home/dagar/.cache/QGCMapCache100" / "qgcMapCache.db"
Map Cache in: "/home/dagar/.cache/QGCMapCache100" / "qgcMapCache.db"
VideoReceiver::start() failed. Error with gst_element_factory_make('h264parse')
VideoReceiver::start() failed. Error with gst_element_factory_make('h264parse')