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

Some problem in gridslamprocess.hxx of slam_gmapping

asked 2018-06-06 08:02:28 -0500

Liuche gravatar image

updated 2020-02-14 17:41:38 -0500

jayess gravatar image

Sorry to disturb you all!!

I found some problems about gmapping when I using Turtlebot Package, there is a document which named "gridslamprocess.hxx".

roslaunch turtlebot_navigation gmapping_demo.launch

I already modify it, but when I do catkin_make and create a new slam_gmapping,

I run the new one,but I didn't see have any change after I modify it.

I noticed that every time when I run gmapping, there are some information on the screen.

Ex: When scanmatch Done! it will show laser poser: x,y,z on screen. When scanmatch failed,it will use odometry. Then show lp: x,y,z op:x,y,z on screen.

So I want to get lp: op: laser pose These (x,y) information, so I'm trying to modify the source code.

When I looked in the source code, I found gridslamprocess.hxx, but i did't see any happened after me modify it

Of course, I already compile after modifying.

I want to get m_lastpartpose.x m_lastpartpose.y m_odopose.x m_odopose.y

image description

But I need some help..

Has anyone ever modified this file? Thank you very much!!๐Ÿ˜“

edit retag flag offensive close merge delete

Comments

Why did you modify the source?

jayess gravatar image jayess  ( 2018-06-06 22:21:58 -0500 )edit

Because I can only subscribe to /odom now, then get a pair (x,y). I also need another pair of (x,y) to compare.

So I noticed that every time when I run gmapping, there are some information on the screen.

Liuche gravatar image Liuche  ( 2018-06-06 23:32:02 -0500 )edit

Ex: When scanmatch Done! it will show laser poser: x,y,z on screen. When scanmatch failed,it will use odometry. Then show lp: x,y,z op:x,y,z on screen.

Liuche gravatar image Liuche  ( 2018-06-06 23:32:18 -0500 )edit

So I want to get lp: op: laser pose These (x,y) information, so I'm trying to modify the source code.

Liuche gravatar image Liuche  ( 2018-06-06 23:32:27 -0500 )edit

Are you saying that you are using gmapping for localization?

jayess gravatar image jayess  ( 2018-06-06 23:50:16 -0500 )edit

yes,I am using turtlebot and use gmapping to do SLAM

Liuche gravatar image Liuche  ( 2018-06-07 00:56:58 -0500 )edit

Please don't use images to post text. Images can't be searched/copy-pasted. Please update your question with a copy and pasted of your code instead.

jayess gravatar image jayess  ( 2018-06-07 01:48:36 -0500 )edit

Thank you~~ I'll get what I want now!!

Liuche gravatar image Liuche  ( 2018-06-07 04:16:11 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-06-07 02:07:32 -0500

jayess gravatar image

Typically, the gmapping package is used for mapping an environment:

Using slam_gmapping, you can create a 2-D occupancy grid map (like a building floorplan) from laser and pose data collected by a mobile robot.

and other packages such as amcl are used for localization. Some packages, such as google cartographer, do simulatenous mapping and localization. So, you should either

  • use a mapping package (e.g., gmapping) and a separate localization package (e.g., amcl)
  • use a package that does simultaneous mapping and localization (e.g., Google cartographer)

As a side note, it is not a good idea to modify the source of packages that you don't control. If/when that package gets updated any changes that you made will be lost when it's updated.

edit flag offensive delete link more

Comments

I change slam_gmapping.cpp now, and i get what i want, thank you!

Liuche gravatar image Liuche  ( 2018-06-07 04:16:55 -0500 )edit

Great. Can you please click on the checkmark to mark the answer as correct?

jayess gravatar image jayess  ( 2018-06-07 04:36:59 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2018-06-06 08:02:28 -0500

Seen: 161 times

Last updated: Jun 07 '18