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

Revision history [back]

click to hide/show revision 1
initial version

Here is the error:

currentPoint = map.data[grid_x * grid_y];

I suppose currentPoint should be calculated as follows:

currentPoint = map.data[grid_x * `mapWidth` + grid_y];

or

currentPoint = map.data[grid_y * `mapWidth` + grid_x];

depending on your orientation.

Here is the error:

currentPoint = map.data[grid_x * grid_y];

I suppose currentPoint should be calculated as follows:

currentPoint = map.data[grid_x * `mapWidth` mapWidth + grid_y];

or

currentPoint = map.data[grid_y * `mapWidth` mapWidth + grid_x];

depending on your orientation.

Here is the error:

currentPoint = map.data[grid_x * grid_y];

I suppose believe currentPoint should be calculated as follows:

currentPoint = map.data[grid_x * mapWidth + grid_y];

or

currentPoint = map.data[grid_y * mapWidth + grid_x];

depending on your orientation.orientation. mapWidth:

mapWidth = map.info.width;

Here is the error:

currentPoint = map.data[grid_x * grid_y];

I believe currentPoint should be calculated as follows:

currentPoint = map.data[grid_x * mapWidth + grid_y];

or

currentPoint = map.data[grid_y * mapWidth + grid_x];

depending on your orientation. By the way, you can get mapWidth: as follows:

mapWidth = map.info.width;