Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service %s/spawn_entity unavailable. Was Gazebo started with GazeboRosFactory? #59

Open
HYD-PG opened this issue Dec 9, 2022 · 2 comments

Comments

@HYD-PG
Copy link

HYD-PG commented Dec 9, 2022

Hi,thank you very much for your contribution. But when I compile, I have the following problem with the terminal. Anyone experiencing the same issue? If you have the same problem, please help me, greatly appreciated.

: Waiting for entity xml on robot_description [spawn_entity.py-1] [INFO] [1671761703.354007793] [rexrov.urdf_spawner]: Waiting for service /gazebo/spawn_entity, timeout = 30 [spawn_entity.py-1] [INFO] [1671761703.354242044] [rexrov.urdf_spawner]: Waiting for service /gazebo/spawn_entity [spawn_entity.py-1] [ERROR] [1671761733.394673836] [rexrov.urdf_spawner]: Service %s/spawn_entity unavailable. Was Gazebo started with GazeboRosFactory? [spawn_entity.py-1] [ERROR] [1671761733.395134307] [rexrov.urdf_spawner]: Spawn service failed. Exiting. [ERROR] [spawn_entity.py-1]: process has died [pid 89139, exit code 1, cmd '/opt/ros/humble/lib/gazebo_ros/spawn_entity.py -gazebo_namespace /gazebo -x 0 -y 0 -z -20 -R 0.0 -P 0.0 -Y 0.0 -entity rexrov -topic robot_description --ros-args -r __node:=urdf_spawner -r __ns:=/rexrov --params-file /tmp/launch_params_8oj6kd7r'].

@HYD-PG HYD-PG changed the title Unable to complete "colcon build" Service %s/spawn_entity unavailable. Was Gazebo started with GazeboRosFactory? Dec 23, 2022
@bioniwulf
Copy link

bioniwulf commented Jun 11, 2023

@yudonghou123 Dear friend, I have the same problem on Ubuntu 22.04 + ROS2 Humble. I found that you have resolved it (link). My Chinese not so good, I tried to autotranslate your last comment and only could understand that problem is somehow connected with namespacing. Could you, please, help me with this problem?

@bioniwulf
Copy link

So, to whom it may concern.
I think I've found the problem.

OS: Ubuntu 22.04
ROS version: Humble

For some reason Gazebo is creating the spawn entity on the /spawn_entity service, but the vehicle model is trying to connect to the /gazebo/spawn_entity service.
So as a quick patch, I just remapped the topic for the urdf_spawner node in the vehicle description launch file as follows:

urdf_spawner = Node(
        name = 'urdf_spawner',
        package='gazebo_ros',
        executable='spawn_entity.py',
        output='screen',
        parameters=[{'use_sim_time': res}],
        arguments=args,
        remappings=[
            ('/gazebo/spawn_entity', '/spawn_entity')
        ]
    )

Now Plankton works correctly (after many minor changes in Plankton code).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants