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

using stdout of a node in a launch file

asked 2016-10-07 07:26:57 -0500

Sietse gravatar image

I would like to use the output of a command in a launch file. Think of the back quote notatie is the shell: hostname So for example something like

<arg name="robotname" default="`hostname`" />

With the idea that the value of robotname is the hostname of the machine.

How could this functionality be achieved?

Thanks in advance, Sietse

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2016-10-07 07:59:28 -0500

mgruhler gravatar image

You would need to write this yourself.

Currently, you can only get environment variables, which would work for the hostname

<arg name="robotname" default="$(env HOSTNAME)/>

The wiki page states that (for kinetic) eval

allows to evaluate arbitrary complex python expressions

but I don't know what this actually means. Maybe this would allow you to work a way around this.

edit flag offensive delete link more

Comments

Thanks! Thats it.

Sietse gravatar image Sietse  ( 2016-10-07 08:20:40 -0500 )edit
0

answered 2016-10-07 07:57:33 -0500

Airuno2L gravatar image

Can you pass the output in through an arg somehow?

http://wiki.ros.org/roslaunch/Command...

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-10-07 07:26:57 -0500

Seen: 217 times

Last updated: Oct 07 '16