ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

ROS2 rqt_gui error: unrecognized arguments --perspective-file

asked 2022-09-30 14:54:39 -0500

bcopenha gravatar image

updated 2022-10-01 00:53:42 -0500

ravijoshi gravatar image

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!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-10-08 14:29:25 -0500

marguedas gravatar image

Does it work if you pass the argument and its value as 2 different elements of the argument list ?

Node(package="rqt_gui", executable="rqt_gui", name="monitoring", arguments=["--perspective-file", os.path.join("path", "to", "file")])
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-09-30 14:54:39 -0500

Seen: 354 times

Last updated: Oct 08 '22