Maximum Recursion depth exceeded when calling a Python Object

asked 2023-07-11 05:37:18 -0500

dianne gravatar image

updated 2023-07-12 23:53:29 -0500

gvdhoorn gravatar image

Hi I'm newbie in using ROS2. Hoping someone can help me fix the error that I attached. Have a good day!

import os

from ament_index_python.packages import get_package_share_directory
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription, ExecuteProcess
from launch.substitutions import LaunchConfiguration ,Command ,PathJoinSubstitution
from launch_ros.substitutions import FindPackageShare
#from launch.conditions import IfCondition
from launch import LaunchDescription
from launch_ros.actions import Node

import xacro

def generate_launch_description():

        use_sim_time = LaunchConfiguration('use_sim_time', default='true')
        #path  sa world and kanang gas station kay custom map sa lain ako ge suwayan
        world_path = PathJoinSubstitution (
                        [FindPackageShare('mecanum_gazebo'), 'world', 'gas_station.world ']
                        )   
        #description ni sa robot
        description_launch_path = PathJoinSubstitution(
                        [FindPackageShare('mecanum_description'), 'launch', 'description.launch.py']
                )

        return LaunchDescription([
                        DeclareLaunchArgument(
                                name='world',
                                default_value=world_path,
                                description='Gazebo World'
                        ),

                        ExecuteProcess(
                                cmd=['gazebo', '--verbose', '-s', 'libgazebo_ros_factory.so', '-s', 'libgazebo_ros_init.so', LaunchConfiguration('world')],
                                output = 'screen'
                        ),

                        Node(
                                package='gazebo_ros',
                                executable='spawn_entity.py',
                                name='urdf_spawner',
                                output='screen',
                                arguments=["-topic", "mecanum_description", "-entity", "mecanum_wp"]
                        ),

                        IncludeLaunchDescription(
                                PythonLaunchDescriptionSource(description_launch_path),
                                launch_arguments={
                                        'use_sim_time': str(use_sim_time),
                                        'publish_joints': 'false',
                                }.items()
                        ),


                ])
edit retag flag offensive close merge delete

Comments

I would suggest to include a verbatim copy of the error message you see.

Paraphrasing or selectively copy-pasting only parts of them is not a good idea, as important information may be missing.

gvdhoorn gravatar image gvdhoorn  ( 2023-07-12 23:55:32 -0500 )edit