This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from scipy.signal import filtfilt, butter | |
from quaternion import quaternion, from_rotation_vector, rotate_vectors | |
def estimate_orientation(a, w, t, alpha=0.9, g_ref=(0., 0., 1.), | |
theta_min=1e-6, highpass=.01, lowpass=.05): | |
""" Estimate orientation with a complementary filter. | |
Fuse linear acceleration and angular velocity measurements to obtain an |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Change these variables to suit your setup | |
var username = "admin"; | |
var password = "password"; | |
var ipAddress = "192.168.0.100"; | |
// Call this function from your button press like this: | |
// sendToIPSymcon("SetValue", [12345, 42]); | |
// sendToIPSymcon("SetValue", [12346, false]); | |
function sendToIPSymcon(method, params) { | |
CF.request("http://" + username + ":" + password + "@" + ipAddress + ":3777/api/", "POST", {"Content-Type": "application/json"}, {"jsonrpc": "2.0", "id": "0", "method": method, "params": params}, function (status, headers, body) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -e | |
hostname=$1 | |
device=$2 | |
file=$HOME/.dynv6.addr6 | |
[ -e $file ] && old=`cat $file` | |
if [ -z "$hostname" -o -z "$token" ]; then | |
echo "Usage: token=<your-authentication-token> [netmask=64] $0 your-name.dynv6.net [device]" | |
exit 1 | |
fi |