-
Notifications
You must be signed in to change notification settings - Fork 3
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
Assembler起動用Shell Scriptの作成 #58
Comments
.shファイルをどこに置くかなど、ご意見ございましたらお願いします。 置き場所等が決まるまで、ここにshを載せておきます。 run_assembler.sh#!/bin/bash
set -x
iname=${DOCKER_IMAGE:-"repo.irsl.eiiris.tut.ac.jp/choreonoid_robot_assembler_plugin:20.04"}
cname=${DOCKER_CONTAINER:-"irsl_choreonoid_assembler"}
DEFAULT_USER_DIR="$(pwd)"
DEFAULT_SETUP=${SETUP_FILE:-"/choreonoid_ws/install/setup.bash"}
mtdir=${MOUNTED_DIR:-$DEFAULT_USER_DIR}
VAR=${@:-"choreonoid --assembler /choreonoid_src/choreonoid/ext/robot_assembler_plugin/config/irsl/irsl_assembler_config.yaml /choreonoid_src/choreonoid/ext/robot_assembler_plugin/config/assembler.cnoid"}
if [ $# -eq 0 -a -z "$OPT" ]; then
OPT=-it
fi
if [ "$NO_GPU" = "" ]; then
GPU_OPT='--gpus all,"capabilities=compute,graphics,utility,display"'
else
GPU_OPT=""
fi
NET_OPT="--net=host"
DOCKER_ENVIRONMENT_VAR=""
XDG_OPTION="-u $(id -u):$(id -g) --volume=/run/user/$(id -u):/tmp/xdg_runtime --env=XDG_RUNTIME_DIR=/tmp/xdg_runtime"
xhost +si:localuser:root
docker rm ${cname}
docker run \
--pull=always \
--privileged \
--rm \
${OPT} \
${GPU_OPT} \
${NET_OPT} \
${DOCKER_ENVIRONMENT_VAR} \
${XDG_OPTION} \
--env="DOCKER_ROS_SETUP=${DEFAULT_SETUP}" \
--env="ROS_IP=localhost" \
--env="ROS_MASTER_URI=http://localhost:11311" \
--env="DISPLAY" \
--env="QT_X11_NO_MITSHM=1" \
--volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
--name=${cname} \
--volume="${mtdir}:/workdir" \
-w="/workdir" \
${iname} \
${VAR} run_choreonoid.sh#!/bin/bash
set -x
iname=${DOCKER_IMAGE:-"repo.irsl.eiiris.tut.ac.jp/choreonoid_robot_assembler_plugin:20.04"}
cname=${DOCKER_CONTAINER:-"irsl_choreonoid"}
DEFAULT_USER_DIR="$(pwd)"
DEFAULT_SETUP=${SETUP_FILE:-"/choreonoid_ws/install/setup.bash"}
mtdir=${MOUNTED_DIR:-$DEFAULT_USER_DIR}
VAR=${@:-"choreonoid"}
if [ $# -eq 0 -a -z "$OPT" ]; then
OPT=-it
fi
if [ "$NO_GPU" = "" ]; then
GPU_OPT='--gpus all,"capabilities=compute,graphics,utility,display"'
else
GPU_OPT=""
fi
NET_OPT="--net=host"
DOCKER_ENVIRONMENT_VAR=""
XDG_OPTION="-u $(id -u):$(id -g) --volume=/run/user/$(id -u):/tmp/xdg_runtime --env=XDG_RUNTIME_DIR=/tmp/xdg_runtime"
xhost +si:localuser:root
docker rm ${cname}
docker run \
--pull=always \
--privileged \
--rm \
${OPT} \
${GPU_OPT} \
${NET_OPT} \
${DOCKER_ENVIRONMENT_VAR} \
${XDG_OPTION} \
--env="DOCKER_ROS_SETUP=${DEFAULT_SETUP}" \
--env="ROS_IP=localhost" \
--env="ROS_MASTER_URI=http://localhost:11311" \
--env="DISPLAY" \
--env="QT_X11_NO_MITSHM=1" \
--volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
--name=${cname} \
--volume="${mtdir}:/workdir" \
-w="/workdir" \
${iname} \
${VAR} exec.shcontainer_name=${DOCKER_CONTAINER:-"irsl_choreonoid_assembler"}
docker exec -it ${container_name} bash |
上記shの デフォルトは |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Docker環境でassemberを起動するシェルスクリプトを作成する。
(ドキュメント内の説明で使用予定)
run_assembler.sh
repo.irslからDockerイメージをpullして、assemblerを起動する。
run_choreonoid.sh
run_assembler.sh
とは別のコンテナで、通常のChoreonoidを起動する。(
exec.sh
)run_assembler.sh
で起動したコンテナの中に入る。(ユーザーは必要なさそう)The text was updated successfully, but these errors were encountered: