-
Notifications
You must be signed in to change notification settings - Fork 37
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
Open
Embers-of-the-Fire
wants to merge
5
commits into
Alliance-Algorithm:flight
Choose a base branch
from
Embers-of-the-Fire:gimbal
base: flight
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
db18fd7
new
1Feishu bb55566
Merge downstream to branch `gimbal`
Embers-of-the-Fire 5cbc55f
Merge branch 'flight' into gimbal
Embers-of-the-Fire f99b7ed
fix: fix logging import
Embers-of-the-Fire e89679b
fix: fix gimbal xz transform
Embers-of-the-Fire File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 地址]' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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.
Show resolved
Hide resolved
|
||
| 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" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 169.254.233.233 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.