Caught exception in launch (see debug for traceback): Unable to parse the value of parameter robot_description as yaml
Hello,
I am currently trying to run my TurtleBot2 on ROS2 Humble (using Ubuntu 22.04), but have troubles to import my modified URDF files. The bringup launch file worked for the preset URDF files but after importing the URDF files of my TurtleBot2 (it has a construction frame with a Asus Xtion Pro live, a Hokuyo URG-04-LX-UG01 , aswell as 2 Dynamixel AX12A mounted on ) it keeps showing me this error whenever I launch the turtlebot_bringup.launch.py file:
`[INFO] [launch]: Default logging verbosity is set to INFO
[ERROR] [launch]: Caught exception in launch (see debug for traceback): Unable to parse the value of parameter robot_description as yaml. If the parameter is meant to be a string, try wrapping it in launch_ros.parameter_descriptions.ParameterValue(value, value_type=str)`
turtlebot_bringup.launch.py:
import os
from struct import pack
from setuptools import Command
from ament_index_python import get_package_share_directory, get_package_share_path
import launch
import launch.launch_description_sources
import launch.substitutions
import launch_ros
import launch_ros.substitutions
def generate_launch_description():
kobuki_package = launch_ros.substitutions.FindPackageShare(package='kobuki_node').find('kobuki_node')
urg_package = launch_ros.substitutions.FindPackageShare(package='urg_node2').find('urg_node2')
turtlebot2_bringup_package = launch_ros.substitutions.FindPackageShare(package='turtlebot2_bringup').find('turtlebot2_bringup')
turtlebot2_description_package = launch_ros.substitutions.FindPackageShare(package='turtlebot2_description').find('turtlebot2_description')
ekf_config_params = os.path.join(turtlebot2_bringup_package,'config/ekf_config.yaml')
kobuki_node_launch = launch.actions.IncludeLaunchDescription(
launch.launch_description_sources.PythonLaunchDescriptionSource(
os.path.join(
kobuki_package,
'launch/kobuki_node-launch.py')
)
)
ekf_node = launch_ros.actions.Node(
package='robot_localization',
executable='ekf_node',
output='screen',
parameters=[ekf_config_params],
remappings=[("odometry/filtered", "odom")]
)
urg_node = launch.actions.IncludeLaunchDescription(
launch.launch_description_sources.PythonLaunchDescriptionSource(
os.path.join(
urg_package,
'launch/urg_node2.launch.py'
)
),
launch_arguments= {'sensor_interface':'serial'}.items()
)
robot_state_publisher_node = launch_ros.actions.Node(
package='robot_state_publisher',
executable='robot_state_publisher',
parameters=[{'robot_description': launch.substitutions.Command(['xacro ',os.path.join(turtlebot2_description_package,'robots/kobuki_conveyor.urdf.xacro')])}]
)
joint_state_publisher_node = launch_ros.actions.Node(
package='joint_state_publisher',
executable='joint_state_publisher',
name='joint_state_publisher'
)
rviz_node = launch_ros.actions.Node(
package='rviz2',
executable='rviz2',
name='rviz2',
output='screen',
arguments=['-d',os.path.join(turtlebot2_bringup_package,'rviz/bringup.rviz')],
condition=launch.conditions.IfCondition(launch.substitutions.LaunchConfiguration("open_rviz"))
)
return launch.LaunchDescription([
launch.actions.DeclareLaunchArgument(
'open_rviz',
default_value='false',
description='open rviz'),
kobuki_node_launch,
urg_node,
robot_state_publisher_node,
joint_state_publisher_node,
rviz_node,
#ekf_node
])
kobuki_conveyor.urdf.xacro:
<?xml version="1.0"?>
<!--
- Base : kobuki
- Stacks : conveyor
- 3d Sensor : asus xtion pro live
: hokuyo
-->
<robot name="turtlebot" xmlns:xacro="http://ros.org/wiki/xacro">
<!-- <xacro:include filename="$(find turtlebot2_description)/urdf/turtlebot_library.urdf.xacro" /> -->
<xacro:include filename="$(find turtlebot2_description)/urdf/turtlebot_common_library.urdf.xacro" />
<!-- <xacro:include filename="$(find turtlebot2_description)/urdf/turtlebot_properties.urdf.xacro" /> -->
<xacro:include filename="$(find kobuki_description)/urdf/kobuki.urdf.xacro" />
<xacro:include filename="$(find turtlebot2_description)/urdf/stacks/conveyor.urdf.xacro" />
<xacro:kobuki/>
<xacro:stack_conveyor parent="base_link"/>
<!--
<xacro:sensor_asus_xtion_pro1 parent="base_link"/>
<xacro:sensor_asus_xtion_pro2 parent="base_link"/>
<xacro:sensor_hokuyo parent="base_link"/>
-->
</robot>
conveyor.urdf.xacro:
<?xml version="1.0"?>
<!--
Hexagon stacks
-->
<robot name="stack_conveyor" xmlns:xacro="http://ros.org/wiki/xacro">
<xacro:include filename="$(find turtlebot2_description)/urdf/common_properties.urdf.xacro"/>
<!--<xacro:include filename="$(find turtlebot2_description)/urdf/turtlebot_properties.urdf.xacro"/> -->
<!-- Xacro properties -->
<xacro:property name="M_SCALE" value="0.001 ...
@djchopp I've seen that you've answered a similiar question, I hope you don't mind me tagging you. Could you maybe take a look and tell me if you see any mistakes?