Ask Your Question

About Topics and Namespaces

asked 2019-08-16 17:02:18 -0600

Ras Vince gravatar image

updated 2019-08-19 13:20:48 -0600

gvdhoorn gravatar image

Hi all,

I'm new in ROS (I'm using Indigo and Ubuntu 16.04), so in order to start to manage ROS environments I have launched the dataset prepared for an algorithm that I have studied (concretely, SVO). But at this point, some doubts arise.

First of all, can one topic have differents kinds of messages? I explain it: I executed commands "rostopic echo /svo/keyframes" and "rostopic echo /svo/points" to see what is published in these topics. According to ROSwiki, tutorials I had seen, and my rqt_graph, I thougth that "svo" is the namespace; but in rviz appears the following fields (Namespaces looks like belong to topics...)

Does it mean that in the same topic ("/svo/points") are being published points from map and from trajectory?

Then, how could I see this in rostopic? Default info displayed is only about trajectory points

Same doubt for the the topic /svo/keyframes with cams and kfs namespaces


Thank you so much in advance! Hope anyone can clarify my confusion :)

Edit: Thank you very much for response! It's clearer now.

There you'd need to more details about the node you are using.

I tried to link a screenshot that showed my rviz settings, but I don't know why I did it wrong... so I am going to describe it with more details:

"svo" is a node which publishes in the topics "/svo/points" and "/svo/keyframes". I have 2 Markers to visualize these 2 topics in rviz, one for "/svo/points" and the other for "/svo/keyframes". Both of them, in their rviz Marker, have a dropdown field called 'Namespaces', with 2 options each. For example, in "/svo/points" appear namespace 'pts' (for points on the map) and namespace 'trajectory' (por points that recover the camera path). According to your reply, both ('pts' and 'trajectory') are published with same message format in "/svo/points" topic. Okey, I understand it. But when I execute rostopic echo command with this topic, the bash only displays info about points regardindg to 'trajectory' namespace.

So, my doubts are

  • Are 'pts' and 'trayectory' a namespaces within "/svo/points" topic?
  • How could I see info for 'pts' points with rostopic echo? (By default only displays info for 'trajectory' namespace)

I hope I have expressed myself better. Thanks again. BR.

edit retag flag offensive close merge delete


Do not post updates as answers, unless you are answering your own question.

To add more information or to clarify something, edit your original question (using the edit button/link) or post a comment.

Edit: I've also just given you sufficient karma to post your RViz screenshot. So please do so.

gvdhoorn gravatar image gvdhoorn  ( 2019-08-19 13:07:06 -0600 )edit

Sorry, I'll keep it in mind next time. Thanks.

Ras Vince gravatar image Ras Vince  ( 2019-08-19 13:14:41 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-08-19 01:46:35 -0600

mgruhler gravatar image

updated 2019-08-20 01:44:02 -0600

(I'm using Indigo and Ubuntu 16.04)

Let's start with this :-) If there is no very specific reason to use Indigo, I'd suggest to migrate to another Ubuntu/ROS version, as Indigo is EOL. I'd suggest you use Melodic, as this is the latest release...

can one topic have differents kinds of messages?

No, they must all be of the same "kind", i.e. message type (e.g. std_msgs/Int32). But any node can publish to that topic.

I executed commands "rostopic echo /svo/keyframes" and "rostopic echo /svo/points" to see what is published in these topics.

Yes, that are two topics. They are put into a namespace (you are correct there as well), to show that they are somehow related. The extent to which they are related can be from: "published in the same node" to "both are required for a consumer to work properly". But rviz can only visualize single topics, not namespaces, which is why the full name appears. Otherwise you would not be able to distinguish between the same type of topic from multiple nodes (often an issue when using multiple sensors, e.g. two cameras, where both publish an image topic).

Does it mean that in the same topic ("/svo/points") are being published points from map and from trajectory?

This I don't understand, but I don't think this is (or at least should not be) the case. There you'd need to more details about the node you are using.

I hope this helps. Please edit your question with follow-up information.


@Ras Vince thanks for the update. This really clarifies and very well describes the issue.

With visualization_msgs/Marker there is actually another set of "namespaces" available. I didn't think of this so this is why I didn't understand your issue before. The screenshot now makes the problem clear.

As the message definition states:

Namespace to place this object in... used in conjunction with id to create a unique name for the object

The thing with markers is now that the objects published to the marker topic are actually persistent, until an object with the same unique name is republished. As stated above, the unique name consists of the namespace ns as well as the id that is published to the topic.

To quickly see if it is actually only the trajectory namespace being published, or if there are multiple ones, you can use rostopic echo /svo/points/ns which will only print the namespaces. It could very well be that the two namespaces are published with different frequencies.

I hope this clarifies a bit the issue you are seeing here.

edit flag offensive delete link more


Thank you so much! Your explanation really works for me. All understood now on this subject :) Best regards.

Ras Vince gravatar image Ras Vince  ( 2019-08-20 17:18:53 -0600 )edit

@Ras Vince Happy to help. Please mark this question as answered by clicking the checkmark icon next to the answer. This helps other people quickly filter where they can get the information they are looking for.

mgruhler gravatar image mgruhler  ( 2019-08-21 00:55:12 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2019-08-16 16:49:30 -0600

Seen: 365 times

Last updated: Aug 20 '19