bob_av_tools.webscreen_node

Render any URL offscreen and stream it to a FIFO pipe and/or ROS topic.

Supports cookie injection (JSON file), JavaScript pre-script injection at DeferredLoad time, non-blocking FIFO auto-reconnect, and ROS Image publishing.

Attributes

HAS_CV_BRIDGE

Classes

CustomPage

QWebEnginePage subclass forwarding console output to ROS logger.

WebScreenNode

ROS 2 node that renders any URL offscreen and streams frames.

Functions

main([args])

Entry point for the webscreen node.

Module Contents

bob_av_tools.webscreen_node.HAS_CV_BRIDGE = True
class bob_av_tools.webscreen_node.CustomPage(node)

Bases: PySide6.QtWebEngineCore.QWebEnginePage

QWebEnginePage subclass forwarding console output to ROS logger.

node
javaScriptConsoleMessage(level, message, line, source)

Forward browser console messages to ROS logger at DEBUG level.

class bob_av_tools.webscreen_node.WebScreenNode

Bases: rclpy.node.Node

ROS 2 node that renders any URL offscreen and streams frames.

Renders a URL or local file using QtWebEngine (Chromium) in offscreen mode. Frames are captured at the configured FPS, published as ROS Image, and/or written to a named FIFO pipe (ffplay, bob_sdlviz, FFmpeg). Supports cookie injection and JS pre-script injection for automation.

width
height
fps
url
fifo_path
queue_length
cookies_file
pre_script
scroll_x
scroll_y
publisher
fifo_fd = None
qt_app
profile
cookie_store
page
view
timer
_inject_cookies(path)

Load cookies from a JSON file and inject them into the browser.

_inject_pre_script(path)

Register a JS file to be injected at DeferredLoad into each page.

_on_load_finished(success)

Log the result of a page load attempt.

_try_reconnect_fifo()

Try to open the FIFO non-blockingly and then switch to blocking.

capture_frame()

Capture the current render, publish to ROS, and write to FIFO.

run()

Run the Qt + ROS event loop and return the exit code.

bob_av_tools.webscreen_node.main(args=None)

Entry point for the webscreen node.