Robotics StackExchange | Archived questions

Gazebo ros control plugin not loading on OSX

I am trying to simulate my robot with gazebo, and I am getting the following warning "Controller Spawner couldn't find the expected controllermanager ROS interface.". After looking to other answers, I assume that it is related to the gazebo gazeboros_control plugin which is not being loaded appropriatelly.

I checked if the controller_manager was running with that command

rosservice list | grep controller_manager

But I did not get any result. The only services listed with a name containing "controller" are the "/controllerspawner/getloggers" and "/controllerspawner/setlogger_level" (and they are available until that warning message is displayed).

My URDF file contains this :

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

And since I am on OSX, I had to clone the gazeborospkgs repository in my catkin workspace, and I built it myself (using catkin_make). I noticed that the built files are .dylib files instead of .so, but replacing .so by .dylib in the "filename" attribute value of the URDF file does not solve the issue. I have seen a related issue on the gazebo bitbucket repo but since all the other gazebo libraries I have built are .dylib, I think that the gazebo version I use, already embed their fix (else I would have crashed sooner ?)

So here is the full log following my roslaunch command, I'm open to any idea that can solve this problem :)

$ roslaunch myrobot_gazebo myrobot_world.launch
... logging to /Users/.../.ros/log/9d1a05e3-e8f5-11e5-9c0d-0025bce79628/roslaunch-MacBook-Pro.local-19181.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt

... loading XML file [/opt/ros/indigo/etc/ros/roscore.xml]
... executing command param [rosversion roslaunch]
Added parameter [/rosversion]
... executing command param [rosversion -d]
Added parameter [/rosdistro]
Added core node of type [rosout/rosout] in namespace [/]
... loading XML file [/Users/.../catkin_ws/src/myrobot_simulator/myrobot_gazebo/launch/myrobot_world.launch]
... loading XML file [/Users/.../catkin_ws/src/gazebo_ros_pkgs/gazebo_ros/launch/empty_world.launch]
Added parameter [/use_sim_time]
Added node of type [gazebo_ros/gzserver] in namespace [/]
Added node of type [gazebo_ros/gzclient] in namespace [/]
... done importing include file [/Users/.../catkin_ws/src/gazebo_ros_pkgs/gazebo_ros/launch/empty_world.launch]
... loading XML file [/Users/.../catkin_ws/src/myrobot/myrobot_description/launch/robot_state_publisher.launch]
... executing command param [/opt/ros/indigo/lib/xacro/xacro '/Users/.../catkin_ws/src/myrobot/myrobot_description/urdf/base.urdf.xacro']
Added parameter [/robot_description]
Added node of type [robot_state_publisher/state_publisher] in namespace [/]
... done importing include file [/Users/.../catkin_ws/src/myrobot/myrobot_description/launch/robot_state_publisher.launch]
... loading XML file [/Users/.../catkin_ws/src/myrobot/myrobot_control/launch/control.launch]
Added parameter [/myrobot_joint_publisher/type]
Added parameter [/myrobot_joint_publisher/publish_rate]
Added parameter [/myrobot_velocity_controller/pose_covariance_diagonal]
Added parameter [/myrobot_velocity_controller/twist_covariance_diagonal]
Added parameter [/myrobot_velocity_controller/linear/y/max_velocity]
Added parameter [/myrobot_velocity_controller/linear/y/has_acceleration_limits]
Added parameter [/myrobot_velocity_controller/linear/y/has_velocity_limits]
Added parameter [/myrobot_velocity_controller/linear/y/max_acceleration]
Added parameter [/myrobot_velocity_controller/linear/x/max_velocity]
Added parameter [/myrobot_velocity_controller/linear/x/has_acceleration_limits]
Added parameter [/myrobot_velocity_controller/linear/x/has_velocity_limits]
Added parameter [/myrobot_velocity_controller/linear/x/max_acceleration]
Added parameter [/myrobot_velocity_controller/publish_rate]
Added parameter [/myrobot_velocity_controller/wheel_radius_multiplier]
Added parameter [/myrobot_velocity_controller/front_right_wheel_joint]
Added parameter [/myrobot_velocity_controller/back_left_wheel_joint]
Added parameter [/myrobot_velocity_controller/front_left_wheel_joint]
Added parameter [/myrobot_velocity_controller/back_right_wheel_joint]
Added parameter [/myrobot_velocity_controller/wheel_separation_multiplier]
Added parameter [/myrobot_velocity_controller/enable_odom_tf]
Added parameter [/myrobot_velocity_controller/cmd_vel_timeout]
Added parameter [/myrobot_velocity_controller/type]
Added parameter [/myrobot_velocity_controller/angular/z/max_velocity]
Added parameter [/myrobot_velocity_controller/angular/z/has_acceleration_limits]
Added parameter [/myrobot_velocity_controller/angular/z/has_velocity_limits]
Added parameter [/myrobot_velocity_controller/angular/z/max_acceleration]
Added node of type [controller_manager/spawner] in namespace [/]
Added node of type [topic_tools/relay] in namespace [/]
... done importing include file [/Users/.../catkin_ws/src/myrobot/myrobot_control/launch/control.launch]
... loading XML file [/Users/.../catkin_ws/src/myrobot/myrobot_control/launch/teleop.launch]
Added node of type [teleop_twist_keyboard/teleop_twist_keyboard.py] in namespace [/]
... done importing include file [/Users/.../catkin_ws/src/myrobot/myrobot_control/launch/teleop.launch]
Added node of type [gazebo_ros/spawn_model] in namespace [/]

started roslaunch server http://192.168.1.16:49437/

SUMMARY
========

PARAMETERS
 * /myrobot_joint_publisher/publish_rate: 50
 * /myrobot_joint_publisher/type: joint_state_contr...
 * /myrobot_velocity_controller/angular/z/has_acceleration_limits: False
 * /myrobot_velocity_controller/angular/z/has_velocity_limits: False
 * /myrobot_velocity_controller/angular/z/max_acceleration: 1.0
 * /myrobot_velocity_controller/angular/z/max_velocity: 2.0
 * /myrobot_velocity_controller/back_left_wheel_joint: back_left_wheel_link
 * /myrobot_velocity_controller/back_right_wheel_joint: back_right_wheel_...
 * /myrobot_velocity_controller/cmd_vel_timeout: 0.25
 * /myrobot_velocity_controller/enable_odom_tf: True
 * /myrobot_velocity_controller/front_left_wheel_joint: front_left_wheel_...
 * /myrobot_velocity_controller/front_right_wheel_joint: front_right_wheel...
 * /myrobot_velocity_controller/linear/x/has_acceleration_limits: False
 * /myrobot_velocity_controller/linear/x/has_velocity_limits: False
 * /myrobot_velocity_controller/linear/x/max_acceleration: 0.5
 * /myrobot_velocity_controller/linear/x/max_velocity: 1.0
 * /myrobot_velocity_controller/linear/y/has_acceleration_limits: False
 * /myrobot_velocity_controller/linear/y/has_velocity_limits: False
 * /myrobot_velocity_controller/linear/y/max_acceleration: 0.5
 * /myrobot_velocity_controller/linear/y/max_velocity: 1.0
 * /myrobot_velocity_controller/pose_covariance_diagonal: [0.001, 0.001, 10...
 * /myrobot_velocity_controller/publish_rate: 50
 * /myrobot_velocity_controller/twist_covariance_diagonal: [0.001, 0.001, 0....
 * /myrobot_velocity_controller/type: mecanum_drive_con...
 * /myrobot_velocity_controller/wheel_radius_multiplier: 1.0
 * /myrobot_velocity_controller/wheel_separation_multiplier: 1.0
 * /robot_description: <?xml version="1....
 * /rosdistro: indigo
 * /rosversion: 1.11.16
 * /use_sim_time: True

NODES
  /
    cmd_vel_relay (topic_tools/relay)
    controller_spawner (controller_manager/spawner)
    gazebo (gazebo_ros/gzserver)
    gazebo_gui (gazebo_ros/gzclient)
    robot_state_publisher (robot_state_publisher/state_publisher)
    urdf_spawner (gazebo_ros/spawn_model)

ROS_MASTER_URI=http://localhost:11311

core service [/rosout] found
process[gazebo-1]: started with pid [19190]
process[gazebo_gui-2]: started with pid [19192]
process[robot_state_publisher-3]: started with pid [19202]
process[controller_spawner-4]: started with pid [19209]
process[cmd_vel_relay-5]: started with pid [19210]
process[urdf_spawner-6]: started with pid [19211]

[WARN] [WallTime: 1457869357.752491] [0.000000] Controller Spawner couldn't find the expected controller_manager ROS interface.
[controller_spawner-4] process has finished cleanly
log file: /Users/.../.ros/log/9d1a05e3-e8f5-11e5-9c0d-0025bce79628/controller_spawner-4*.log

Edit : I tried "almost" the same setup on an Ubuntu, and I had the following additional messages in the console :

[ INFO] [1457971914.887456146, 1780.244000000]: Loading gazebo_ros_control plugin
[ INFO] [1457971914.890765898, 1780.244000000]: Starting gazebo_ros_control plugin in namespace: /
[ INFO] [1457971914.896273026, 1780.244000000]: gazebo_ros_control plugin is waiting for model URDF in parameter [robot_description] on the ROS param server.
[ INFO] [1457971915.584540607, 1780.244000000]: Loaded gazebo_ros_control.

So I really think my issue is related to OSX.

EDIT 2 :

Ignore my comment about the verbose option, it finally worked, so here is the additional log I retrieved :

Gazebo multi-robot simulator, version 6.5.1
Copyright (C) 2012-2015 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

[Err] [Plugin.hh:165] Failed to load plugin //Users/../catkin_ws/devel/lib/libgazebo_ros_paths_plugin.dylib: dlopen(//Users/.../catkin_ws/devel/lib/libgazebo_ros_paths_plugin.dylib, 9): Library not loaded: libroslib.dylib
  Referenced from: //Users/.../catkin_ws/devel/lib/libgazebo_ros_paths_plugin.dylib
  Reason: image not found
[Err] [Plugin.hh:165] Failed to load plugin //Users/.../catkin_ws/devel/lib/libgazebo_ros_api_plugin.dylib: dlopen(//Users/.../catkin_ws/devel/lib/libgazebo_ros_api_plugin.dylib, 9): Library not loaded: libroslib.dylib
  Referenced from: //Users/.../catkin_ws/devel/lib/libgazebo_ros_api_plugin.dylib
  Reason: image not found
[Msg] Waiting for master.
[Msg] Connected to gazebo master @ http://127.0.0.1:11345
[Msg] Publicized address: 192.168.1.16

A locate give me this : $ locate libgazeborospathsplugin.dylib /Users/../indigodesktopfullws/devel/lib/libgazeborospathsplugin.dylib < created by @mikepurvis script I think /opt/ros/indigo/lib/libgazeborospathsplugin.dylib

And here are my ROS env vars :

ROS_ROOT=/opt/ros/indigo/share/ros
ROS_PACKAGE_PATH=/Users/.../catkin_ws/src:/opt/ros/indigo/share:/opt/ros/indigo/stacks
ROS_MASTER_URI=http://localhost:11311
ROSLISP_PACKAGE_DIRECTORIES=/Users/.../catkin_ws/devel/share/common-lisp
ROS_DISTRO=indigo
ROS_ETC_DIR=/opt/ros/indigo/etc/ros

Asked by LiohAu on 2016-03-13 08:24:12 UTC

Comments

As of gazebo 2.2 (see pull request 925) the .dylib plugin suffix should not be a problem. Is there a way to print more verbose console output to diagnose the error?

Asked by scpeters on 2016-03-14 12:32:36 UTC

Is there any flag, arg or env var that I can add to get a more verbose output ?

Asked by LiohAu on 2016-03-14 12:59:17 UTC

gazebo_ros/launch/empty_world.launch has a verbose option. Try adding verbose:=true to your roslaunch invocation

Asked by scpeters on 2016-03-14 13:57:34 UTC

I have completed the log with the -v option for roslaunch AND with verbose:=true.

Asked by LiohAu on 2016-03-14 19:14:42 UTC

Answers