Robotics StackExchange | Archived questions

Controller manager failed to start controller in realtime loop.

I'm trying to control the joints of my robot in gazebo using gazeboroscontol. 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:

<launch>
<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)"/>
</include>

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

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

    <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"/>


</group>      

The_one launch file can be be seen bellow:

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

<group ns="$(arg namespace)">
    <param name="robot_description" command="$(find xacro)/xacro.py $(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"/>
    </node>
</group>

Part of my config file can be seen bellow:

joint_state_controller:
    type: joint_state_controller/JointStateController
    publish_rate: 30

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

jointfive_position_controller:
    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 gazeboroscontrol 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"/>
    </joint>

<transmission name="jointnine_transmission" type="SimpleTransmission">
        <type>transmission_interface/SimpleTransmission</type>
        <joint name="jointnine">
            <hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
        </joint>
        <actuator name="jointnine_motor">
            <hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
            <mechanicalReduction>1</mechanicalReduction>
        </actuator>
    </transmission>

<gazebo>
    <!--<static>false</static>-->
    <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
      <!--<robotNamespace>/simple_model</robotNamespace>
      <robotSimType>gazebo_ros_control/DefaultRobotHWSim</robotSimType>
      <legacyModeNS>false</legacyModeNS>-->
    </plugin>
</gazebo>

What I've tried:

System Configuration:

Asked by zokowc on 2020-02-28 14:20:32 UTC

Comments

Answers

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.

Asked by 404RobotNotFound on 2020-03-11 08:25:01 UTC

Comments

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

Asked by zokowc on 2020-03-12 14:49:12 UTC

@zokowc

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 !

[ INFO] [1588300964.909958329, 0.169000000]: Loading gazebo_ros_control plugin [ INFO] [1588300964.910069293, 0.169000000]: Starting gazebo_ros_control plugin in namespace: /arm1 [ INFO] [1588300964.910570152, 0.169000000]: gazebo_ros_control plugin is waiting for model URDF in parameter [/robot_description] on the ROS param server. [INFO] [1588300965.024808, 0.169000]: Controller Spawner: Waiting for service controller_manager/switch_controller [ INFO] [1588300965.025091389, 0.169000000]: Loaded gazebo_ros_control. [INFO] [1588300965.026704, 0.171000]: Controller Spawner: Waiting for service controller_manager/unload_controller [INFO] [1588300965.028309, 0.172000]: Loading controller: joint_state_controller [INFO] [1588300965.034403, 0.179000]: Loading controller: joint1_position_controller [INFO] [1588300965.040608, 0.185000]: Loading controller: joint2_position_controller [INFO] [1588300965.043775, 0.188000]: Loading controller: joint3_position_controller [INFO] [1588300965.046615, 0.191000]: Loading controller: joint4_position_controller [INFO] [1588300965.049696, 0.194000]: Controller Spawner: Loaded controllers: joint_state_controller, joint1_position_controller, joint2_position_controller, joint3_position_controller, joint4_position_controller [FATAL] [1588300965.052388204, 0.196000000]: Failed to start controller in realtime loop. This should never happen. [FATAL] [1588300965.052409769, 0.196000000]: Failed to start controller in realtime loop. This should never happen. [FATAL] [1588300965.052418397, 0.197000000]: Failed to start controller in realtime loop. This should never happen. [FATAL] [1588300965.052426395, 0.197000000]: Failed to start controller in realtime loop. This should never happen. [INFO] [1588300965.052661, 0.197000]: Started controllers: joint_state_controller, joint1_position_controller, joint2_position_controller, joint3_position_controller, joint4_position_controller

Asked by myboyhood on 2020-04-30 22:49:37 UTC

Comments

I used a gazebo model plugin, and used gazebos joint controller interface instead of ROS controllers. http://gazebosim.org/tutorials?tut=set_velocity&cat=

Asked by zokowc on 2020-06-05 15:00:24 UTC