rosbridge_server.websocket_handler module

class rosbridge_server.websocket_handler.IncomingQueue(protocol: rosbridge_library.rosbridge_protocol.RosbridgeProtocol)

Bases: Thread

Decouples incoming messages from the Tornado thread.

This mitigates cases where outgoing messages are blocked by incoming, and vice versa.

finish() None

Clear the queue and do not accept further messages.

push(msg: str) None
run() None

Method representing the thread’s activity.

You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.

class rosbridge_server.websocket_handler.RosbridgeWebSocket(*args: Any, **kwargs: Any)

Bases: WebSocketHandler

check_origin(origin: str) bool
client_id: uuid.UUID
client_manager: ClassVar[ClientManager | None] = None
clients_connected: ClassVar[int] = 0
get_compression_options() dict | None
incoming_queue: IncomingQueue
node_handle: ClassVar[Node | None] = None
on_close() None
on_message(message: str | bytes) None
open(*args: str, **kwargs: str) None
async prewrite_message(message: bson.BSON | bytearray | str, binary: bool) None
protocol: RosbridgeProtocol
protocol_parameters: ClassVar = {}
send_message(message: bson.BSON | bytearray | str, compression: str = 'none') None
use_compression: ClassVar[bool] = False
rosbridge_server.websocket_handler.log_exceptions(f: Callable[P, R]) Callable[P, R]

Log exceptions to ROS.