0
$\begingroup$

Rosanswers logo

In brief, I am going to use slam_gmapping with kinect. but the result is very bad. however I rotate, move the kinect, the result map in rviz just keep a fan-shaped area no more than 90 degree.

I am not even very clear about what question to ask, I feel not mastering the whole thing :(

so, maybe describe what I did in detail is a good idea. the question will be long, but easy to understand this way:

  1. in ubuntu open a terminal, type

    roscore
    
  2. start kinect driver in another terminal

    rosrun openni_camera openni_node
    
  3. convert depth image into LaserScan

    rosrun depthimage_to_laserscan depthimage_to_laserscan image:=/depth/image_raw
    
  4. run gmapping

    rosrun gmapping slam_gmapping scan:=/scan
    
  5. run rviz to see result "Map", "LaserScan" and "Image"

    rosrun rviz rviz
    

I got warning message at step 2, I hope it doesn't matter because I can see a fairly good "Image" of "/depth/image_raw" topic

[ WARN] [1399535684.197109851]: ~device_id is not set! Using first device.
[ WARN] [1399535684.562974619]: Camera calibration file /home/vdonkey/.ros/camera_info/rgb_A00366913062050A.yaml not found.
[ WARN] [1399535684.563025039]: Using default parameters for RGB camera calibration.

I also got warning at step 4

[ WARN] [1399536805.888066710]: MessageFilter [target=odom ]: Dropped 100.00% of messages so far. Please turn the [ros.gmapping.message_notifier] rosconsole logger to DEBUG for more information.

this warning cannot be ignored, since I cannot see any map showed in rviz after adding a "Map" subscribing "/map" topic. so I add this before step 4

rosparam set /slam_gmapping/odom_frame camera_depth_frame

camera_depth_frame seems to be the default frame id of /scan topic published by depthimage_to_laserscan package

but after that, the warning message of gmapping changed into

[ WARN] [1399537552.284971741]: Failed to compute laser pose, aborting initialization ("base_link" passed to lookupTransform argument target_frame does not exist. )

so I added this before step 4

rosparam set /slam_gmapping/base_frame camera_depth_frame

this time I got no warning message, after setting base_frame and odom_frame, I have "Map", "LaserScan" showed in rviz.

The problem is, nevertheless I rotate/move the kinect, the result map is always facing a same direction. of course so does the laser scan lines. I have some guesses/questions:

  1. maybe I need a Wheel Encoder hardware?
  2. where to buy a proper wheel encoder? how to drive it?
  3. what topic will wheel encoder's driver publish? while gmapping only subscribe /tf and /scan
  4. topics subscribed can be regarded as input, topics published can be regarded as output, how about parameters? input? output? how about base_frame and odom_frame of gmapping ? I think they should affect "/map" topic, an output topic, so that they are some kind of output, but the two "rosparam set" before running gmapping give me hint that they are inputs.
  5. why I got no warning even I didn't do anything to the /tf topic? what should I do about /tf? why I always get "no tf data received" pdf after executing "rosrun tf view_frames" even when gmapping is running?

thank you for watching this long question. I hope I can understand the essence of ROS faster. thank you for your help


Originally posted by vdonkey on ROS Answers with karma: 51 on 2014-05-07

Post score: 2

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

1 - 3: Gmapping needs odometry published as /tf. Look into hector_mapping for an approach that doesn't require odometry.

4 Parameters are parameters. If you want to declare them something, they are inputs. Especially something that affects an output is an input. The frames shouldn't be considered something to "tune" as parameters. They need to be set correctly.

5 Because your circumvented the actual odometry by setting the odom frame to the camera frame. This also explains why you don't see the algorithm doing anything.


Originally posted by dornhege with karma: 31395 on 2014-05-08

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by vdonkey on 2014-05-08:
@dornhege, Thank you very much. you showed me the way like the signpost at the crossroad, the lighthouse on the sea.

Comment by vdonkey on 2014-05-08:
I tried hector_gmapping, but still get error:

[ERROR] [1399602478.182731899]: Transform failed during publishing of map_odom transform: "base_link" passed to lookupTransform argument source_frame does not exist.

after I set output_frame_id param of depthimage_to_laserscan to base_link

Comment by vdonkey on 2014-05-08:
I hate tunning these parameters, too. but I just don't know how to provide data by /tf. I read the tutorials of tf(one turtle chasing another), and got some ideas that tf is used for converting x/y/z of one frame into another frame. but how to use it as a topic? please give me some help about tf.

Comment by dornhege on 2014-05-08:
DO you have the transform base_link to your camera available. I don't know about your setup.In the mean while.; hector_slam might be able to deal with just cmaera_frame as the base frame.

Comment by MarkyMark2012 on 2015-04-23:
@vdonkey did you get to the bottom of this? I have a very similar set up and I'm encountering the same issues. Thanks Mark

$\endgroup$

Your Answer

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