New ROS DTProject#

What you will need

What you will get

  • Learn how to create a new ROS-compatible DTProject from a template

Create a project from a template#

A new repository is created from the template-ros boilerplate. Navigate to the template repository on GitHub: duckietown/template-ros. Select Use this template, then choose Create a new repository from the dropdown menu.

GitHub Use Template button interface

Fig. 6 Use template repository on GitHub.#

This will take you to a page that looks like the following:

GitHub create repository from ROS template interface

Fig. 7 Creating a repository from the ROS template.#

Ensure that duckietown/template-ros is selected. Assign a repository name (for example, my-ros-project) and provide a description. Then select Create repository.

Note

Replace my-ros-project with the preferred repository name. If a different name is chosen, follow that name in subsequent instructions.

This will create a new repository starting from the content of the template template-ros. Clone the newly created repository:

git clone https://github.com/YOUR_NAME/my-ros-project
cd my-ros-project

Note

Replace YOUR_NAME in the link above with your GitHub username.

Edit placeholders#

As seen in Edit placeholders, the placeholders left by the template need to be edited. Open Dockerfile in a text editor and update the following arguments:

ARG REPO_NAME="<REPO_NAME_HERE>"
ARG DESCRIPTION="<DESCRIPTION_HERE>"
ARG MAINTAINER="<YOUR_FULL_NAME> (<YOUR_EMAIL_ADDRESS>)"

Replace each placeholder as follows:

  • REPO_NAME: the repository name (e.g., my-ros-project)

  • DESCRIPTION: a concise summary of the project’s functionality

  • MAINTAINER: full name and email address of the maintainer

Save the changes to proceed with compiling this project into a Docker image.

Build the project#

As shown in Build the project, navigate to the project root and run:

dts devel build -f

Again, building a project produces a Docker image. This image is the compiled version of the source project. Upon success, the final image name is displayed, for example:

Final image name: duckietown/my-ros-project:v2-amd64

Run the project#

As shown in Run the DTproject, run the project with:

dts devel run

This will show the following message:

...
==> Launching app...
This is an empty launch script. Update it to launch your application.
<== App terminated!

Congratulations 🎉

You just built and ran your first ROS-based Duckietown-compliant Docker image.