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

creating rostopic

asked 2016-08-02 09:54:51 -0500

SaurabhR gravatar image

updated 2016-08-02 09:58:58 -0500

Hi, I am confused in how to create ROSTOPICs. In case of ROSMSG,one has to create a msg folder and then .msg file .Does one has to do the similar process for creating ROSTOPIC ?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2016-08-02 10:00:23 -0500

updated 2016-08-02 10:55:01 -0500

ahendrix gravatar image

A topic is "created" (and will show up when using ROS introspection tools such as rostopic) as soon as a publisher or subscriber to that topic is created within a ROS node. From the Python and C++ creating a publisher/subscriber tutorials:

C++:

ros::Publisher chatter_pub = n.advertise<std_msgs::String>("chatter", 1000);

Python:

pub = rospy.Publisher('chatter', String, queue_size=10)
edit flag offensive delete link more

Comments

What is "chatter " here? Is it the name of topic?

SaurabhR gravatar image SaurabhR  ( 2016-08-02 10:04:06 -0500 )edit
2

Yes. "chatter" is the name of the topic.

ahendrix gravatar image ahendrix  ( 2016-08-02 10:56:05 -0500 )edit

Question Tools

Stats

Asked: 2016-08-02 09:54:19 -0500

Seen: 2,223 times

Last updated: Aug 02 '16