View my account

Taking Depth images in certain times slots

Comments

1 comment

  • MartyG

    This is a tricky question.  One approach would be to use a sleep timer in ROS:

    https://answers.ros.org/question/233331/timesleep-in-a-node/

    Another approach would be to put the camera thread to sleep for a certain amount of milliseconds with an instruction like the one below.

    this_thread::sleep_for(std::chrono::milliseconds(x))

    Where 'x' should be substituted for the value in milliseconds that you want the camera to sleep for.

    It can be used in a 'while loop' that determines when the camera thread is allowed to sleep.  Example:

    while (!frameArrived)
    {
        std::this_thread::sleep_for(std::chrono::milliseconds(100));
        std::cout << "Waiting for depth frame" << std::endl;
    }

    0
    Comment actions Permalink

Please sign in to leave a comment.