Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions .script/complete/_save-map-once
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
#compdef save-map-once

_arguments \
'1:mode:(remote local)'
Comment thread
coderabbitai[bot] marked this conversation as resolved.
45 changes: 45 additions & 0 deletions .script/save-map-once
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
#!/bin/zsh

set -euo pipefail

usage() {
cat <<'EOF'
Usage: save-map-once <remote|local>

remote Trigger robot-side /save_pcd_map service via ssh remote.
local Trigger local container /save_pcd_map service.
EOF
Comment thread
creeper5820 marked this conversation as resolved.
}

if (( $# != 1 )); then
usage
exit 1
fi

readonly mode="$1"
readonly service_call='ros2 service call /save_pcd_map std_srvs/srv/Trigger "{}"'

call_local() {
bash -lc "source ~/env_setup.bash && ${service_call}"
}

call_remote() {
ssh-remote "bash -lc 'source ~/env_setup.bash && ${service_call}'"
}

case "$mode" in
remote)
call_remote
;;
local)
call_local
;;
--help|-h)
usage
;;
*)
echo "Error: unsupported mode '$mode'."
usage
exit 1
;;
esac
1 change: 1 addition & 0 deletions Dockerfile
Original file line numberDiff line numberDiff line change
Expand Up@@ -96,6 +96,7 @@ RUN mkdir -p /etc/apt/keyrings && \
> /etc/apt/sources.list.d/llvm.list && \
apt-get update && \
apt-get install -y --no-install-recommends \
libomp-${LLVM_VERSION}-dev \
clang-${LLVM_VERSION} clangd-${LLVM_VERSION} clang-format-${LLVM_VERSION} clang-tidy-${LLVM_VERSION} \
lldb-${LLVM_VERSION} lld-${LLVM_VERSION} llvm-${LLVM_VERSION} && \
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${LLVM_VERSION} 50 && \
Expand Down