upgrade numpy to 1.25.0 and fix bugs (#861)

This commit is contained in:
Atsushi Sakai
2023-07-01 15:30:32 +09:00
committed by GitHub
parent 67edaf8b02
commit 4d71470631
18 changed files with 66 additions and 58 deletions

View File

@@ -15,6 +15,7 @@ import copy
import math
import matplotlib.pyplot as plt
import matplotlib as mpl
import numpy as np
from scipy.ndimage import gaussian_filter
from scipy.stats import norm
@@ -114,7 +115,7 @@ def motion_model(x, u):
def draw_heat_map(data, mx, my):
max_value = max([max(i_data) for i_data in data])
plt.grid(False)
plt.pcolor(mx, my, data, vmax=max_value, cmap=plt.cm.get_cmap("Blues"))
plt.pcolor(mx, my, data, vmax=max_value, cmap=mpl.colormaps["Blues"])
plt.axis("equal")
@@ -194,7 +195,7 @@ def motion_update(grid_map, u, yaw):
y_shift = grid_map.dy // grid_map.xy_resolution
if abs(x_shift) >= 1.0 or abs(y_shift) >= 1.0: # map should be shifted
grid_map = map_shift(grid_map, int(x_shift), int(y_shift))
grid_map = map_shift(grid_map, int(x_shift[0]), int(y_shift[0]))
grid_map.dx -= x_shift * grid_map.xy_resolution
grid_map.dy -= y_shift * grid_map.xy_resolution

View File

@@ -69,8 +69,8 @@ def motion_model(x, u):
[0, 0, 1.0, 0],
[0, 0, 0, 0]])
B = np.array([[DT * math.cos(x[2]), 0],
[DT * math.sin(x[2]), 0],
B = np.array([[DT * math.cos(x[2, 0]), 0],
[DT * math.sin(x[2, 0]), 0],
[0.0, DT],
[1.0, 0.0]])