feat: 初始化 Go2 导航相关代码与配置

This commit is contained in:
2026-10-15 09:40:29 +08:00
commit 07426fcc09
1282 changed files with 331220 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
FROM althack/ros2:foxy-full
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
USER root
RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] https://mirrors.ustc.edu.cn/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2.list
# install zsh and oh-my-zsh
RUN apt update && apt install -y zsh git
RUN wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh && chmod +x install.sh && ls
RUN ./install.sh
RUN git clone https://github.com/zsh-users/zsh-autosuggestions.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions && \
apt install zsh-syntax-highlighting
# configure zsh
RUN echo 'export ZSH=$HOME/.oh-my-zsh' >> ~/.zshrc && \
echo 'ZSH_THEME="ys"' >> ~/.zshrc && \
echo 'plugins=(git zsh-autosuggestions)' >> ~/.zshrc && \
echo 'source $ZSH/oh-my-zsh.sh' >> ~/.zshrc && \
echo 'source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh' >> ~/.zshrc
# # install clang tools
# RUN wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 18 all
# RUN update-alternatives --install /usr/bin/clangd clangd /usr/bin/clangd-18 100 \
# && update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-18 100 \
# && update-alternatives --install /usr/bin/clang clang /usr/bin/clang-18 100 \
# && update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-18 100 \
# && update-alternatives --install /usr/bin/run-clang-tidy run-clang-tidy /usr/bin/run-clang-tidy-18 100
# ENV CC=/usr/bin/clang-18
# ENV CXX=/usr/bin/clang++-18
WORKDIR /workspace
RUN echo "source /opt/ros/foxy/setup.sh" >> ~/.zshrc
RUN apt update && apt install -y ros-foxy-rmw-cyclonedds-cpp ros-foxy-rosidl-generator-dds-idl
CMD [ "zsh" ]

View File

@@ -0,0 +1,21 @@
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive \
ROS_DISTRO=foxy
RUN sed -i 's|http://.*archive.ubuntu.com|http://mirrors.aliyun.com|g' /etc/apt/sources.list && \
sed -i 's|http://.*security.ubuntu.com|http://mirrors.aliyun.com|g' /etc/apt/sources.list
# install ros2
RUN apt-get update && apt-get install -y curl gnupg2 lsb-release software-properties-common
RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] https://mirrors.ustc.edu.cn/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2.list
RUN apt-get update && apt-get install -y ros-${ROS_DISTRO}-desktop git vim wget
RUN apt-get install -y cmake g++ build-essential ros-foxy-rmw-cyclonedds-cpp ros-foxy-rosidl-generator-dds-idl
RUN apt install -y python3-colcon-common-extensions
WORKDIR /workspace
CMD ["bash"]

View File

@@ -0,0 +1,34 @@
FROM althack/ros2:humble-full
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
USER root
# install zsh and oh-my-zsh
RUN apt update && apt install -y zsh git
RUN wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh && chmod +x install.sh && ls
RUN ./install.sh
RUN git clone https://github.com/zsh-users/zsh-autosuggestions.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions && \
apt install zsh-syntax-highlighting
# configure zsh
RUN echo 'export ZSH=$HOME/.oh-my-zsh' >> ~/.zshrc && \
echo 'ZSH_THEME="ys"' >> ~/.zshrc && \
echo 'plugins=(git zsh-autosuggestions)' >> ~/.zshrc && \
echo 'source $ZSH/oh-my-zsh.sh' >> ~/.zshrc && \
echo 'source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh' >> ~/.zshrc
# install clang tools
RUN wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 18 all
RUN update-alternatives --install /usr/bin/clangd clangd /usr/bin/clangd-18 100 \
&& update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-18 100 \
&& update-alternatives --install /usr/bin/clang clang /usr/bin/clang-18 100 \
&& update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-18 100 \
&& update-alternatives --install /usr/bin/run-clang-tidy run-clang-tidy /usr/bin/run-clang-tidy-18 100
ENV CC=/usr/bin/clang-18
ENV CXX=/usr/bin/clang++-18
WORKDIR /workspace
RUN echo "source /opt/ros/humble/setup.sh" >> ~/.zshrc
RUN apt update && apt install -y ros-humble-rmw-cyclonedds-cpp ros-humble-rosidl-generator-dds-idl
CMD [ "zsh" ]

View File

@@ -0,0 +1,29 @@
{
"name": "Existing Docker Compose (Extend)",
"dockerComposeFile": [
"docker-compose.yml"
],
"service": "devcontainer-humble",
"workspaceFolder": "/workspace",
"customizations": {
"vscode": {
"extensions": [
"gitlab.gitlab-workflow",
"llvm-vs-code-extensions.vscode-clangd",
"xaver.clang-format",
"ms-vscode.cmake-tools",
"zxh404.vscode-proto3",
"donjayamanne.githistory",
"mhutchie.git-graph",
"matepek.vscode-catch2-test-adapter",
"ryanluker.vscode-coverage-gutters",
"donjayamanne.python-extension-pack",
"adam-bender.commit-message-editor",
"axetroy.vscode-changelog-generator",
"vsliveshare.vsliveshare",
"bierner.markdown-mermaid",
"vadimcn.vscode-lldb"
]
}
}
}

View File

@@ -0,0 +1,55 @@
version: '3'
services:
devcontainer-humble:
volumes:
- ..:/workspace:cached
- /tmp/.X11-unix:/tmp/.X11-unix:rw
- /mnt/wslg:/mnt/wslg
- /root/.gazebo/models/:/root/.gazebo/models/
- /var/run/docker.sock:/var/run/docker.sock
- $HOME/.Xauthority:/tmp/.Xauthority:rw
environment:
- DISPLAY=${DISPLAY}
- XAUTHORITY=/tmp/.Xauthority
cap_add:
- SYS_PTRACE
command: /bin/sh -c "while sleep 1000; do :; done"
build:
context: .
dockerfile: Dockerfile-humble
# image: ros2-humble-dev:latest
# run `cd .devcontainer/ && docker build . -t ros2-humble-dev:latest -f Dockerfile-humble`
# to use the development environment, or you can build it with Dockerfile.
# Perhaps Unitree will provide a dockerhub image later to save you time compiling.
privileged: true
network_mode: "host"
devcontainer-foxy:
volumes:
- ..:/workspace:cached
- /tmp/.X11-unix:/tmp/.X11-unix:rw
- /mnt/wslg:/mnt/wslg
- /root/.gazebo/models/:/root/.gazebo/models/
- /var/run/docker.sock:/var/run/docker.sock
- $HOME/.Xauthority:/tmp/.Xauthority:rw
environment:
- DISPLAY=${DISPLAY}
- XAUTHORITY=/tmp/.Xauthority
cap_add:
- SYS_PTRACE
command: /bin/sh -c "while sleep 1000; do :; done"
build:
context: .
dockerfile: Dockerfile-foxy
# image: ros2-foxy-dev:latest
# run `cd .devcontainer/ && docker build . -t ros2-humble-dev:latest -f Dockerfile-humble`
# to use the development environment, or you can build it with Dockerfile.
# Perhaps Unitree will provide a dockerhub image later to save you time compiling.
privileged: true
network_mode: "host"