Ask Your Question
1

launch file: parameters via -- (double dash) don't go well with commenting

asked 2021-11-23 11:15:25 -0500

ticotico gravatar image

updated 2021-11-23 11:16:38 -0500

I have a rqt being loaded with a custom perspective, see:

<node name="my_rqt_dashboard" pkg="rqt_gui" type="rqt_gui" respawn="false" output="screen" 
    args="--perspective-file $(find my_rospkg)/cfg/viz/asdf.perspective"/>

My "problem" is that commenting out that line breaks the xml, as double hyphen are not allowed in comments, see Link. A workaround is to use &#45;&#45; instead of --, but that is kind of ugly. Any other ideas? Unfortunately, the --perspective-file does not seem to have a single hyphen equivalent, e.g. -q

edit retag flag offensive close merge delete

Comments

1

I put a space in between the two hyphens, so I have <!-- - -perspective-file -->. In my particular case it's a gdb command line, and luckily its argument parser interprets - -foo as --foo, so I don't need to remember to remove the space when commenting back in. FYI, this is my usual way for debugging a crashing node <!-- launch-prefix="xterm -e gdb -ex 'catch throw' -ex 'catch syscall 60' -ex run - -args" -->.

KenYN gravatar image KenYN  ( 2021-11-25 22:56:51 -0500 )edit

1 Answer

Sort by » oldest newest most voted
3

answered 2021-11-23 18:26:42 -0500

miura gravatar image

updated 2021-11-23 18:28:49 -0500

There seems to be a way to make comments like this.

<?ignore
<node name="my_rqt_dashboard" pkg="rqt_gui" type="rqt_gui" respawn="false" output="screen" 
    args="--perspective-file $(find my_rospkg)/cfg/viz/asdf.perspective"/>
?>

( <?ignore <stuff> ?>, and <stuff> is said to be a comment. )

ref : https://norlab.ulaval.ca/research/how...

edit flag offensive delete link more

Comments

1

nice, thx a lot! too bad that there is no out of the box shortcut for that...

ticotico gravatar image ticotico  ( 2021-11-24 10:52:40 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

3 followers

Stats

Asked: 2021-11-23 11:15:25 -0500

Seen: 96 times

Last updated: Nov 23 '21