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
#include <CoDrone.h> | |
int init_yaw; | |
int cmd_yaw; | |
int err_yaw; | |
void setup() | |
{ | |
CoDrone.begin(115200); | |
CoDrone.AutoConnect(NearbyDrone); |
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
c the orignal coming from: http://www.ngdc.noaa.gov/IAGA/vmod/igrf.html, and modified by jongrae | |
c | |
subroutine igrf12syn (isv,date,itype,alt,colat,elong,x,y,z,f) | |
c | |
c This is a synthesis routine for the 12th generation IGRF as agreed | |
c in December 2014 by IAGA Working Group V-MOD. It is valid 1900.0 to | |
c 2020.0 inclusive. Values for dates from 1945.0 to 2010.0 inclusive are | |
c definitive, otherwise they are non-definitive. | |
c INPUT | |
c isv = 0 if main-field values are required |
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 | |
import matplotlib.pyplot as plt | |
from skimage.segmentation import boundaries | |
from scipy import ndimage | |
num_image = 4 | |
fig = plt.figure(1) |
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
from mpl_toolkits.mplot3d import axes3d | |
import matplotlib.pyplot as plt | |
import numpy as np | |
from scipy.integrate import odeint | |
def DCM_ode(state, t): | |
w1 = 0.1*np.sin(2*t) | |
w2 = 0.01*np.cos(0.2*t) | |
w3 = -0.1*np.sin(0.1*t+0.5) |
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 scipy as sp | |
from scipy.integrate import odeint | |
import matplotlib.pyplot as plt | |
# 마분방정식이 적분기 부르기 전에 정의되어야 합니다. | |
def RLC_eqn(x, t): | |
R, L, C = [1, 1, 1] | |
u = 1 | |
x1, x2 = x |
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 | |
import scipy as sp | |
import matplotlib.pyplot as plt | |
# number of samples | |
num_sample = 2000; | |
# map size | |
map_width = 10; | |
map_height = 5; |
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 scipy as sp | |
num_node = 1000 | |
num_path = max([int(num_node*num_node/4), 1]) | |
row = sp.unique(sp.random.randint(0,num_node,num_path)); | |
col = sp.random.randint(0,num_node,row.size); | |
mask = row!=col | |
row = row[mask] | |
col = col[mask] |
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
# define distance matrix | |
import scipy as sp | |
A = sp.array([[0,2,0,5,0,0], | |
[2,0,1,3,4,0], | |
[0,1,0,4,0,0], | |
[5,3,4,0,2,4], | |
[0,4,0,2,0,1], | |
[0,0,0,4,1,0]]) |
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
def cost_function(x): | |
k_spring, c_damper = x | |
# import functions | |
from numpy import linspace, max, abs | |
from scipy.integrate import odeint | |
import msd_ode | |
# define constants |
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
def mass_spring_damper(state, t, k_c_set): | |
x, x_dot = state | |
k_spring, c_damper = k_c_set | |
f = [x_dot, | |
-k_spring*x - c_damper*x_dot] | |
return f |
NewerOlder