Rosanswers logo


I installed and tried nav2d navigation package exploration feature, with a real robot setup (kobuki base, urg-04lx) as per ros wiki instructions. i modified the tutorial3 launch and param files, as shown below (just copied the launch file and .yaml files into my catkin workspace so i can edit them). I received a map and other topics in RVIZ. since i dont have a joy stick i used rosservice call /StartMapping 3 and rosservice call /StartExploration 2 as per tutorials instructions i got nothing but a "response: 0" on my terminal window.



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

<!-- 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 navigation)/param/operator.yaml"/>
    <rosparam file="$(find navigation)/param/costmap.yaml" ns="local_map" />

<!-- Start Mapper to genreate map from laser scans -->
<node name="Mapper" pkg="nav2d_karto" type="mapper">
    <remap from="scan" to="base_scan"/>
    <rosparam file="$(find navigation)/param/mapper.yaml"/>

<!-- Start the Navigator to move the robot autonomously -->
<node name="Navigator" pkg="nav2d_navigator" type="navigator">
    <rosparam file="$(find navigation)/param/navigator.yaml"/>
            <!-- <remap from="/cmd_vel" to="/mobile_base/commands/velocity" /> -->

<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 particle filter to track the robot's position 
<node name="SelfLocalizer" pkg="nav2d_localizer" type="localizer">
    <remap from="scan" to="base_scan"/>
    <param name="min_particles" type="int" value="5000"/>
    <param name="max_particles" type="int" value="20000"/>
</node> -->

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

when i tried to launch the SelfLocalizer in my launch file, it gave me an error saying: ERROR: cannot launch node of type [nav2d_localizer/localizer]: can't locate node [localizer] in package [nav2d_localizer]

Another issue, i tried to remap /cmd_vel to kobuki's velocity topic but i received an error, [MD5] topic format mismatch.

any help, suggestions are greately appreciated. Param files (.yaml) are also available.


Here is the rqt_dot file to download.





it also takes like 20 seconds or so before the topics in RVIZ receive information and go green.

UPDATE 2: Parameters list: PARAMETERS

 * /Mapper/LoopSearchMaximumDistance: 10.0
 * /Mapper/MinimumTravelDistance: 1.0
 * /Mapper/MinimumTravelHeading: 0.52
 * /Mapper/grid_resolution: 0.05
 * /Mapper/map_update_rate: 5
 * /Mapper/max_covariance: 0.01
 * /Mapper/max_particles: 10000
 * /Mapper/min_map_size: 20
 * /Mapper/min_particles: 2500
 * /Mapper/publish_pose_graph: True
 * /Mapper/range_threshold: 4.0
 * /Mapper/transform_publish_period: 0.1
 * /Navigator/exploration_goal_distance: 0.5
 * /Navigator/map_inflation_radius: 0.25
 * /Navigator/min_target_area_size: 1.0
 * /Navigator/navigation_goal_angle: 1.0
 * /Navigator/navigation_goal_distance: 0.5
 * /Navigator/navigation_homing_distance: 0.5
 * /Navigator/robot_radius: 0.2
 * /Navigator/visualize_frontiers: True
 * /Operator/conformance_weight: 1
 * /Operator/continue_weight: 0
 * /Operator/distance_weight: 1
 * /Operator/local_map/cost_scaling_factor: 2.0
 * /Operator/local_map/footprint: [[-0.18, -0.18], ...
 * /Operator/local_map/global_frame: odom
 * /Operator/local_map/height: 10.0
 * /Operator/local_map/inflation_radius: 0.25
 * /Operator/local_map/lethal_cost_threshold: 100
 * /Operator/local_map/map_type: costmap
 * /Operator/local_map/max_obstacle_height: 0.5
 * /Operator/local_map/min_obstacle_height: 0.0
 * /Operator/local_map/observation_sources: laser
 * /Operator/local_map/obstacle_range: 2.5
 * /Operator/local_map/publish_frequency: 3.0
 * /Operator/local_map/publish_voxel_map: False
 * /Operator/local_map/raytrace_range: 4.5
 * /Operator/local_map/resolution: 0.05
 * /Operator/local_map/robot_base_frame: base_footprint
 * /Operator/local_map/robot_radius: 0.2
 * /Operator/local_map/rolling_window: True
 * /Operator/local_map/scan/clearing: True
 * /Operator/local_map/scan/data_type: LaserScan
 * /Operator/local_map/scan/expected_update_rate: 0.4
 * /Operator/local_map/scan/marking: True
 * /Operator/local_map/scan/max_obstacle_height: 0.4
 * /Operator/local_map/scan/min_obstacle_height: 0.08
 * /Operator/local_map/scan/observation_persistence: 0.0
 * /Operator/local_map/scan/topic: base_scan
 * /Operator/local_map/static_map: False
 * /Operator/local_map/track_unknown_space: True
 * /Operator/local_map/transform_tolerance: 0.3
 * /Operator/local_map/update_frequency: 5.0
 * /Operator/local_map/width: 10.0
 * /Operator/max_free_space: 1.0
 * /Operator/max_velocity: 0.1
 * /Operator/publish_route: True
 * /Operator/safety_decay: 0.97
 * /Operator/safety_weight: 2
 * /SelfLocalizer/max_particles: 20000
 * /SelfLocalizer/min_particles: 5000
 * /laser_frame: laser
 * /laser_topic: base_scan
 * /map_frame: map
 * /map_service: static_map
 * /map_topic: map
 * /odometry_frame: odom
 * /offset_frame: offset
 * /robot_frame: base_footprint
 * /rosdistro: indigo
 * /rosversion: 1.11.10
 * /use_sim_time: Fals

Originally posted by sobot on ROS Answers with karma: 116 on 2015-05-13

Post score: 0

Original comments

Comment by Sebastian Kasperski on 2015-05-15:
@sobot Please add a picture from "rqt_graph" and the dot-export result from "rosrun tf view_frames". These are usually the best starting point to search for problems in your setup.

Comment by sobot on 2015-05-15:
@Sebastian Kasperski really appreciate it, i updated the question with the info that you asked.

Comment by Sebastian Kasperski on 2015-05-17:
The transformations look fine, but in your ROS-Graph you see that the Operator in not connected to "base_scan". As the remapping is correct, it probably doesn't get to the point where the Costmap is initialized. Does it give any warnings or errors during start?

Comment by sobot on 2015-05-17:
@Sebastian Kasperski i only can get 2 errors in different start up setups: (1. when i try to remap /cmd_vel to topic of my robot. (it says content is mismatch, MD5 xxx) (2. when i include SelfLocalizer in the launch file, its says the node can not be found int the package folder.

Comment by Sebastian Kasperski on 2015-05-18:
@sobot: 1) Please do a "rostopic type" on your robots cmd-topic. If its not geometry_msgs/Twist, you have to do a conversion. 2) Have you build the package from source or installed the binary packages?

Comment by sobot on 2015-05-18:
@Sebastian Kasperski the topic is /mobile_base/commands/velocity and rostopic shows that type is geometry_msgs/Twist. tried to remap that topic to /cmd_vel and got the MD5 error. I installed the pkg from the binary as per in the ros-wiki instructions using apt-get install.

Comment by Sebastian Kasperski on 2015-05-19:
@sobot: This is really strange. Do you have different ROS-Versions on your machine? Or does any of your packages bring an own version of "geometry_msgs"? Before you start your launch file, do a "roscd geometry_msgs" and check where it takes you.

Comment by sobot on 2015-05-19:
My machine's config is: native "Ubuntu 14,04" with ROS Indigo (full desktop). i just use this 1 machine, and it runs my robot. roscd takes me to /opt/ros/indigo/share/geometry_msgs$ yes it looks very strange. i thought it should be pretty straightforward. other packages work Ok.

Comment by Sebastian Kasperski on 2015-05-20:
Sometimes one misses messages from startup when launching rqt_console after the launch file. Can you add an output="screen" to the Operator's node-tag in your launch file and see if anything else pops up during startup? Have you build the kobuki base package on this machine or is it also a binary?

Comment by sobot on 2015-05-20:
yes, i installed Kobuki from binary. added the output=screen and received the following warning repeatedly on screen. ( [ WARN] [1432152439.052146627]: Robot is stuck! Trying to recover... ). Around the robot is all open wide. i also UPDATED question with parameters list.

Comment by Sebastian Kasperski on 2015-05-21:
"Robot is stuck" can happen at the beginning, but if this warning is there, then the Operator completed its startup. So the real problem seems to be the not-connected /cmd_vel topic. Can you make the kobuki move manually? (http://wiki.ros.org/kobuki/Tutorials/Examine%20Kobuki#Trigger_stuff)

Comment by sobot on 2015-05-21:
@Sebastian Kasperski Yes Kobuki moves manually (keyop), also through rviz set goal and some other nodes that i tried out. still Localisation node gives error (can not find node) and don't start. also "Robot is stuck" repeats over and over again until i abort the launch.

Comment by Sebastian Kasperski on 2015-05-21:
Yes, the "Robot is stuck" warning is ok for now. But can you move the robot as it is described in the link, by using "rostopic pub"? Have you installed ros-indigo-nav2d_localizer package? It contains the localizer node. (But you don't need it for mapping/exploration anyway)

Comment by sobot on 2015-05-21:
yes rostopic pub in the link works. i installed nav2d using the install ros-indigo-nav2d line, didn't install localizer separately, sorry! are there different versions of nav2d available so i test? what minimums i need for autonomous exploration launch, so i make a clean launch file to test. THX

Comment by Sebastian Kasperski on 2015-05-21:
Your launch-file looks ok, the minimum you need from nav2d is Operator, Navigator and Mapper. The 3 Action-Clients and Joystick are for convinience. Maybe you should try to put kobuki-stuff and nav2d-stuff in one launch file and start this. (and post this file when you have it)

Comment by sobot on 2015-05-21:
Hi Sebastian, i made some progress, fixed the cmd_vel topic mappings successfully, but Explorer don't work yet. I filmed the robot for you to see: i run the launch file and manually set a simple goal, see what happens. also shared the Launch and Param files in dropbox for you ".zip file" (below)

Comment by sobot on 2015-05-21:
launch, param, new rqt_graph files in a zip file here. and the video of the robot shared on youtube here. Thank you!


1 Answer 1


Rosanswers logo

The operator is not connected to the laser scanner. It needs it to update the local costmap for obstacle avoidance. In your costmap.yaml, the observation_source is defined incorrectly. Should be: "observation_sources: scan". You should visualize the costmap in RVIZ to see if the local costmap (not the global map from the mapper) is built correctly.

Before you start any navigation task (setting a goal via RVIZ or explore) you should move the robot a bit forward, (with a joystick or by calling "rosservice call /StartMapping 3")

In your mapper.yaml you have "range_threshold: 4.0". This is VERY little for a Hokuyo-Scanner! This is the reason your global map is so small and has a lot of holes in it. Use at least 10 meter. (Hokuyo can easily go up to 30 meter)

Originally posted by Sebastian Kasperski with karma: 1658 on 2015-05-22

This answer was ACCEPTED on the original site

Post score: 1

Original comments

Comment by sobot on 2015-05-22:
Changed observation_sources and ran a quick test and it worked...! my Hokuyo scanner is URG-04LX-UG01 and according to its data sheet Max range is 4m , so the only way to increase maps size is to increase the range_threshold? You are awesome! thanks for your time, really appreciate it..!


Your Answer

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