2D SLAM with gmapping and openni_kinect
I know it's possible to do 2D SLAM with Kinect using slam_gmapping
, eg. because of this post. Could anyone please tell me how exactly to do that?
I've already installed pointcloud_to_laserscan
, slam_gmapping
, turtlebot
and turtlebot_apps
. But after running roslaunch turtlebot_navigation gmapping_demo.launch
all I'm getting is an info saying: "Still waiting on map". What and in which order should I execute to obtain a map like in turtlebot_navigation's tutorial?
Ok, I think I partially got it. There were some errors in the default pointcloud_to_laserscan launchfile. My working version below.
<launch>
<!-- kinect and frame ids -->
<include file="$(find openni_camera)/launch/openni_node.launch"/>
<!-- Kinect -->
<node pkg="nodelet" type="nodelet" name="openni_manager" output="screen" respawn="true" args="manager"/>
<!-- fake laser -->
<node pkg="nodelet" type="nodelet" name="kinect_laser" args="load pointcloud_to_laserscan/CloudToScan openni_camera">
<param name="output_frame_id" value="/openni_depth_frame"/>
<remap from="cloud" to="cloud_throttled"/>
</node>
<!-- throttling -->
<node pkg="nodelet" type="nodelet" name="pointcloud_throttle" args="load pointcloud_to_laserscan/CloudThrottle openni_camera">
<param name="max_rate" value="2"/>
<remap from="cloud_in" to="/camera/depth/points"/>
<remap from="cloud_out" to="cloud_throttled"/>
</node>
</launch>
When I now run rosrun gmapping slam_gmapping
I get a warning saying:
[ WARN] [1300374330.893690231]: MessageFilter [target=/odom ]: Dropped 100.00% of messages so far. Please turn the [ros.gmapping.message_notifier] rosconsole logger to DEBUG for more information.
[DEBUG] [1300374332.317853661]: MessageFilter [target=/odom ]: Removed oldest message because buffer is full, count now 5 (frame_id=/kinect_depth_frame, stamp=1300374331.992896)
[DEBUG] [1300374332.318014019]: MessageFilter [target=/odom ]: Added message in frame /kinect_depth_frame at time 1300374332.311, count now 5
[DEBUG] [1300374332.376768593]: MessageFilter [target=/odom ]: Removed oldest message because buffer is full, count now 5 (frame_id=/kinect_depth_frame, stamp=1300374332.060879)
I think the problem might be there is no tf tree between /openni_camera and /map defined - how do I achieve this?
Any help appreciated, Tom.