Gazebo | Ignition | Community
Ask Your Question

Controller manager failed to start controller in realtime loop.

asked 2020-02-28 13:20:32 -0500

zokowc gravatar image

I'm trying to control the joints of my robot in gazebo using gazebo_ros_contol. However, every time i launch my simulation i get the following error:

[FATAL] [1582914730.942896966, 0.314000000]: Failed to start controller in realtime loop. This should never happen.

This error comes up 6 times(# of joints =6), after which i get the following message every few seconds in my command prompt:

Node::Advertise(): Error advertising a topic. Did you forget to start the discovery service?

My launch file can be seen below:

<arg name="namespace" default="simplemodel"/>
<arg name="cmd_timeout" default="0.5"/>
<arg name="x" default="1"/>
<arg name="y" default="1"/>
<arg name="z" default="0.1"/>

<include file="$(find sim)/launch/the_one.launch">
    <arg name="namespace" value="$(arg namespace)"/>

<group ns="$(arg namespace)">

    <include file="$(find gazebo_ros)/launch/empty_world.launch">
        <arg name="world_name" value=""/> 

    <node name="spawn_vehicle" pkg="gazebo_ros" type="spawn_model"
          args="-urdf -param robot_description -model my_vehicle
                -gazebo_namespace /$(arg namespace)/gazebo
                -x $(arg x) -y $(arg y) -z $(arg z)"/>

    <node name="controller_spawner" pkg="controller_manager" type="spawner"
          args="$(find sim)/config/config.yaml"/>


</launch> The_one launch file can be be seen bellow:

<arg name='namespace' default='my_vehicle'/>

<group ns="$(arg namespace)">
    <param name="robot_description" command="$(find xacro)/ $(find sim)/urdf/cat797.xacro"/>

    <node name="vehicle_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher">
        <param name="publish_frequency"  value="30.0"/>


Part of my config file can be seen bellow:

    type: joint_state_controller/JointStateController
    publish_rate: 30

    type: effort_controllers/JointPositionController
    joint: jointfour
    pid: {p: 1.0, i: 1.0, d: 0.0}

    type: effort_controllers/JointPositionController
    joint: jointfive
    pid: {p: 1.0, i: 1.0, d: 0.0}

Since the URDF is pretty repetitive, here is a joint, transmission, and gazebo_ros_control code:

<joint name="jointeight" type="continuous">
       <origin rpy="0 0 0" xyz="0.08 0 0"/>
       <parent link="front_left_wheel_hinge"/>
       <child link="front_left_wheel"/>
       <axis xyz="-1 0 0"/>
       <limit effort="10" velocity="100"/>

<transmission name="jointnine_transmission" type="SimpleTransmission">
        <joint name="jointnine">
        <actuator name="jointnine_motor">

    <plugin name="gazebo_ros_control" filename="">

What I've tried:

  • Un-grouping the launch file and adding namespace tags to individual nodes(same error)
  • Pausing the simulation (controllers load and start, however using "rostopic list" only shows /joint_state topic, and no topics for the other joints, using rosservice, it was seen that non of the other controllers are running)
  • adding namespace to gazebo_ros_control and config file brings the following error:

    [WARN] [1582915496.881255, 0.191000]: Controller Spawner couldn't find the expected controller_manager ROS interface

System Configuration:

  • Ubuntu 18.04 LTS (64-bit OS)
  • ARMv8 Processor
  • ROS Melodic 1.14.3
  • Gazebo version 9.0.0
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2020-04-30 22:49:37 -0500


I was trapped in the same error, maybe I have installed all related packages, But this problem still occurs: if you have solved it, hopefully help me ,thanks advance !

edit flag offensive delete link more


I used a gazebo model plugin, and used gazebos joint controller interface instead of ROS controllers.

zokowc gravatar imagezokowc ( 2020-06-05 15:00:24 -0500 )edit

answered 2020-03-11 08:25:01 -0500

I don't know if it will solve your problem, but when comparing what I normally launch with, your line here

<node name="controller_spawner" pkg="controller_manager" type="spawner"
      args="$(find sim)/config/config.yaml"/>

I have formatted like this

<rosparam command="load" file="$(find sim)/config/config.yaml" />
<node name="controller_spawner" pkg="controller_manager" type="spawner"
      args="joint_state_controller jointfour_position_controller jointfive_position_controller"/>

This is just an example, and you would probably want to put all of your controllers named in there. Let me know if that works.

edit flag offensive delete link more


Thanks for your answer, I've tried this format and it produces the same error.

zokowc gravatar imagezokowc ( 2020-03-12 14:49:12 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2020-02-28 13:20:32 -0500

Seen: 564 times

Last updated: Feb 28