Skip to content

Added cards for publishing messages - based on an existing pull request - #157

Open
EOued wants to merge 16 commits into
dheera:mainfrom
EOued:publisher
Open

EOued wants to merge 16 commits into
dheera:mainfrom
EOued:publisher

Conversation

@EOued

@EOued EOued commented Jun 16, 2026

Copy link
Copy Markdown

This pull request is based on the fork of @brendanburns (the original pull request may be found here)

Summary

This PR adds the possibility to create a publisher for any ros message type, the same ways viewers add the possibility to view any message type.

Features Added

Added by the original PR, and not modified in this PR

  • Centralized Publishing Dialog: Modal dialog for publishing ROS messages with topic name, type, and JSON message data
  • Continuous Publishing: Option to publish messages at specified frequencies (Hz) with start/stop controls
  • Message Templates: Built-in templates for common message types (std_msgs, geometry_msgs, sensor_msgs, nav_msgs)
  • Dark Theme Integration: Publishing interface matches rosboard's existing dark theme
  • Input Validation: JSON validation with helpful error messages
  • Auto-close Behavior: Dialog management with proper state handling

Added by this PR

  • Publishers Integration: Publishers can be added for any message type, and will fallback to a Generic Publisher if none exists. Thoses publishers are based on the publishing pipeline the original PR added.
  • Continuous Publishing: Every publisher implements continuous publishing at specified frequencies.

Backend Changes

Added by the original PR, and not modified in this PR

  • Enhanced publish_message() method in ROSBoardNode class
  • WebSocket message handling for publishing via MSG_PUB messages
  • ROS1/ROS2 compatible publishing with proper message class resolution

Improvements

  • Fixed python-to-ros message conversion, to counter the auto-resolution of integer-valued floating-point numbers to round numbers in JavaScript (e.g. 1.0 that would automatically resolve to 1). This behavior would, for some ros2 datatypes, lead the generated message to be populated with int instead of floats, which led to failing asserts later.

Frontend Changes

Added by the original PR, and not modified in this PR

  • New publishing modal dialog with Material Design components
  • JavaScript publishing interface with rate control and validation
  • CSS styling for dark theme consistency
  • Left navigation publisher entry point

Added in this PR

  • The Single Publishing feature was removed in favor of publisher cards. Raw messages may still be published with the navigation publisher entry point.
  • Added cards for a few data types.
  • Added "publisher topics" on the left navigation menu.

Usage

  1. From Navigation: Click "Publish" in the left sidebar for blank publishing dialog
  2. From Publishers: Click on the corresponding topic in the left sidebar. If the data type of the topic has a card implemented for it, the card will appear. Otherwise, it will fallback to a Generic Publisher card.
  3. Single Publishing: Enter topic details and message, click "Publish Once"
  4. Continuous Publishing: Check continuous mode, set rate, and use Start/Stop controls

Testing

Tested with both single and continuous publishing modes across various message types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants