Skip to content

Multibeam color filter as a lookup table - #278

Merged
jp-pino merged 1 commit into
masterfrom
jp-pino/multibeam-color-filter
Sep 7, 2026
Merged

Multibeam color filter as a lookup table#278
jp-pino merged 1 commit into
masterfrom
jp-pino/multibeam-color-filter

Conversation

@jp-pino

@jp-pino jp-pino commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Replace MultibeamConfig.color_filter (an index into palettes compiled into the fan renderer) with a MultibeamColorFilter message — bytes rgb, 768 bytes of R,G,B triplets indexed by echo intensity — plus SetMultibeamColorFilterReq/Rep and GetMultibeamColorFilterReq/Rep. The app can send a filter at any time; the drone keeps the last one in memory and uses grayscale until one is set (Get returns an empty rgb then).

Linked PRs (multibeam color filter — merge in dependency order)

  1. Multibeam color filter as a lookup table #278MultibeamColorFilter + Set/Get requests
  2. BluEye-Robotics/p2_msgs#43 — ROS message mirror (MultibeamColorFilter.msg)
  3. BluEye-Robotics/p2_drone#998 — node_comm repliers publishing /multibeam/color_filter (ROS + tyndall IPC)
  4. BluEye-Robotics/gst-sonar-renderer (merged to main) — elements read the IPC slot and follow changes
  5. BluEye-Robotics/gst_rtsp_record#307 — sonar RTSP node (uses the renderer, no filter wiring needed)

The recorded-fan overlay (OverlayParameters.multibeam_enabled) is a separate set: #298, BluEye-Robotics/p2_msgs#54, BluEye-Robotics/p2_drone#1066, BluEye-Robotics/gst_rtsp_record#297. mbezoverlay picks the filter up from the same IPC slot once both have landed.

Color filter flows app → SetMultibeamColorFilterReq (768 bytes: 256 R,G,B triplets by echo intensity) → node_comm publishes /multibeam/color_filter → tyndall shared memory → mbezsrc/mbezoverlay poll it on start and on change. Greyscale until one is set; nothing is compiled into the renderer any more, so new app palettes need no drone rebuild.

Design note: the renderer reads the slot through the generated p2_msgs struct

The first cut mirrored the message with a local struct { uint8_t rgb[768]; } in the renderer to avoid a p2_msgs dependency. That cannot work: tyndall tags every shared-memory slot with a hash of the storage type name (typeinfo_hash(seq_lock<T>)) and asserts on mismatch when a second opener arrives, and the cross build has asserts on. The renderer therefore includes p2_msgs/msg/detail/multibeam_color_filter__struct.hpp (header-only, no ROS runtime linked) so both sides use the same p2_msgs::msg::MultibeamColorFilter type. Consequence: the message must stay trivially copyable and exactly uint8[768] (static_asserted in the renderer).

@jp-pino
jp-pino force-pushed the jp-pino/multibeam-color-filter branch from 3fc4d29 to 981a200 Compare July 7, 2026 13:45
@jp-pino jp-pino changed the title Add multibeam colour filter + overlay-enable fields Add multibeam color filter + overlay-enable fields Jul 7, 2026
@jp-pino jp-pino changed the title Add multibeam color filter + overlay-enable fields Multibeam color filter as a lookup table + overlay-enable field Sep 7, 2026
@jp-pino
jp-pino force-pushed the jp-pino/multibeam-color-filter branch from d70c503 to 2b46427 Compare September 7, 2026 12:30
@jp-pino jp-pino self-assigned this Sep 7, 2026
@jp-pino jp-pino added the enhancement New feature or request label Sep 7, 2026
@jp-pino jp-pino added this to the Blunux v5.2 milestone Sep 7, 2026
@jp-pino
jp-pino marked this pull request as ready for review September 7, 2026 12:32
@jp-pino
jp-pino requested a review from follesoe September 7, 2026 12:32
@jp-pino jp-pino changed the title Multibeam color filter as a lookup table + overlay-enable field Multibeam color filter as a lookup table Sep 7, 2026
The app sends the color filter used to render the multibeam sonar fan as a
768-byte lookup table (256 R,G,B triplets indexed by echo intensity). The
drone keeps the last one received and applies it to the sonar RTSP stream;
grayscale is used until one is set.
@jp-pino
jp-pino force-pushed the jp-pino/multibeam-color-filter branch from 2b46427 to 7494737 Compare September 7, 2026 12:33
@jp-pino
jp-pino merged commit 369b31c into master Sep 7, 2026
4 checks passed
@jp-pino
jp-pino deleted the jp-pino/multibeam-color-filter branch September 7, 2026 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants