Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
e60781b
✨feat: add vim config
kyo0221 Jun 7, 2026
3b3dbe6
✨feat: add tmux conf
kyo0221 Jun 7, 2026
ea47615
✨feat: ws, name, pathの修正
kyo0221 Jun 7, 2026
c07617b
✨feat: bash
kyo0221 Jun 7, 2026
da6640a
✨feat: ブランチ名表示
kyo0221 Jun 7, 2026
bbd17b2
✨feat: add config setting
kyo0221 Jun 7, 2026
9dd1fd0
✨feat: docker build shell
kyo0221 Jun 7, 2026
3f4486a
✨feat: docker run shell (gpu前提)
kyo0221 Jun 7, 2026
453d49f
✨feat: ベースイメージの変更と内容の整理
kyo0221 Jun 8, 2026
be3f719
🐛fix: gpu実行shellの分離
kyo0221 Jun 8, 2026
328de7a
✨feat: share
kyo0221 Jun 8, 2026
91f41fc
✨feat: add requirements
kyo0221 Jun 8, 2026
cbec13e
✨feat: add requirements install
kyo0221 Jun 8, 2026
a245eff
✨feat: add urdf
kyo0221 Jun 8, 2026
2ddb87a
🔥remove: urdf ignore
kyo0221 Jun 8, 2026
03cb980
✨feat: 実行権限
kyo0221 Jun 8, 2026
6212efa
🔧modify: 一時的にclone対象をfix/dockerに変更(検証用)
kyo0221 Jun 8, 2026
3f48994
📝docs: 修正内容に伴うreadme整備
kyo0221 Jun 8, 2026
28e6352
🔥remove: 不要な機能・ファイルの削除 and rename
kyo0221 Jun 8, 2026
d5bcf0f
✨feat: vectornav関連スクリプト
kyo0221 Jun 8, 2026
dd6bb9f
♻ refactor: リファクタリング
kyo0221 Jun 8, 2026
29131df
🐛fix: file path
kyo0221 Jun 8, 2026
da069ac
✨feat: add e2e ignore
kyo0221 Jun 8, 2026
352caca
🐛fix: pointcloud rename
kyo0221 Jun 8, 2026
4a512fd
✨feat: add e2e sim weights
kyo0221 Jun 8, 2026
9958301
🐛fix: versionの整合
kyo0221 Jun 8, 2026
b078959
🐛fix: sim param
kyo0221 Jun 8, 2026
cb949f6
🐛fix: timeout
kyo0221 Jun 10, 2026
b5507aa
🔥remove: global tracking
kyo0221 Jun 10, 2026
7cdaaaa
✨feat: exec用
kyo0221 Jun 10, 2026
33a14bc
🔥remove: 不要な機能・ファイルの削除
kyo0221 Jun 12, 2026
df10977
🐛fix: topic経由のgrabメソッドの挙動修正
kyo0221 Jun 12, 2026
0a8e219
🔥remove: 消し忘れ
kyo0221 Jun 12, 2026
b8814ba
Merge branch 'deploy' into fix/docker
kyo0221 Jun 12, 2026
ee11407
🔥remove: 不要な機能・ファイルの削除
kyo0221 Jun 12, 2026
3b219e0
✨feat: 重み保管用のディレクトリ
kyo0221 Jun 12, 2026
8e1dd93
🐛fix: yolop重みファイルパス変更
kyo0221 Jun 12, 2026
03f3b20
✨feat: navsat remap and add clock
kyo0221 Jun 12, 2026
5715b9c
✨feat: 地図ベースに合わせたパラメータ追加
kyo0221 Jun 12, 2026
ec9588b
🔧modify: 開発環境にsdkがなければbuildスキップ
kyo0221 Jun 12, 2026
350f473
✨feat: zed ifdef
kyo0221 Jun 13, 2026
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ install/
log/

simulator_old/
e2e_planner/data/
e2e_planner/runs/
#ファイル名で指定
AGENTS.md
CLAUDE.md
Expand Down
93 changes: 18 additions & 75 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,39 +1,8 @@
# cudaやcuDNNを利用したい場合は公式サイトを参考に以下のように変更してください
# 例 FROM nvidia/cuda:12.2.0-devel-ubuntu22.04
FROM ubuntu:22.04
# maintainer
LABEL maintainer="Kenta Ishizeki<kentai5420@gmail.com>"
# ROS_DIDTRO
ENV ROS_DISTRO=humble
# username 自分の好きな名前に変更
ENV USER_NAME=developer
ENV DEBIAN_FRONTEND=noninteractive
# workspace 好きな名前に変更
ENV MYWORKSPACE_NAME=ros2_ws
# basic packages
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y \
wget \
curl \
git \
build-essential \
vim \
sudo \
lsb-release \
locales \
bash-completion \
tzdata \
python3-pip \
python3-dev \
software-properties-common && \
rm -rf /var/lib/apt/lists/*

# locale
RUN locale-gen en_US en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8
FROM kyo0221/cudagl:12.6.0-devel-ubuntu22.04-torch-humble

ENV USER_NAME=nvidia
ENV MYWORKSPACE_NAME=formula_ws

# create user
RUN useradd -m -s /bin/bash ${USER_NAME} && \
Expand All @@ -45,48 +14,22 @@ USER ${USER_NAME}
WORKDIR /home/${USER_NAME}
ENV HOME=/home/${USER_NAME}

# ROS2 Humble install
RUN sudo apt-get update && \
sudo apt-get install -y software-properties-common && \
sudo add-apt-repository universe && \
sudo 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] \
http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | \
sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null

# Other install
RUN sudo apt-get update && \
sudo apt-get install -y \
ros-humble-desktop \
python3-colcon-common-extensions \
python3-rosdep \
python3-vcstool \
python3-argcomplete \
ros-dev-tools \
ros-humble-joint-state-publisher \
ros-humble-rqt-* \
ros-humble-xacro \
ros-$ROS_DISTRO-ros-gz-sim \
ros-$ROS_DISTRO-ros-gz-bridge

# rosdep
RUN sudo rosdep init || true
RUN rosdep update

# python packages
RUN pip3 install --upgrade pip
RUN pip3 install pyserial
# install aiformula repository
RUN mkdir ~/$MYWORKSPACE_NAME && \
cd ~/$MYWORKSPACE_NAME && \
git clone --recursive -b fix/docker https://github.com/open-rdc/aiformula src

# Layout of terminal
RUN echo "PS1='\[\e[1;31m\]\u@\h\[\e[00m\]:\[\e[1;34m\]\w\[\e[00m\]\$ '" >> ~/.bashrc
# download YOLOPv2 weights
RUN wget -q https://github.com/CAIC-AD/YOLOPv2/releases/download/V0.0.1/yolopv2.pt \
-O ~/$MYWORKSPACE_NAME/src/perception/road_detector/data/weights/yolopv2.pt

# ROS environment
RUN echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc && \
echo "source/ros2_ws/install/setup.bash" >> ~/.bashrc
# config setting
COPY config/.bashrc /home/${USER_NAME}/.bashrc
COPY config/.vimrc /home/${USER_NAME}/.vimrc
COPY config/.tmux.conf /home/${USER_NAME}/.tmux.conf

RUN mkdir -p ~/$MYWORKSPACE_NAME/src && \
cd ~/$MYWORKSPACE_NAME/src && \
git clone --recursive -b main https://github.com/open-rdc/aiformula
# install python dependencies
COPY config/requirements.txt /tmp/requirements.txt
RUN pip3 install --no-cache-dir -r /tmp/requirements.txt

CMD ["/bin/bash"]
125 changes: 88 additions & 37 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,96 @@
# aiformula2026_docker
これはAIForemulaにおける環境構築のためのDockerfileです。
こちらを使用する前にDockerをインストールしてください。
以下が手順になります。
# docker

AIFormulaの開発環境を構築するための Docker 環境です。

## 前提

- [Docker](https://docs.docker.com/get-docker/) がインストール済みであること
- GPU を使う場合は [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html) がインストール済みであること

## 使い方

以下のスクリプトはすべて `docker/` ディレクトリ内で実行してください。

### 1. イメージのビルド

```bash
./build.sh
```

`aiformula:humble` というイメージが作成されます。

### 2. コンテナの起動

```bash
# GPU を使わない場合
./run.sh

# GPU を使う場合
./run_gpu.sh
```

`my-aiformula-humble` という名前でコンテナが起動し、そのまま bash に入ります。
(GUIが表示されない場合はホスト側で `xhost +local:docker` を実行してください)。

### 3. ワークスペースのビルド(初回のみ)

コンテナ内で以下を実行します。

## 手順
```bash
#ホスト側
git clone https://github.com/open-rdc/aiformula
cd docker
docker build -t <your-image-name> .
#例
docker run -it -d --name <your_container_name> <your_image_name>
docker exec -it <your_container_name> /bin/bash
#コンテナ内
cd ~/ros2_ws
colcon build
cd ~/formula_ws
cb # colcon build --symlink-install のエイリアス
source ~/.bashrc
```
## GPUをお使いの場合
GPUを使っており、cudaやcuDNNを利用したい場合は以下のサイトを参考にベースイメージ名を変更してください。

- [参考サイト](https://hub.docker.com/r/nvidia/cuda/)
### コンテナへの再接続

`exit` するとコンテナは停止します。再度入る場合は次のようにします。

GPUをお使いの場合の実行例は以下のようになります。
```bash
docker run -it \
--net=host \
--ipc=host \
--pid=host \
--gpus all \
--name <your_container_name> \
-e DISPLAY=$DISPLAY \
-e WAYLAND_DISPLAY=$WAYLAND_DISPLAY \
-e XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR \
-e PULSE_SERVER=$PULSE_SERVER \
-e XAUTHORITY=/tmp/.docker.xauth \
-v $HOME/.Xauthority:/tmp/.docker.xauth \
-v /mnt/wslg:/mnt/wslg \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v $(realpath <your_workspace>):/home/<yourname>/<your_workspace> \
<your_image_name>

xhost +local:docker > /dev/null && docker start <your_container_name> > /dev/null && docker exec -it <your_container_name> bash
# 停止中のコンテナを起動して入る
docker start -i my-aiformula-humble

# 起動中のコンテナに別シェルから入る
docker exec -it my-aiformula-humble bash
```

## 補足

### シェルの便利機能

#### bash(エイリアス / 関数)

| コマンド | 内容 |
| --- | --- |
| `cb` | `colcon build --symlink-install` |
| `cbcl` | `install/ build/ log/` を削除してからクリーンビルド |
| `bashrc` | `~/.bashrc` を再読み込み |
| `ros_make` | ワークスペースへ移動してビルドし、元のディレクトリへ戻る |

- プロンプトにカレントディレクトリの git ブランチを表示します。
- 起動時に `/opt/ros/humble/setup.bash` と `~/formula_ws/install/setup.bash` を自動で source します。
- `ROS_DOMAIN_ID=10` を設定済みです。

#### tmux

| 操作 | キー |
| --- | --- |
| prefix | `C-a`(`C-b` から変更) |
| ペインを垂直分割 | `prefix` + `\` |
| ペインを水平分割 | `prefix` + `-` |
| ペイン移動 | `C-h` / `C-j` / `C-k` / `C-l`(`C-o` で順送り) |
| ペインのリサイズ | `prefix` + `H` / `J` / `K` / `L` |
| ウィンドウ切り替え | `Shift` + `←` / `→` |
| 設定のリロード | `prefix` + `r` |

- マウス操作が有効です。
- ステータスラインは 256 色対応、ウィンドウ一覧は右寄せ表示です。

#### vim

- 行番号を表示します(`set number`)。

### ホストとのファイル共有

`docker/docker_share/` がコンテナ内の `/home/host_files` にマウントされます。
ホストとコンテナの間でファイルをやり取りしたいときはこのディレクトリを使ってください。
3 changes: 3 additions & 0 deletions docker/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

eval "docker image build -t aiformula:humble ."
131 changes: 131 additions & 0 deletions docker/config/.bashrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

# If not running interactively, don't do anything
[ -z "$PS1" ] && return

# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace

# append to the history file, don't overwrite it
shopt -s histappend

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi

# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color) color_prompt=yes;;
esac

# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes

if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
fi
fi

if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
esac

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'

alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi

# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
alias open='xdg-open'

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
#if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
# . /etc/bash_completion
#fi

############ original config ############
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/[\1]/'
}

if [ -f /usr/lib/git-core/git-sh-prompt ]; then
source /usr/lib/git-core/git-sh-prompt
elif [ -f /etc/bash_completion.d/git-prompt ]; then
source /etc/bash_completion.d/git-prompt
fi

export PS1='\[\033[01;32m\]\u@\h\[\033[01;33m\] \w \[\033[01;31m\]$(__git_ps1 "(%s)") \n\[\033[01;34m\]\$\[\033[00m\] '
export ROS_DOMAIN_ID=10

source /opt/ros/humble/setup.bash
[ -f ~/formula_ws/install/setup.bash ] && source ~/formula_ws/install/setup.bash

export ROS_WORKSPACE=${HOME}/formula_ws

alias cb='colcon build --symlink-install'
alias cbcl='rm -rf install/ build/ log/ && colcon build --symlink-install'
alias bashrc='source ~/.bashrc'

function ros_make() {
dir=$PWD;
cd $ROS_WORKSPACE;
colcon build --symlink-install;
. install/local_setup.bash;
cd $dir;
}
Loading