Duration of 1 second during while(ros::ok())
Hi All,
Below is the snippet of the code I have.
int main()
{
//Declaration part
ros::Rate rate(50);
while(ros::ok())
{
//I need to run one condition or function at each second
//Modify the message based on the condition in previous line
//Publish the message
rate.sleep();
ros::spinOnce();
}
}
Can anybody please tell me how can I check for some condition at each second?
Thank you, KK