Ask Your Question
3

Publish to topic via launch file

asked 2016-03-29 16:37:22 -0500

Borob gravatar image

Is it possible to publish to a topic with a custom message type from within a launch file?

In a launch-file I launch several robots from external packages which I want to register to my running platform as they are launched.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
8

answered 2016-03-29 19:25:56 -0500

ahendrix gravatar image

You can run rostopic pub from within a launch file with:

<node pkg="rostopic" type="rostopic" name="rostopic" args="pub {pub args}"/>

where {pub args} are the arguments to rostopic pub to make it publish the way you want it to.

You may also want to change name="rostopic" to something specific to each robot, if there will be multiple copies of this running with the same ros master.

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: 2016-03-29 16:37:22 -0500

Seen: 2,678 times

Last updated: Mar 29 '16