Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

nav2d Exploration failed with hectormapping

Hello,everyone In the tutorial3.launch, I remove the mapper node and use hectormapping instead. after roslaunch tutorial3.launch, in a new terminal,type "rosservice call /StartMapping 3" and enter,the robot can run.Then,I tyep ""rosservice call /StartExploration 2 and enter,the terminal,which roslaunch tutorial3.launch,shows some message: Is the robot out of the map? Exploration failed, could not get current position.

I add some log in the code,finding that mCurrentMap.getIndex(current_x, current_y, i)=false,mHasNewMap=false,getMap()=false.

here is my launch files,

tutorial3.launch: <launch> <rosparam file="$(find nav2d_tutorials)/param/ros.yaml"/>

<!-- Start Stage simulator with a given environment -->

<node name="Stage" pkg="stage_ros" type="stageros" args="$(find nav2d_tutorials)/world/"> </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 pkg="hector_mapping" type="hector_mapping" name="hector_height_mapping" output="screen">
  <param name="scan_topic" value="base_scan" />
<param name="base_frame" value="base_link" />
<param name="odom_frame" value="odom" />
<param name="map_frame" value="map"/>
<param name="laser_frame" value="base_laser_link"/>
<param name="output_timing" value="false"/>

<param name="map_pub_period" value="0.5"/>
<param name="update_factor_free" value="0.45"/>

<param name="map_update_distance_thresh" value="0.02"/>
<param name="map_update_angle_thresh" value="0.1"/>

<param name="map_resolution" value="0.05"/>
<param name="map_size" value="1024"/>
<param name="map_start_x" value="0.5"/>
<param name="map_start_y" value="0.5"/>
<remap from="map" to="map"/>


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

<!-- Pioneer model for fancy visualization -->
<!-- Comment this out if you do not have the package 'p2os' available! -->
<include file="$(find p2os_urdf)/launch/pioneer3at_urdf.launch" />
<node name="front_left_wheel" pkg="tf" type="static_transform_publisher" args="0 0 0 0 0 0 p3at_front_left_hub p3at_front_left_wheel 100" />
<node name="front_right_wheel" pkg="tf" type="static_transform_publisher" args="0 0 0 0 0 0 p3at_front_right_hub p3at_front_right_wheel 100" />
<node name="back_left_wheel" pkg="tf" type="static_transform_publisher" args="0 0 0 0 0 0 p3at_back_left_hub p3at_back_left_wheel 100" />
<node name="back_right_wheel" pkg="tf" type="static_transform_publisher" args="0 0 0 0 0 0 p3at_back_right_hub p3at_back_right_wheel 100" />

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


Thank you!!