waitKey and ROS
How can i use Waitkey in ROS..
I have while loop which waits for a user input, and then goes to the next state.. Within i get video image using Image_transport.
So my idea is to have
cout << "Am i done?" << endl;
While(input != 'y')
{
Retreive new frames for the function to work with....
}
But the problem is that it keeps outputting "Am i done", which i suspect is because the Ros::spin(), but what doesn't make sense, it how it breaks out of the while loop. How do make it only do the thing within the while loop until a key is pressed.
where is the getting input part ?
user input
where is cin ?
Well.. the way i was thinking of doing was using getch() to detect the input, and if it correspond to a letter ex. 'y' it will jump out.. while(input != 'y' ) { .... input = getch(); }
may be some small datatype error from reading input. please put your real code about input.
The reason why i want to use OpenCV wait key.. is because the function within runs imshow("webcam",frame), which require wait key...