Ask Your Question
0

Navigation - how to use my own Local and Global costmaps?

asked 2018-08-09 03:13:15 -0600

Myzhar gravatar image

Hi, I have my own node that provides Global Map and Local Map as nav_msgs::OccupancyGrid messages. I would like to use them in the navigation stack and I cannot figure out how to do it.

Have someone done this kind of operation?

Thank you Walter

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2018-08-13 09:07:42 -0600

David Lu gravatar image

Generally speaking, you can just subscribe to the OccupancyGrid messages as a "static" layer

edit flag offensive delete link more

Comments

The maps are updated constantly (SLAM), I cannot use a static layer. The Global map normally is updated at 1 Hz, the local map at 5 Hz

Myzhar gravatar imageMyzhar ( 2018-08-13 12:27:16 -0600 )edit

"static" is a bit of a misnomer. It will subscribe to the topic as long as you publish on it. Whether that's going to be efficient is another matter.

David Lu gravatar imageDavid Lu ( 2018-08-13 14:35:12 -0600 )edit

Ok, I saw the code and I understood how it works. Thank you you have been of great help

Myzhar gravatar imageMyzhar ( 2018-08-13 15:08:58 -0600 )edit

David, I have a last question for you. Can you explain me the meaning of the message "_updates"? I have my idea about it, but I want to understand if I need to publish "myMap" and "myMap_updates" too...

Myzhar gravatar imageMyzhar ( 2018-08-14 02:09:13 -0600 )edit

You don't have to publish both, but publishing updates can be more efficient. If you have a 1000x1000 global map and change one pixel, you can either send the entire 1000x1000 map again or you can just send the update.

David Lu gravatar imageDavid Lu ( 2018-08-14 07:46:09 -0600 )edit

Good, this is really important for me since I have this information. The documentation of "map_msgs" is really poor.

Myzhar gravatar imageMyzhar ( 2018-08-14 07:55:24 -0600 )edit
0

answered 2018-08-16 07:50:34 -0600

Myzhar gravatar image

I'm trying to use this configuration file to add two static layers:

global_costmap:
    global_frame:           /map
    robot_base_frame:       /base_link
    update_frequency:       1.0
    publish_frequency:      0.5
    static_map:             true
    transform_tolerance:    0.5
    plugins:
        - {name: height_layer,            type: "costmap_2d::StaticLayer"}
        - {name: traversability_layer,    type: "costmap_2d::StaticLayer"}

height_layer:
    enabled:                true
    map_topic:              /zed/map/glob_map_costmap
    first_map_only:         false
    unknown_cost_value:     -1
    lethal_cost_threshold:  100
    subscribe_to_updates:   false
    track_unknown_space:    true
    use_maximum:            false     
    trinary_costmap:        false       

traversability_layer:
    enabled:                true
    map_topic:              /zed/map/glob_map_heightmap
    first_map_only:         false
    unknown_cost_value:     -1
    lethal_cost_threshold:  100
    subscribe_to_updates:   false
    track_unknown_space:    true
    use_maximum:            false     
    trinary_costmap:        false

Is this file correct?

edit flag offensive delete link more

Comments

Please post this as a new question. If appropriate, refer to this one.

gvdhoorn gravatar imagegvdhoorn ( 2018-08-16 15:48:59 -0600 )edit

I faced the problem. It was a "tabbing" issue. The parameters of the "height_layer" and "traversability_layer" need a tab on the left to be under "global_costmap"

Myzhar gravatar imageMyzhar ( 2018-08-17 02:16:51 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-08-09 03:13:15 -0600

Seen: 223 times

Last updated: Aug 16 '18