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

minerva's profile - activity

2021-10-07 15:26:35 -0500 received badge  Famous Question (source)
2021-10-07 15:26:35 -0500 received badge  Notable Question (source)
2021-10-07 15:26:35 -0500 received badge  Popular Question (source)
2017-04-10 20:07:41 -0500 received badge  Famous Question (source)
2016-06-09 05:55:05 -0500 received badge  Notable Question (source)
2016-04-05 09:29:39 -0500 received badge  Famous Question (source)
2015-06-26 09:51:18 -0500 received badge  Popular Question (source)
2015-05-15 19:04:04 -0500 asked a question How can i reach the array out of document ready function?

I've got an array created out of the document ready function, and i need to reach it inside the document ready scopes.

var outarray= [];
var i =0;

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

cmdSonarTopic0.subscribe(function(message) {
    outarray.push(message.range);
    console.log(outarray[i]);
    document.getElementById("abc").innerHTML = outarray[1];
    i++;
  });

$(document).ready(function(){
    $("#xyz").text(outarray[1]);
    var inarray= [];
    inarray = outarray; 
    ...
});

<div>
  <p id="abc"></p>
  <p id="xyz"></p>
</div>
  • when i fill the array out of the subscribe function it works, but i need to fill it by datas come from the topic, so it must be in subscribe function.
  • when i do

    document.getElementById("abc").innerHTML = outarray[1];
    

    this in the subscribe function, it works ok. But i need to assign the whole array to another array, so need to receive the array from document ready function.

  • when i try the following, it comes empty and writes nothing in tag.

    $(document).ready(function(){
        $("#xyz").text(outarray[1]);    
    });
    

    So how can i reach the array ?

2015-05-13 05:00:39 -0500 commented question how to subscribe float32 data

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

2015-05-12 17:10:41 -0500 asked a question how to subscribe float32 data

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?

2015-05-11 05:39:48 -0500 received badge  Notable Question (source)
2015-05-11 05:16:55 -0500 commented question how to subscribe a topic to a web page

no, when i look cmd_vel info there's one subscriber: gazebo.

2015-05-11 05:04:39 -0500 received badge  Enthusiast
2015-05-10 17:20:51 -0500 commented question how to subscribe a topic to a web page

on web console there's just "connected to webso..." and when i run the code i get; "warning: no messages received and simulated time is active. Is /clock being published?" but gazebo robot is moving why cant get the message :/

2015-05-10 02:20:55 -0500 received badge  Popular Question (source)
2015-05-09 17:45:02 -0500 commented question how to subscribe a topic to a web page

still doesnt work

2015-05-09 15:05:01 -0500 commented question how to subscribe a topic to a web page

it didn't work for me. i editted the question. i need something like that.

2015-05-09 08:29:15 -0500 received badge  Editor (source)
2015-05-09 08:28:08 -0500 asked a question how to subscribe a topic to a web page

hello guys, i have a running gazebo simulation and i want to receive the /gazebo/cmd_vel linear x value to a web page, into the p tags.

 <body>
 <p id="vel"> </p>
 </body>

i use rosbridge. there are lots of publishment examples but i couldnt find subscriber ones.

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

cmdVelTopic.subscribe(function(message) {
        console.log('Received message on ' + cmdVelTopic.name + ': ' + message.linear.x);
        listener.unsubscribe();
}); 
cmdVelTopic.subscribe();

subscribe function doesnt work. how can i get it right?

2015-05-07 02:56:25 -0500 received badge  Notable Question (source)
2015-05-05 07:13:53 -0500 received badge  Supporter (source)
2015-05-05 07:13:47 -0500 commented answer how to subscribe with rosbridge

it helped thank you! :)

2015-05-05 07:13:29 -0500 received badge  Scholar (source)
2015-05-05 05:27:43 -0500 commented question how to subscribe with rosbridge

oh "Received message on /listener: Hello wold" is written there thank you :) so the code is ok but how can i write it to a label?

2015-05-04 18:58:48 -0500 received badge  Popular Question (source)
2015-05-04 16:15:10 -0500 commented question how to subscribe with rosbridge

what do you mean by browser console? i just open html file.

2015-05-03 22:28:54 -0500 asked a question how to subscribe with rosbridge

hello guys, i'm new at ros. i want to subscribe a topic to a webpage. i tried to do the following tutorial but subscribe part doesnt work. Should i add a label or something to view the subscription to the html file? here is the tutorial: http://wiki.ros.org/roslibjs/Tutorial...

2015-01-28 13:16:37 -0500 commented answer How to install ROS indigo in Ubuntu 14.04 trusty 64-bit?

Thankss! it worked for me.