ros-controls / gz_ros2_control

Connect the latest version of Gazebo with ros2_control.
https://gazebosim.org
Apache License 2.0
114 stars 84 forks source link

Failed to load system plugin [ign_ros2_control] #91

Open karolinajudzentyte opened 2 years ago

karolinajudzentyte commented 2 years ago

Hello, I am trying to get moveit2 configured arm working in ignition. I am using humble with docker set the following: export IGN_GAZEBO_SYSTEM_PLUGIN_PATH="/root/ws_moveit/install/ign_ros2_control/lib" export XDG_RUNTIME_DIR=/run/user/1000 export IGN_FILE_PATH="/root/ws_moveit/src" export RUNLEVEL=3

Have added the flowing to the URDF file:

`

ign_ros2_control/IgnitionSystem

...

/root/ws_moveit/install/courgette_moveit_config_new/share/courgette_moveit_config_new/config/ros2_controllers.yaml controller_manager

`

I am getting the following error

[ign gazebo-1] [ignition::plugin::Loader::LookupPlugin] Failed to get info for [ign_ros2_control]. Could not find a plugin with that name or alias. [ign gazebo-1] [Err] [SystemLoader.cc:91] Failed to load system plugin [ign_ros2_control] : could not instantiate from library [libign_ros2_control-system.so] from path [/root/ws_moveit/install/ign_ros2_control/lib/libign_ros2_control-system.so]. Any help would be appreciated

wilcobonestroo commented 1 year ago

Hi @karolinajudzentyte,

This issue seems similar to #89. I am currently trying to get ign_ros2_control working in ROS 2 Humble (not in Docker). Yesterday, I encountered a similar problem that you describe. I could solve it by changing the name in the plugin tag from ign_ros2_control to ign_ros2_control::IgnitionROS2ControlPlugin. In my case that solved the loading error.

<gazebo>
    <plugin filename="libign_ros2_control-system.so" name="ign_ros2_control::IgnitionROS2ControlPlugin">
   ... the rest here ...
</gazebo>

Does that help?

wilcobonestroo commented 1 year ago

I also made a small repo where the plugin is loaded. However, I can't figure out how to activate it. I also posted a question about the latter on ROS Answers.

SteveMacenski commented 1 year ago

This is blocking a migration to Ignition by Nav2 See iRobot's ticket above

alsora commented 1 year ago

FYI: these issues are present in the humble branch, but they seem to be fixed in the master branch.

iche033 commented 1 year ago

I tested the newly available ign-ros2-control-demos binary packages that's on the ros2-testing repo and the demos worked for me. We'll just need to wait for the next humble sync

mbed92 commented 1 year ago

@wilcobonestroo I think that the plugin is loaded when Ignition Gazebo launches. Perhaps you should pay attention to the order of nodes loaded in the launchfile? Also, have you loaded environmental variables when launching Ignition Gazebo? I guess it should be something like that:

    env = {
        'IGN_GAZEBO_SYSTEM_PLUGIN_PATH': ':'.join([
            os.environ.get('IGN_GAZEBO_SYSTEM_PLUGIN_PATH', default=''),
            os.environ.get('LD_LIBRARY_PATH', default='')]
        ),
        'IGN_GAZEBO_RESOURCE_PATH': ":".join([
            # path to your worlds and meshes
        ])
    }

    cmd = ["ign gazebo", world, "--force-version", gz_version, "-v", "4"]
    ign_gazebo_spawn_world = ExecuteProcess(
        cmd=cmd,
        additional_env=env,
        output='screen',
        shell=True
    )

Generally, I have other compatibility issues, a lack of 'humble' branches in many repos, and tons of other problems with ROS 2, but that one worked for me.