class which implements the occupancy grid More...
Public Member Functions | |
def | __init__ |
def | argmax_z |
def | fill_grid |
fill the occupancy grid. | |
def | find_objects |
def | find_objects_2d |
def | find_plane_indices |
def | grid_lines |
returns list of 8 tuples of 3x1 points which form the edges of the grid. | |
def | grid_to_centroids |
get centroids of all the occupied cells as a 3xN np matrix | |
def | grid_to_points |
def | labeled_array_to_points |
def | remove_horizontal_plane |
def | remove_vertical_plane |
def | segment_objects |
def | to_binary |
Public Attributes | |
brf | |
grid | |
grid_points_list | |
grid_shape | |
resolution | |
rotation_z | |
tlb |
class which implements the occupancy grid
Definition at line 93 of file occupancy_grid_3d.py.
def hrl_tilting_hokuyo.occupancy_grid_3d.occupancy_grid_3d.__init__ | ( | self, | |
brf, | |||
tlb, | |||
resolution, | |||
rotation_z = math.radians(0.) |
|||
) |
brf | - 3x1 matrix. Bottom Right Front. |
tlb | - 3x1 matrix (coord of center of the top left back cell) |
resolution | - 3x1 matrix. size of each cell (in meters) along the different directions. |
Definition at line 100 of file occupancy_grid_3d.py.
def hrl_tilting_hokuyo.occupancy_grid_3d.occupancy_grid_3d.argmax_z | ( | self, | |
index_min = -np.Inf , |
|||
index_max = np.Inf , |
|||
search_up = False , |
|||
search_down = False |
|||
) |
searches in the z direction for maximum number of cells with occupancy==1 call this function after calling to_binary() returns index.
Definition at line 187 of file occupancy_grid_3d.py.
def hrl_tilting_hokuyo.occupancy_grid_3d.occupancy_grid_3d.fill_grid | ( | self, | |
pts, | |||
ignore_z = False |
|||
) |
fill the occupancy grid.
pts | - 3xN matrix of points. |
ignore_z | - not use the z coord of the points. grid will be like a 2D grid. |
each cell of the grid gets filled the number of points that fall in the cell.
Definition at line 147 of file occupancy_grid_3d.py.
region growing kind of thing for segmentation. Useful if plane has been removed.
Definition at line 490 of file occupancy_grid_3d.py.
projects all points into the xy plane and then performs segmentation by region growing.
Definition at line 440 of file occupancy_grid_3d.py.
def hrl_tilting_hokuyo.occupancy_grid_3d.occupancy_grid_3d.find_plane_indices | ( | self, | |
hmin = -np.Inf , |
|||
hmax = np.Inf , |
|||
assume_plane = False |
|||
) |
assume_plane - always return something. returns list of indices (z) corrresponding to horizontal plane points. returns [] if there is no plane
Definition at line 232 of file occupancy_grid_3d.py.
def hrl_tilting_hokuyo.occupancy_grid_3d.occupancy_grid_3d.grid_lines | ( | self, | |
rotation_angle = 0. |
|||
) |
returns list of 8 tuples of 3x1 points which form the edges of the grid.
Useful for displaying the extents of the volume of interest (VOI).
Definition at line 116 of file occupancy_grid_3d.py.
def hrl_tilting_hokuyo.occupancy_grid_3d.occupancy_grid_3d.grid_to_centroids | ( | self, | |
occupancy_threshold = 1 |
|||
) |
get centroids of all the occupied cells as a 3xN np matrix
occupancy_threshold | - number of points in a cell for it to be "occupied" |
Definition at line 283 of file occupancy_grid_3d.py.
def hrl_tilting_hokuyo.occupancy_grid_3d.occupancy_grid_3d.grid_to_points | ( | self, | |
array = None , |
|||
occupancy_threshold = 1 |
|||
) |
array - if not None then this will be used instead of self.grid returns 3xN matrix of 3d coord of the cells which have occupancy >= occupancy_threshold
Definition at line 292 of file occupancy_grid_3d.py.
def hrl_tilting_hokuyo.occupancy_grid_3d.occupancy_grid_3d.labeled_array_to_points | ( | self, | |
array, | |||
label | |||
) |
returns coordinates of centers of grid cells corresponding to label as a 3xN matrix.
Definition at line 314 of file occupancy_grid_3d.py.
def hrl_tilting_hokuyo.occupancy_grid_3d.occupancy_grid_3d.remove_horizontal_plane | ( | self, | |
remove_below = True , |
|||
hmin = -np.Inf , |
|||
hmax = np.Inf , |
|||
extra_layers = 0 |
|||
) |
call after to_binary() removes points corresponding to the horizontal plane from the grid. remove_below - remove points below the plane also. hmin,hmax - min and max possible height of the plane. (meters) This function changes grid. extra_layers - number of layers above the plane to remove. Sometimes I want to be over zealous while removing plane points. e.g. max_fwd_without_collision it returns the slice which has been set to zero, in case you want to leave the grid unchanged.
Definition at line 370 of file occupancy_grid_3d.py.
removes plane parallel to the YZ plane. changes grid. returns plane_indices, slice corresponding to the vertical plane. points behind the plane are lost for ever!
Definition at line 332 of file occupancy_grid_3d.py.
def hrl_tilting_hokuyo.occupancy_grid_3d.occupancy_grid_3d.segment_objects | ( | self, | |
twod = False |
|||
) |
segments out objects after removing the plane. call after calling to_binary. returns labelled_array,n_labels labelled_array - same dimen as occupancy grid, each object has a different label.
Definition at line 422 of file occupancy_grid_3d.py.
def hrl_tilting_hokuyo.occupancy_grid_3d.occupancy_grid_3d.to_binary | ( | self, | |
thresh = 1 |
|||
) |
all cells with occupancy>=thresh set to 1, others set to 0.
Definition at line 180 of file occupancy_grid_3d.py.
Definition at line 100 of file occupancy_grid_3d.py.
Definition at line 100 of file occupancy_grid_3d.py.
Definition at line 100 of file occupancy_grid_3d.py.
Definition at line 100 of file occupancy_grid_3d.py.
Definition at line 100 of file occupancy_grid_3d.py.
Definition at line 100 of file occupancy_grid_3d.py.
Definition at line 100 of file occupancy_grid_3d.py.