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

Revision history [back]

AFAIK there is not.

One reason being probably that this is perfectly valid for two nodes to emit on the same topic (see /tf for instance).

On a more general point of view, you should not do that when designing your node, please use meaningful names for your topic instead (aka in, out, position, velocity, etc.) even if they create name clash.

Making sure that a topic name is the duty of the roslaunch XML file and of the architect (the guy who write this file). It is not your role as a node designer.

AFAIK there is not.not. There reason is that there is nothing such as "creating" a topic. Topics are implicitly considered as "existing" as soon as one node starts publishing on it. To this extent, if you really want to see if a ""topic exists"" you should create a publisher and wait for a message to come. This is the best approximation you can get.

One reason being probably that this is perfectly valid for two nodes to emit on the same topic (see /tf for instance).

On a more general point of view, you should not do that when designing your node, please use meaningful names for your topic instead (aka in, out, position, velocity, etc.) even if they create name clash.

Making sure that a topic name is the duty of the roslaunch XML file and of the architect (the guy who write this file). It is not your role as a node designer.

AFAIK there is not. There The reason is that there is nothing such as "creating" a topic. Topics are implicitly considered as "existing" as soon as one node starts publishing on it. To this extent, if you really want to see if a ""topic exists"" you should create a publisher and wait for a message to come. This is the best approximation you can get.

One reason being probably that this is perfectly valid for two nodes to emit on the same topic (see /tf for instance).

On a more general point of view, you should not do that when designing your node, please use meaningful names for your topic instead (aka in, out, position, velocity, etc.) even if they create name clash.

Making sure that a topic name is the duty of the roslaunch XML file and of the architect (the guy who write this file). It is not your role as a node designer.

AFAIK there is not. The reason is that there is nothing such as "creating" a topic. Topics are implicitly considered as "existing" as soon as one node starts publishing on it. To this extent, if you really want to see if a ""topic exists"" you should create a publisher and wait for a message to come. This is the best approximation you can get.

One reason being probably that Also, this is a perfectly valid behavior for two nodes to emit on the same topic (see /tf for instance).

On a more general point of view, you should not do that when designing your node, please use meaningful names for your topic instead (aka in, out, position, velocity, etc.) even if they create name clash.

Making sure that a topic name is the duty of the roslaunch XML file and of the architect (the guy who write this file). It is not your role as a node designer.

AFAIK there is not. The reason is that there is nothing such as "creating" a topic. Topics are implicitly considered as "existing" as soon as one node starts publishing on it. To this extent, if you really want to see if a ""topic exists"" you should create a publisher subscriber and wait for a message to come. This is the best approximation you can get.

Also, this is a perfectly valid behavior for two nodes to emit on the same topic (see /tf for instance).

On a more general point of view, you should not do that when designing your node, please use meaningful names for your topic instead (aka in, out, position, velocity, etc.) even if they create name clash.

Making sure that a topic name is the duty of the roslaunch XML file and of the architect (the guy who write this file). It is not your role as a node designer.