gazebo fails to load ign_ros2_control-system plugin

asked 2022-10-03 15:40:34 -0500

lukas97 gravatar image

updated 2022-10-06 00:32:42 -0500

gazebo: gazebo citadel ros distro: foxy installed binaries: ros-foxy-ignition-citadel,ros-foxy-ign-ros2-control and ros-foxy-ign-ros2-control-demos

I was trying to setup the <ros2_control> tag for my robot to use with the ign_ros2_control/IgnitionSystem plugin, however when I try to spawn the robot into empty gazebo world, I get the following error message in the gazebo terminal

lukas@DESKTOP-QRS1BRB:~$ ign gazebo empty.sdf
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-lukas'
[Err] [SystemLoader.cc:66] Failed to load system plugin [ign_ros2_control-system]: couldn't find shared library.

here is the <ros2_control> tag

<ros2_control name="IgnitionSystem" type="system">
    <hardware>
      <plugin>ign_ros2_control/IgnitionSystem</plugin>
    </hardware>
    <joint name="link_1_joint">
      <command_interface name="position">
        <param name="min">-15</param>
        <param name="max">15</param>
      </command_interface>
      <state_interface name="position"/>
      <state_interface name="velocity"/>
      <state_interface name="effort"/>
    </joint>
  </ros2_control>

   <gazebo>
    <!-- Joint state publisher -->
    <plugin filename="libign_ros2_control-system.so" name="ign_ros2_control">
      <robot_param>robot_description</robot_param>
      <robot_param_node>robot_state_publisher</robot_param_node>
      <parameters>$(find inobot_config)/config/ros_controllers.yaml</parameters>
    </plugin>
  </gazebo>

None of the demos work neither, when I try to launch the cart position demo I get the following output with no working system

log.txt

Let me know if this is not the right place to post this issue as I am unsure if this is issue with gazebo or gz_ros2_control, however I keep getting the same error msg (i.e. Failed to load system plugin) for other plugins such as diff_drive, camera, imu

Here is the output of the launch.log

1664774096.8416636 [INFO] [launch]: All log files can be found below /home/lukas/.ros/log/2022-10-03-06-14-56-834269-DESKTOP-QRS1BRB-19283
1664774096.8420956 [INFO] [launch]: Default logging verbosity is set to INFO
1664774097.0093417 [INFO] [ign gazebo-1]: process started with pid [19288]
1664774097.0096638 [INFO] [robot_state_publisher-2]: process started with pid [19291]
1664774097.0098433 [INFO] [create-3]: process started with pid [19293]
1664774097.4934983 [INFO] [create-3]: process has finished cleanly [pid 19293]
1664774097.5219979 [INFO] [ros2-4]: process started with pid [19356]
1664774108.1720819 [WARNING] [launch]: user interrupted with ctrl-c (SIGINT)
1664774108.1955278 [INFO] [robot_state_publisher-2]: process has finished cleanly [pid 19291]
1664774108.3028009 [ERROR] [ros2-4]: process has died [pid 19356, exit code 2, cmd 'ros2 control load_controller --set-state start joint_state_broadcaster'].
1664774113.1790979 [ERROR] [ign gazebo-1]: process[ign gazebo-1] failed to terminate '5' seconds after receiving 'SIGINT', escalating to 'SIGTERM'
1664774113.1800406 [INFO] [ign gazebo-1]: sending signal 'SIGTERM' to process[ign gazebo-1]
1664774113.1809649 [ERROR] [ign gazebo-1]: process has died [pid 19288, exit code -15, cmd 'ign gazebo  -r -v 4 empty.sdf'].
edit retag flag offensive close merge delete

Comments

I just tested the examples in docker with your set of binaries and it worked. Not sure what the problem is from looking at the logs. Can you also post the logs from your ~/.ros/log/2022-10-03-06-14-56-834269-DESKTOP-QRS1BRB-19283/?

azeey gravatar imageazeey ( 2022-10-05 21:17:15 -0500 )edit

thanks, azeey, I appended the output of the launch.log to the original post

lukas97 gravatar imagelukas97 ( 2022-10-06 00:33:34 -0500 )edit

@azeey it worked for you? What is the requirement to run it? Is there any apt repo needed for this one? What about colcon build? Where should I use the colcon build at? I tried it another day when people asked me how and I couldn't figure it out lol See here: https://github.com/ros-controls/gz_ro...

I wanted to help them but i dont know how. Do you think you could refer us to the right route?

kakcalu13 gravatar imagekakcalu13 ( 2022-10-06 07:55:31 -0500 )edit

BTW @lukas97, your log says user pressed C to end. Prior to that event, was it just hanging for no reason?

kakcalu13 gravatar imagekakcalu13 ( 2022-10-06 07:56:04 -0500 )edit

From the launch.log, it looks like you pressed ctrl-c within 10 seconds of launch, as @kakcalu13 mentioned. Is that not the case?

azeey gravatar imageazeey ( 2022-10-11 18:47:29 -0500 )edit

thanks, yes, I interrupted it as it threw a bunch of errors in the console output and nothing would happen - did not start the ros2 controllers

lukas97 gravatar imagelukas97 ( 2022-10-14 11:40:09 -0500 )edit

Can you run it longer (at least a minute) and send the logs?

azeey gravatar imageazeey ( 2022-10-14 12:40:36 -0500 )edit