ROS2 rqt_gui error: unrecognized arguments --perspective-file
Hello everyone,
I am trying to launch RQT from a launch file in ROS2 Foxy with a specific custom perspective file. When launching from the command line with ros2 run rqt_gui rqt_gui --perspective-file "path/to/file
, RQT launches with the custom perspective file as expected; however, when trying to launch from inside a launch file by generating a Node with the arguments=['--perspective-file' + os.path.join("path", "to", "file"]
, it raises the error:
"rqt_gui: error: unrecognized arguments: --perspective-file path/to/file"
Additionally and importantly, this doesn't happen when trying to launch with a single dash argument such as -p
. For example, when trying to launch the RQT Node with arguments=['-p' + "@name_of_saved_perspective_file]
, RQT launches with the correct perspective file. This doesn't work however when the perspective list is cleared (or on new systems) so this won't work 100% of the time. This means that we would need to launch RQT with our custom perspective file in a terminal before launching it in the launch file, in order to get the perspective file in the RQT config memory (for lack of a better term). As this is inefficient, I was wondering if anyone knew how to get the launch file to accept double dash arguments.
The format of my launch file is below:
Node(package="rqt_gui", executable="rqt_gui", name="monitoring", arguments=["--perspective-file" + os.path.join("path", "to", "file")])
I am using ROS2 Foxy on Ubuntu 20.04 on an x86 machine. It seems like ROS2 just doesn't process double dash arguments correctly and instead interprets them as strings, so if there is a way to run command line-like arguments from a launch file instead of launching RQT as a Node() class, I would imagine that might work too.
Any help is greatly appreciated and let me know if I need to provide more information! Thank you!