Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: bag play remap #44

Merged
merged 2 commits into from
Nov 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion driving_log_replayer_v2/launch/driving_log_replayer_v2.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def get_launch_arguments() -> list:
record_only
override_topics_regex
storage
remap
"""
launch_arguments = []

Expand Down Expand Up @@ -109,6 +110,11 @@ def add_launch_arg(
default_value="sqlite3", # Settings are adjusted to ros distro standards. Currently autoware is humble, so use sqlite3. Change to mcap when updated to jazzy.
description="select storage type mcap or sqlite3",
)
add_launch_arg(
"remap",
default_value="", # Settings are adjusted to ros distro standards. Currently autoware is humble, so use sqlite3. Change to mcap when updated to jazzy.
description="use comma separated string. Ex: remap:=/tf,/sensing/lidar/concatenated/pointcloud",
)

return launch_arguments

Expand Down Expand Up @@ -368,6 +374,12 @@ def launch_bag_player(
remap_list.append(
"/planning/mission_planning/route:=/unused/planning/mission_planning/route",
)
# user defined remap
if conf["remap"] != "":
remap_topics: list[str] = conf["remap"].split(",")
for topic in remap_topics:
if topic.startswith("/") and topic not in remap_list:
remap_list.append(f"{topic}:=/unused{topic}")
if len(remap_list) != 1:
play_cmd.extend(remap_list)
bag_player = (
Expand All @@ -379,7 +391,7 @@ def launch_bag_player(
if conf["record_only"] == "true"
else ExecuteProcess(cmd=play_cmd, output="screen")
)
return [bag_player]
return [bag_player, LogInfo(msg=f"remap_command is {remap_list}")]


def launch_bag_recorder(context: LaunchContext) -> list:
Expand Down
Loading