ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Sensor doesn't move from an initial pose for navigation stack

asked 2017-08-28 10:42:17 -0600

gerson_n gravatar image

updated 2017-09-11 07:43:27 -0600

Hi to all.

I'm having some troubles trying to make a map. I'm driving the wheeled robot by teleop_twist_keyboard and it moves around, but the vision sensor (kinect) seems doesn't detect itself inside the map. It only actualizes what it sees in front of it, even if rotates. Here are the portions of map I got.

image description image description

My tf tree image description

And here the files I have for my project

Which parameters should I change in order to make the sensor moves in combination with the robot? Maybe inside Rviz?


On github I attached the files I'm using as All files for navigation and the tf_tree I got. Also I added some pictures of terminals used and fragments of the map I got. As you can see is set only looking in one direction, even if it moves and rotate.

What can be the problem I have on my files? I've tried to change lots of parameters that could affect it performance without sucess.


On my github page I attached some pictures of rostopic echo values that it shows. Which are the following:

rostopic echo /scan
rostopic echo /odom
rostopic echo /rpm
rostopic echo /cmd_vel
rostopic list -v

As you can see, for /scan topic there are a lot of "nan" and numbers for rangers. There, only ranges seems change. Maybe angle_min | angle_max are the responsables of my issue.

For rostopic echo /odom, only changes x position and x linear for it covariance when it moves around. And it's only detecting forward movement because of my problem,'s OK.

For rostopic echo /rpm, the z vector is always on 0.1 but x vector increase when it's moving and it should be OK.

/cmd_vel also print the the suppostly given speed which is 0.04 [m/s] and a turn of 0.1[rad/s] when changes it directions, so no problem.

For rostopic list I attached only the suscribed topics used for you can see, and as a complement of that the rqt_graph. (Rqt_graph I have) image description


After playing with the parameters I managed to solve my odometry problem. Now I'm able to generate a more accurate map. By the moment isn't good at all, but close to what it should be.

my first map


edit retag flag offensive close merge delete


Could you please post the images on an image hosting site such as imgur (unless you are given enough karma to post them here)? I'm a bit reluctant to download random files from the internet.

jayess gravatar image jayess  ( 2017-08-28 13:55:08 -0600 )edit

Thanks, here are some pictures

gerson_n gravatar image gerson_n  ( 2017-08-28 14:18:20 -0600 )edit

Also, please upload your code to a hosting site such as (and possibly put relevant code here) because I have to download your code in order to read it (and like I said earlier I don't download random files from the internet).

jayess gravatar image jayess  ( 2017-08-28 14:19:38 -0600 )edit

How long were you mapping for? Sometimes it takes a bit for things to get settled and rviz to show you moving around your map.

jayess gravatar image jayess  ( 2017-08-28 14:20:22 -0600 )edit

Here is the github link for the files I created. and thanks, is a great tool for sharing files for projects like this. I was mapping a while, but for now without sucess. Hope it helps to you to find what can be the problem.

gerson_n gravatar image gerson_n  ( 2017-08-28 15:11:21 -0600 )edit

You know... maybe inside rviz for LaserScan I should modify other parameters like Decay time, Size, etc. There I only choose the /scan topic as well /odom and /map topics for those display options.

gerson_n gravatar image gerson_n  ( 2017-08-28 15:39:01 -0600 )edit

Decay time and size will only help with visualization in rviz.

jayess gravatar image jayess  ( 2017-08-28 15:40:27 -0600 )edit

How are you running everything? Can you update your question with that and any relevant terminal output.

jayess gravatar image jayess  ( 2017-08-28 15:42:10 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2017-08-28 12:36:26 -0600

jayess gravatar image

From your tf tree it looks like you are using gmapping for localization. You should use amcl for localization during navigation. gmapping is more suited to mapping (hence the word "mapping" in gmapping).

Checkout gmapping on the wiki and amcl on the wiki.

edit flag offensive delete link more


Yes, I'm using gmapping, but at the moment I try to generate the map, it only sees what is in front of it initial point of view. So, when I drive around it doesn't change it position, only the thing it sees in the first direction it saw the environment, as I showed in the first link.

gerson_n gravatar image gerson_n  ( 2017-08-28 14:00:41 -0600 )edit

Please post the images on an image hosting site such as imgur or don't gzip them. I don't download random files from the internet.

jayess gravatar image jayess  ( 2017-08-28 14:03:26 -0600 )edit

AMCL is for localization after mapping, or with an known map. That's the reason I didn't use AMCL for generate a map. BTW when I execute amcl it needs a map and I don't have it yet. Is there something I'm missing for make the kinect moves in combination with the wheeled robot I have? Thanks

gerson_n gravatar image gerson_n  ( 2017-08-28 14:04:24 -0600 )edit

Sorry, I misread your question. Yes, amcl is for navigating a known map and gmapping is for creating maps. If you're running both at the same time though, you may have issues.

jayess gravatar image jayess  ( 2017-08-28 14:18:29 -0600 )edit

Maybe we should check if this is related to gmapping at all. What happens if you use "odom" as global frame?

Humpelstilzchen gravatar image Humpelstilzchen  ( 2017-09-08 09:20:21 -0600 )edit

An hour ago, I solved the odometry problem. Now it's updating it position by receiving odometry information. The problem was a mistake I had for the encoders supply, and a wrong theta declaration on the base_controller.cpp file. So, it's solved.

gerson_n gravatar image gerson_n  ( 2017-09-09 09:13:50 -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: 2017-08-28 10:42:17 -0600

Seen: 730 times

Last updated: Sep 11 '17