Skip to content

Commit dc49509

Browse files
Update rtime_gmapping_node.py
1 parent 66212d1 commit dc49509

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

scripts/rtime_gmapping_node.py

+16-16
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from utils import *
1717

1818
P_prior = 0.5 # Prior occupancy probability
19-
P_occ = 0.9 # Probability that cell is occupied with total confidence
19+
P_occ = 0.9 # Probability that cell is occupied with total confidence
2020
P_free = 0.3 # Probability that cell is free with total confidence
2121

2222
RESOLUTION = 0.03 # Grid resolution in [m]
@@ -49,9 +49,9 @@
4949

5050
# Create grid map
5151
gridMap = GridMap(X_lim = map_x_lim,
52-
Y_lim = map_y_lim,
53-
resolution = RESOLUTION,
54-
p = P_prior)
52+
Y_lim = map_y_lim,
53+
resolution = RESOLUTION,
54+
p = P_prior)
5555

5656
# Init time
5757
t_start = perf_counter()
@@ -114,11 +114,11 @@
114114
set_pixel_color(bgr_image, x, y, 'GREEN')
115115

116116
resized_image = cv2.resize(src = bgr_image,
117-
dsize = (500, 500),
118-
interpolation = cv2.INTER_AREA)
117+
dsize = (500, 500),
118+
interpolation = cv2.INTER_AREA)
119119

120120
rotated_image = cv2.rotate(src = resized_image,
121-
rotateCode = cv2.ROTATE_90_COUNTERCLOCKWISE)
121+
rotateCode = cv2.ROTATE_90_COUNTERCLOCKWISE)
122122

123123
cv2.imshow("Grid map", rotated_image)
124124
cv2.waitKey(1)
@@ -143,33 +143,33 @@
143143

144144
# Saving Grid Map
145145
resized_image = cv2.resize(src = gridMap.to_BGR_image(),
146-
dsize = (500, 500),
147-
interpolation = cv2.INTER_AREA)
146+
dsize = (500, 500),
147+
interpolation = cv2.INTER_AREA)
148148

149149
rotated_image = cv2.rotate(src = resized_image,
150-
rotateCode = cv2.ROTATE_90_COUNTERCLOCKWISE)
150+
rotateCode = cv2.ROTATE_90_COUNTERCLOCKWISE)
151151

152152
flag_1 = cv2.imwrite(img = rotated_image * 255.0,
153-
filename = MAPS_PATH + '/' + MAP_NAME + '_grid_map_TEST.png')
153+
filename = MAPS_PATH + '/' + MAP_NAME + '_grid_map_TEST.png')
154154

155155
# Calculating Maximum likelihood estimate of the map
156156
gridMap.calc_MLE()
157157

158158
# Saving MLE of the Grid Map
159159
resized_image_MLE = cv2.resize(src = gridMap.to_BGR_image(),
160-
dsize = (500, 500),
161-
interpolation = cv2.INTER_AREA)
160+
dsize = (500, 500),
161+
interpolation = cv2.INTER_AREA)
162162

163163
rotated_image_MLE = cv2.rotate(src = resized_image_MLE,
164-
rotateCode = cv2.ROTATE_90_COUNTERCLOCKWISE)
164+
rotateCode = cv2.ROTATE_90_COUNTERCLOCKWISE)
165165

166166
flag_2 = cv2.imwrite(img = rotated_image_MLE * 255.0,
167-
filename = MAPS_PATH + '/' + MAP_NAME + '_grid_map_TEST_mle.png')
167+
filename = MAPS_PATH + '/' + MAP_NAME + '_grid_map_TEST_mle.png')
168168

169169
if flag_1 and flag_2:
170170
print('\nGrid map successfully saved!\n')
171171

172172
if cv2.waitKey(0) == 27:
173173
cv2.destroyAllWindows()
174174

175-
pass
175+
pass

0 commit comments

Comments
 (0)