ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

No Map Received in Rviz while trying out gmapping. [closed]

asked 2022-03-20 20:29:10 -0600

mgrallos gravatar image

Hi! Newbie here. I was trying to run gmapping on our own model but I can't seem to solve this problem in rviz, it says no map received. My global fixed frame is odom and map is subscribed to /map topic. I am trying to generate a map. I am using Ubuntu 20.04 and ROS noetic for this. My tf frames are

world->base_footprint->based_stabelized->base_link->laser

map->odom

Can someone help me with this one? Is there any way I can modify the tf frames?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by mgrallos
close date 2022-05-04 00:10:37.571972

2 Answers

Sort by ยป oldest newest most voted
2

answered 2022-03-21 11:21:19 -0600

nigeno gravatar image

First, you need to make sure that you have /map published.

To check it, run:

rostopic list

see that you have /map in the list.

To check /map message published, run:

rostopic echo /map

Next, if you have the /map published but you don't see it in Rviz, then you should have a problem in Rviz setup. If you found that /map is not published, check your gmapping, it might be that you don't have proper /tf or other reasons.

edit flag offensive delete link more

Comments

Hi, thanks. I have map in my rostopic list. According to my research, I need to modify TF tree but I really have no idea how to do. I only knew how to set odom_fram and base_frame and it create a separate TF tree

mgrallos gravatar image mgrallos  ( 2022-03-21 14:28:00 -0600 )edit

it's not clear why you would need the transforms if you have /map topic. But anyways..

What's your relation between base_link and odom frames?

The reason why I'm asking is you need to provide two transformations to gmapping to work: base_link -> laser; odom -> base_link

If you have them plus /laser topic then gmapping will give you map -> odom transformation plus /map.

The other transforms shouldn't be required for gmapping to work.

To test it out use the following static transforms:

rosrun tf2_ros static_transform_publisher 0 0 0 0 0 0 odom base_link

rosrun tf2_ros static_transform_publisher 0 0 0 0 0 0 base_link laser

If this works, then you know which transforms you need and you can provide dynamic ones.

nigeno gravatar image nigeno  ( 2022-03-21 15:34:20 -0600 )edit

Hi thank you for this.

mgrallos gravatar image mgrallos  ( 2022-05-04 00:08:40 -0600 )edit
1

answered 2022-03-21 07:53:19 -0600

charithreddy101 gravatar image

Hey, Your tf should be map->odom->base_footprint->.... Also, your global fixed frame will be map.

edit flag offensive delete link more

Comments

Hi I figure that I need to change the tf tree as well. How do I exactly do that?

mgrallos gravatar image mgrallos  ( 2022-03-21 14:24:02 -0600 )edit

Please give more information regarding your problem while asking the question so that people can give you an exact solution. Include if you are working on a simulated model by using any gazebo plugins, controllers or making a real robot.

Coming to the tf, if you are using the gazebo plugins or calculation odom data using math, you must have declared your odom frame and base_footprint in the plugin itself. It will directly create a transform between /odom and /base_footprint

Else, you can also create a static transform as @nigeno said.

charithreddy101 gravatar image charithreddy101  ( 2022-03-22 07:18:21 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2022-03-20 20:29:10 -0600

Seen: 2,552 times

Last updated: Mar 21 '22