Ask Your Question
0

How to launch master_sync_fkie from the launch file?

asked 2019-05-20 09:49:46 -0500

kump gravatar image

The Multimaster FKIE package provides this node master_sync that sets topics to synchronize among multiple ROS masters. When I launch it from the terminal, I use command

rosrun master_sync_fkie master_sync _ignore_nodes:=[/gazebo*,/gazebo_gui*,/panda*]

so I'm passing this list to it. Now if I want to launch it from launch file, I would need to launch the node like this

<node name="my_master_sync_fkie" pkg="master_sync_fkie" type="master_sync" ... />

and then somehow put those list arguments to it. How can I do that?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2019-05-20 10:53:44 -0500

gvdhoorn gravatar image

updated 2019-05-20 10:58:40 -0500

When I launch it from the terminal, I use command

rosrun master_sync_fkie master_sync _ignore_nodes:=[/gazebo*,/gazebo_gui*,/panda*]

ignore_nodes here is a private parameter of master_sync. The ROS wiki for the package master_sync_fkie documents those here. The specific rosrun command line syntax you're using is documented here.

Private parameters can be passed to nodes in .launch files by adding a rosparam or param element as a child of the node element.

For the specific rosrun command line you show, that would look something like this:

<node name="my_master_sync_fkie" pkg="master_sync_fkie" type="master_sync">
  <rosparam>
    ignore_nodes:
      - '/gazebo*'
      - '/gazebo_gui*'
      - '/panda*'
  </rosparam>
</node>

Note that I used the "verbose list" form here, which I happen to like. You can also still use the single-line notation you used with rosrun.

Note also: the single quotes (') are probably not necessary, but when strings contain (what appear to be) globbing characters I'm always a bit careful and just wrap them in quotes.

edit flag offensive delete link more

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: 2019-05-20 09:49:46 -0500

Seen: 111 times

Last updated: May 20 '19