Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 42
Merge downstream gimbal control for flight#48
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
db18fd7bb555665cbc55ff99b7ede89679bFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| #compdef play-autoaim | ||
| _arguments \ | ||
| '--user[指定远程用户名]:用户名:' \ | ||
| '--remote[从设备拉取 SDP 到容器]' \ | ||
| '--no-copy[跳过容器到宿主机的拷贝]'\ | ||
| '--ip[监视端的 IP 地址]' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| #compdef set-remote | ||
| _remote_hosts() { | ||
| local hosts=( | ||
| "169.254.233.233" | ||
| "alliance-sentry.local" | ||
| "alliance-infantry.local" | ||
| "alliance-hero.local" | ||
| ) | ||
| # 从 ~/.ssh/config 提取最近使用的 HostName | ||
| if [[ -f ~/.ssh/config ]]; then | ||
| local extracted | ||
| extracted=(${(f)"$(grep -A1 'Host remote' ~/.ssh/config | grep HostName | awk '{print $2}')"}) | ||
| hosts+=(${extracted}) | ||
| fi | ||
| compadd -- $hosts | ||
| } | ||
| _arguments \ | ||
| '1:远程主机地址:_remote_hosts' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| #! /bin/bash | ||
| source ~/env_setup.bash | ||
| ros2 launch foxglove_bridge foxglove_bridge_launch.xml port:=8765 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,38 +1,74 @@ | ||
| #!/bin/sh | ||
| if [ "$#" -ne 1 ]; then | ||
| echo "用法: $0 <用户名>" | ||
| echo "示例: $0 user" | ||
| exit 1 | ||
| fi | ||
| set -e | ||
| REMOTE_PLAYER="vlc" | ||
| MONITOR_USER="" | ||
| MONITOR_PLAYER="vlc" | ||
| MONITOR_HOST="localhost" | ||
| REMOTE_USER="$1" | ||
| REMOTE_HOST="localhost" | ||
| SDP_PATH="/tmp/auto_aim.sdp" | ||
| REMOTE_PATH="/tmp/auto_aim.sdp" | ||
| LOCAL_PATH="/tmp/auto_aim.sdp" | ||
| USE_REMOTE=false | ||
| SKIP_COPY=false | ||
| # 参数解析 | ||
| while [ "$#" -gt 0 ]; do | ||
| case "$1" in | ||
| --user) | ||
| shift | ||
| [ -z "$1" ] && echo "❌ --user 参数缺失" && exit 1 | ||
| MONITOR_USER="$1" | ||
| ;; | ||
| --remote) | ||
| USE_REMOTE=true | ||
| ;; | ||
| --no-copy) | ||
| SKIP_COPY=true | ||
| ;; | ||
| --ip) | ||
| shift | ||
| [ -z "$1" ] && echo "❌ --ip 参数缺失" && exit 1 | ||
| MONITOR_HOST="$1" | ||
| ;; | ||
| *) | ||
| echo "未知参数: $1" | ||
| echo "用法: $0 --user <用户名> [--remote] [--no-copy]" | ||
| exit 1 | ||
| ;; | ||
| esac | ||
| shift | ||
| done | ||
| scp remote:${REMOTE_PATH} ${REMOTE_PATH} | ||
| if [ $? -ne 0 ]; then | ||
| echo "⚠️ 从 remote 拷贝失败。是否继续?(y/n)" | ||
| if [ -z "$MONITOR_USER" ]; then | ||
| echo "❌ 缺少 --user 参数" | ||
| echo "用法: play-autoaim --user <用户名> [--remote] [--no-copy]" | ||
| exit 1 | ||
| fi | ||
| if [ "$USE_REMOTE" = true ]; then | ||
| scp remote:${SDP_PATH} ${SDP_PATH} | ||
| if [ $? -ne 0 ]; then | ||
| echo " 从 remote 拷贝失败。是否继续?(y/n)" | ||
| read -r answer | ||
| case "$answer" in | ||
| [Yy]*) echo "继续执行后续操作…" ;; | ||
| [Yy]*) echo " 继续执行后续操作…" ;; | ||
| *) | ||
| echo "已取消。" | ||
| exit 1 | ||
| ;; | ||
| echo " 已取消。" | ||
| exit 1 | ||
| ;; | ||
| esac | ||
| fi | ||
| fi | ||
| scp "${REMOTE_PATH}" "${REMOTE_USER}@${REMOTE_HOST}:${LOCAL_PATH}" | ||
| if [ $? -ne 0 ]; then | ||
| echo "❌ scp 拷贝失败" | ||
| if [ "$SKIP_COPY" = false ]; then | ||
| scp "${SDP_PATH}" "${MONITOR_USER}@${MONITOR_HOST}:${SDP_PATH}" | ||
| if [ $? -ne 0 ]; then | ||
| echo " scp 拷贝失败" | ||
| exit 1 | ||
| fi | ||
Embers-of-the-Fire marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| echo " 文件已拷贝到宿主机:${SDP_PATH}" | ||
| else | ||
| echo " 跳过拷贝,直接打开远程 SDP" | ||
| fi | ||
| echo "✅ 文件已拷贝到宿主机:${LOCAL_PATH}" | ||
| ssh -f "${REMOTE_USER}@${REMOTE_HOST}" "DISPLAY=:0 ${REMOTE_PLAYER} '${LOCAL_PATH}'" | ||
| ssh -f "${MONITOR_USER}@${MONITOR_HOST}" "DISPLAY=:0 ${MONITOR_PLAYER} '${SDP_PATH}' --network-caching=50" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -88,19 +88,25 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
| openssh-client \ | ||
| lsb-release software-properties-common gnupg sudo \ | ||
| python3-colorama python3-dpkt && \ | ||
| wget -O ./llvm-snapshot.gpg.key https://apt.llvm.org/llvm-snapshot.gpg.key && \ | ||
| apt-key add ./llvm-snapshot.gpg.key && \ | ||
| rm ./llvm-snapshot.gpg.key && \ | ||
| echo "deb https://apt.llvm.org/noble/ llvm-toolchain-noble main" > /etc/apt/sources.list.d/llvm-apt.list && \ | ||
| apt-get update && \ | ||
| version=`apt-cache search clangd- | grep clangd- | awk -F' ' '{print $1}' | sort -V | tail -1 | cut -d- -f2` && \ | ||
| apt-get install -y --no-install-recommends clangd-$version && \ | ||
| update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 50 && \ | ||
| update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 50 && \ | ||
| update-alternatives --install /usr/bin/clangd clangd /usr/bin/clangd-$version 50 && \ | ||
| apt-get autoremove -y && apt-get clean && \ | ||
| rm -rf /var/lib/apt/lists/* /tmp/* | ||
| # Install latest stable llvm-toolchain | ||
| RUN mkdir -p /etc/apt/keyrings && \ | ||
| wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | gpg -o /etc/apt/keyrings/llvm-snapshot.gpg --dearmor && \ | ||
| echo "deb [signed-by=/etc/apt/keyrings/llvm-snapshot.gpg] https://mirrors.tuna.tsinghua.edu.cn/llvm-apt/noble/ llvm-toolchain-noble-22 main" \ | ||
| | tee /etc/apt/sources.list.d/llvm.list && \ | ||
| apt-get update && \ | ||
| apt-get install -y --no-install-recommends clang-22 clangd-22 clang-format-22 lldb-22 && \ | ||
| update-alternatives --install /usr/bin/clang clang /usr/bin/clang-22 100 && \ | ||
| update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-22 100 && \ | ||
| update-alternatives --install /usr/bin/clangd clangd /usr/bin/clangd-22 100 && \ | ||
| update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-22 100 && \ | ||
| update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-22 100 && \ | ||
| apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* | ||
Embers-of-the-Fire marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| # Generate/load ssh key and setup unison | ||
| RUN --mount=type=bind,target=/tmp/.ssh,source=.ssh,readonly=false \ | ||
| cd /home/ubuntu && mkdir -p .ssh && \ | ||
| @@ -117,6 +123,11 @@ RUN curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linu | ||
| tar -C /opt -xzf nvim-linux-x86_64.tar.gz && \ | ||
| rm nvim-linux-x86_64.tar.gz | ||
| # Install latest stable cmake for user ubuntu | ||
| RUN wget https://github.com/kitware/cmake/releases/download/v4.2.3/cmake-4.2.3-linux-x86_64.sh -O install.sh && \ | ||
| mkdir -p /opt/cmake/ && bash install.sh --skip-license --prefix=/opt/cmake/ --exclude-subdir && \ | ||
| rm install.sh | ||
| # Change user | ||
| RUN chsh -s /bin/zsh ubuntu && \ | ||
| echo "ubuntu ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers | ||
| @@ -130,12 +141,14 @@ RUN sh -c "$(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools | ||
| sed -i 's/ZSH_THEME=\"[a-z0-9\-]*\"/ZSH_THEME="af-magic"/g' ~/.zshrc && \ | ||
| echo 'source ~/env_setup.zsh' >> ~/.zshrc && \ | ||
| echo 'export PATH="${PATH}:/opt/nvim-linux-x86_64/bin"' >> ~/.zshrc && \ | ||
| # echo 'export PATH="${PATH}:/opt/cmake/bin"' >> ~/.zshrc && \ | ||
| echo 'export PATH="${PATH}:${RMCS_PATH}/.script"' >> ~/.zshrc | ||
| # Copy environment setup scripts | ||
| COPY --chown=1000:1000 .script/template/env_setup.bash env_setup.bash | ||
| COPY --chown=1000:1000 .script/template/env_setup.zsh env_setup.zsh | ||
| # Runtime container, will automatically launch the main program | ||
| FROM rmcs-base AS rmcs-runtime | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,16 @@ | ||
| services: | ||
| rmcs-develop: | ||
| image: qzhhhi/rmcs-develop:latest | ||
| user: "${CONTAINER_USER}" | ||
| privileged: true | ||
| command: > | ||
| bash -c " | ||
| sudo chown -R ${CONTAINER_USER}:${CONTAINER_USER} ${CONTAINER_HOME}/.config | ||
| exec bash | ||
| " | ||
| user: "1000:1000" | ||
| volumes: | ||
| - /dev:/dev:bind | ||
| - /tmp/.X11-unix:/tmp/.X11-unix:bind | ||
| - /run/user/1000/wayland-0:/run/user/1000/wayland-0 | ||
| - /run/user/1000/wayland-0:/run/user/1000/wayland-0:bind | ||
| - ${HOST_NVIM_DIR}:${CONTAINER_HOME}/.config/nvim/:bind | ||
| - .:/workspaces/RMCS:bind | ||
| environment: | ||
| - DISPLAY=${DISPLAY} | ||
| - WAYLAND_DISPLAY=${WAYLAND_DISPLAY} | ||
| network_mode: host | ||
| tty: true | ||
| stdin_open: true | ||
| stdin_open: true |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 169.254.233.233 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.