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

Revision history [back]

click to hide/show revision 1
initial version

I don't know of any environment variable (or a similar piece of infrastructure) that you could use for this, but perhaps using the support for loading roscore.xml from /etc/ros could be used for this.

roscore will try to load that file from /etc/ros first, and if that fails, default to the file in the roslaunch package (which will be in /opt/ros/$distro/share). See ros/ros_comm/tools/roslaunch/src/roslaunch/config.py, lines 78 to 84.

I've not tested this, but you could copy the default file to /etc/ros and then add the parameter there.

I don't know of any environment variable (or a similar piece of infrastructure) that you could use for this, but perhaps using the support for loading roscore.xml from /etc/ros could be used for this.

roscore will try to load that file from /etc/ros first, and if that fails, default to the file in the roslaunch package (which will be in /opt/ros/$distro/share). See ros/ros_comm/tools/roslaunch/src/roslaunch/config.py, lines 78 to 84.

I've not tested this, but you could copy the default file to /etc/ros and then add the parameter there.


Edit: apparently the value of ROS_ETC_DIR on my machine (Xenial, Kinetic) is /opt/ros/kinetic/etc/ros instead of /etc/ros.

In any case: adding a parameter to /opt/ros/kinetic/etc/ros/roscore.xml makes it part of the 'default' set of parameters that get set for every roscore launch. Do read the wiki page I linked in my comment for some more information about that file though.

It would have been ideal if /etc/ros was also searched, as that would allow per-machine or per-deployment configuration. I seem to remember some discussion about this a few years ago about exactly this, but can't find it right now.

I don't know of any environment variable (or a similar piece of infrastructure) that you could use for this, but perhaps using the support for loading roscore.xml from /etc/ros could be used for this.

roscore will try to load that file from /etc/ros first, and if that fails, default to the file in the roslaunch package (which will be in /opt/ros/$distro/share). See ros/ros_comm/tools/roslaunch/src/roslaunch/config.py, lines 78 to 84.

I've not tested this, but you could copy the default file to /etc/ros and then add the parameter there.


Edit: apparently the value of ROS_ETC_DIR on my machine (Xenial, Kinetic) is /opt/ros/kinetic/etc/ros instead of /etc/ros.

In any case: adding a parameter to /opt/ros/kinetic/etc/ros/roscore.xml makes it part of the 'default' set of parameters that get set for every roscore launch. Do read the wiki page I linked in my comment for some more information about that file though.

It would have been ideal if /etc/ros was also searched, as that would allow per-machine or per-deployment configuration. I seem to remember some discussion about this a few years ago about exactly this, but can't find it right now.