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: http://wiki.ros.org/stage/Tutorials/M... 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/prova.world">
    <param name="base_watchdog_timeout" value="0" />
</node>

<!-- 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" />
</node>

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

<!-- 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>

<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.

costamp.yaml

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}

navigator.yaml

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

operator.yaml

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

rqt_graph: https://s30.postimg.org/5lo2oidw1/gra...

rqt_console: https://s28.postimg.org/r00b5gs4t/201...

tf tree: https://s29.postimg.org/e3aqbbnon/201...

edit retag flag offensive close merge delete

Comments

1

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 imagegvdhoorn ( 2017-02-01 10:02:03 -0500 )edit

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

rossini gravatar imagerossini ( 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 imageSebastian Kasperski ( 2017-02-02 03:12:01 -0500 )edit
1

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

rossini gravatar imagerossini ( 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 imageSebastian 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 imagerossini ( 2017-02-02 07:24:38 -0500 )edit