Vacuum Cleaner Loc

The provided matrix visualization example with numpy doesn’t display the result in the graphical interface, and to obtain the map, the path where the file is hosted is indicated. However, I’m not sure if we should access it in any specific way or use the HAL object as in other exercises. Regards.

Hi adrianCo, the numpy matrix display is now available with the new RADI 3.4.14. You can visualize a grayscale numpy array with this code:

import numpy as np
nav_mat = np.zeros((1024, 1024), int) # grey color
for i in range(512):
  for j in range(512):
    nav_mat[i][j] = 255
GUI.showNumpy(nav_mat)

We will soon publish a new RADI 3.4.15 which will include a method GUI.getMap() to obtain directly the map numpy array. I will notify here when the feature is released.

perfect, thank you .

Hi, in the new RADI 3.4.16, the matrix visualization was updated. It now supports grayscale and colors, explained in the forum. The map image array is now obtained using the function:

GUI.getMap('/RoboticsAcademy/exercises/static/exercises/vacuum_cleaner_loc_newmanager/resources/mapgrannyannie.png')

It returns a 3 dimensional array with the RGBA data of the image with values ranging from 0.0 to 1.0.