Ask Your Question

nav2d autonomouse exploration

asked 2015-05-13 18:37:48 -0600

sobot gravatar image

updated 2015-05-20 15:13:57 -0600


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/">
    <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 ...
edit retag flag offensive close merge delete


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

Sebastian Kasperski gravatar image Sebastian Kasperski  ( 2015-05-15 03:01:40 -0600 )edit

@Sebastian Kasperski really appreciate it, i updated the question with the info that you asked.

sobot gravatar image sobot  ( 2015-05-15 13:03:24 -0600 )edit

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?

Sebastian Kasperski gravatar image Sebastian Kasperski  ( 2015-05-17 05:08:32 -0600 )edit

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

sobot gravatar image sobot  ( 2015-05-17 08:27:32 -0600 )edit

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

Sebastian Kasperski gravatar image Sebastian Kasperski  ( 2015-05-18 01:59:49 -0600 )edit

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

sobot gravatar image sobot  ( 2015-05-18 11:09:01 -0600 )edit

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

Sebastian Kasperski gravatar image Sebastian Kasperski  ( 2015-05-19 02:37:46 -0600 )edit

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.

sobot gravatar image sobot  ( 2015-05-19 13:19:15 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2015-05-22 03:30:57 -0600

Sebastian Kasperski gravatar image

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)

edit flag offensive delete link more


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

sobot gravatar image sobot  ( 2015-05-22 04:40:20 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-05-13 18:37:48 -0600

Seen: 1,358 times

Last updated: May 22 '15