Is "/" necessary for naming frames in ROS Noetic

In ROS TF , Unit 3, Subscribe and Publish to TF, program, the goal is to listen to TF data and get one turtle to follow another turtle.

In the code, while naming the frames, we add “/” before the frame name as shown below:

follower_model_frame = "/"+follower_model_name
model_to_be_followed_frame = "/"+model_to_be_followed_name

I got the same result when I ran the code without the “/”, as shown below:

# follower_model_frame = "/"+follower_model_name
# model_to_be_followed_frame = "/"+model_to_be_followed_name

follower_model_frame = follower_model_name
model_to_be_followed_frame = model_to_be_followed_name

If the code works without the “/”, then why add it in the first place?


Good question. So in theory the “/” in front states that you want that TF to have that name, no matter if it has a robot Namespace.

But namespaces in ROS1 are quite a buggy topic and in some systems, this works and some others doesn’t.

In the end it’s just to state that the name has to be /whatever, without the namespace


When you say that its buggy in some systems, what do you mean by systems specifically? is it the Distro like Melodic or specific programs ?

I mean in ROS in general, some packages process correctly the namespacing and others don’t, to avoid that or at least be consistent we use this “/”.