ROS_NAMESPACE environment variable in ROS 2?

asked 2022-02-27 03:05:24 -0500

aprotyas gravatar image

I couldn't find this anywhere online, so I'm asking here: is there an equivalent to the ROS_NAMESPACE environment variable in ROS 2? I'm developing a course that relies on using said environment variable because all students access ROS through a shared server, and this set-and-forget (in bashrc) approach was very useful for students.

edit retag flag offensive close merge delete



Not sure about the environment variable, but there is a "PushRosNamespace" method when using launch files

WarTurtle gravatar image WarTurtle  ( 2022-04-11 08:15:03 -0500 )edit

I also believe that there is not such thing. Perhaps you can define that namespace globally yourself and then apply it in launch files. Launch files are in Python, so getting the namespace shouldn't be an issue, and then as @WarTurtle pointed out - use PushRosNamespace to apply namespaces to your Nodes.

sejego gravatar image sejego  ( 2022-04-22 01:35:48 -0500 )edit