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

Explore package on Gazebo & Turtlebot

asked 2013-05-27 05:57:12 -0600

Zayin gravatar image

updated 2013-05-29 07:18:10 -0600

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 ... (more)

edit retag flag offensive close merge delete

Comments

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.

tfoote gravatar image tfoote  ( 2013-05-27 08:05:50 -0600 )edit

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?

SL Remy gravatar image SL Remy  ( 2013-05-27 15:55:24 -0600 )edit

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.

Zayin gravatar image Zayin  ( 2013-05-28 04:54:22 -0600 )edit

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.

Zayin gravatar image Zayin  ( 2013-05-28 08:35:07 -0600 )edit

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.

SL Remy gravatar image SL Remy  ( 2013-05-28 09:12:10 -0600 )edit

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.

Zayin gravatar image Zayin  ( 2013-05-28 09:28:31 -0600 )edit

Can you also check /base_scan topic (rostopic echo /base_scan)?

jorge gravatar image jorge  ( 2013-05-28 14:23:16 -0600 )edit

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.

Zayin gravatar image Zayin  ( 2013-05-29 04:41:27 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2013-05-29 15:05:40 -0600

jorge gravatar image

updated 2013-05-30 14:28:56 -0600

I think that your kinect_laser is publishing on topic /scan but move_base and gmapping expect it to be on topic /base_scan. So first undo your change on costmap_common.yaml, and add this remap on your node:

<remap from="scan" to="/base_scan"/>

after the

<remap from="cloud" to="/cloud_throttled"/>

Then type

rostopic info /scan

and

rostopic info /base_scan

to check that everybody is subscribed to /base_scan

Update Yeap, you must remap everything to /scan or to /base_scan. Let's use /scan:

  • Remove the <remap from="scan" to="/base_scan"/> on Fake laser
  • Rename base_scan as scan on costmap_common.yaml
  • Add <remap from="base_scan" to="scan"/> in the explore launch file

/base_scan topic should disapear, and /scan should have 1 publisher and 3 subscribers

edit flag offensive delete link more

Comments

So I followed your suggestion, but the result is the same. Rostopic info is as follows:

rostopic info /scan Type: sensor_msgs/LaserScan

Publishers: * /gazebo (http://localhost:41083/)

Subscribers: * /slam_gmapping (http://localhost:51813/)

Zayin gravatar image Zayin  ( 2013-05-30 04:51:07 -0600 )edit

rostopic info /base_scan Type: sensor_msgs/LaserScan

Publishers: None

Subscribers: * /explore (http://localhost:40629/) * /move_base (http://localhost:39869/)

I assume the problem comes from the fact there is no publisher here?

Zayin gravatar image Zayin  ( 2013-05-30 04:53:12 -0600 )edit

By the way, I was wrong when I said Stage was working fine; it also generates all these warnings repetitively. However, the robot behaves as expected in this case.

Zayin gravatar image Zayin  ( 2013-05-30 10:31:57 -0600 )edit

Alright, so now I have this:

Publishers: * /gazebo (http://localhost:51156/)

Subscribers: * /slam_gmapping (http://localhost:37441/) * /move_base (http://localhost:60119/) * /explore (http://localhost:38308/)

However, I still get the warnings and the robot is standing still.

Zayin gravatar image Zayin  ( 2013-05-31 04:48:52 -0600 )edit

I see a map though (I actually modified explore to use the gmapping map). Maybe the problem lies in move.xml? Or maybe it's just a publishing frequency issue? Also, rostopic hz scan returns: "no new messages average rate: 14.860 min: 0.050s max: 0.144s std dev: 0.02170s window: 175 " many times

Zayin gravatar image Zayin  ( 2013-05-31 05:03:24 -0600 )edit

I just set the expected_update_rate in costmap_common.yaml to 0.0, and the robot moves around. But that's not a good solution. And besides, the gmapping map only gets generated once at the beginning. It stays the same afterwards even if the robot explores.

I'll be back on Monday.

Zayin gravatar image Zayin  ( 2013-05-31 06:32:19 -0600 )edit

mmm... curious the "no new messages"... if you echo scan topic, you get readings continuously? if gmapping don't receive scans, he doesn't update the map

jorge gravatar image jorge  ( 2013-06-02 14:44:02 -0600 )edit

I finally fixed the problem! After adding your suggestion, I had not noticed there was a ros node running in the background. I killed it, and now it's working perfectly fine in both Gazebo (even though it's very slow) and in the real world. This was a silly problem. Thanks so much for your help!!!

Zayin gravatar image Zayin  ( 2013-06-03 05:18:10 -0600 )edit
0

answered 2013-06-03 06:31:37 -0600

Zayin gravatar image

updated 2013-06-03 06:36:56 -0600

I created a git repo for my explore_real and explore_gazebo packages: https://github.com/LadyZayin/explore . I'm quite new to ROS so I can't guarantee these packages are functioning properly. Place them in the same folder as explore and explore_stage.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-05-27 05:57:12 -0600

Seen: 2,092 times

Last updated: Jun 03 '13