ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

[gzserver-1] Segmentation fault (core dumped) gazebo-11 ROS2 Foxy error

asked 2022-11-24 09:10:44 -0500

Edvard gravatar image

updated 2022-11-25 04:32:04 -0500

Hi. Sorry for all mistakes, English is not my native language. I managed to load in gazebo my map and robot model, but after it is loaded I receive following error:

[gzserver-1] Segmentation fault (core dumped) [ros2-5] Could not contact service /controller_manager/load_controller [ros2-6] Could not contact service /controller_manager/load_controller ^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT) Gazebo window is still working but drop down list Model from World tab is not working. Appreciate any help

UPD. Adding launch file, that I use

import os

from ament_index_python.packages import get_package_share_directory


from launch import LaunchDescription
from launch.actions import ExecuteProcess, IncludeLaunchDescription, RegisterEventHandler
from launch.event_handlers import OnProcessExit
from launch.launch_description_sources import PythonLaunchDescriptionSource

from launch_ros.actions import Node

import xacro


def generate_launch_description():

    package_dir = os.path.join(get_package_share_directory('minicar_simulator'))
    xacro_file = os.path.join(package_dir, 'urdf', 'minicar.gazebo.xacro')
    world_files = os.path.join(package_dir,'worlds','test_walls.world')

    gazebo = IncludeLaunchDescription(
                PythonLaunchDescriptionSource([os.path.join(
                    get_package_share_directory('gazebo_ros'), 'launch'), '/gazebo.launch.py']),launch_arguments={'world': world_files}.items()
    )

    doc = xacro.parse(open(xacro_file))
    xacro.process_doc(doc)
    params = {'robot_description': doc.toxml()}

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

    spawn_entity = Node(package='gazebo_ros', executable='spawn_entity.py',
                        arguments=['-topic', 'robot_description',
                                '-x', '-3.0',
                                '-y', '-1.5',
                                '-z', '2.719',
                                '-entity', 'minicar'],
                        output='screen')

    load_joint_state_controller = ExecuteProcess(
        cmd=['ros2', 'control', 'load_controller', '--set-state', 'start',
            'joint_state_broadcaster'],
        output='screen'
    )

    load_joint_trajectory_controller = ExecuteProcess(
        cmd=['ros2', 'control', 'load_controller', '--set-state', 'start',
            'minicar_controller'],
        output='screen'
    )

    return LaunchDescription([
        RegisterEventHandler(
            event_handler=OnProcessExit(
                target_action=spawn_entity,
                on_exit=[load_joint_state_controller],
            )
        ),
        RegisterEventHandler(
            event_handler=OnProcessExit(
                target_action=load_joint_state_controller,
                on_exit=[load_joint_trajectory_controller],
            )
        ),
        gazebo,
        node_robot_state_publisher,
        spawn_entity
    ])
edit retag flag offensive close merge delete

Comments

Have you installed control manager package?

sudo apt-get install ros-<version>-controller-manager

and

sudo apt-get install ros-<version>-controller-manager-msgs
Ranjit Kathiriya gravatar image Ranjit Kathiriya  ( 2022-11-24 11:06:57 -0500 )edit

Thank you for your help. Yes, I am. It doesn't seem to be the reason for this problem

Edvard gravatar image Edvard  ( 2022-11-24 23:14:15 -0500 )edit

Can you show your launch file where you are using controller_manager package.

Thanks

Ranjit Kathiriya gravatar image Ranjit Kathiriya  ( 2022-11-25 04:14:28 -0500 )edit

Again thank you. I added launch file in question

Edvard gravatar image Edvard  ( 2022-11-25 04:32:41 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-11-25 07:42:47 -0500

Ranjit Kathiriya gravatar image

updated 2022-11-25 07:44:15 -0500

Hello,

From your code I can understand that, you have not called controller_manager service. You need to add controller manager node in your launch file..

Node(
                package="controller_manager",
                executable="ros2_control_node",
                parameters=[robot_description, controller_file],  # URDF file and controller yaml file
                output="screen",
            )
edit flag offensive delete link more

Comments

Thank you for your help. I added controller_manager to to launch file and now I have following error:

[gzserver-1] [INFO] [1669646397.238929908] [controller_manager]: Loading controller 'joint_state_broadcaster'
[gzserver-1] terminate called after throwing an instance of 'pluginlib::CreateClassException'
[gzserver-1]   what():  MultiLibraryClassLoader: Could not create object of class type joint_state_broadcaster::JointStateBroadcaster as no factory exists for it. Make sure that the library exists and was explicitly loaded through MultiLibraryClassLoader::loadLibrary()
[gzserver-1] Aborted (core dumped)
[ERROR] [gzserver-1]: process has died [pid 22867, exit code 134, cmd 'gzserver /home/mikita/ros2_ws/install/minicar_simulator/share/minicar_simulator/worlds/test_walls.world                                                                      -s libgazebo_ros_init.so   -s libgazebo_ros_factory.so   -s libgazebo_ros_force_system.so       '].

Any thoughts?

Edvard gravatar image Edvard  ( 2022-11-28 08:29:01 -0500 )edit

sudo apt-get install ros-<version>-gazebo-ros

Ranjit Kathiriya gravatar image Ranjit Kathiriya  ( 2022-11-28 09:29:03 -0500 )edit

This is result of the operation.

Reading package lists... Done
Building dependency tree       
Reading state information... Done
ros-foxy-gazebo-ros is already the newest version (3.5.3-1focal.20221013.010602).
ros-foxy-gazebo-ros set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Everything has been installed before. I used full desktop installation with this guide before starting migration. Still, much appreciate for your help and time.

Edvard gravatar image Edvard  ( 2022-11-29 00:32:13 -0500 )edit

sudo apt-get install ros-<disto>-gazebo-ros-pkgs ros--<disto>-gazebo-ros-control

Have a look at this package; this is a gazebo package error.

Ranjit Kathiriya gravatar image Ranjit Kathiriya  ( 2022-11-29 02:00:41 -0500 )edit
1

Sorry that I answering only now. So, I reinstall my ros and gazebo and that resolved my problem. Apparantly, that was an installation problem.

Edvard gravatar image Edvard  ( 2022-12-05 03:40:50 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2022-11-24 09:10:44 -0500

Seen: 644 times

Last updated: Nov 25 '22