ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
I would advise you to read this wiki about names in ROS.
It is not a convention to chose to put a /
or nothing before the topic name. It will actually have consequences about the final name of the topic. In your second example you'll probably have your topic in the rostopic list
appearring as : /your_node_name/lwheel_ticks
whereas with your first example you will just have /lwheel_ticks
.
So it's basically up to you to choose wheither you define the topic with /
, nothing or even a ~
but you should be aware of what it will induce on the actual name of the topic.
For example : imagine you have a node publishing some velocities to a robot. If you define a global name (i.e. /topic
) it will be fine with one robot but what will happened if you have two robots ? You will call your node twice (with a different name of course) and you would have to remap your topic for both node because they would publish on the same topic. If you define a relative name then the topic will be already remapped with your node name so there won't be conflilct and you'll have two topics without changing anything, just by calling your node twice with a different name.
2 | No.2 Revision |
I would advise you to read this wiki about names in ROS.
It is not a convention to chose chsose to put a /
or nothing before the topic name. It will actually have consequences about the final name of the topic. In your second example you'll probably have your topic in the rostopic list
appearring as : /your_node_name/lwheel_ticks
whereas with your first example you will just have /lwheel_ticks
.
So it's basically up to you to choose wheither you define the topic with /
, nothing or even a ~
but you should be aware of what it will induce on the actual name of the topic.
For example : imagine you have a node publishing some velocities to a robot. If you define a global name (i.e. /topic
) it will be fine with one robot but what will happened if you have two robots ? You will call your node twice (with a different name of course) and you would have to remap your topic for both node because they would publish on the same topic. If you define a relative name then the topic will be already remapped with your node name so there won't be conflilct and you'll have two topics without changing anything, just by calling your node twice with a different name.
3 | No.3 Revision |
I would advise you to read this wiki about names in ROS.
It is not a convention to chsose choose to put a /
or nothing before the topic name. It will actually have consequences about the final name of the topic. In your second example you'll probably have your topic in the rostopic list
appearring as : /your_node_name/lwheel_ticks
whereas with your first example you will just have /lwheel_ticks
.
So it's basically up to you to choose wheither you define the topic with /
, nothing or even a ~
but you should be aware of what it will induce on the actual name of the topic.
For example : imagine you have a node publishing some velocities to a robot. If you define a global name (i.e. /topic
) it will be fine with one robot but what will happened if you have two robots ? You will call your node twice (with a different name of course) and you would have to remap your topic for both node because they would publish on the same topic. If you define a relative name then the topic will be already remapped with your node name so there won't be conflilct and you'll have two topics without changing anything, just by calling your node twice with a different name.