0
$\begingroup$

Rosanswers logo

Im trying to subscribe gazebo topics and see the datas on a webpage.

var cmdSonarTopic = new ROSLIB.Topic({
ros : ros,
name : '/gazebo/sensor/Sonar0',
messageType : 'sensor_msgs/Range' });

cmdSonarTopic.subscribe(function(message) {
console.log('Received message on ' + cmdSonarTopic.name + ': ' +  message.header.range);   });

But on browser console the message i see is "Received message on /gazebo/sensor/Sonar0: undifined ". Range's data type is float32. How can i make it right?


Originally posted by minerva on ROS Answers with karma: 18 on 2015-05-12

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

sorry guys its my mistake. range data should be out of header scope.


Originally posted by minerva with karma: 18 on 2015-05-13

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.