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

Roslaunch and env variables for HOSTNAME

asked 2016-07-26 07:45:21 -0500

Mehdi. gravatar image

updated 2020-02-12 19:55:29 -0500

130s gravatar image

In my launch file I want to read the hostname from user input and when it is missing, it will use the local hostname by default. I use this line in my launch file

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

When doing echo $HOSTNAME in the terminal, the value is set, however when I run roslaunch it complains that there is no HOSTNAME variable.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
4

answered 2016-07-26 08:05:32 -0500

Mehdi. gravatar image

HOSTNAME is a special environment variable that is not available for shell scripts. adding

export HOSTNAME

to my .bashrc fixed the problem.

edit flag offensive delete link more

Question Tools

3 followers

Stats

Asked: 2016-07-26 07:45:21 -0500

Seen: 2,667 times

Last updated: Feb 12 '20