File Comments & ROS Development Container

- Add comments to files explaining what the file is
- Add ros-dev container for development
This commit is contained in:
Sravan Balaji
2020-03-25 12:12:09 -04:00
parent e4c6c7470b
commit fd2039e610
5 changed files with 47 additions and 14 deletions

View File

@@ -1 +1,3 @@
# .env for docker-compose
IP_ADDRESS=192.168.1.14 IP_ADDRESS=192.168.1.14

View File

@@ -5,20 +5,20 @@ version: '3'
# Define services # Define services
services: services:
# ROS Service # ROS Development Service
ros: ros-dev:
# Use Dockerfile in ros folder # Use Dockerfile in ros-dev folder
build: ./ros build: ./ros-dev
# Mount ros folder on host to app folder in container # Mount ros-dev folder on host to app folder in container
volumes: volumes:
- ./ros:/app - ./ros-dev:/app
# Set DISPLAY variable and network mode for GUIs # Set DISPLAY variable and network mode for GUIs
environment: environment:
- DISPLAY=${IP_ADDRESS}:0.0 - DISPLAY=${IP_ADDRESS}:0.0
network_mode: "host" network_mode: "host"
# Set working directory in container to app folder # Set working directory in container to app folder
working_dir: /app working_dir: /app
# ROS Turtlesim Service # ROS Turtlesim Service
ros-turtlesim: ros-turtlesim:
# Use Dockerfile in ros-turtlesim folder # Use Dockerfile in ros-turtlesim folder
@@ -35,13 +35,27 @@ services:
# Run turtlesim script when container is run # Run turtlesim script when container is run
command: bash -c "./turtlesim.sh" command: bash -c "./turtlesim.sh"
# Gazebo Service # ROS Production Service
gazebo: ros:
# Use Dockerfile in gazebo folder # Use Dockerfile in ros folder
build: ./gazebo build: ./ros
# Mount gazebo folder on host to app folder in container # Mount ros folder on host to app folder in container
volumes: volumes:
- ./gazebo:/app - ./ros:/app
# Set DISPLAY variable and network mode for GUIs
environment:
- DISPLAY=${IP_ADDRESS}:0.0
network_mode: "host"
# Set working directory in container to app folder
working_dir: /app
# Gazebo Production Service
gazebo:
# Use Dockerfile in gazebo folder
build: ./gazebo
# Mount gazebo folder on host to app folder in container
volumes:
- ./gazebo/.gazebo:/root/.gazebo
# Set DISPLAY variable and network mode for GUIs # Set DISPLAY variable and network mode for GUIs
environment: environment:
- DISPLAY=${IP_ADDRESS}:0.0 - DISPLAY=${IP_ADDRESS}:0.0

16
src/ros-dev/Dockerfile Normal file
View File

@@ -0,0 +1,16 @@
# ROS Development Dockerfile
# Use official image for ROS Melodic Morenia
FROM ros:melodic
# Install dependencies for development
RUN sudo apt-get update && apt-get install -y \
# ROS Tutorial Dependencies
ros-melodic-ros-tutorials \
ros-melodic-rqt \
ros-melodic-rqt-common-plugins \
ros-melodic-turtlesim \
# C++ Development: g++ compiler, etc.
build-essential
CMD ["/bin/bash"]

View File

@@ -1,4 +1,4 @@
# ROS Dockerfile # ROS Turtlesim Dockerfile
# Use official image for ROS Melodic Morenia # Use official image for ROS Melodic Morenia
FROM ros:melodic FROM ros:melodic

View File

@@ -1,3 +1,4 @@
# turtlesim.sh
#!/bin/bash #!/bin/bash
roscore & roscore &