Stage exploration

asked 2017-02-01 09:43:35 -0500

rossini gravatar image

updated 2017-02-02 04:18:45 -0500

I want to explore a map in stage like in this tutorial: but the link to the stage_controllers doesn't work and I can't find them in another way. I tried frontier_exploration but I find it tricky to use and it often crashes. I am using kinetic and nav2d is not supported. Anyone has some ideas?

EDIT: I have successfully installed nav2d but I want to explore the map while building it, I changed the third tutorial file:`<launch>

<!-- Some general parameters -->
<param name="use_sim_time" value="true" />
<rosparam file="$(find nav2d_tutorials)/param/ros.yaml"/>

<!-- Start Stage simulator with a given environment -->
<node name="Stage" pkg="stage_ros" type="stageros" args="/home/ros/catkin_ws/">
    <param name="base_watchdog_timeout" value="0" />

<!-- Start the Operator to control the simulated robot -->
<node name="Operator" pkg="nav2d_operator" type="operator" >
    <remap from="scan" to="base_scan"/>
    <rosparam file="$(find nav2d_tutorials)/param/operator.yaml"/>
    <rosparam file="$(find nav2d_tutorials)/param/costmap.yaml" ns="local_map" />

<!-- Start Mapper to genreate map from laser scans -->
<node name="Mapper" pkg="gmapping" type="slam_gmapping">
    <remap from="scan" to="base_scan"/>

<!-- Start the Navigator to move the robot autonomously -->
<node name="Navigator" pkg="nav2d_navigator" type="navigator">
    <rosparam file="$(find nav2d_tutorials)/param/navigator.yaml"/>

<node name="GetMap" pkg="nav2d_navigator" type="get_map_client" />
<node name="Explore" pkg="nav2d_navigator" type="explore_client" />
<node name="SetGoal" pkg="nav2d_navigator" type="set_goal_client" />

<!-- Start the joystick-driver and remote-controller for operation-->
<node name="Joystick" pkg="joy" type="joy_node" />
<node name="Remote" pkg="nav2d_remote" type="remote_joy" />

<!-- RVIZ to view the visualization -->
<node name="RVIZ" pkg="rviz" type="rviz" args=" -d $(find nav2d_tutorials)/param/tutorial3.rviz" />

</launch> using gmapping instead of karto. The problem is that now it keeps spinning instead of going straight and after a while it crashes.


global_frame: odom
robot_base_frame: base_link
update_frequency: 1.0
publish_frequency: 1.0

publish_voxel_map: true

static_map: false

rolling_window: true
width: 6.0
height: 6.0  
resolution: 0.05

map_type: costmap
track_unknown_space: true

transform_tolerance: 0.3
obstacle_range: 4.0
min_obstacle_height: 0.0
max_obstacle_height: 2.0
raytrace_range: 4.5

robot_radius: 0.2
inflation_radius: 0.4
cost_scaling_factor: 2.0
lethal_cost_threshold: 100
observation_sources: scan
scan: {data_type: LaserScan, expected_update_rate: 0.4,observation_persistence: 0.0, marking: true,clearing:true, max_obstacle_height: 0.4, min_obstacle_height: 0.08}


map_inflation_radius: 0.5
robot_radius: 0.1
navigation_goal_distance: 2.0

navigation_goal_angle: 1.0

navigation_homing_distance: 4.0

exploration_goal_distance: 3.0

min_target_area_size: 1.0
visualize_frontiers: true


max_velocity: 1.0

publish_route: true

max_free_space: 2.0
safety_decay: 0.97

distance_weight: 1
safety_weight: 2
conformance_weight: 1
continue_weight: 0



tf tree:

edit retag flag offensive close merge delete



I am using kinetic and nav2d is not supported.

Are you sure it's not supported? Could it be that it's just not released? In that case you'd just have to build it from source on your Kinetic system.

gvdhoorn gravatar image gvdhoorn  ( 2017-02-01 10:02:03 -0500 )edit

Thank you, you're right! I will try nav2d

rossini gravatar image rossini  ( 2017-02-01 10:21:37 -0500 )edit

Are there any error messages in rqt_console? The Navigator gets the map by calling a service, which may have another name in gmapping. So you might have to change the map_service parameter in ros.yaml.

Sebastian Kasperski gravatar image Sebastian Kasperski  ( 2017-02-02 03:12:01 -0500 )edit

Yes, I already changed the service from static_map to dynamic_map. I will add to the question the rqt_graph

rossini gravatar image rossini  ( 2017-02-02 03:43:39 -0500 )edit

The Navigator has cycle times of up to 12 seconds, something is really slowing down your system. Have you build nav2d with "catkin_make -DCMAKE_BUILD_TYPE=Release"?

Sebastian Kasperski gravatar image Sebastian Kasperski  ( 2017-02-02 06:44:42 -0500 )edit

Yes I built nav2d with that command, but I am running it on a virtual machine on a macbook air. I think I have found the problem, I changed my world file with the one in the tutorial changing only the map and it's working. Thanks for the help

rossini gravatar image rossini  ( 2017-02-02 07:24:38 -0500 )edit