0
$\begingroup$

Rosanswers logo

I am using moveit with spiri_simulator package. When I launch the file, I get the warning, "Controller Spawner couldn't find the expected controller_manager ROS interface". I cut the ros_control and gazebo_ros_pkgs and paste it back in the catkin workspace. Sometimes this solves the problem but at most times this does not solve the problem. I don't find this problem with controller_manager while using other simulators. What should I be doing?


Originally posted by boon on ROS Answers with karma: 111 on 2015-09-28

Post score: 1


Original comments

Comment by boon on 2015-10-01:
Creating a separate launch file for the node, 'controller_spawner' and launching it after the simulator and Rviz ( I was using for visualization) were launched, solved the problem. Was the node missing some information before, that it could not be launched?

Comment by Adolfo Rodriguez T on 2015-10-01:
The spawner only requests controller load and start actions. They are serviced by the controller_manager. The error you are getting is telling you that the spawner did not find a running controller_manager in its namespace to service its requests.

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

Make sure the namespace is same in the gazebo plugin and the controllers.yaml file. This namespace is equal to the name of the robot in your URDF file. Also make sure the hardwareInterface type (eg. PositonJointInterface) matches the corresponding controller of the joint in controllers.yaml file you created.

For eg. my gazebo plugin has this tag: /arm_mesh

where arm_mesh is the name specified in my URDF.

My controllers.yaml file is like this:

arm_mesh:

  robotic_arm_controller:

      type: "position_controllers/JointTrajectoryController"

         .......

My launch file to activate controller manager:

 <launch>

   <rosparam file="$(find PKG_NAME)/config/controllers.yaml" command="load"/>

      <node name="robotic_arm_controller_spawner" pkg="controller_manager" type="spawner" 
        respawn="false"  output="screen" ns="/arm_mesh" args="robotic_arm_controller"/>


 </launch>

Originally posted by Sohan_Anisetty with karma: 26 on 2019-07-11

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$
0
$\begingroup$

In my case the controller_spawner was dying after few seconds. The solution would be to add the argument --timeout 0 in the launch file as below. Worked fine on ROS Noetic on Ubuntu 20.04 LTS.

node name="" pkg="controller_manager" type="spawner" respawn="false" output="screen"
  <node name="controller_spawner" pkg="controller_manager" type="spawner"  
        output="screen" respawn="false" ns ="/jim_bot"
        args="--timeout 0 joint_state_controller
              mobile_base_controller
              joint1_position_controller
              joint1_position_controller" >
  </node>

Another point is to ensure that the namespace in the controllers.yaml and the controller_spawner section of launch file match. For a differential drive bot.

controllers.yaml had the namespace as jim_bot

controllers.yaml

jim_bot:
  joint_state_controller:
  type: joint_state_controller/JointStateController
  publish_rate: 50

The gazebo plugin had the name space as /jim_bot

gazebo_control.xacro

  <gazebo>
        <plugin name="differential_drive_controller" filename="libgazebo_ros_diff_drive.so">
            <robotNamespace>/jim_bot</robotNamespace>
            <robotSimType>gazebo_ros_control/DefaultRobotHWSim</robotSimType>
        </plugin>
</gazebo>

references

https://github.com/ms-iot/ROSOnWindows/issues/285

https://classic.gazebosim.org/tutorials/?tut=ros_control

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.