Skip to content
Snippets Groups Projects
Unverified Commit 3feee915 authored by Mikael Arguedas's avatar Mikael Arguedas Committed by GitHub
Browse files

Remove outdated docker resources now that SROS2 ships as part of the core (#48)

parent 3ab0b7a5
No related branches found
No related tags found
No related merge requests found
......@@ -12,5 +12,3 @@ If you want to run the demo using RTI Connext Secure you will need a license for
[Try SROS2 on MacOS](https://github.com/ros2/sros2/blob/master/SROS2_MacOS.md)
[Try SROS2 on Windows](https://github.com/ros2/sros2/blob/master/SROS2_Windows.md)
[Try SROS2 in Docker](https://github.com/ros2/sros2/blob/master/SROS2_Docker.md)
# Testing in a docker container (Fast-RTPS only)
## Building the docker image
To setup the environment, first clone this repository:
```
mkdir ~/sros2_demo && cd ~/sros2_demo
git clone https://github.com/ros2/sros2.git
```
And then build the docker container:
```
cd ~/sros2_demo/sros2/sros2_docker/docker
./build_sros2.sh
```
This may take a few minutes.
Finally enter the container:
```
./run_sros2_container.sh
```
Hooray we are now ready to start the demo.
## Run the demo
We will start by creating a set of keys for our DDS participant:
```
cd /root/sros2_demo
ros2 security create_keystore demo_keys
ros2 security create_key demo_keys talker
ros2 security create_key demo_keys listener
```
And now start testing!
In the terminal inside docker, run:
```
ros2 run demo_nodes_py talker
```
This will start a python executable that publishes messages periodically.
Now let's open another terminal into the container by opening a new terminal, then running:
```
docker exec -ti <CONTAINER_NAME> /bin/bash
ros2 run demo_nodes_cpp listener
```
Hooray our nodes are authenticated and talking encrypted-talk!
#!/usr/bin/env bash
docker build -t sros2 ./sros2
#!/bin/bash
docker run -ti sros2
FROM ubuntu:xenial
RUN apt-get -qq update && \
apt-get -qq install locales -y
RUN locale-gen en_US en_US.UTF-8 && \
update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
ENV LANG en_US.UTF-8
RUN sh -c 'echo "deb http://repo.ros2.org/ubuntu/main xenial main" > /etc/apt/sources.list.d/ros2-latest.list' && \
apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys 421C365BD9FF1F717815A3895523BAEEB01FA116
# upgrade distro
RUN apt-get -qq update && \
apt-get -qq dist-upgrade -y
# install deps
RUN apt-get -qq update && \
apt-get -qq install -y \
python3-pip \
ros-r2b2-demo-nodes-cpp \
ros-r2b2-demo-nodes-py \
ros-r2b2-ros2run \
ros-r2b2-sros2 \
vim
RUN pip3 install argcomplete
# setup ros2 workspace
ENV ROS2_WS=/root/sros2_demo
WORKDIR $ROS2_WS
RUN echo "export ROS_SECURITY_ROOT_DIRECTORY=/root/sros2_demo/demo_keys" >> /root/.bashrc && \
echo "export ROS_SECURITY_ENABLE=true" >> /root/.bashrc && \
echo "export ROS_SECURITY_STRATEGY=Enforce" >> /root/.bashrc && \
echo "export RMW_IMPLEMENTATION=rmw_fastrtps_cpp" >> /root/.bashrc && \
echo "source /opt/ros/r2b2/setup.bash" >> /root/.bashrc
#!/bin/bash
set -e
source $HOME/.bashrc
# setup ros
. /root/sros2_ws/install_isolated/local_setup.bash
exec "$@"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment