ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Library or tools to operate on map matrix (occupancy grid)

asked 2022-06-22 02:01:25 -0600

electrophod gravatar image

updated 2022-06-22 02:02:15 -0600

Hi

I want to perform some operations on map (in the form of a 2D occupancy grid) -> like checking the number of cells covered by the field of view of camera, etc. Right now I am dealing with the map as a numpy matrix and then performing operations on it.

The problem I am facing is that it's quite slow as the map matrix is quite big in my case (3000 x 4000) and even the camera field of view covers quite a lot of number of cells.

I tried using PyTorch tensors instead of numpy arrays and got some increase in speed.

Can anyone suggest me any other (if any) tool or library for my work?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-06-22 03:50:58 -0600

ljaniec gravatar image

You can try to use these packages:

Especially last one, in C++, could be faster than your custom code

This is a C++ library with ROS interface to manage two-dimensional grid maps with multiple data layers

In general, you can try to speed up of your code if you reduce the scale of the map array to at most a few hundreds pixels in width and height - usually these types of hacks allow you to accelerate the code execution significantly

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-06-22 02:01:25 -0600

Seen: 548 times

Last updated: Jun 22 '22