Rosanswers logo

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 http://imgur.com/a/FbGaj

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, so...it'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.

http://imgur.com/a/nF2Xe (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


Originally posted by gerson_n on ROS Answers with karma: 43 on 2017-08-28

Post score: 0

Original comments

Comment by jayess on 2017-08-28:
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.

Comment by gerson_n on 2017-08-28:
Thanks, here are some pictures http://imgur.com/a/FbGaj

Comment by jayess on 2017-08-28:
Also, please upload your code to a hosting site such as https://github.com (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).

Comment by jayess on 2017-08-28:
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.

Comment by gerson_n on 2017-08-28:
Here is the github link for the files I created. https://github.com/gersonos/Yirsoon_environment_mapping 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.

Comment by gerson_n on 2017-08-28:
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.

Comment by jayess on 2017-08-28:
Decay time and size will only help with visualization in rviz.

Comment by jayess on 2017-08-28:
How are you running everything? Can you update your question with that and any relevant terminal output.

Comment by gerson_n on 2017-08-29:
I've attached on github all terminals displayed and what sees the kinect. I hope you can find what's going on in there. Thanks

Comment by gvdhoorn on 2017-08-30:
@gerson_n: I've given you enough karma to be able to attach your images to your question directly. Could I ask you to do that? Thanks.

Comment by gerson_n on 2017-08-30:
@gvdhoorn Thanks for the karma. I've uploaded the main pictures of my project. I hope it helps to you to understand what could be my problem in there.

Comment by gerson_n on 2017-08-31:
I've tried changing almost all parameters that could have change the kinect position. Maybe the problem is with odometry. But for rostopic echo rpm/cmd_vel positions seems change. How can I measure encoder's values?

Comment by gerson_n on 2017-08-31:
I've noticed that even though the kinect doesn't move in complement with robot. After drive around a while, it moves only 1 or 2 meters.

Comment by gerson_n on 2017-08-31:
You know... I haven't seen other poeple have this kind of issues. It has to be something with the odometry received.


1 Answer 1


Rosanswers logo

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.

Originally posted by jayess with karma: 6155 on 2017-08-28

This answer was ACCEPTED on the original site

Post score: 1

Original comments

Comment by gerson_n on 2017-08-28:
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.

Comment by jayess on 2017-08-28:
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.

Comment by gerson_n on 2017-08-28:
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

Comment by jayess on 2017-08-28:
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.

Comment by Humpelstilzchen on 2017-09-08:
Maybe we should check if this is related to gmapping at all. What happens if you use "odom" as global frame?

Comment by gerson_n on 2017-09-09:
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.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.