Ask Your Question

global costmap is not centered

asked 2019-09-18 23:11:22 -0600

june2473 gravatar image

updated 2019-09-19 01:20:10 -0600

I am running the move_base node with dynamic global_cosmap.

here is global_costmap_params.yaml file:

image description

and costmap_common_params.yaml: image description

and this is how global costmap looks like in rviz: image description

you see, robot position starts in the corner, not in the center of global costmap

What can i do to make global costmap centered?

I have mapping node which is publishing the OccupancyGrid. I have a python script that is taking this OccupancyGrid and publishing it in map frame:

#!/usr/bin/env python  
import rospy
import tf_conversions

import tf2_ros
import tf2_msgs.msg
import geometry_msgs.msg
import sensor_msgs.msg
import nav_msgs.msg
from std_msgs.msg import String

def handle_map_frame(data):
  pub = rospy.Publisher("map", nav_msgs.msg.OccupancyGrid, queue_size=10)
  rate = rospy.Rate(10) # 10hz

  data.header.frame_id = "/map"


if __name__ == '__main__':
  rospy.Subscriber("/occupancy", nav_msgs.msg.OccupancyGrid, handle_map_frame)
  ##rospy.Subscriber('/sensor_us', sensor_msgs.msg.Range, handle_camera_pose)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-09-19 02:53:18 -0600

pavel92 gravatar image

updated 2019-09-19 02:54:37 -0600

You should set the parameter rolling_window to true in your global_costmap_params.yaml.

You can check out this answer for more information.

edit flag offensive delete link more


thanks a lot! it helped

june2473 gravatar image june2473  ( 2019-09-19 04:13:06 -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


Asked: 2019-09-18 23:11:22 -0600

Seen: 125 times

Last updated: Sep 19 '19