mirror of
https://github.com/AtsushiSakai/PythonRobotics.git
synced 2026-04-22 03:00:22 -04:00
replace math.radians to np.deg2rad
This commit is contained in:
@@ -12,11 +12,11 @@ import matplotlib.pyplot as plt
|
||||
|
||||
|
||||
# EKF state covariance
|
||||
Cx = np.diag([0.5, 0.5, math.radians(30.0)])**2
|
||||
Cx = np.diag([0.5, 0.5, np.deg2rad(30.0)])**2
|
||||
|
||||
# Simulation parameter
|
||||
Qsim = np.diag([0.2, math.radians(1.0)])**2
|
||||
Rsim = np.diag([1.0, math.radians(10.0)])**2
|
||||
Qsim = np.diag([0.2, np.deg2rad(1.0)])**2
|
||||
Rsim = np.diag([1.0, np.deg2rad(10.0)])**2
|
||||
|
||||
DT = 0.1 # time tick [s]
|
||||
SIM_TIME = 50.0 # simulation time [s]
|
||||
@@ -203,7 +203,7 @@ def jacobH(q, delta, x, i):
|
||||
|
||||
|
||||
def pi_2_pi(angle):
|
||||
return (angle + math.pi) % (2*math.pi) - math.pi
|
||||
return (angle + math.pi) % (2 * math.pi) - math.pi
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
@@ -12,12 +12,12 @@ import matplotlib.pyplot as plt
|
||||
|
||||
|
||||
# Fast SLAM covariance
|
||||
Q = np.diag([3.0, math.radians(10.0)])**2
|
||||
R = np.diag([1.0, math.radians(20.0)])**2
|
||||
Q = np.diag([3.0, np.deg2rad(10.0)])**2
|
||||
R = np.diag([1.0, np.deg2rad(20.0)])**2
|
||||
|
||||
# Simulation parameter
|
||||
Qsim = np.diag([0.3, math.radians(2.0)])**2
|
||||
Rsim = np.diag([0.5, math.radians(10.0)])**2
|
||||
Qsim = np.diag([0.3, np.deg2rad(2.0)])**2
|
||||
Rsim = np.diag([0.5, np.deg2rad(10.0)])**2
|
||||
OFFSET_YAWRATE_NOISE = 0.01
|
||||
|
||||
DT = 0.1 # time tick [s]
|
||||
@@ -325,7 +325,7 @@ def motion_model(x, u):
|
||||
|
||||
|
||||
def pi_2_pi(angle):
|
||||
return (angle + math.pi) % (2*math.pi) - math.pi
|
||||
return (angle + math.pi) % (2 * math.pi) - math.pi
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
@@ -12,12 +12,12 @@ import matplotlib.pyplot as plt
|
||||
|
||||
|
||||
# Fast SLAM covariance
|
||||
Q = np.diag([3.0, math.radians(10.0)])**2
|
||||
R = np.diag([1.0, math.radians(20.0)])**2
|
||||
Q = np.diag([3.0, np.deg2rad(10.0)])**2
|
||||
R = np.diag([1.0, np.deg2rad(20.0)])**2
|
||||
|
||||
# Simulation parameter
|
||||
Qsim = np.diag([0.3, math.radians(2.0)])**2
|
||||
Rsim = np.diag([0.5, math.radians(10.0)])**2
|
||||
Qsim = np.diag([0.3, np.deg2rad(2.0)])**2
|
||||
Rsim = np.diag([0.5, np.deg2rad(10.0)])**2
|
||||
OFFSET_YAWRATE_NOISE = 0.01
|
||||
|
||||
DT = 0.1 # time tick [s]
|
||||
@@ -354,7 +354,7 @@ def motion_model(x, u):
|
||||
|
||||
|
||||
def pi_2_pi(angle):
|
||||
return (angle + math.pi) % (2*math.pi) - math.pi
|
||||
return (angle + math.pi) % (2 * math.pi) - math.pi
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
@@ -18,8 +18,8 @@ import matplotlib.pyplot as plt
|
||||
|
||||
|
||||
# Simulation parameter
|
||||
Qsim = np.diag([0.2, math.radians(1.0)])**2
|
||||
Rsim = np.diag([0.1, math.radians(10.0)])**2
|
||||
Qsim = np.diag([0.2, np.deg2rad(1.0)])**2
|
||||
Rsim = np.diag([0.1, np.deg2rad(10.0)])**2
|
||||
|
||||
DT = 2.0 # time tick [s]
|
||||
SIM_TIME = 100.0 # simulation time [s]
|
||||
@@ -29,7 +29,7 @@ STATE_SIZE = 3 # State size [x,y,yaw]
|
||||
# Covariance parameter of Graph Based SLAM
|
||||
C_SIGMA1 = 0.1
|
||||
C_SIGMA2 = 0.1
|
||||
C_SIGMA3 = math.radians(1.0)
|
||||
C_SIGMA3 = np.deg2rad(1.0)
|
||||
|
||||
MAX_ITR = 20 # Maximum iteration
|
||||
|
||||
@@ -253,7 +253,7 @@ def motion_model(x, u):
|
||||
|
||||
|
||||
def pi_2_pi(angle):
|
||||
return (angle + math.pi) % (2*math.pi) - math.pi
|
||||
return (angle + math.pi) % (2 * math.pi) - math.pi
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
@@ -138,7 +138,7 @@ def main():
|
||||
# simulation parameters
|
||||
nPoint = 10
|
||||
fieldLength = 50.0
|
||||
motion = [0.5, 2.0, math.radians(-10.0)] # movement [x[m],y[m],yaw[deg]]
|
||||
motion = [0.5, 2.0, np.deg2rad(-10.0)] # movement [x[m],y[m],yaw[deg]]
|
||||
|
||||
nsim = 3 # number of simulation
|
||||
|
||||
|
||||
Reference in New Issue
Block a user