0
$\begingroup$

I'm using py launch files for spawing a robot in Gazebo environment. System: ROS2-humble After the robot description files(xacro) are launched the ODOM, lidar and GPS (all are gazebo plugins) topics are not getting published. Initial launch file - here follows

import os

from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.actions import IncludeLaunchDescription
from launch.conditions import IfCondition
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import Node


def generate_launch_description():

    pkg_eve_car_gazebo = get_package_share_directory('eve_car_gazebo')
    pkg_eve_car_description = get_package_share_directory('eve_car_description')

    # Sart World
    start_world = IncludeLaunchDescription(
        PythonLaunchDescriptionSource(
            os.path.join(pkg_eve_car_gazebo, 'launch', 'start_world_launch.py'),
        )
    )

    spawn_robot_world = IncludeLaunchDescription(
        PythonLaunchDescriptionSource(
            os.path.join(pkg_eve_car_description, 'launch', 'spawn_robot_launch_v4.launch.py'),
        )
    )     

    return LaunchDescription([
        start_world,
        spawn_robot_world
    ])

[ERROR] [gzserver-1]: process has died [pid 19207, exit code 255, cmd 'gzserver /home/david/eve/install/eve_car_gazebo/share/eve_car_gazebo/worlds/eve_bot_empty.world -slibgazebo_ros_init.so -slibgazebo_ros_factory.so -slibgazebo_ros_force_system.so']

this error occurs when I launch. but the robot physics loads perfectly

I tried to rebuild and reinstall everything. But still no luck!

$\endgroup$

1 Answer 1

0
$\begingroup$

I presume you also launch the gzserver. By adding the verbose launch argument you get a possible inside in what is crashing the gzserver.

# Start Gazebo server
    start_gazebo_server_cmd = IncludeLaunchDescription(
        PythonLaunchDescriptionSource(os.path.join(pkg_gazebo_ros, 'launch', 'gzserver.launch.py')),
        condition=IfCondition(use_simulator),
        launch_arguments={'world': world,
                          'verbose' :"true"}.items())
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.