ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Simulation of Navigation_2D/nav2d package in Gazebo

asked 2014-10-15 08:57:38 -0500

Ashwin27 gravatar image

updated 2014-10-23 06:56:25 -0500


I am currently trying to implement the navigation_2d package using Gazebo with a Husky Robot Model and am facing several problems. Is there anyone out there who has managed to successfully implement the navigation_2d package in Gazebo?

EDIT: So far, I have managed to successfully launch Gazebo, however I believe there is an error in the tf tree. The following warning is seen when the launch is started:

Node: /Operator Time: 05:30:35.510000000 (1970-01-01) Severity: Warn Published Topics: /rosout

Waiting on transform from base_link to odom to become available before running costmap, tf error:

Location: /tmp/buildd/ros-hydro-costmap-2d-1.11.11-0quantal-20140919-0015/src/costmap_2d_ros.cpp:Costmap2DROS::Costmap2DROS:95

The launch file, tf tree, rqt_graph and images of the simulation once launched, can be found here.

When the command to start mapping is issued, the following error is printed:

Could not get robot position: "map" passed to lookupTransform argument target_frame does not exist.

Basically, I do not understand why the robot fails to localize. If it is an error in the tf tree, do I need to modify the sdf file of the Husky IIRC? The simulation, despite inputting the laser scan data, does not localize the robot nor create a map. Any help at all will be gratefully accepted. I apologize for the overload of information.

Thank you.

edit retag flag offensive close merge delete


What is your specific problem?

ROSCMBOT gravatar image ROSCMBOT  ( 2014-10-15 18:12:30 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2014-10-16 10:08:07 -0500

Sebastian Kasperski gravatar image

updated 2014-10-24 07:04:19 -0500

I used it in Gazebo (also with a Husky IIRC) and it should work pretty much the same as with Stage.

The warning from the Operator about the missing tf-transform is no problem, if it happens once at startup. (Some nodes need some more time to start, so a transform can be unavailable at first.) It should not happen during runtime though.

Both ros-graph and tf-graph seem to be fine. What is the error when you call StartMapping?

With the changed husky definition I could start your launch file and identify two problems:

Operator is not connected to gazebo, because topics don't match. So add the following to the Operator node in your launch file:

<remap from="cmd_vel" to="husky/cmd_vel"/>

Your laser is mounted higher then usual, so you have to increase the max_obstacle_height in costmap.yaml in nav2d_tutorials:

scan: {data_type: LaserScan, expected_update_rate: 0.4, observation_persistence: 0.0, marking: true, clearing: true, max_obstacle_height: 1.0, min_obstacle_height: 0.08}

After these changes the exploration with the Husky works for me. However there still seems to be an issue with the Husky's Odometry, causing a significant drift when turning the robot. The mapping cannot always compensate for that.

edit flag offensive delete link more


Hello Sebastien, thanks for the reply! If it's not too much to ask, would you please share your launch file for the gazebo simulation?

Ashwin27 gravatar image Ashwin27  ( 2014-10-16 10:26:09 -0500 )edit

Sorry, can't find it anymore. Do you have problems starting Gazebo or running the nav2d stuff on the simulated robot?

Sebastian Kasperski gravatar image Sebastian Kasperski  ( 2014-10-17 09:53:06 -0500 )edit

I have updated the question with some more details, Sebastien. Please do let me know if there is any other information that you would like.

Ashwin27 gravatar image Ashwin27  ( 2014-10-21 13:53:41 -0500 )edit

The error printed once I Start Mapping is "Could not get robot position: "map" passed to lookupTransform argument target_frame does not exist." I've also included my gazebo launch file here(http://). Thanks again!

Ashwin27 gravatar image Ashwin27  ( 2014-10-23 06:22:18 -0500 )edit

In your launchfile, there is Stage and the pioneer model included. As it does not appear in the graph, you probably removed it locally already, but if not, you should do so. I think your problem is, that the robot is not moving. Can you control it with a joystick (as in tutorial1)?

Sebastian Kasperski gravatar image Sebastian Kasperski  ( 2014-10-23 08:59:08 -0500 )edit

Nevermind, I see it's commented out... Have you changed anything in gazebo_ros or husky_gazebo package? And you are using hydro, right?

Sebastian Kasperski gravatar image Sebastian Kasperski  ( 2014-10-23 09:08:25 -0500 )edit

Ok, while looking into this, I remembered where I put my launchfiles long ago. I pushed to Github and deleted them on my PC: Can you try to start the drive.launch? It uses a pioneer instead of a husky though.

Sebastian Kasperski gravatar image Sebastian Kasperski  ( 2014-10-23 09:49:06 -0500 )edit

I can start your launch file, but then the Husky has no laser scanner. So no map is build at all, but driving it around using the Operator works.

Sebastian Kasperski gravatar image Sebastian Kasperski  ( 2014-10-23 10:41:29 -0500 )edit

Question Tools



Asked: 2014-10-15 08:57:38 -0500

Seen: 633 times

Last updated: Oct 24 '14