Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gz_ros2_control-system] Could not find shared library #390

Open
Juancams opened this issue Aug 9, 2024 · 7 comments
Open

[gz_ros2_control-system] Could not find shared library #390

Juancams opened this issue Aug 9, 2024 · 7 comments

Comments

@Juancams
Copy link

Juancams commented Aug 9, 2024

Hi!

I'm trying to get the tiago robot working inside harmonic with ros 2 jazzy and I'm having the following problem:

[gz-1] [Err] [SystemLoader.cc:92] Failed to load system plugin [gz_ros2_control-system] : Could not find shared library.

This is what I have in my ros2_control.urdf.xacro

...

<!-- Init the ROS 2 control gazebo interface -->
    <xacro:if value="${use_sim_time}">
      <gazebo>
        <plugin name="gz_ros2_control::GazeboSimROS2ControlPlugin" filename="gz_ros2_control-system">
          <parameters>$(find tiago_description)/ros2_control/gazebo_controller_manager_cfg.yaml</parameters>
        </plugin>
      </gazebo>
    </xacro:if>

    <!-- ROS 2 control config-->
    <ros2_control name="ros2_control_tiago_system" type="system">

      <!-- Execution env config -->
      <hardware>
        <xacro:if value="${use_sim_time}">
          <plugin>gz_ros2_control/GazeboSimSystem</plugin>

        <!-- IMU sensor (only in simulation)-->
        <xacro:ros2_control_imu name="base_imu_sensor"/>
        </xacro:if>
        <xacro:unless value="${use_sim_time}">
          <plugin>robot_control/RobotControl</plugin>
        </xacro:unless>
      </hardware>

...

In another simulator that I have in which I use a UR10 I have no problem putting it like that, but here there is no way and I have tried to call it in different ways.

Thank you so much!

@christophfroehlich
Copy link
Contributor

First of all, can you run the gz_ros2_control_demos successfully?

@Juancams
Copy link
Author

Yes, they work correctly.

@christophfroehlich
Copy link
Contributor

You should cleanup the part from your snippet, why do you have several plugin tags? Use a clean simple working one from the demos, and put some xacro conditions afterwards if you need them.

@n4495
Copy link

n4495 commented Sep 25, 2024

I had a similar problem where I could run the gz_ros2_control_demos without issue but when I tried to use my own URDF+launch files GZ threw the "Could not find shared library" error. Even Using the URDF from the examples with my launch script gave the same result. So I assume the problem is in my launch file.

Turns out the shell var GZ_SIM_SYSTEM_PLUGIN_PATH wasn't set so I pointed it to where I found libgz_ros2_control-system.so.

export GZ_SIM_SYSTEM_PLUGIN_PATH=/opt/ros/jazzy/lib/

This worked but I'm still not sure why the example launch has this set and mine does not.

@Amronos
Copy link

Amronos commented Nov 1, 2024

I also had a similar problem. In my case I think it was caused by using the gz_server.launch.py launch file. The launch file uses gzserver.cpp to just start a gz server. I don't encounter this problem when using the gz_sim.launch.py launch file which the demos use.
I think the plugin path for some reason is not added when using gzserver.cpp.

@roncapat
Copy link
Contributor

roncapat commented Nov 4, 2024

I had a similar problem where I could run the gz_ros2_control_demos without issue but when I tried to use my own URDF+launch files GZ threw the "Could not find shared library" error. Even Using the URDF from the examples with my launch script gave the same result. So I assume the problem is in my launch file.

Turns out the shell var GZ_SIM_SYSTEM_PLUGIN_PATH wasn't set so I pointed it to where I found libgz_ros2_control-system.so.

export GZ_SIM_SYSTEM_PLUGIN_PATH=/opt/ros/jazzy/lib/

This worked but I'm still not sure why the example launch has this set and mine does not.

I confirm it works. Thank you @n4495 for sharing your mitigation here.

@siyengar04
Copy link

I had a similar problem where I could run the gz_ros2_control_demos without issue but when I tried to use my own URDF+launch files GZ threw the "Could not find shared library" error. Even Using the URDF from the examples with my launch script gave the same result. So I assume the problem is in my launch file.

Turns out the shell var GZ_SIM_SYSTEM_PLUGIN_PATH wasn't set so I pointed it to where I found libgz_ros2_control-system.so.

export GZ_SIM_SYSTEM_PLUGIN_PATH=/opt/ros/jazzy/lib/

This worked but I'm still not sure why the example launch has this set and mine does not.

can confirm, this workaround seems to work for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants