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

Revision history [back]

click to hide/show revision 1
initial version

Hi! Try something like this:

...
ros::Rate rate(<yourFrequency>);
...
while (ros::ok())
{
ros::spinOnce();
rate.sleep();
}

Hi! Try something like this:

...
ros::Rate rate(<yourFrequency>);
...
while (ros::ok())
{
ros::spinOnce();
rate.sleep();
}

Hi! Try something like this:

...
ros::Rate rate(<yourFrequency>);
...
while (ros::ok())
{
ros::spinOnce();
rate.sleep();
}

Also, be sure to set the right buffer length for your subscriber.

Hi! Try something like this:

...
ros::Rate rate(<yourFrequency>);
...
while (ros::ok())
{
ros::spinOnce();
rate.sleep();
}

Also, be sure to set the right buffer length for your subscriber.subscriber, in order to prevent your node to elaborate old data.