ROS2 launch file: how to convert LaunchArgument to string
I want to convert either a LaunchConfiguration
or a LaunchArgument
to a string so I can use it in a filepath later. How to do it?
Example:
support_package = LaunchConfiguration("support_package")
declared_arguments = []
declared_arguments.append(
DeclareLaunchArgument(
"support_package",
description="Name of the support package",
choices=["abb_irb_1200_support"],
)
)
robot_description_config = xacro.process_file(
os.path.join(
get_package_share_directory(support_package), # FAILURE AT THIS LINE
"urdf",
"irb1200_5_90.xacro",
)
)
The failure is:
Caught exception when trying to load file of format [py]: expected string or bytes-like object
I'm not much of a Python programmer, but an str()
function would be great.
Related question: https://answers.ros.org/question/3407...