Skip to content

Commit e8a2591

Browse files
committed
WIP: simulator setup
1 parent a8079a5 commit e8a2591

3 files changed

Lines changed: 33 additions & 76 deletions

File tree

Dockerfile.Simulator

Lines changed: 4 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,9 @@
1-
FROM osrf/ros:noetic-desktop-full
2-
3-
4-
ARG TELEOP_CONTROLLER
5-
ENV TELEOP_CONTROLLER=${TELEOP_CONTROLLER}
6-
7-
ARG ENABLE_MANIPULATOR
8-
ENV ENABLE_MANIPULATOR=${ENABLE_MANIPULATOR}
9-
10-
ARG OPEN_MANIPULATOR_GUI
11-
ENV MANIPULATOR_GUI=${MANIPULATOR_GUI}
12-
13-
ARG WORLD_NAME
14-
ENV WORLD_NAME=${WORLD_NAME}
15-
16-
17-
ENV NVIDIA_VISIBLE_DEVICES \
18-
${NVIDIA_VISIBLE_DEVICES:-all}
19-
ENV NVIDIA_DRIVER_CAPABILITIES \
20-
${NVIDIA_DRIVER_CAPABILITIES:+$NVIDIA_DRIVER_CAPABILITIES,}graphics
21-
1+
FROM osrf/ros:jazzy-desktop
222

233
WORKDIR /home/
244

25-
RUN apt-get update &&\
26-
apt-get install -y\
27-
gazebo11 \
28-
build-essential \
29-
python3-osrf-pycommon \
30-
python3-catkin-tools \
31-
python3-rosdep \
32-
libignition-rendering3 \
33-
git \
34-
xvfb
35-
36-
37-
RUN mkdir -p catkin_ws/src
38-
39-
WORKDIR /home/catkin_ws/src/
40-
41-
RUN git clone -b noetic-devel https://github.com/ROBOTIS-GIT/turtlebot3_simulations.git &&\
42-
git clone https://github.com/ROBOTIS-GIT/turtlebot3_manipulation.git &&\
43-
git clone https://github.com/ROBOTIS-GIT/turtlebot3_manipulation_simulations.git &&\
44-
git clone https://github.com/ROBOTIS-GIT/open_manipulator_dependencies.git
45-
46-
47-
COPY ./ros_packages/ /home/catkin_ws/src/
48-
COPY ./docker_scripts/install_dep.sh /home/
49-
RUN /home/install_dep.sh
50-
51-
RUN mkdir -p /usr/share/gazebo-11/models
52-
COPY ./models /usr/share/gazebo-11/models
53-
COPY ./docker_scripts/setup.sh /usr/share/gazebo-11/setup.sh
54-
COPY ./docker_scripts/setup.sh /usr/share/gazebo/setup.sh
55-
56-
COPY ./config /home/config
57-
COPY ./docker_scripts/entrypoint.sh /home/
58-
COPY ./worlds /home/catkin_ws/src/isar_turtlebot/worlds/
59-
COPY ./maps /home/catkin_ws/src/isar_turtlebot/maps/
60-
61-
62-
# Change user to avoid running as root
63-
# User needs to have an explicit guid for radix
64-
RUN useradd -ms /bin/bash --uid 1001 -g users turtle_sim
65-
RUN chown -R 1001 /home
66-
RUN chmod 755 /home
5+
COPY /docker_scripts/install_sim.sh /home/
676

68-
USER 1001
7+
RUN bash /home/install_sim.sh
698

70-
CMD /home/entrypoint.sh
9+
CMD ["sleep", "infinity"]

docker-compose.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
1-
version: "2.3"
21
services:
3-
noetic:
2+
simulator:
43
image: turtle_sim:latest
54
container_name: turtle_sim
5+
platform: linux/amd64
66
build:
77
context: ./
88
dockerfile: Dockerfile.Simulator
9-
ports:
10-
- "9090:9090"
11-
- "5000:5000"
12-
environment:
13-
- TELEOP_CONTROLLER=${TELEOP_CONTROLLER:-disabled}
14-
- ENABLE_MANIPULATOR=${ENABLE_MANIPULATOR:-false}
15-
- MANIPULATOR_GUI=${MANIPULATOR_GUI:-disabled}
16-
- HEADLESS=${HEADLESS:-true}
17-
- WORLD_NAME=${WORLD_NAME:-house}
189
tty: true
1910
networks:
2011
- turtlenet
12+
environment:
13+
- DISPLAY=${DISPLAY} # for gazebo gui
14+
privileged: true # for gazebo gui
15+
volumes:
16+
- /tmp/.X11-unix:/tmp/.X11-unix:ro # for gazebo gui
2117
networks:
2218
turtlenet:
2319
name: turtlenet

docker_scripts/install_sim.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash/
2+
3+
curl https://packages.osrfoundation.org/gazebo.gpg --output /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg
4+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null
5+
6+
apt-get update
7+
apt-get install -y ros-dev-tools gz-harmonic
8+
9+
mkdir -p /home/turtlebot4_ws/src
10+
cd /home/turtlebot4_ws/src
11+
12+
git clone https://github.com/turtlebot/turtlebot4_simulator.git -b jazzy
13+
cd /home/turtlebot4_ws
14+
rosdep install --from-path src -yi
15+
16+
source /opt/ros/jazzy/setup.bash
17+
colcon build --symlink-install
18+
19+
source /home/turtlebot4_ws/install/setup.bash
20+
21+
echo 'source /opt/ros/jazzy/setup.bash' >> /home/.bashrc
22+
echo 'source /home/turtlebot4_ws/install/setup.bash'>> /home/.bashrc

0 commit comments

Comments
 (0)