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

gzserver Does not Find Some Gazebo Plugins #630

Open
Amronos opened this issue Nov 2, 2024 · 1 comment
Open

gzserver Does not Find Some Gazebo Plugins #630

Amronos opened this issue Nov 2, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Amronos
Copy link
Contributor

Amronos commented Nov 2, 2024

Environment

  • OS Version: Ubuntu 24.04
  • Source or binary build?
    Source - ad225a2

Description

  • Expected behavior: When launching gazebo through the gz_server.launch.py launch file, I expected gazebo to find the gz_ros2_control-system plugin and not report an error.
  • Actual behavior: Gazebo does not find the plugin and outputs Failed to load system plugin [gz_ros2_control-system] : Could not find shared library.

More information can be found in ros-controls/gz_ros2_control#390

Steps to reproduce

Use the following launch file (A slightly modified version of diff_drive_example.launch.py that uses gz_server.launch.py):

from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription
from launch.actions import RegisterEventHandler
from launch.event_handlers import OnProcessExit
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import Command, FindExecutable, LaunchConfiguration, PathJoinSubstitution

from launch_ros.actions import Node
from launch_ros.substitutions import FindPackageShare


def generate_launch_description():
    # Launch Arguments
    use_sim_time = LaunchConfiguration('use_sim_time', default=True)

    # Get URDF via xacro
    robot_description_content = Command(
        [
            PathJoinSubstitution([FindExecutable(name='xacro')]),
            ' ',
            PathJoinSubstitution(
                [FindPackageShare('gz_ros2_control_demos'),
                 'urdf', 'test_diff_drive.xacro.urdf']
            ),
        ]
    )
    robot_description = {'robot_description': robot_description_content}
    robot_controllers = PathJoinSubstitution(
        [
            FindPackageShare('gz_ros2_control_demos'),
            'config',
            'diff_drive_controller_velocity.yaml',
        ]
    )

    node_robot_state_publisher = Node(
        package='robot_state_publisher',
        executable='robot_state_publisher',
        output='screen',
        parameters=[robot_description]
    )

    gz_spawn_entity = Node(
        package='ros_gz_sim',
        executable='create',
        output='screen',
        arguments=['-topic', 'robot_description', '-name',
                   'diff_drive', '-allow_renaming', 'true'],
    )

    joint_state_broadcaster_spawner = Node(
        package='controller_manager',
        executable='spawner',
        arguments=['joint_state_broadcaster'],
    )
    diff_drive_base_controller_spawner = Node(
        package='controller_manager',
        executable='spawner',
        arguments=[
            'diff_drive_base_controller',
            '--param-file',
            robot_controllers,
            ],
    )

    return LaunchDescription([
        # Launch gazebo environment
        IncludeLaunchDescription(
            PythonLaunchDescriptionSource(
                [PathJoinSubstitution([FindPackageShare('ros_gz_sim'),
                                   'launch',
                                   'gz_server.launch.py'])]),
            launch_arguments=[('world_sdf_file', 'empty.sdf'),]),
        RegisterEventHandler(
            event_handler=OnProcessExit(
                target_action=gz_spawn_entity,
                on_exit=[joint_state_broadcaster_spawner],
            )
        ),
        RegisterEventHandler(
            event_handler=OnProcessExit(
                target_action=joint_state_broadcaster_spawner,
                on_exit=[diff_drive_base_controller_spawner],
            )
        ),
        node_robot_state_publisher,
        gz_spawn_entity,
        # Launch Arguments
        DeclareLaunchArgument(
            'use_sim_time',
            default_value=use_sim_time,
            description='If true, use simulated clock'),
    ])
@Amronos Amronos added the bug Something isn't working label Nov 2, 2024
@Amronos
Copy link
Contributor Author

Amronos commented Nov 17, 2024

I tested this with a binary installation of v1.0.7 (jazzy) from the testing repository. The result is the same: using gz_sim.launch.py, the plugin is found successfully while when using gz_server.launch.py, the plugin is not found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Inbox
Development

No branches or pull requests

1 participant