WebSocket Client plugin to integrate remote data into PlotJuggler through a WebSocket bridge.
This plugin allows PlotJuggler to connect to a WebSocket server (for example, a custom ROS2 bridge) without requiring direct DDS or ROS2 access.
- Configurable WebSocket server connection (IP + port)
- Dynamic topic discovery
- Real-time subscribe and unsubscribe
- Remote close and reconnection handling
- Native integration within the PlotJuggler plugin system
PlotJuggler <-> WebSocket Client Plugin <-> WebSocket Server (pj_ros_bridge or similar)
The server can run on:
- The same machine
- Another laptop on the local network
- A remote robot
mkdir -p ~/ws_plotjuggler/src
cd ~/ws_plotjuggler/src
git clone https://github.com/PlotJuggler/PlotJuggler.gitcd PlotJuggler/plotjuggler_plugins
git clone https://github.com/Alvvalencia/DataStreamWebsocketBridge.gitThe final structure should look like:
PlotJuggler/
├── plotjuggler_plugins/
│ ├── DataStreamWebsocketBridge/
│ ├── ...
Open:
PlotJuggler/plotjuggler_plugins/CMakeLists.txt
Add your plugin directory:
add_subdirectory(DataStreamWebsocketBridge)Place it alongside the other plugin add_subdirectory(...) entries.
sudo apt install \
qt6-base-dev \
qt6-websockets-dev \
libzstd-devsudo apt install \
qtbase5-dev \
qtwebsockets5-dev \
libzstd-devcd ~/ws_plotjuggler
mkdir build
cd build
cmake ../src/PlotJuggler -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)- Run PlotJuggler:
./bin/plotjuggler- Navigate to:
Streaming → WebSocket Client
-
Configure:
- Server IP (e.g., 192.168.1.50)
- Port (e.g., 8080)
-
Connect.
-
Select topics and subscribe.
If the server listens on:
ws://0.0.0.0:8080
It accepts connections from any network interface.
From another machine, connect using:
ws://SERVER_IP:8080
Example:
ws://192.168.1.42:8080
If using your ROS2 bridge:
ros2 run pj_ros_bridge pj_ros_bridge_nodeDefault configuration:
- Port: 8080
- Publish rate: 50 Hz
Then connect the plugin to:
ws://localhost:8080
or to the robot’s IP address.
The plugin handles the following states:
- Connecting
- Connected
- Disconnected
- Remote Close
- Error
If the server closes the connection, the plugin detects the event and displays a warning in the UI.
Typical plugin structure:
DataStreamWebsocketBridge/
├── websocket_client.h
├── websocket_client.cpp
├── websocket_client.ui
├── CMakeLists.txt
└── resources/
It integrates using PlotJuggler’s DataStream interface.