0
$\begingroup$

Rosanswers logo

I need to run AMCL and Movebase from two different maps as there are many locations in an outdoor map that the robot would get stuck in gravel, rocks, bushes, etc that are below the level of the laser scanner. AMCL needs to use the raw map from gmapping, but move_base should use a map that I have manually added exclusion zones to for path planning.

I've made some progress setting up two different map servers and remapping output of one to planner_map.

 <!-- Run the map server for AMCL map-->
  <node name="map_server" pkg="map_server" type="map_server" args="$(find my_robot_name_2dnav)/map.yaml"/>

  <!-- Run the map server for MOVE_BASE map -->
  <node name="planner_map_server" pkg="map_server" type="map_server" args="$(find my_robot_name_2dnav)/map_backyard.yaml">
    <remap from="map" to="planner_map"/>
  </node>

I changed Global Planner YAML file to watch new map for move_base (I think this is correct, please tell me if not)

global_costmap:
  global_frame: /planner_map
  robot_base_frame: base_link
  update_frequency: 3.0
  static_map: true

And now realize I need to have AMCL use one map for location but output the transform to the other map for use by move_base.

[ WARN] [1529387937.537219284]: Timed out waiting for transform from base_link to planner_map to become available before running costmap, tf error: canTransform: target_frame planner_map does not exist. canTransform: source_frame base_link does not exist.. canTransform returned after 0.100704 timeout was 0.1.

Wondering also if I need to double up on the ODOM base_link transforms to make this work.

I found this thread on an external site dealing with this topic but the conversation doesn't cover these points and it's 8 years old so unknown how relevant it is. http://ros-users.122217.n3.nabble.com/Different-maps-for-navigation-and-path-planning-td1426132.html

So I have four questions:

1 - How do I get AMCL to output transform to the planner_map in addition to the regular map?

2 - Will I have to duplicate ODOM to base_link transform with different name to get transform from AMCL?

3 - Is the modification in the global costmap yaml lfile the correct way to get move_base to use the secondary map?

4 - Is there an easier way to do this that you can point me to?

Thanks in advance for your help. Using ROS Kinetic, Ubuntu 14.04


Originally posted by billy on ROS Answers with karma: 1850 on 2018-06-19

Post score: 0

$\endgroup$

3 Answers 3

0
$\begingroup$

Rosanswers logo

  1. You don't have to. Also, how should this work? How would AMCL know, where the second map is located?
  2. You don't have to either. Duplicating transforms is always a bad idea.
  3. yes
  4. yes. Use a static_transform_publisher (wiki). This is a simple node that publishes a static transform (yay, the name speaks for itself), that should allow you to solve your problems. Just add it to your launch file like this: <node pkg="tf" type="static_transform_publisher" name="map_to_planner_map" args="0 0 0 0 0 0 1 map planner_map 100" />

(Just wondering: Kinetic on Ubuntu 14.04?)


Originally posted by mgruhler with karma: 12390 on 2018-06-19

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by billy on 2018-06-19:
Thanks Mig. Thanks for showing how to leverage the transform publisher. I will try it.

$\endgroup$
0
$\begingroup$

Rosanswers logo

The way I've typically done this in the past is to take the raw map, modify it in an image editor (without changing the size/etc). Then publish both maps (they are already aligned in space -- there is no transforms needed). Take a look at fetch_navigation and fetch_maps -- it does just this (the keepout map has been edited to draw boxes over things that would kill the robot, like desks): https://github.com/fetchrobotics/fetch_ros/tree/indigo-devel/fetch_navigation


Originally posted by fergs with karma: 13902 on 2018-06-19

This answer was NOT ACCEPTED on the original site

Post score: 2


Original comments

Comment by billy on 2018-06-19:
Thanks fergs. In the move_base launch you linked I see an argument input to move_base that is likely the key. I will try it out later when I get home.

$\endgroup$
0
$\begingroup$

Rosanswers logo

Fergs answer will definitely work, I've seen this done a number of times. Another option is to create a costmap layer that just adds these exclusionary zones. I find this to be cleaner.


Originally posted by stevemacenski with karma: 8272 on 2018-06-19

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by billy on 2018-06-19:
Yes, I found the costmap_prohibition_layer right after posting the question. But given the size of the map and the number of places I would need to add polygons for, it would be a lot of work. It seems like a good solution for simple maps with only a few danger zones.

Comment by stevemacenski on 2018-06-20:
I might propose building your own ;)

Comment by billy on 2018-06-20:
No offense intended - especially if your name is Stephan

Comment by stevemacenski on 2018-06-20:
It is not, no offense taken.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.