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:
in ubuntu open a terminal, type
roscore
start kinect driver in another terminal
rosrun openni_camera openni_node
convert depth image into LaserScan
rosrun depthimage_to_laserscan depthimage_to_laserscan image:=/depth/image_raw
run gmapping
rosrun gmapping slam_gmapping scan:=/scan
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:
- maybe I need a Wheel Encoder hardware?
- where to buy a proper wheel encoder? how to drive it?
- what topic will wheel encoder's driver publish? while gmapping only subscribe /tf and /scan
- 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.
- 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