Gazebo | Ignition | Community
Ask Your Question
0

A start seach algorithm: issues with walls

asked 2019-07-02 02:42:14 -0500

VansFannel gravatar image

I'm using ROS melodic and Gazebo 9.9.0 on an Ubuntu 18.04.2 LTS bionic.

I'm implementing A* on a robotic simulator to find the path from start position to goal position.

I have a question about walls.

This is the image of an office that I want to use:

image description

I have used a OpenCV program to convert it to a matrix used as input map in the A* algorithm:

int grid[14][16] = {
{0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,1,1,1,1,0,1,1,0,1,1,1,1,0},
{0,1,1,1,1,0,1,1,0,1,1,1,1,0},
{0,1,1,1,1,1,1,1,0,1,1,1,1,0},
{0,1,1,1,1,1,1,1,0,1,1,1,1,0},
{0,1,1,1,1,0,1,1,1,1,1,1,1,0},
{0,1,1,1,1,0,1,1,1,1,1,1,1,0},
{0,1,1,1,1,0,1,1,0,0,0,0,0,0},
{0,1,1,1,1,0,1,1,0,1,1,1,1,0},
{0,0,0,0,0,0,1,1,0,1,1,1,1,0},
{0,1,1,1,1,1,1,1,0,1,1,1,1,0},
{0,1,1,1,1,1,1,1,0,1,1,1,1,0},
{0,1,1,1,1,0,1,1,1,1,1,1,1,0},
{0,1,1,1,1,0,1,1,1,1,1,1,1,0},
{0,1,1,1,1,0,1,1,0,1,1,1,1,0},
{0,1,1,1,1,0,1,1,0,1,1,1,1,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0}};

Ones are free space, and zeros are walls.

Walls take up one cell (i.e. zeros at {0,1,1,1,1,0,1,1,0,1,1,1,1,0},).

My problem is that walls take up one cell in the matrix, but in Gazebo, they don't. So, if I want to move the robot from the top left corner, when the robot is at a door, in Gazebo it will be at the corridor. It will be at the corridor because, in gazebo, walls don't take up space, but in the matrix they take up one cell.

Do you have any suggestion about how to avoid this problem? (Maybe creating walls that take up one cell space in Gazebo)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-07-02 08:24:43 -0500

kumpakri gravatar image

Model your walls using primitive geometries as models. Do not enter Building Editor.

image description

edit flag offensive delete link more

Comments

Great answer!! By the way, those squares at the floor, what are their size? 1x1 meters? Thanks a lot.

VansFannel gravatar imageVansFannel ( 2019-07-02 08:31:42 -0500 )edit
1

Yes, at least in my case they have always been 1x1 m. But you can check by placing a box that takes up exactly the one square and seeing the box width.

kumpakri gravatar imagekumpakri ( 2019-07-02 08:35:34 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2019-07-02 02:42:14 -0500

Seen: 100 times

Last updated: Jul 02 '19