You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/about_template.md
+52-4Lines changed: 52 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,10 +37,14 @@ Here's a quick guide on the features of this template
37
37
38
38
### Things You Likely Want To Do
39
39
40
+
-**Create a new package**: It's recommended to just start by developing with the example package that comes with the
41
+
template after generation. Once you're familiar with development with the template and want to create a second package,
42
+
you can follow the steps under [Adding a New Package](#adding-a-new-package).
40
43
-**Add new dependencies:**
41
-
-**Python dependencies:** can be added under `pkgs/<package_name>/pyproject.toml`. Run `poetry lock` after.
42
-
-**ROS dependencies:** can be added under `pkgs/<package_name>/package.xml`.
43
44
-**System dependencies:** can be added under `docker/Dockerfile`, under the `install-packages` section.
45
+
-**Python dependencies:** can be added under `pkgs/<package_name>/pyproject.toml`. Run `poetry lock` after.
46
+
-**ROS dependencies:** can be added under `pkgs/<package_name>/package.xml`.
47
+
-**ROS Git dependencies:** If you need to add a ROS package that isn't available in the ROS package index, you can add it as a git dependency in the `docker/Dockerfile` under the `Add Git ROS2 Packages` section.
44
48
45
49
After any changes, the container will automatically re-build on the next launch.
46
50
-**Save persistent data:** The `/robot/persistent` directory is mounted to `.docker_volumes/ros-nodes/` on your local machine. Save data there to persist across container runs, and to view it in your file manager.
@@ -49,7 +53,34 @@ Here's a quick guide on the features of this template
49
53
- Add a directory under `docker/launch-profiles/`
50
54
- Add a `launching.py` file that launches your ROS nodes inside your new profile directory
51
55
- Fill out the `launching.py` file with the nodes you want to launch.
52
-
56
+
- The directory you created will be mounted under `/robot/launch-profile/` at launch. This is a great place to store configuration files, URDFs, and other specifics for your launch profile.
57
+
58
+
59
+
## Container Structure
60
+
61
+
### `/robot` Directory
62
+
63
+
The `/robot` directory is where your source code lives after building the container.
64
+
You can find your:
65
+
-`pkgs/` directory
66
+
-`build/`, `install/` from the colcon build
67
+
68
+
### `/robot/launch-profile/` Directory
69
+
A directory pointing towards the launch profile chosen in `docker/launch <launch profile>`
70
+
is mounted under `/robot/launch-profile/`.
71
+
72
+
### `/robot/persistent/` Directory
73
+
For saving persistent data, `/robot/persistent` is mounted to `.docker_volumes/ros-nodes/` on your local machine.
74
+
This is a great place to save any serialized data, databases, etc. For static configuration,
75
+
it's recommended to use the `launch-profile` directory.
76
+
77
+
### `/ros-git-deps/` Directory
78
+
79
+
In the `Dockerfile`, there's a section for adding ROS packages that aren't available in
80
+
the ROS package index. These are added as git dependencies. The `ros-git-deps/`
81
+
directory is where these packages are cloned to, and built.
82
+
83
+
53
84
## Project Structure
54
85
55
86
### `pkgs/`
@@ -144,4 +175,21 @@ The `/robot/persistent` directory is intended for you, the developer, to use. So
144
175
145
176
The `.gitattributes` file is used to configure common binary file formats that are used in
146
177
robots such that git uses Large File Storage (LFS) to store them. It also specified certain
147
-
line endings so that docker support works on windows.
178
+
line endings so that docker support works on windows.
179
+
180
+
# Adding a New Package
181
+
182
+
It's recommended to start by developing with the example package that comes with the
183
+
template after generation. Once you're familiar with development with the template and want to create a second package,
184
+
you can follow the steps below:
185
+
186
+
1. Create a new package directory under `pkgs/`
187
+
2. Add a `package.xml` file to the package directory, follow the standard ROS2 package.xml format
188
+
3. Create a pyproject.toml file. Follow the example in the `example_package` directory.
189
+
4. Create a `resource` directory in the package directory, with an empty file in it called `{your package name}`
190
+
5. Create a directory for your code in the package directory, and it's recommended to create a `{your_package_name}_test` directory as well.
191
+
6. Add a few things to the Dockerfile:
192
+
- Under the `Add package.xml's of each package` section, copy the `package.xml` file into the container
193
+
- Under the `Add pyproject.toml's of each package` section, copy the `pyproject.toml` file into the container
194
+
195
+
You should be good to go! Next time you run `docker/launch`, your new package will be built and available in the container.
0 commit comments