Skip to content

Commit

Permalink
adapted to template v2
Browse files Browse the repository at this point in the history
  • Loading branch information
afdaniele committed Jul 21, 2020
1 parent f1b0591 commit 9d48909
Show file tree
Hide file tree
Showing 15 changed files with 173 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.1.0
current_version = 0.0.0
files = .dtproject
commit = True
tag = True
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
!packages
!dependencies-apt.txt
!dependencies-py.txt
!launch.sh
!dependencies-py3.txt
!launchers

# YOUR FILES LISTED BELOW THIS LINE (IMPORTANT: PREPEND !)
# ----------------------------------------------------------------------------
4 changes: 2 additions & 2 deletions .dtproject
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
VERSION=0.1.0
VERSION=0.0.0
TYPE=template-ros
TYPE_VERSION=1
TYPE_VERSION=2
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
docs/build
*pyc

# documentation artifacts
html/*
!html/HTML_DOCS_WILL_BE_GENERATED_HERE
70 changes: 44 additions & 26 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,43 @@
# parameters
ARG REPO_NAME="dt-gui-tools"
ARG MAINTAINER="Andrea F. Daniele ([email protected])"

# ==================================================>
# ==> Do not change this code
# ==> Do not change the code below this line
ARG ARCH=arm32v7
ARG MAJOR=daffy
ARG BASE_TAG=${MAJOR}-${ARCH}
ARG DISTRO=daffy
ARG BASE_TAG=${DISTRO}-${ARCH}
ARG BASE_IMAGE=dt-ros-commons
ARG LAUNCHER=default

# define base image
FROM duckietown/${BASE_IMAGE}:${BASE_TAG}

# define repository path
# recall all arguments
ARG ARCH
ARG DISTRO
ARG REPO_NAME
ARG MAINTAINER
ARG BASE_TAG
ARG BASE_IMAGE
ARG LAUNCHER

# check build arguments
RUN dt-build-env-check "${REPO_NAME}" "${MAINTAINER}"

# define/create repository path
ARG REPO_PATH="${CATKIN_WS_DIR}/src/${REPO_NAME}"
ARG LAUNCH_PATH="${LAUNCH_DIR}/${REPO_NAME}"
RUN mkdir -p "${REPO_PATH}"
RUN mkdir -p "${LAUNCH_PATH}"
WORKDIR "${REPO_PATH}"

# create repo directory
RUN mkdir -p "${REPO_PATH}"
# keep some arguments as environment variables
ENV DT_MODULE_TYPE "${REPO_NAME}"
ENV DT_MAINTAINER "${MAINTAINER}"
ENV DT_REPO_PATH "${REPO_PATH}"
ENV DT_LAUNCH_PATH "${LAUNCH_PATH}"
ENV DT_LAUNCHER "${LAUNCHER}"

# install apt dependencies
COPY ./dependencies-apt.txt "${REPO_PATH}/"
Expand All @@ -30,6 +50,10 @@ RUN apt-get update \
COPY ./dependencies-py.txt "${REPO_PATH}/"
RUN pip install -r ${REPO_PATH}/dependencies-py.txt

# install python3 dependencies
COPY ./dependencies-py3.txt "${REPO_PATH}/"
RUN pip3 install -r ${REPO_PATH}/dependencies-py3.txt

# copy the source code
COPY . "${REPO_PATH}/"

Expand All @@ -38,31 +62,25 @@ RUN . /opt/ros/${ROS_DISTRO}/setup.sh && \
catkin build \
--workspace ${CATKIN_WS_DIR}/

# define launch script
ENV LAUNCHFILE "${REPO_PATH}/launch.sh"

# define command
CMD ["bash", "-c", "${LAUNCHFILE}"]
# install launcher scripts
COPY ./launchers/. "${LAUNCH_PATH}/"
COPY ./launchers/default.sh "${LAUNCH_PATH}/"
RUN dt-install-launchers "${LAUNCH_PATH}"

# store module name
LABEL org.duckietown.label.module.type "${REPO_NAME}"
ENV DT_MODULE_TYPE "${REPO_NAME}"
# define default command
CMD ["bash", "-c", "dt-launcher-${DT_LAUNCHER}"]

# store module metadata
ARG ARCH
ARG MAJOR
ARG BASE_TAG
ARG BASE_IMAGE
LABEL org.duckietown.label.architecture "${ARCH}"
LABEL org.duckietown.label.code.location "${REPO_PATH}"
LABEL org.duckietown.label.code.version.major "${MAJOR}"
LABEL org.duckietown.label.base.image "${BASE_IMAGE}:${BASE_TAG}"
# <== Do not change this code
LABEL org.duckietown.label.module.type="${REPO_NAME}" \
org.duckietown.label.architecture="${ARCH}" \
org.duckietown.label.code.location="${REPO_PATH}" \
org.duckietown.label.code.version.distro="${DISTRO}" \
org.duckietown.label.base.image="${BASE_IMAGE}" \
org.duckietown.label.base.tag="${BASE_TAG}" \
org.duckietown.label.maintainer="${MAINTAINER}"
# <== Do not change the code above this line
# <==================================================

# nvidia-container-runtime
ENV NVIDIA_VISIBLE_DEVICES ${NVIDIA_VISIBLE_DEVICES:-all}
ENV NVIDIA_DRIVER_CAPABILITIES ${NVIDIA_DRIVER_CAPABILITIES:+$NVIDIA_DRIVER_CAPABILITIES,}graphics

# maintainer
LABEL maintainer="Andrea F. Daniele ([email protected])"
Binary file added LICENSE.pdf
Binary file not shown.
1 change: 1 addition & 0 deletions dependencies-py3.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# LIST YOUR PYTHON3 PACKAGES HERE
58 changes: 58 additions & 0 deletions docs/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
docs_config_version: v1

# CONFIGURE THESE TO MATCH YOUR PROJECT:
project: "dt-gui-tools"
copyright: "Duckietown"
author: "Andrea F. Daniele ([email protected])"
version: "daffy"
custom_sections: [
"Configuration",
"Subscribers",
"Subscriber",
"Publishers",
"Publisher",
"Services",
"Service",
"Fields",
"Attribute",
"Attributes",
"inputs",
"input",
"outputs",
"output"
]

# REFRAIN FROM CHANGING THESE SPHINX-SPECIFIC CONFIGURATION SETTINGS:
autodoc_default_flags:
members: True
member-order: alphabetical
undoc-members: True
inherited-members: True
show-inheritance: True

add_module_names: False

# settings for napoleon
napoleon_google_docstring: True
napoleon_numpy_docstring: False
napoleon_include_init_with_doc: False
napoleon_include_private_with_doc: False
napoleon_include_special_with_doc: False
napoleon_use_admonition_for_examples: True
napoleon_use_admonition_for_notes: True
napoleon_use_admonition_for_references: True
napoleon_use_ivar: False
napoleon_use_param: False
napoleon_use_rtype: True
napoleon_use_keyword: True

# options for the sphinx_rtd_theme
html_theme_options:
prev_next_buttons_location: 'bottom'
style_nav_header_background: '#fbc10b'
collapse_navigation: False
sticky_navigation: True
navigation_depth: 4
includehidden: False
titles_only: False

23 changes: 23 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

.. documentation master file, created by
sphinx-quickstart on Fri Jul 19 20:26:50 2019.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to dt-gui-tools documentation!
======================================

.. toctree::
:maxdepth: 1
:caption: Contents:

packages



Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
Empty file added docs/mock_imports
Empty file.
8 changes: 8 additions & 0 deletions docs/packages.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Duckietown Module: dt-gui-tools
===============================

.. toctree::
:glob:
:maxdepth: 4

packages/*
1 change: 1 addition & 0 deletions docs/packages/PLACE_YOUR_RST_FILES_HERE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
INTENTIONALLY LEFT BLANK
6 changes: 6 additions & 0 deletions docs/packages/example.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Python Package: example
=======================

.. contents::

TODO: This is a placeholder description of the Python Package.
7 changes: 0 additions & 7 deletions launch.sh

This file was deleted.

23 changes: 23 additions & 0 deletions launchers/default.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

source /environment.sh

# initialize launch file
dt-launchfile-init

# YOUR CODE BELOW THIS LINE
# ----------------------------------------------------------------------------


# NOTE: Use the variable REPO_PATH to know the absolute path to your code
# NOTE: Use `dt-exec COMMAND` to run the main process (blocking process)

# launching app
dt-exec echo "This is an empty launch script. Update it to launch your application."


# ----------------------------------------------------------------------------
# YOUR CODE ABOVE THIS LINE

# wait for app to end
dt-launchfile-join

0 comments on commit 9d48909

Please sign in to comment.