0
$\begingroup$

Rosanswers logo

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:

<!-- Start Stage simulator with a given environment -->
<node name="Stage" pkg="stage_ros" type="stageros" args="$(find nav2d_tutorials)/world/tutorial.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>



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

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


Originally posted by ROSYHB on ROS Answers with karma: 3 on 2017-02-13

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

The navigator gets the map via a service call. If this service is named differently in hector_mapping, you have to set the navigator's map_service parameter accordingly. The same goes for frame names that are published by hector_mapping.


Originally posted by Sebastian Kasperski with karma: 1658 on 2017-02-15

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by ROSYHB on 2017-02-18:
Thanks for your reply.I've found that navigator can get map via a service call after I change the map_service to "dynamic_map" in ros.yaml.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.