Skip to content

Tools: Add Cyber Recorder GUI Lite - #15816

Open
1012327963 wants to merge 1 commit into
ApolloAuto:masterfrom
1012327963:add-cyber-recorder-gui-lite
Open

Tools: Add Cyber Recorder GUI Lite#15816
1012327963 wants to merge 1 commit into
ApolloAuto:masterfrom
1012327963:add-cyber-recorder-gui-lite

Conversation

@1012327963

Copy link
Copy Markdown
Contributor

Description

This PR adds cyber_recorder_gui_lite, a lightweight Qt-based graphical tool for replaying Apollo Cyber record files.
The tool focuses on basic record inspection and playback. It is provided as a separate package from modules/cyber_recorder_gui, allowing both versions to coexist without executable or installation conflicts.

Main changes

  • Add support for opening a single .record file.
  • Add support for loading .record and .record.* shards from a directory.
  • Display record metadata, channel names, and message types.
  • Support play, pause, resume, and stop operations.
  • Support seeking through the playback progress bar.
  • Republish recorded messages to their original Cyber channels.
  • Add Bazel, CMake, Cyber launch, and package configuration files.
  • Add English and Chinese documentation.

Copilot AI lite review requested due to automatic review settings September 3, 2026 10:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

There are correctness/build blockers (task-buffer pop race in the consumer and CMake/BUILD packaging issues) that can cause runtime misbehavior or build failures.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR introduces Cyber Recorder GUI Lite, a lightweight Qt-based GUI for inspecting and replaying Apollo Cyber .record files (single file or directory shards), including basic playback controls and republishing messages back onto Cyber channels.

Changes:

  • Added Qt UI (MainWindow + custom sliders) for file/directory selection, metadata display, and play/pause/stop/seek controls.
  • Implemented a playback pipeline (Player + producer/consumer/task buffer) to read records and publish messages back to their original channels.
  • Added build/packaging and docs assets (Bazel BUILD, CMakeLists, cyber launch, cyberfile.xml, EN/CN README).
File summaries
File Description
modules/tools/cyber_recorder_gui/record_playbar.h New clickable progress slider widget (RecordPlaybar)
modules/tools/cyber_recorder_gui/record_playbar.cpp RecordPlaybar mouse handling implementation
modules/tools/cyber_recorder_gui/README.md English usage/build documentation for GUI Lite
modules/tools/cyber_recorder_gui/README_cn.md Chinese usage/build documentation for GUI Lite
modules/tools/cyber_recorder_gui/player/player.h Player API for GUI-driven playback
modules/tools/cyber_recorder_gui/player/player.cc Threaded playback control and seek/reset implementation
modules/tools/cyber_recorder_gui/player/play_task.h Playback task abstraction (message + writer + timestamps)
modules/tools/cyber_recorder_gui/player/play_task.cc Playback task execution (writer publish)
modules/tools/cyber_recorder_gui/player/play_task_producer.h Producer that reads record(s) and fills task buffer
modules/tools/cyber_recorder_gui/player/play_task_producer.cc Record reading, writer creation, buffering logic
modules/tools/cyber_recorder_gui/player/play_task_consumer.h Consumer that schedules tasks according to timestamps
modules/tools/cyber_recorder_gui/player/play_task_consumer.cc Playback timing loop and pause handling
modules/tools/cyber_recorder_gui/player/play_task_buffer.h Shared task buffer container
modules/tools/cyber_recorder_gui/player/play_task_buffer.cc Task buffer implementation (multimap + mutex)
modules/tools/cyber_recorder_gui/player/play_param.h Playback parameter struct
modules/tools/cyber_recorder_gui/mainwindow.ui Qt Designer UI layout for the lite tool
modules/tools/cyber_recorder_gui/mainwindow.h Main window controller declarations
modules/tools/cyber_recorder_gui/mainwindow.cpp UI wiring, file picking, play/pause/seek orchestration
modules/tools/cyber_recorder_gui/main.cpp Qt entry point + Cyber init/clear
modules/tools/cyber_recorder_gui/launch/cyber_recorder_gui_lite.launch cyber_launch config for starting the binary
modules/tools/cyber_recorder_gui/info.h Record metadata reader interface
modules/tools/cyber_recorder_gui/info.cc Record metadata extraction/formatting
modules/tools/cyber_recorder_gui/doubleslider.h Dual-handle range slider widget
modules/tools/cyber_recorder_gui/doubleslider.cc Dual-handle slider rendering and interaction
modules/tools/cyber_recorder_gui/cyberfile.xml Package metadata for installation
modules/tools/cyber_recorder_gui/CMakeLists.txt CMake build definition for the GUI lite target
modules/tools/cyber_recorder_gui/BUILD Bazel targets (binary + qt library) and packaging
Review details

Suppressed comments (3)

modules/tools/cyber_recorder_gui/player/play_task_producer.cc:325

  • The preload-mode nullptr check log text is grammatically incorrect and unclear ("should not nullptr"); it should state what is null and why that is invalid.
    if (preload_fill_buffer_mode_ && !record_viewer_ptr_) {
        AERROR << "Preload should not nullptr";
        return;
    }

modules/tools/cyber_recorder_gui/player/play_task_producer.cc:329

  • Same issue as above: the non-preload check message ("No preload should nullptr") is unclear and grammatically incorrect.
    if (!preload_fill_buffer_mode_ && record_viewer_ptr_) {
        AERROR << "No preload should nullptr";
        return;
    }

modules/tools/cyber_recorder_gui/record_playbar.h:44

  • The trailing #endif comment should match the updated header guard macro name to avoid confusion when navigating headers.
#endif  // RECORDPLAYBAR_H
  • Files reviewed: 27/27 changed files
  • Comments generated: 10
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +74 to +75
apollo_package(enable_source=False)
apollo_package()
Comment on lines +11 to +12
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Comment on lines +17 to +25
set(PROJECT_SOURCES
main.cpp
mainwindow.cpp
mainwindow.h
mainwindow.ui
record_playbar.cpp
record_playbar.h

)
Comment on lines +75 to +79
auto task = task_buffer_->Front();
if (task == nullptr) {
std::this_thread::sleep_for(std::chrono::nanoseconds(kWaitProduceSleepNanoSec));
continue;
}
Comment on lines +4 to +8
<description>
This is a demo package
</description>

<maintainer email="sample@sample.com">Apollo Developer</maintainer>
#include "doubleslider.h"

QT_BEGIN_NAMESPACE
using namespace apollo::goodman::record;
Comment on lines +66 to +69
if (!preload_fill_buffer_mode_ && node_ != nullptr) {
AERROR << "invalid param: nullptr node";
node_ = nullptr;
}
Comment on lines +217 to +218
AINFO << "preload time is zero, we will use defalut value: " << kPreloadTimeSec << " seconds.";
play_param_.preload_time_s = kPreloadTimeSec;
Comment on lines +93 to +96
if (!is_stopped_.exchange(false)) {
AERROR << "player has been stopped.";
return false;
}
Comment on lines +1 to +2
#ifndef RECORDPLAYBAR_H
#define RECORDPLAYBAR_H
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