Send automatically nav goal based on the map
Hello there,
I am trying to create a script that sends automatically nav goals around a wall (so 4 poses) and then go to the next one and so on until the are no more walls left (see the photo below). I am thinking of sub into the map topic and take the edges of the wall and then convert them to poses after publishing them to move base, but I don't know how exactly to implement this... any ideas??
Thank you in advance!
Asked by al_ca on 2021-07-14 07:26:27 UTC
Answers
If you know the poses apriory, why not just use a for loop to go through them? Compare your current pose and goal pose to know when you have reached your goal and update your iterator.
If you also want to avoid the wall, you could use some mapping stack (gmapping, rtabmap, etc.) to generate a costmap which can be passed on to the nav stack for avoidance.
Asked by Akhil Kurup on 2021-07-14 10:23:45 UTC
Comments
Firstly thank your for your time and effort and sorry for my poor explanation of the question, also could you please explain what do you mean here "If you know the poses apriory". So my problem is how to find these poses, were the only thing I have is the map topic.
I need something to always work regardless where the walls are. The algorithm I need is to detect the edges of the walls and convert them into x,y coordinates automatically wherever I put the walls.
In other words I have already generated the map from gmapping and I want to write a code that reads from the pgm file or from the map topic and detects these four poses that I have mentioned from all the walls that exist without me intervene in the code whenever the map changes.
Please feel free to ask for clarifications. :)
Asked by al_ca on 2021-07-14 10:58:30 UTC
Ahh! I see. So you want to route around targets by setting goal poses.
There are several ways to do this and I cant think of any packages that will have such a specific implementation. You could just use the lidar scans and perform some sort of range measurements and edges/corners detection to set a goal as close as possible to these artifacts.
Maybe you could also look at the costmap and look for gradients (where object edges finish and drive-able area starts).
You could also try doing the same to the pgm image and then transforming them into your robots frame.
A bigger question is why? What's your application? Why not just rely on the nav stack for planning around obstacles?
Asked by Akhil Kurup on 2021-07-14 11:28:09 UTC
Hmm, interesting... have you in mind of something where I can find applications or examples regarding edge & corner detection or with the gradient you mentioned?
Because I want a custom route based on the walls and I want the robot, in this case, to go around the walls and then move to the next. It's just a personal project that could apply to agriculture.
Asked by al_ca on 2021-07-14 13:42:06 UTC
Unfortunately, No. I haven't come across any such project
Asked by Akhil Kurup on 2021-07-14 17:09:17 UTC
It's okay I will find a way to do this. Thank you again for your help!
Asked by al_ca on 2021-07-16 02:29:04 UTC
Comments
I am a bit confused by your question. Are you trying to avoid the wall or just trying to send goals in a sequential manner? Also, what sensors are you working with?
Asked by Akhil Kurup on 2021-07-14 08:51:35 UTC
the second one, the sensors I am using are lidar,imu and Odometry
Asked by al_ca on 2021-07-14 09:19:47 UTC