Publishing javascript program data in a ROS topic

asked 2022-04-03 08:58:06 -0500

Following http://wiki.ros.org/roslibjs/Tutorial... I want to publish information from my JavaScript application data on ROS topic. in the following section of the tutorial:

var cmdVel = new ROSLIB.Topic({ os : ros, name : '/cmd_vel',
messageType : 'geometry_msgs/Twist' });

Do I need to first create a topic called cmd_vel in ROS?

For example I want to publish my data in a topic called Watch on my ROS. My message format will be { rr: int , hr: int} Should I create Watch topic first in my ROS then use its name in above block of code as value for name ?

edit retag flag offensive close merge delete