osrf / gazebojs

3 stars 3 forks source link

subscription works for a single message #4

Closed osrf-migration closed 9 years ago

osrf-migration commented 10 years ago

Original report (archived issue) by Hugo Boyer (Bitbucket: hugomatic, GitHub: hugomatic).


The callback is not invoked afterwards.

This problem only happens on certain machines. To try to reproduce, setup a cemera in Gazebo and run the save_jpeg example.

NOTE:

I am not sure what causes the problem, but it looks like it can be circumvented if the gazebo instance is used in the loop at the end. It looks like the garbage collector is trying to delete the gazebo instance prematurely. The following code hides the problem:

#!python

console.log('setup a loop with 5 sec interval tick');
setInterval(function (){
  console.log('tick');

  // ADD THIS LINE TO HIDE THE PROBLEM
  var x = gazebo;

},1000);
osrf-migration commented 10 years ago

Original comment by Hugo Boyer (Bitbucket: hugomatic, GitHub: hugomatic).


osrf-migration commented 9 years ago

Original comment by Hugo Boyer (Bitbucket: hugomatic, GitHub: hugomatic).


Fixed