Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 24

[roslibjs,rosbridgesuite] How to get data back from the robot in turtleSim

$
0
0
According to the roslibjs documentation, we should be able to get the data back from the robot by using a listener: // Publish the Topic var cmdVel = new ROSLIB.Topic({ ros: ros, name: '/turtle1/cmd_vel', messageType: 'geometry_msgs/Twist' }); // Subscribe to the Topic var listener = new ROSLIB.Topic({ ros: ros, name: '/listener', messageType: 'std_msgs/String' }); listener.subscribe(function (message) { console.log("Recieved Message on: " + listener.name + ": " + message.data); }); However, when I tried to use this, there was a compilation error that said `property 'data does not exist on type 'message'`. I really need to get the turtle-robot data back to my web browser, any help with this matter would be highly appreciated. Many thanks!

Viewing all articles
Browse latest Browse all 24

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>