Skip to content

Commit

Permalink
docker build pass
Browse files Browse the repository at this point in the history
  • Loading branch information
rafal-gorecki committed Feb 29, 2024
1 parent 9664c0a commit e59cc3c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 15 deletions.
3 changes: 2 additions & 1 deletion Dockerfile.hardware
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ RUN apt-get update && \
rosdep update --rosdistro $ROS_DISTRO && \
rosdep install --from-paths src -y -i --skip-keys mecanum_drive_controller && \
source /opt/ros/$ROS_DISTRO/setup.bash && \
colcon build --symlink-install --cmake-args "-DCMAKE_BUILD_TYPE=$BUILD_TYPE" "-DCMAKE_EXPORT_COMPILE_COMMANDS=On" && \
colcon build --cmake-args "-DCMAKE_BUILD_TYPE=$BUILD_TYPE" "-DBUILD_TESTING=OFF" && \
# Get version
echo $(cat /ros2_ws/src/panther_ros/panther/package.xml | grep '<version>' | sed -r 's/.*<version>([0-9]+.[0-9]+.[0-9]+)<\/version>/\1/g') >> /version.txt && \
# Size optimalization
rm -rf build log src && \
export SUDO_FORCE_REMOVE=yes && \
apt-get remove -y \
ros-dev-tools && \
apt-get autoremove -y && \
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.simulation
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ WORKDIR /ros2_ws
RUN apt-get update && \
apt-get install -y \
ros-dev-tools && \
git clone -b ros2-dependencies https://github.com/husarion/panther_ros.git src/panther_ros && \
git clone -b ros2-devel https://github.com/husarion/panther_ros.git src/panther_ros && \
vcs import src < src/panther_ros/panther/panther_hardware.repos && \
vcs import src < src/panther_ros/panther/panther_simulation.repos && \
rosdep init && \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Depending on your hardware configuration your `compose.yaml` file may differ. Fo
To launch the simulation, from the directory containing Docker compose file run:

```bash
docker compose -f compose.simulation.yaml up
docker compose -f compose.simulation.yaml up
```

Nvidia users have to install NVIDIA Container Toolkit. Installation steps can be found [here](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html). With NVIDIA Container Toolkit installed following Docker compose file will be needed: [compose.simulation-gpu.yaml](./demo/simulation/compose.simulation-gpu.yaml).
Expand Down
12 changes: 5 additions & 7 deletions demo/compose.simulation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,20 @@ x-gpu-config:
services:

panther:
# image: husarion/panther-gazebo:humble-nightly
build:
context: ..
dockerfile: Dockerfile.simulation
image: husarion/panther-gazebo:humble
# build:
# context: ..
# dockerfile: Dockerfile.simulation
<<:
- *common-config
- *cpu-config
# environment:
# - QT_X11_NO_MITSHM=1
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix:rw
command: >
ros2 launch panther_gazebo simulation.launch.py
rviz:
image: husarion/rviz2:humble-11.2.8-20231122
image: husarion/rviz2:humble
<<:
- *common-config
- *cpu-config
Expand Down
6 changes: 1 addition & 5 deletions demo/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ x-gpu-config:

services:
panther:
image: husarion/panther:humble-nightly
image: husarion/panther:humble
# build:
# context: ..
# dockerfile: Dockerfile.hardware
Expand Down Expand Up @@ -52,7 +52,3 @@ services:
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix:rw
- ./panther.rviz:/root/.rviz2/default.rviz
environment:
- DISPLAY=${DISPLAY:?You need to define display env}
- LIBGL_ALWAYS_SOFTWARE=1
- ROS_DOMAIN_ID=${ROS_DOMAIN_ID:-0}

0 comments on commit e59cc3c

Please sign in to comment.