mirror of
https://github.com/AtsushiSakai/PythonRobotics.git
synced 2026-01-13 14:48:02 -05:00
Update motion_model.py
fix the problem of the unsafe type in the `scipy.interpolate`
This commit is contained in:
@@ -36,6 +36,11 @@ def generate_trajectory(s, km, kf, k0):
|
||||
|
||||
n = s / ds
|
||||
time = s / v # [s]
|
||||
|
||||
if isinstance(time, type(np.array([]))): time = time[0]
|
||||
if isinstance(km, type(np.array([]))): km = km[0]
|
||||
if isinstance(kf, type(np.array([]))): kf = kf[0]
|
||||
|
||||
tk = np.array([0.0, time / 2.0, time])
|
||||
kk = np.array([k0, km, kf])
|
||||
t = np.arange(0.0, time, time / n)
|
||||
@@ -62,6 +67,11 @@ def generate_last_state(s, km, kf, k0):
|
||||
|
||||
n = s / ds
|
||||
time = s / v # [s]
|
||||
|
||||
if isinstance(time, type(np.array([]))): time = time[0]
|
||||
if isinstance(km, type(np.array([]))): km = km[0]
|
||||
if isinstance(kf, type(np.array([]))): kf = kf[0]
|
||||
|
||||
tk = np.array([0.0, time / 2.0, time])
|
||||
kk = np.array([k0, km, kf])
|
||||
t = np.arange(0.0, time, time / n)
|
||||
|
||||
Reference in New Issue
Block a user