Ask Your Question
0

Does <param> override an included launch file's variable?

asked 2021-03-26 12:40:21 -0600

MadeleineP gravatar image

I am including a launch file from another package. It loads a yaml file which sets values in the parameter server.

I like all the values except once, so I'd like to set only that value. However, what I'm doing doesn't seem to override the value on the parameter server. In my launch file I have the following:

<include file="$(find some_package)/launch/package.launch">
  <param name="some/var" type="bool" value="false" />
</include>

where I'd like to change the variable var to false, which is set to true in the yaml file being included by package.launch.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2021-03-26 14:15:23 -0600

updated 2021-03-26 14:15:58 -0600

You can include args with defaults in your launch file and use them as params when launching your node. If you want to change these defaults, you can provide specific args from command line while launching.

<launch>

  <!-- Args -->
  <arg name="some_arg" default="true" doc="description of some arg>

  <include file="$(find some_package)/launch/package.launch">
    <param name="some/var" value="$(arg some_arg)"/>
  </include>

</launch>

If you want to change the value of some_arg at launch time: $ roslaunch some_package some_arg:=false

edit flag offensive delete link more
0

answered 2021-03-26 12:49:01 -0600

MadeleineP gravatar image

Well, I now see that if I put the <param> outside and after the <include> tag, this works as I wanted.

edit flag offensive delete link more

Comments

See also #q199608, which is sort-of a duplicate of your question.

gvdhoorn gravatar image gvdhoorn  ( 2021-03-27 01:33:52 -0600 )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

1 follower

Stats

Asked: 2021-03-26 12:40:21 -0600

Seen: 55 times

Last updated: Mar 26