From 035bb7bdfe128977e9ca6b52a684a0e32287e6e1 Mon Sep 17 00:00:00 2001 From: rafal-gorecki Date: Tue, 5 Mar 2024 12:00:14 +0100 Subject: [PATCH] Readme, last fixes --- Dockerfile.hardware | 1 - Dockerfile.simulation | 2 - README.md | 53 +++++++++---------- demo/.env.cpu | 1 + ...se.simulation.yaml => compose.gazebo.yaml} | 4 +- demo/compose.yaml | 2 + 6 files changed, 31 insertions(+), 32 deletions(-) rename demo/{compose.simulation.yaml => compose.gazebo.yaml} (76%) diff --git a/Dockerfile.hardware b/Dockerfile.hardware index 72f2640..6e8e91a 100644 --- a/Dockerfile.hardware +++ b/Dockerfile.hardware @@ -40,4 +40,3 @@ RUN apt-get update && \ # Setup envs from eeprom RUN sed -i "/# /i set -e -a && source /run/husarion/panther_config.env" /*_entrypoint.sh -ENTRYPOINT ["/ros_entrypoint.sh"] diff --git a/Dockerfile.simulation b/Dockerfile.simulation index 0ce9506..502f4ec 100644 --- a/Dockerfile.simulation +++ b/Dockerfile.simulation @@ -28,5 +28,3 @@ RUN apt-get update && \ apt-get autoremove -y && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* - -ENTRYPOINT ["/ros_entrypoint.sh"] diff --git a/README.md b/README.md index 9699983..1fd1bf0 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Docker images dedicated to Husarion Panther ROS system and simulation. ## Docker Images -Docker images are automatically deployed to Docker Hub. Image tag includes information about the ROS distribution, the version of the [panther_ros](https://github.com/husarion/panther_ros/tree/ros2-devel) repository, and the date of release. Additionally stable image versions are tagged with `stable` and recommended for production use. +Docker images are automatically deployed to Docker Hub. Image tag includes information about the ROS distribution, the version of the [panther_ros](https://github.com/husarion/panther_ros/tree/ros2-devel) repository, and the date of release. Additionally stable image versions are tagged with `stable` and recommended for production use. Below, you can find a list of available Docker images. To access the latest tag, simply follow provided links: - [husarion/panther](https://hub.docker.com/r/husarion/panther) - ROS packages for Panther robot, @@ -12,8 +12,7 @@ Below, you can find a list of available Docker images. To access the latest tag, ## Updating Panther Software -> **Note** -> Latest Panther Docker images are compatible with Built-in Computer OS version 2.0.0 and newer. If your operating system is older, please ensure you update it before proceeding. **[COMING SOON]** Follow [operating system reinstallation](ros2-os-instalation-link) for more info. +> [!Note] Latest Panther Docker images are compatible with Built-in Computer OS version 2.0.0 and newer. If your operating system is older, please ensure you update it before proceeding. **[COMING SOON]** Follow [operating system reinstallation](ros2-os-instalation-link) for more info. Connect to Panther's Built-in Computer: @@ -21,43 +20,41 @@ Connect to Panther's Built-in Computer: ssh husarion@10.15.20.2 ``` -Edit Docker compose file: +## Quick Start + +Depending on your needs, you can run Docker to quickly launch the physical robot or run a simulation. To do this, clone this repository to your robot or computer. ```bash -nano compose.yaml +git clone -b ros2 https://github.com/husarion/panther-docker.git +cd panther-docker/demo ``` -Update Docker image tag: +### 🤖 Robot -```yaml - panther_ros: - image: husarion/panther: # example tag: humble-2.0.0-20231208-stable -``` +1. Activate Panther -Restart Docker containers: + ```bash + docker compose up + ``` -```bash -docker compose up -d --force-recreate -``` +2. Launch Visualization on PC -## Running Simulation + ```bash + xhost local:root + docker compose -f compose.rviz.yaml up + ``` -To give Docker access to your screen run: +> [!NOTE] +> To use the latest version of the image, run the `docker compose pull` command and rerun above commands. -```bash -xhost local:docker -``` +### 💻 Gazebo Simulation -Depending on your hardware configuration your `compose.yaml` file may differ. For Intel and AMD users you will need the following configuration: [compose.simulation.yaml](./demo/simulation/compose.simulation.yaml). -To launch the simulation, from the directory containing Docker compose file run: +To give Docker access to your screen run: ```bash -docker compose -f compose.simulation.yaml up +xhost local:docker +docker compose -f compose.gazebo.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). -To launch the simulation, from the directory containing Docker compose file run: - -```bash -docker compose -f compose.simulation-gpu.yaml up -``` +> [!NOTE] +> If you have an NVIDIA GPU, it is worth changing the compos configuration from cpu-config to gpu-config. For this purpose, it is necessary to install [NVIDIA Container Toolkit](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). diff --git a/demo/.env.cpu b/demo/.env.cpu index 28c85c2..e645a8c 100644 --- a/demo/.env.cpu +++ b/demo/.env.cpu @@ -1,2 +1,3 @@ DISPLAY=${DISPLAY:?You need to define display env} LIBGL_ALWAYS_SOFTWARE=1 # comment if you want to use CPU for rendering +QT_X11_NO_MITSHM=1 diff --git a/demo/compose.simulation.yaml b/demo/compose.gazebo.yaml similarity index 76% rename from demo/compose.simulation.yaml rename to demo/compose.gazebo.yaml index a073113..12ceb3a 100644 --- a/demo/compose.simulation.yaml +++ b/demo/compose.gazebo.yaml @@ -2,6 +2,8 @@ x-common-config: &common-config network_mode: host ipc: host + environment: + - RMW_IMPLEMENTATION=rmw_cyclonedds_cpp # TODO: Fix Default FastDDS x-cpu-config: &cpu-config @@ -14,7 +16,7 @@ x-gpu-config: services: panther: - image: husarion/panther-gazebo:humble + image: husarion/panther-gazebo:humble-ros2-update # build: # context: .. # dockerfile: Dockerfile.simulation diff --git a/demo/compose.yaml b/demo/compose.yaml index ce1a558..366d4a1 100644 --- a/demo/compose.yaml +++ b/demo/compose.yaml @@ -3,6 +3,8 @@ x-common-config: network_mode: host ipc: host restart: always + environment: + - RMW_IMPLEMENTATION=rmw_cyclonedds_cpp # TODO: Fix Default FastDDS x-cpu-config: &cpu-config