Skip to content

Commit

Permalink
Make is possible to access the microRTPS bridge inside the px4-sitl c…
Browse files Browse the repository at this point in the history
…ontainer from the host by mapping shared memory (see discussion here: eProsima/Fast-DDS#1698). This is needed e.g. if you want to run GISNav on host while using the containerized SITL environment. Also make ROS_DOMAIN_ID a build argument for the px4-sitl container image and add a short related note to the README.md troubleshooting section.
  • Loading branch information
hmakelin committed Aug 18, 2022
1 parent afe1bae commit 427c95e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.md
Expand Up @@ -63,6 +63,14 @@ docker run -it --env="DISPLAY" --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" --gpu
--entrypoint="/bin/bash" gisnav-docker_px4-sitl
```

If you are trying to connect to the PX4-ROS 2 bridge inside the container from the host but it seems like the messages
are not coming through, ensure your `ROS_DOMAIN_ID` environment variable on your host matches what is used inside the
container (0 by default):

```bash
export ROS_DOMAIN_ID=0
```

## Repository Structure

This repository is structured as follows:
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yaml
Expand Up @@ -19,6 +19,7 @@ services:
- DISPLAY=${DISPLAY}
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix:ro
- /dev/shm:/dev/shm
network_mode: host
stdin_open: true
tty: true
3 changes: 2 additions & 1 deletion docker/px4-sitl/Dockerfile
Expand Up @@ -83,6 +83,7 @@ COPY Makefile /
RUN sudo mv Makefile $HOME/

# See https://docs.ros.org/en/dashing/Concepts/About-Domain-ID.html
ENV ROS_DOMAIN_ID=0
ARG ROS_DOMAIN_ID=0
ENV ROS_DOMAIN_ID=${ROS_DOMAIN_ID}

CMD cd $HOME && make HOME=$HOME gazebo

0 comments on commit 427c95e

Please sign in to comment.