[gzserver-1] Segmentation fault (core dumped) gazebo-11 ROS2 Foxy error
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:
[INFO] [ros2-5]: process started with pid [2622] [gzserver-1] Segmentation fault (core dumped) [ERROR] [gzserver-1]: process has died [pid 2483, exit code 139, cmd 'gzserver /home/mikita/ros2ws/install/minicarsimulator/share/minicarsimulator/worlds/testwalls.world -s libgazeborosinit.so -s libgazeborosfactory.so -s libgazeborosforcesystem.so ']. [ros2-5] Could not contact service /controllermanager/loadcontroller [ERROR] [ros2-5]: process has died [pid 2622, exit code 1, cmd 'ros2 control loadcontroller --set-state start jointstatebroadcaster']. [INFO] [ros2-6]: process started with pid [2656] [ros2-6] Could not contact service /controllermanager/loadcontroller [ERROR] [ros2-6]: process has died [pid 2656, exit code 1, cmd 'ros2 control loadcontroller --set-state start minicarcontroller']. ^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT) [robotstatepublisher-3] [INFO] [1669312321.033221398] [rclcpp]: signalhandler(signalvalue=2) [INFO] [robotstatepublisher-3]: process has finished cleanly [pid 2488] [ERROR] [gzclient -2]: process has died [pid 2485, exit code -2, cmd 'gzclient '].
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
])
Asked by Edvard on 2022-11-24 10:10:44 UTC
Answers
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",
)
Asked by Ranjit Kathiriya on 2022-11-25 08:42:47 UTC
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?
Asked by Edvard on 2022-11-28 09:29:01 UTC
sudo apt-get install ros-
Asked by Ranjit Kathiriya on 2022-11-28 10:29:03 UTC
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.
Asked by Edvard on 2022-11-29 01:32:13 UTC
sudo apt-get install ros-
Have a look at this package; this is a gazebo package error.
Asked by Ranjit Kathiriya on 2022-11-29 03:00:41 UTC
Sorry that I answering only now. So, I reinstall my ros and gazebo and that resolved my problem. Apparantly, that was an installation problem.
Asked by Edvard on 2022-12-05 04:40:50 UTC
Comments
Have you installed control manager package?
and
Asked by Ranjit Kathiriya on 2022-11-24 12:06:57 UTC
Thank you for your help. Yes, I am. It doesn't seem to be the reason for this problem
Asked by Edvard on 2022-11-25 00:14:15 UTC
Can you show your launch file where you are using controller_manager package.
Thanks
Asked by Ranjit Kathiriya on 2022-11-25 05:14:28 UTC
Again thank you. I added launch file in question
Asked by Edvard on 2022-11-25 05:32:41 UTC