Exemplo n.º 1
0
        elif time.time() - last_ball_found_time > Constants.HOLD_TARGET_TIME:
            odom_table.putBoolean("ball_found", False)
        return True
    except Empty:
        return False


ball_process_manager = ProcessManager(
    lambda: D435Process(frame_queue, ball_queue, xyzrpy_value),
    ball_update,
)

# main loop
while True:
    # get pose
    t265_process_manager.update()
    odom_table.putBoolean('pose_good', t265_process_manager.is_connected)

    # get CV
    cv_process_manager.update()
    odom_table.putBoolean('target_good', cv_process_manager.is_connected)

    ball_process_manager.update()
    odom_table.putBoolean('ball_good', ball_process_manager.is_connected)

    # handshake
    odom_table.putNumber('client_time', time.time())

    # update camera server
    camera_server.set_output(odom_table.getString("video_output", ""))
    try: