Gmapping not recognizing /tf data
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!
Asked by accutting on 2019-09-04 10:28:27 UTC
Answers
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)
Asked by ahendrix on 2019-09-04 12:23:00 UTC
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. )
Asked by accutting on 2019-09-05 14:07:45 UTC
_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.
Asked by stevemacenski on 2019-09-04 12:26:49 UTC
Comments
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
Asked by accutting on 2019-09-09 14:59:49 UTC
Comments
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
Asked by jayess on 2019-09-09 16:02:41 UTC
Comments