This file contains hidden or 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
""" | |
Example of how to set target speed in guided mode with pymavlink | |
""" | |
import time | |
import math | |
# Import mavutil | |
from pymavlink import mavutil | |
# Imports for attitude | |
from pymavlink.quaternion import QuaternionBase |
This file contains hidden or 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 mavutil | |
from pymavlink import mavutil | |
from pymavlink.quaternion import QuaternionBase | |
import math | |
import time | |
import sys | |
ALT_HOLD_MODE = 2 | |
def is_armed(): | |
try: |
This file contains hidden or 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
#!/usr/bin/env python | |
# Script to set target depth in Ardusub 3.6 beta | |
# requires this commit: https://github.com/williangalvani/ardupilot/commit/85a41d5771ba9d64e594dcc0856b6a3906767c3f | |
from pymavlink import mavutil | |
# There is very likely a builtin in pymavlink for this, but I didn't find it | |
ALT_HOLD_MODE = 2 |
This file contains hidden or 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
% MATLAB Script for Simulating PFC Controller from Example 4.4 | |
% Clear workspace and command window | |
clear; | |
close all; | |
clc; | |
% Sampling time | |
Ts = 3; % seconds |
This file contains hidden or 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
#!/usr/bin/env python3 | |
import cv2 | |
import gi | |
import numpy as np | |
import json | |
gi.require_version('Gst', '1.0') | |
from gi.repository import Gst | |
class Video(): |
This file contains hidden or 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
% MATLAB Code for Offset-Free MPC Control of Heated Swimming Pool System | |
% Clear workspace and command window | |
clear; close all; clc; | |
% System Parameters | |
A = 0.7788; | |
B = 0.0442; | |
C = 1; % Output matrix |
This file contains hidden or 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
% MATLAB Code for Offset-Free MPC Control of Heated Swimming Pool System | |
% Clear workspace and command window | |
clear; close all; clc; | |
% System Parameters | |
A = 0.7788; | |
B = 0.0442; | |
C = 1; % Output matrix |
This file contains hidden or 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
#!/usr/bin/env python3 | |
''' Mavlink telemetry (.tlog) file parser. | |
Operates as a generator. Allows csv output or listing useful types/fields. | |
''' | |
import json | |
from pathlib import Path | |
from fnmatch import fnmatch | |
from pymavlink import mavutil |
This file contains hidden or 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
I, i_X_p = rig_dyn.model() | |
Ic_i = [] | |
for i in range(0, ss.n_joints): | |
Ic_i.append(I[i]) | |
for i in range(ss.n_joints-1, -1, -1): | |
if i != 0: | |
p_X_i_f = pluck.inverse_spatial_transform(i_X_p[i]).T | |
Ic_i[i-1] = Ic_i[i-1] + p_X_i_f@Ic_i[i]@i_X_p[i] |
This file contains hidden or 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 | |
import matplotlib.pyplot as plt | |
class BayesianParameterEstimator: | |
def __init__(self, param_min=0.0, param_max=5.0, num_points=500, known_variance=1.0): | |
""" | |
Initialize the Bayesian estimator. | |
:param param_min: Minimum value of the parameter space | |
:param param_max: Maximum value of the parameter space |