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

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

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

ticotico gravatar image

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

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 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
3

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

miura gravatar image

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

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 -0600 )edit

Question Tools

3 followers

Stats

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

Seen: 540 times

Last updated: Nov 23 '21