I have managed to use the explore package (frontier based exploration) with stage without problem. Now, I would like to use it with Gazebo and in the real world. I am using robots similar to the Turtlebot (Create base + IMU + Asus camera). I have tried modifying the explore/stage launch file (see below), but it didn't work (I don't see anything in the Rviz map, and the robot doesn't move). How can I fix this?
[Edit] Here is the Wiki for the explore package: http://www.ros.org/wiki/explore
[Edit 2] Basically, this url shows what I want to do, but with the PR2 instead of the Turtlebot. I tried following his steps, but I still get no movement in Gazebo and no map in Rviz. http://answers.ros.org/question/33590/map-resolution-issue-between-explore-and-pr2_2dnav_slam/
[Edit 3] Here is the original explore_stage launch file and its rostopic list output:
<launch>
<master auto="start"/>
<param name="/use_sim_time" value="true"/>
<node pkg="stage" type="stageros" name="stage" args="$(find stage)/world/willow-erratic.world" respawn="false" output="screen"/>
<node pkg="gmapping" type="slam_gmapping" name="gmapping" output="screen">
<remap from="scan" to="base_scan" />
<param name="inverted_laser" value="false" />
<param name="maxUrange" value="30.0" />
<param name="particles" value="30" />
<param name="delta" value="0.10" />
<param name="xmin" value="-15.0" />
<param name="xmax" value="15.0" />
<param name="ymin" value="-15.0" />
<param name="ymax" value="15.0" />
<param name="angularUpdate" value="0.5" />
<param name="linearUpdate" value="1.0" />
<param name="map_update_interval" value="1.0" />
<param name="resampleThreshold" value="0.3" />
<param name="llsamplerange" value ="0.05" />
<param name="llsamplestep" value ="0.05" />
<param name="lasamplerange" value ="0.05" />
<param name="lasamplestep" value ="0.05" />
</node>
<include file="$(find explore_stage)/move.xml" />
<include file="$(find explore_stage)/explore_slam.xml" />
</launch>
OUTPUT:
/base_pose_ground_truth
/base_scan
/clock
/cmd_vel
/explore/explore_costmap/inflated_obstacles
/explore/explore_costmap/obstacles
/explore/explore_costmap/parameter_descriptions
/explore/explore_costmap/parameter_updates
/explore/explore_costmap/robot_footprint
/explore/explore_costmap/unknown_space
/explore/explore_planner/NavfnROS_costmap/inflated_obstacles
/explore/explore_planner/NavfnROS_costmap/obstacles
/explore/explore_planner/NavfnROS_costmap/robot_footprint
/explore/explore_planner/NavfnROS_costmap/unknown_space
/explore/explore_planner/plan
/explore/loop_closure_planner/NavfnROS_costmap/inflated_obstacles
/explore/loop_closure_planner/NavfnROS_costmap/obstacles
/explore/loop_closure_planner/NavfnROS_costmap/robot_footprint
/explore/loop_closure_planner/NavfnROS_costmap/unknown_space
/explore/loop_closure_planner/plan
/explore/map
/gmapping/entropy
/map
/map_metadata
/move_base/NavfnROS/NavfnROS_costmap/inflated_obstacles
/move_base/NavfnROS/NavfnROS_costmap/obstacles
/move_base/NavfnROS/NavfnROS_costmap/robot_footprint
/move_base/NavfnROS/NavfnROS_costmap/unknown_space
/move_base/NavfnROS/plan
/move_base/TrajectoryPlannerROS/cost_cloud
/move_base/TrajectoryPlannerROS/global_plan
/move_base/TrajectoryPlannerROS/local_plan
/move_base/TrajectoryPlannerROS/parameter_descriptions
/move_base/TrajectoryPlannerROS/parameter_updates
/move_base/cancel
/move_base/current_goal
/move_base/feedback
/move_base/global_costmap/inflated_obstacles
/move_base/global_costmap/obstacles
/move_base/global_costmap/parameter_descriptions
/move_base/global_costmap/parameter_updates
/move_base/global_costmap/robot_footprint
/move_base/global_costmap/unknown_space
/move_base/goal
/move_base/local_costmap/inflated_obstacles
/move_base/local_costmap/obstacles
/move_base/local_costmap/parameter_descriptions
/move_base/local_costmap/parameter_updates
/move_base/local_costmap/robot_footprint
/move_base/local_costmap/unknown_space
/move_base/parameter_descriptions
/move_base/parameter_updates
/move_base/result
/move_base/status
/move_base_simple/goal
/odom
/rosout
/rosout_agg
/tf
/visualization_marker
/visualization_marker_array
[Edit 4] I modified the launch file and made some progress. Now, I can accurately see the gmapping map in Rviz. However, there are two issues. First, Rviz displays the explore map, but it's blank (ignore the camera height, that's normal):
.
Secondly, the robot moved only once in Gazebo; it rotated by 90 degrees and then stopped moving completely.
When running explore on Gazebo, I get a lot of warnings from the terminal, and my computer becomes really slow (4 CPUs are used between 90-100%):
[ WARN] [1369766566.516970091, 12.321000000]: The base_scan observation buffer has not been updated for 4.03 seconds, and it should be updated every 0.20 seconds.
[ WARN] [1369766567.986540211, 12.378000000]: [/move_base]:Sensor data is out of date, we're not going to allow commanding of the base for safety
[ WARN] [1369766568.061583553, 12.380000000]: Entropy has not been updated. Loop closure opportunities may be ignored.
Here are my 2 launch files. I use 2 files to reduce the amount of warnings I get on the same terminal.
1.
<launch>
<master auto="start"/>
<param name="/use_sim_time" value="true"/>
<!--- Run gazebo -->
<node name="gazebo" pkg="gazebo" type="gazebo" args="-u $(find turtlebot_gazebo)/worlds/empty.world" respawn="false" output="screen"/>
<node name="gazebo_gui" pkg="gazebo" type="gui" />
<!--- Turtlebot -->
<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"/>
</launch>
-
<!--- Set up Turtlebot --> <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"/> <param name="output_frame" value="odom"/> </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="/camera_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="/camera_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> <!--- Run explore --> <include file="$(find explore_gazebo)/move.xml" /> <include file="$(find explore_gazebo)/explore_slam.xml" /> <!--- Run gmapping --> <include file="$(find turtlebot_navigation)/config/gmapping_turtlebot.launch" /> </launch>
Here is the rostopic list when running explore & Gazebo:
/base_scan
/camera/camera_info
/camera/depth/points
/camera/image_raw
/camera/image_raw/compressed
/camera/image_raw/compressed/parameter_descriptions
/camera/image_raw/compressed/parameter_updates
/camera/image_raw/compressedDepth
/camera/image_raw/compressedDepth/parameter_descriptions
/camera/image_raw/compressedDepth/parameter_updates
/camera/image_raw/theora
/camera/image_raw/theora/parameter_descriptions
/camera/image_raw/theora/parameter_updates
/clock
/cmd_vel
/depth/camera_info
/depth/image_raw
/diagnostics
/diagnostics_agg
/diagnostics_toplevel_state
/explore/explore_costmap/inflated_obstacles
/explore/explore_costmap/obstacles
/explore/explore_costmap/parameter_descriptions
/explore/explore_costmap/parameter_updates
/explore/explore_costmap/robot_footprint
/explore/explore_costmap/unknown_space
/explore/explore_planner/NavfnROS_costmap/inflated_obstacles
/explore/explore_planner/NavfnROS_costmap/obstacles
/explore/explore_planner/NavfnROS_costmap/robot_footprint
/explore/explore_planner/NavfnROS_costmap/unknown_space
/explore/explore_planner/plan
/explore/loop_closure_planner/NavfnROS_costmap/inflated_obstacles
/explore/loop_closure_planner/NavfnROS_costmap/obstacles
/explore/loop_closure_planner/NavfnROS_costmap/robot_footprint
/explore/loop_closure_planner/NavfnROS_costmap/unknown_space
/explore/loop_closure_planner/plan
/explore/map
/gazebo/link_states
/gazebo/model_states
/gazebo/parameter_descriptions
/gazebo/parameter_updates
/gazebo/set_link_state
/gazebo/set_model_state
/gmapping/entropy
/imu/data
/initialpose
/joint_states
/map
/map_metadata
/move_base/NavfnROS/NavfnROS_costmap/inflated_obstacles
/move_base/NavfnROS/NavfnROS_costmap/obstacles
/move_base/NavfnROS/NavfnROS_costmap/robot_footprint
/move_base/NavfnROS/NavfnROS_costmap/unknown_space
/move_base/NavfnROS/plan
/move_base/TrajectoryPlannerROS/cost_cloud
/move_base/TrajectoryPlannerROS/global_plan
/move_base/TrajectoryPlannerROS/local_plan
/move_base/TrajectoryPlannerROS/parameter_descriptions
/move_base/TrajectoryPlannerROS/parameter_updates
/move_base/cancel
/move_base/current_goal
/move_base/feedback
/move_base/global_costmap/inflated_obstacles
/move_base/global_costmap/obstacles
/move_base/global_costmap/parameter_descriptions
/move_base/global_costmap/parameter_updates
/move_base/global_costmap/robot_footprint
/move_base/global_costmap/unknown_space
/move_base/goal
/move_base/local_costmap/inflated_obstacles
/move_base/local_costmap/obstacles
/move_base/local_costmap/parameter_descriptions
/move_base/local_costmap/parameter_updates
/move_base/local_costmap/robot_footprint
/move_base/local_costmap/unknown_space
/move_base/parameter_descriptions
/move_base/parameter_updates
/move_base/result
/move_base/status
/move_base_simple/goal
/odom
/robot_pose_ekf/odom
/rosout
/rosout_agg
/scan
/set_hfov
/set_update_rate
/slam_gmapping/entropy
/tf
/turtlebot_node/sensor_state
/visualization_marker
/visualization_marker_array
[Edit 5] Here is the rxgraph that I have. Wouldn't I need to connect one of the Kinect_Laser nodes to move_base? How can I do that? I'm quite a newbie...
[Edit 6] I just made a little progress. I modified costmap_common.yaml and now the robot is moving around (very very slowly). The map is still blank and I still receive warnings related to base_scans. Here's what I changed (but I don't even know what I'm doing!).
map_type: costmap
transform_tolerance: 0.5
obstacle_range: 2.5
max_obstacle_height: 2.0
raytrace_range: 3.0
inscribed_radius: 0.35
circumscribed_radius: 0.4
inflation_radius: 0.6
cost_scaling_factor: 15.0
lethal_cost_threshold: 100
observation_sources: base_scan **//Changed this to kinect_laser**
base_scan: {sensor_frame: base_laser_link, data_type: LaserScan, expected_update_rate: 0.2,
observation_persistance: 0.0, marking: true, clearing: true}
Originally posted by Zayin on ROS Answers with karma: 343 on 2013-05-27
Post score: 1
Original comments
Comment by tfoote on 2013-05-27:
Please provide more information about how it didn't work. We cannot see how it did not work. Please provide enough information to reproduce what you are doing and what you expect it to do and what you observe it doing.
Comment by SL Remy on 2013-05-27:
What is the result of rostopic
when you run the launch file with stage (only) and how does it compare with the output of rostopic after running the modified launch file?
Comment by Zayin on 2013-05-28:
I've done that yesterday to pinpoint the problem, but I wasn't sure what to do next. I'll post the results in my first post in a few minutes.
Comment by Zayin on 2013-05-28:
Alright, I made some progress, but the problem isn't solved yet. I'll clean up my first post because it's filled with useless information.
Comment by SL Remy on 2013-05-28:
After the robot turns 90 degrees, are there any messages being sent? You can check useful sounding topics like.. rostopic echo /cmd_vel
, rostopic echo /move_base_simple/goal
, etc.
Comment by Zayin on 2013-05-28:
I only get this in cmd_vel: linear:
x: 0.0
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 0.0
And goal outputs: "Is /clock being published?"
I think the problem is related to the 3 warnings I posted above. There might be a wrong parameter, but I don't even know which could cause that.
Comment by jorge on 2013-05-28:
Can you also check /base_scan topic (rostopic echo /base_scan)?
Comment by Zayin on 2013-05-29:
I get this: "WARNING: no messages received and simulated time is active.
Is /clock being published?"
By the way, thanks a lot for all your help so far.