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

Gmapping not recognizing /tf data

asked 2019-09-04 10:28:27 -0500

accutting gravatar image

updated 2019-09-09 16:02:19 -0500

jayess gravatar image

Hello,

I am trying to get a gmapping SLAM stack running on my Create 2, RP LIDAR A2 running on an Intel NUC.

The first ting I am trying to tackle building a map of my environment. I have a ROS bag recorded with my /scan and /tf data. However when I run

rosparam set use_sim_time true

rosrun gmapping slam_gmapping scan:=/scan _odom_frame:=/tf

play my rosbag

and run

rosrun map_server map_saver -f the name of my map

I get the error

Dropped 100.00% of messages so far. Please turn the [ros.gmapping.message_notifier] rosconsole logger to DEBUG for more information.

From my research so far it looks like this is becasue my /tf topic is not formatted correctly.

Here is some sample output from my /tf topic:

{
    "transforms": [
        {
            "header": {
                "stamp": {
                    "secs": 1567610189,
                    "nsecs": 432388718
                },
                "frame_id": "odom",
                "seq": 0
            },
            "transform": {
                "translation": {
                    "y": -0.0005495854,
                    "x": 0.0168445315,
                    "z": 0
                },
                "rotation": {
                    "y": 0,
                    "x": 0,
                    "z": -0.0266392006,
                    "w": 0.9996451135000001
                }
            },
            "child_frame_id": "base_footprint"
        }
    ]
}

Any insight into enabling the map builder to recognize my transform would be greatly appreciated!

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
1

answered 2019-09-04 12:23:00 -0500

ahendrix gravatar image

It looks like the frame_id for your odom frame is odom, so when you run gmapping you should probably use:

rosrun gmapping slam_gmapping scan:=/scan _odom_frame:=odom

(gmapping already knows to subscribe to the /tf topic)

edit flag offensive delete link more

Comments

Thanks for the suggestions! I recorded a new .bag file with the /odom recording as well. I then ran gmapping with suggested changes

rosrun gmapping slam_gmapping scan:=/scan _odom_frame:=odom

and am now getting the following error continuously while running the .bag file:

"Failed to Compute laser pose, aborting initialization ("base" passed to lookupTransform argument target_frame does not exist. )

accutting gravatar image accutting  ( 2019-09-05 14:07:45 -0500 )edit
0

answered 2019-09-09 14:59:49 -0500

accutting gravatar image

updated 2019-09-09 15:02:09 -0500

I ended up running the following and got the map to build:

rosrun gmapping slam_gmapping scan:=scan _base_frame:=base_footprint

I believe the issue was that I didn't have my _base_frame set correctly. However now that I am getting a map to build the map looks like something is very wrong. Any ideas on what could cause a map to look so very bad? I

edit flag offensive delete link more

Comments

1

However now that I am getting a map to build the map looks like something is very wrong. Any ideas on what could cause a map to look so very bad?

That looks like a topic for another question

jayess gravatar image jayess  ( 2019-09-09 16:02:41 -0500 )edit
0

answered 2019-09-04 12:26:49 -0500

_odom_frame:=/tf

doesn't quite look right. Your odometry frame is usually something like odom in the typical way of defining things. /tf is the topic for which transformation information is transported describing over frames, but isn't typically a frame by itself, though you could in theory make a frame called /tf.

Try changing your odom_frame to your actual odom frame. TF will take care of the /tf topic for you.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2019-09-04 10:28:27 -0500

Seen: 436 times

Last updated: Sep 09 '19