Skip to content

Commit bce9726

Browse files
authored
feat: restore --passthrough option (#70)
Allow processing all messages even without decodable LiDAR packet topics. Previously available in #40 but dropped during the v0.6.0 rearchitecture. Also add a documentation-update rule to AGENTS.md.
1 parent 82222c1 commit bce9726

4 files changed

Lines changed: 14 additions & 1 deletion

File tree

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- When creating commits and pull requests, always use `tier4/bag_converter` (origin) as the base repository. Never push commits or create PRs against the upstream fork (`0x126/bag_converter`).
88
- Do not push directly to the main branch without permission. Always create a pull request first.
99
- Always write source code and documentation in English.
10+
- When modifying source code, always update the corresponding documentation (e.g. README.md, help text) to reflect the changes.
1011
- Write PR descriptions that are comprehensive and detailed, but concise. Cover the problem, solution, and test plan without unnecessary verbosity.
1112
- When writing code or documentation, be mindful of the GitHub Actions workflows configured in this repository and ensure changes do not cause them to fail.
1213
- When investigating GitHub Actions workflow failures, always use the `gh` command (e.g. `gh run view`, `gh run view --log-failed`) to retrieve and read the actual workflow logs. Base your bug fixes on evidence from those logs, not on assumptions.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ If the input path is a directory, all bag files (`.mcap`, `.db3`, `.sqlite3`) in
5858
| `--keep-original` | Keep original packet topics in output bag |
5959
| `--base-frame <frame>` | Transform PointCloud2 to the specified TF frame |
6060
| `--tf-mode <static\|dynamic>` | TF mode: `static` (default) or `dynamic` |
61+
| `--passthrough` | Process all messages even without decodable LiDAR packet topics |
6162
| `--comp-algo <algo>` | Output compression algorithm: `none`, `lz4`, or `zstd` (default: `zstd`). Applies to mcap output only. |
6263
| `--comp-level <level>` | Output compression level: `fastest`, `fast`, `default`, `slow`, or `slowest` (default: `default`). Ignored when `--comp-algo none`. |
6364
| `--merge` | Merge bag files from distributed log modules and convert in a single pass. Accepts multiple input directories. The last positional argument is the output directory. |

src/bag_converter/include/bag_converter.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ struct BagConverterConfig
111111
std::string comp_algo = "zstd";
112112
std::string comp_level = "default";
113113

114+
// Passthrough mode (process all messages even without decodable topics)
115+
bool passthrough = false;
116+
114117
// Delete source files after successful conversion
115118
bool delete_sources = false;
116119

src/bag_converter/src/bag_converter.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ void print_usage()
128128
<< " after point cloud messages in the bag.\n"
129129
<< " --merge Merge bag files from distributed log modules, then\n"
130130
<< " convert. Accepts multiple input directories.\n"
131+
<< " --passthrough Process all messages even without decodable topics\n"
131132
<< " --comp-algo <none|lz4|zstd> Output compression algorithm (default: zstd)\n"
132133
<< " --comp-level <fastest|fast|default|slow|slowest>\n"
133134
<< " Output compression level (default: default)\n"
@@ -290,6 +291,8 @@ std::optional<int> parse_arguments(int argc, char ** argv, BagConverterConfig &
290291
<< "'. Must be 'fastest', 'fast', 'default', 'slow', or 'slowest'.\n";
291292
return 1;
292293
}
294+
} else if (arg == "--passthrough") {
295+
config.passthrough = true;
293296
} else if (arg == "--merge" || arg == "--delete") {
294297
// Already processed in pre-scan
295298
} else if (arg == "--help" || arg == "-h" || arg == "--version" || arg == "-v") {
@@ -541,13 +544,18 @@ BagConverterResultStatus run_impl(const BagConverterConfig & config)
541544
}
542545
}
543546

544-
if (!has_decodable_topics) {
547+
if (!has_decodable_topics && !config.passthrough) {
545548
RCLCPP_WARN(
546549
g_logger, "Skipping conversion: no decodable topics found in %s",
547550
config.src_bag_path.c_str());
548551
return BagConverterResultStatus::kSkipped;
549552
}
550553

554+
if (!has_decodable_topics && config.passthrough) {
555+
RCLCPP_INFO(
556+
g_logger, "Passthrough mode: no decodable topics, all messages will be passed through");
557+
}
558+
551559
if (transformer && !has_tf_topic) {
552560
RCLCPP_ERROR(
553561
g_logger, "No TF topics found in %s. Cannot transform to frame '%s'",

0 commit comments

Comments
 (0)