New ROS DTProject#

What you will need

What you will get

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

Create project from a template#

Visit the template repository page duckietown/template-ros. Click on the button that reads “Use this template” and then choose “Create a new repository” from the dropdown menu.


Fig. 6 Use template repository on GitHub.#

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


Fig. 7 Creating a repository from template.#

Make sure the selected template is duckietown/template-ros, pick a name for our repository (e.g., my-ros-project), and add a description for the new repository.

Click on the button Create repository.


You can replace my-ros-project with the name of the repository that you prefer. If you do change it, make sure you use the right name in the instructions going forward.

This will create a new repository starting from the content of the template template-ros. You can now open a terminal and clone your newly created repository.

git clone
cd my-ros-project


Replace YOUR_NAME in the link above with your GitHub username.

Edit placeholders#

As we learned in Edit placeholders, we now need to edit the placeholders left by the template. Head over to the Dockerfile and edit the following lines using any text editor:


Replace the placeholders strings with, respectively,

  • the name of the repository (i.e., my-ros-project);

  • a brief description of the functionalities implemented in this project;

  • your name and email address to claim the role of maintainer;

Save the changes. We can now compile this project into a Docker image.

Build the project#

Exactly as in Build the project, we can now move to the project root and run the following command to build our project (beware that it might take some time):

dts devel build -f

Again, building a project produces a Docker image. This image is the compiled version of your source project. You can find the name of the resulting image at the end of the output of the dts devel build command. In this case, look for the line:

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

Run the project#

Again, as in Run the project, we can run our project by executing the command,

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 run your first ROS-based Duckietown-compliant Docker image.