Ask Your Question
11

Gazebo controller spawner warning

asked 2015-07-28 03:56:01 -0500

Damon gravatar image

updated 2015-07-30 05:30:43 -0500

Hi everyone. I have a problem and I hope you can help me. :)

I have a robot: Two Schunk lwa4d arms mounted on a box.

I can load this robot in gazebo.

I can load this robot in moveit + rviz and plan path for it.

But the problem is making connection between these two. So far, I am unable of doing so. I know that in both sides, gazebo and moveit, i need to have some modifications. But my major suspicion is a warning message that I receive when launching my robot in gazebo, where it warns:

[WARN] [WallTime: 1438070984.731293] [4.961000] Controller Spawner couldn't find the expected controller_manager ROS interface.

[WARN] [WallTime: 1438070984.740924] [4.954000] Controller Spawner couldn't find the expected controller_manager ROS interface.

I know it has something to do with controller_manager. In my launch file, I have:

<!-- controllers -->
<rosparam file="$(find schunk_lwa4d)/config/TwoArm/TwoArm_arm_controller_v2.yaml" command="load"/>
<rosparam file="$(find schunk_lwa4d)/config/joint_state_controller.yaml" command="load"/>
<!-- start_controllers -->
<node name="joint_state_controller_spawner" pkg="controller_manager" type="spawner" args="joint_state_controller" respawn="false" />
<node name="arm_controller_spawner" pkg="controller_manager" type="spawner" args="arm_controller" />

What I know for now is that each warning is related to one control spawning. My file, joint_state_controller.yaml is very small:

joint_state_controller:
type: joint_state_controller/JointStateController
publish_rate: 50

ROS is able to locate it. So the problem shouldn't be finding the file. But in spawning it using controller spawner, something is going wrong.

I tried to copy-paste the other file, TwoArm_arm_controller_v2.yaml, here too. But I couldn't format it in a good way to be easily readable. But the basic structure is something like:

## joint_names
joint_names: [arm1_1_joint, arm1_2_joint, arm1_3_joint, arm1_4_joint, arm1_5_joint, arm1_6_joint, arm1_7_joint, arm2_1_joint, arm2_2_joint, arm2_3_joint, arm2_4_joint, arm2_5_joint, arm2_6_joint, arm2_7_joint]
## joint trajectory controller
arm_controller:
  type: position_controllers/JointTrajectoryController
  joints:
    - arm1_1_joint
    ...
    - arm1_7_joint
    - arm2_1_joint
    ...
    - arm2_7_joint

  constraints:
    goal_time: 0.6
    stopped_velocity_tolerance: 0.05
    arm1_1_joint: {trajectory: 0.1, goal: 0.1}
    ...
    arm2_7_joint: {trajectory: 0.1, goal: 0.1}
  stop_trajectory_duration: 0.5
  state_publish_rate:  25
  action_monitor_rate: 10

What I could find by now is that there may be two reasons for this warning:

  • controller manager not running.
  • not launching the spawned script in the same namespace as the controller manager.

But honestly, I don't know how to move forward from this point. I know that controller_manager has been installed:

ros@ros:~/Documents/Damon_CPP/ROS_Workspace/devel$ rospack find controller_manager

/opt/ros/indigo/share/controller_manager

Unfortunately I don't know how to remove the warnings. I have the feeling that if Moveit can't communicate with gazebo, this warning can be a reason. Any help is highly appreciated. :)

UPDATE:

After launching my robot in gazebo, I tried this command:

ros@ros:~$ rosrun controller_manager controller_manager list

Nothing appears. The terminal goes frozen. I asked the same thing from my friend whose robot (2 U10 arms on a box) is loaded and controlled properly by moveit. Here is his result:

merosy@MeRoSy-1:~$ rosrun controller_manager controller_manager list joint_state_controller - hardware_interface::JointStateInterface ( running )

arm_controller - hardware_interface::PositionJointInterface ( running )

Seemingly my controller_manager is not working properly. Any suggestion ... (more)

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
21

answered 2015-07-28 08:05:00 -0500

Adolfo Rodriguez T gravatar image

Check two things:

Firstly, that the controller_manager is running. You can check this by executing on the command line:

rosservice list | grep controller_manager

The expected output should look like:

/controller_manager/list_controller_types
/controller_manager/list_controllers
/controller_manager/load_controller
/controller_manager/reload_controller_libraries
/controller_manager/switch_controller
/controller_manager/unload_controller

If you don't get any output, then you're probably not loading the gazebo_ros_control plugin in your robot model:

<gazebo>
  <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
    <robotNamespace>/MYROBOT</robotNamespace>
  </plugin>
</gazebo>

Notice that if you specify <robotNamespace> above (it's optional), the controller_manager ROS API will be namespaced to /MYROBOT/controller_manager/...

Secondly, check that the controller_manager and the spawner are in the same namespace. That is, if you spawn the controller_manager under the MYROBOT namespace, the spawner should be pushed to the same namespace as well. roslaunch allows spawning nodes in namespaces.

You might be interested in this related question

edit flag offensive delete link more

Comments

Thank you so much Adolfo. You were right and I added the plugin. So the warning disappeared. Nevertheless, now I see another problem: Could not load class joint_state_controller/JointStateController: Could not find library corresponding to plugin joint_state_controller/JointStateControlle

Damon gravatar imageDamon ( 2015-07-29 07:44:16 -0500 )edit
1

I know that joint_state_controller/JointStateController is between my controllers. I see it when:

ros@ros:/opt/ros/indigo/stacks$ rosservice call controller_manager/list_controller_types

:(

Damon gravatar imageDamon ( 2015-07-29 07:48:07 -0500 )edit

Are you positive that the library exists and is visible by your current ROS environment?. If installing from binaries, ros-<distro>-joint-state-controller should be installed. If building from source, rospack find joint_state_controller should yield a valid path. Make sure the package is built.

Adolfo Rodriguez T gravatar imageAdolfo Rodriguez T ( 2015-07-29 10:28:26 -0500 )edit

Hi again, Adolfo.

ros@ros:~/Documents/Damon_CPP/ROS_Workspace/devel$ rospack find joint_state_controller
/opt/ros/indigo/stacks/ros_controllers/joint_state_controller
Damon gravatar imageDamon ( 2015-07-30 02:05:27 -0500 )edit

Before installing the stack ros_controllers, I had the same error. So your guess is true that not having the controller causes this error. BUT! The difference is that when having the package, the error says: " Make sure the plugin description XML file has the correct name of the library and ... "

Damon gravatar imageDamon ( 2015-07-30 02:13:11 -0500 )edit

@Damon: edit your original question with any new information. The comments are really way too limited to add copy/pastes of console output. Just add Edit: and then place whatever new info you have after that.

gvdhoorn gravatar imagegvdhoorn ( 2015-07-30 02:24:05 -0500 )edit

Did you mean /opt/ros/indigo/**share**/ros_controllers/joint_state_controller?. Could you check that /opt/ros/indigo/lib/libjoint_state_controller.so exists?.

Adolfo Rodriguez T gravatar imageAdolfo Rodriguez T ( 2015-07-30 04:31:49 -0500 )edit

You mention in the question update that you downloaded the controller into /opt/ros/indigo/stacks, so, you're not installing from binaries. The actual plugin (the .so library) needs to be built, it's not part of the version-controlled files in the repository. Is this what's going on?.

Adolfo Rodriguez T gravatar imageAdolfo Rodriguez T ( 2015-07-30 07:00:08 -0500 )edit
2

answered 2018-06-09 09:26:06 -0500

khaled0000 gravatar image

updated 2018-06-09 17:58:20 -0500

jayess gravatar image

just install ros-kinetic-gazebo-ros-control by :

sudo apt install ros-kinetic-gazebo-ros-control
edit flag offensive delete link more
0

answered 2016-08-24 09:17:24 -0500

sapan gravatar image

Trying to use Gazebo for simulating DarwinOP. "rosservice list | grep controller_manager" doesn't responses ! I checked for the NameSpace but they are correctly written in urdf for controller manager and in darwin_control.launch file for spawner... Still I get the same error

edit flag offensive delete link more

Comments

Did you install the package? Assuming you are using kinetic.

$ sudo apt-get install ros-kinetic-ros-control ros-kinetic-ros-controllers

More details here. http://wiki.ros.org/ros_control

surfertas gravatar imagesurfertas ( 2017-04-12 22:27:10 -0500 )edit

I did install the packages and spawner and manager are within the same namespace (both global /). I use husky simulation running playpen world, husky spawner and keyboard teleop. cmd_vel is active, but husky does not move. I still receive the controller spawner warning.

RodBelaFarin gravatar imageRodBelaFarin ( 2017-04-21 04:03:45 -0500 )edit
5

I did have to install controllers on Gazebo side as well: $ sudo apt-get install ros-kinetic-gazebo-ros ros-kinetic-gazebo-ros-control Worked for me.

RodBelaFarin gravatar imageRodBelaFarin ( 2017-04-26 06:13:01 -0500 )edit

i installed both ros-kinetic-gazebo-ros and ros-kinetic-gazebo-ros-control, but still got the same error.. any ideas? thx!!

myrotrac gravatar imagemyrotrac ( 2019-01-18 07:21:15 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

8 followers

Stats

Asked: 2015-07-28 03:56:01 -0500

Seen: 24,073 times

Last updated: Jun 09 '18