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

NAV2 Getting Started Example error

asked 2022-11-22 11:10:06 -0500

Is_that_so gravatar image

I'm following the NAV2 tutorial and this is what happens:

I have everything installed:

sudo apt install ros-humble-navigation2
sudo apt install ros-humble-nav2-bringup
sudo apt install ros-humble-turtlebot3*
sudo apt-get install ros-humble-turtlebot3-gazebo

Then I set the key environment variables:

source /opt/ros/humble/setup.bash
export TURTLEBOT3_MODEL=waffle
export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:/opt/ros/humble/share/turtlebot3_gazebo/models

Then after running:

ros2 launch nav2_bringup headless:=False

I rush to rviz, set the 2D pose estimation as quick as I can and end up with this in the terminal:

[component_container_isolated-6] [INFO] [1669122316.072762902] [amcl]: Creating bond (amcl) to lifecycle manager.
[rviz2-5] [INFO] [1669122320.120000768] [rviz2]: Setting estimate pose: Frame:map, Position(-2.97266, -0.58257, 0), Orientation(0, 0, 0.0273898, 0.999625) = Angle: 0.0547864
[] [ERROR] [1669122345.950231796] [spawn_entity]: Service %s/spawn_entity unavailable. Was Gazebo started with GazeboRosFactory?
[] [ERROR] [1669122345.950698437] [spawn_entity]: Spawn service failed. Exiting.
[ERROR] []: process has died [pid 20529, exit code 1, cmd '/opt/ros/humble/lib/gazebo_ros/ -entity turtlebot3_waffle -file /opt/ros/humble/share/nav2_bringup/worlds/waffle.model -robot_namespace -x -2.00 -y -0.50 -z 0.01 -R 0.00 -P 0.00 -Y 0.00 --ros-args'].

Some system info ROS_VERSION=2 ROS_PYTHON_VERSION=3 ROS_LOCALHOST_ONLY=0 ROS_DISTRO=humble Ubuntu 22 duel booted

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2022-11-23 17:34:51 -0500

ct2034 gravatar image

There is no need to rush to rviz to set the pose. You can do this whenever you want.

It seems like gazebo is not starting properly. Start it alone with gazebo --verbose and make sure it starts properly. Also with the gazebo path defined. It will download a lot of stuff in the beginning. If this is all good, try the launch file again.

But with the headless:=false it should also show gazebo with the turtlebot and environment. Only then you must set the initial pose.

edit flag offensive delete link more


I started gazebo using gazebo --verbose then I closed it. I then sourced my enviroment and ran ros2 launch nav2_bringup headless:=False and it finally worked.

Is_that_so gravatar image Is_that_so  ( 2022-11-24 11:42:09 -0500 )edit

Glad to hear that. Could you please click the tick next to my answer, then.

ct2034 gravatar image ct2034  ( 2022-11-24 12:04:06 -0500 )edit

Question Tools



Asked: 2022-11-22 11:10:06 -0500

Seen: 626 times

Last updated: Nov 23 '22