ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Building a map with SLAM using turtlebot in gazebo

asked 2012-02-02 22:56:48 -0500

karthik gravatar image

updated 2012-02-03 22:46:34 -0500

Hi, I am trying to build a map of the environment created in gazebo using the turtlebot. I am following the tutorial But i see that the many topics are not being published. They are

/scan

/map

/particlecloud

/move_base/TrajectoryPlannerROS/global_plan

/move_base/local_costmap/obstacles

/move_base/local_costmap/inflated_obstacles

While launching the gmapping_demo.launch file i have removed the kinect launch as the turtlebot simulator in gazebo automatically launches the kinect. I can see the pointclouds in rviz. Has anyone tried SLAM gmapping for the turtlebot in gazebo? Any help here is appreciated.

Note: I am using 11.04 and ROS electric

I think the Fake laser that is generated from the pointclouds of the kinect in turtlebot_simulation is the problem here. I have used the robot.launch from the turtlebot_gazebo package to run the robot in the environment. Can someone help me in understanding the changes that i have to make in the launch file so that the above topics have messages being published. Following is the launch file i am using.

<launch>
  <param name="robot_description" command="$(find xacro)/xacro.py '$(find turtlebot_description)/urdf/turtlebot.urdf.xacro'" />

  <node name="spawn_turtlebot_model" pkg="gazebo" type="spawn_model" args="$(optenv ROBOT_INITIAL_POSE) -unpause -urdf -param robot_description -model turtlebot" respawn="false" output="screen"/>

  <node pkg="diagnostic_aggregator" type="aggregator_node" name="diagnostic_aggregator" >
    <rosparam command="load" file="$(find turtlebot_bringup)/config/diagnostics.yaml" />
  </node>

  <node pkg="robot_state_publisher" type="state_publisher" name="robot_state_publisher" output="screen">
    <param name="publish_frequency" type="double" value="30.0" />
  </node>


  <!-- The odometry estimator -->

  <node pkg="robot_pose_ekf" type="robot_pose_ekf" name="robot_pose_ekf">
    <param name="freq" value="30.0"/>
    <param name="sensor_timeout" value="1.0"/>
    <param name="publish_tf" value="true"/>
    <param name="odom_used" value="true"/>
    <param name="imu_used" value="false"/>
    <param name="vo_used" value="false"/>
  </node>


  <!-- throttling -->
  <node pkg="nodelet" type="nodelet" name="pointcloud_throttle" args="load pointcloud_to_laserscan/CloudThrottle openni_manager" respawn="true">
    <param name="max_rate" value="20.0"/>
    <remap from="cloud_in" to="/camera/depth/points"/>
    <remap from="cloud_out" to="cloud_throttled"/>
  </node>

  <!-- Fake Laser -->
  <node pkg="nodelet" type="nodelet" name="kinect_laser" args="load pointcloud_to_laserscan/CloudToScan openni_manager" respawn="true">
    <param name="output_frame_id" value="/kinect_depth_frame"/>
    <!-- heights are in the (optical?) frame of the kinect -->
    <param name="min_height" value="-0.15"/>
    <param name="max_height" value="0.15"/>
    <remap from="cloud" to="/cloud_throttled"/>
  </node>

  <!-- Fake Laser (narrow one, for localization -->
  <node pkg="nodelet" type="nodelet" name="kinect_laser_narrow" args="load pointcloud_to_laserscan/CloudToScan openni_manager" respawn="true">
    <param name="output_frame_id" value="/kinect_depth_frame"/>
    <!-- heights are in the (optical?) frame of the kinect -->
    <param name="min_height" value="-0.025"/>
    <param name="max_height" value="0.025"/>
    <remap from="cloud" to="/cloud_throttled"/>
    <remap from="scan" to="/narrow_scan"/>
  </node>


</launch>

Thanks, Karthik

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2012-03-05 16:25:39 -0500

mmwise gravatar image

This is caused by a bug in the gazebo.urdf.xacro file. The camera frame names were not correct and therefore the gazebo plugins couldn't initialize properly. It's fixed in 330:4253a4e5f257 . It's released in turtlebot 0.9.2

edit flag offensive delete link more
1

answered 2012-02-06 23:44:36 -0500

karthik gravatar image

I noticed through rxgraph that the Fake laser that is generated in the nodelets are not working as expected. i.e. the cloud_throttle is not being published which in turn is used to get the /narrow_scan (Actual fake laser). Figured out that the problem is with the nodelet manager not being started. Hence i ran the openni_manager externally using the following command

rosrun nodelet nodelet manager __name:=openni_manager

Now i was getting a message that the "Waiting for transform between the /base_link and /odom". Realized that the tf tree has odom_combined and not odom. Actually the robot_pose_ekf gives the odom_frame_id as string "odom_combined" and not as "odom". Hence the following line is to be added to the above launch file under ekf node launch

<param name="output_frame" value="odom" />

This solves the issue. Hope this helps!!!

Karthik

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2012-02-02 22:56:48 -0500

Seen: 4,867 times

Last updated: Mar 05 '12