Ask Your Question

Revision history [back]

You problem is here:

  // Busy wait loop...replace with your own code as needed.
  while (true)
    gazebo::common::Time::MSleep(20); //<<< THIS IS YOUR ONLY WHILE LOOP!!!

  // Spin ROS (needed for publisher)//<< executed at the end only once...
  ros::spinOnce();

You problem is here:

  // Busy wait loop...replace with your own code as needed.
  while (true)
    gazebo::common::Time::MSleep(20); //<<< THIS IS YOUR ONLY WHILE LOOP!!!
That is your only while loop ;-)

  // Spin ROS (needed for publisher)//<< executed at the end only once...
  ros::spinOnce();

You problem is here:

  // Busy wait loop...replace with your own code as needed.
  while (true)
    gazebo::common::Time::MSleep(20); //<<< That is your only while loop ;-)

  // Spin ROS (needed for publisher)//<< executed at the end only once...
  ros::spinOnce();

try:

  // Busy wait loop...replace with your own code as needed.
  while (true)
  {
     gazebo::common::Time::MSleep(20); //<<< That is your only while loop ;-)

  // Spin ROS (needed for publisher)
  ros::spinOnce();

     ...
  }

You problem is here:

  // Busy wait loop...replace with your own code as needed.
  while (true)
    gazebo::common::Time::MSleep(20); //<<< That is your only while loop ;-)

  // Spin ROS (needed for publisher)//<< publisher)
  ros::spinOnce();//<< executed at the end only once...
  ros::spinOnce();

try:

  // Busy wait loop...replace with your own code as needed.
  while (true)
  {
     gazebo::common::Time::MSleep(20); //<<< That is your only while loop ;-)
gazebo::common::Time::MSleep(20);

  // Spin ROS (needed for publisher)
  ros::spinOnce();

     ...
  }

You Your problem is here:

  // Busy wait loop...replace with your own code as needed.
  while (true)
    gazebo::common::Time::MSleep(20); //<<< That is your only while loop ;-)

  // Spin ROS (needed for publisher)
  ros::spinOnce();//<< executed at the end only once...

try:

  // Busy wait loop...replace with your own code as needed.
  while (true)
  {
     gazebo::common::Time::MSleep(20);

  // Spin ROS (needed for publisher)
  ros::spinOnce();

     ...
  }

Your problem is here:

  // Busy wait loop...replace with your own code as needed.
  while (true)
    gazebo::common::Time::MSleep(20); //<<< That is your only while loop ;-)

  // Spin ROS (needed for publisher)
publisher) 
  ros::spinOnce();//<< executed at the end only once...

try:

  // Busy wait loop...replace with your own code as needed.
  while (true)
  {
     gazebo::common::Time::MSleep(20);

  // Spin ROS (needed for publisher)
publisher) // (nope its actually for subscribers-calling callbacks ;-) )
  ros::spinOnce();

     ...
  }