Skip to content

Commit 03e6b79

Browse files
authored
Review REP 144 (ros-infrastructure#96)
* mark REP 144 active * fix spelling * Add statement to avoid double underscore in package name Addresses [this comment](ros-infrastructure#96 (comment)) * Clarify the structure of the mandatory rules Separate the definition. Bold the rules to differentiate them from the explaination. Update some rationales * Add justification for lowercase Update post history date * add lowercase callout in rule and update post date
1 parent 8e053b3 commit 03e6b79

File tree

1 file changed

+31
-16
lines changed

1 file changed

+31
-16
lines changed

rep-0144.rst

+31-16
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
REP: 144
22
Title: ROS Package Naming
33
Author: Vincent Rabaud <[email protected]>
4-
Status: Draft
4+
Status: Active
55
Type: Informational
66
Content-Type: text/x-rst
77
Created: 28-Jan-2015
8-
Post-History:
8+
Post-History: 21-Dec-2018
99

1010
Abstract
1111
========
@@ -22,7 +22,7 @@ Over time, the lack of naming conventions created problems like use of
2222
unexplained acronyms or packages with the same functionality but different names.
2323

2424
For now, ROS package names translate directly to packages in supported Operating
25-
Systems: therefore, there is a flat global namerspace in which rules have to
25+
Systems: therefore, there is a flat global namespace in which rules have to
2626
be followed.
2727

2828
This REP proposes rules to name a ROS package properly.
@@ -31,42 +31,57 @@ Some of those rules are mandatory, others merely advised.
3131
Package Naming
3232
==============
3333

34-
Mandatory Rules
35-
---------------
36-
3734
By habit, a package name is often used as a namespace (in C++ or any other language).
3835
Thus, the naming rules have to be strict.
3936

37+
Definitions
38+
-----------
39+
4040
* ``alphanumerics`` are ``a-z0-9`` only
4141
* ``alphabetics`` are ``a-z`` only
42-
* it must only consist of alphanumerics and ``_`` separators.
43-
Other symbols might not be supported by some OSes (e.g. unicode characters) or would
44-
make it hard to follow OSes conventions/
45-
* they must be at least two characters long and must start with an alphabetic character.
42+
43+
For clarity these are both specifically exclusively lowercase.
44+
45+
46+
Mandatory Rules
47+
---------------
48+
49+
**A name must:**
50+
51+
* **only consist of lowercase alphanumerics and _ separators and start with an alphabetic character.**
52+
This allows it to be used in generated symbols and functions in all supported languages.
53+
Lowercase is required because the names are used in directories and filenames and some
54+
platforms do not have case sensitive filesystems.
55+
* **not use multiple _ separators consecutively.**
56+
This allows generated symbols to use the ``__`` separator to guarenteed the avoidance
57+
of collisions with symbols from other packages, for example in the message generators.
58+
* **be at least two characters long.**
4659
This rule is simply to force the name of the package to be more human understandable.
60+
It's recommended to be noteably longer, see below.
4761

4862
Global Rules
4963
------------
5064

51-
* package names should be specific enough to identify what the package does.
65+
* **Package names should be specific enough to identify what the package does.**
5266
For example, a motion planner should not be called ``planner``.
5367
If it implements the wavefront propagation algorithm, it might be called
5468
``wavefront_planner``.
5569
There's obviously tension between making a name specific and keeping it from becoming
5670
overly verbose
57-
* using catchall names such as ``utils`` should be avoided as they do not scope what goes
71+
* **Using catchall names such as** ``utils`` **should be avoided.** They do not scope what goes
5872
into the package or what should be outside the package
59-
* a package name should not contain ``ros`` as it is redundant.
73+
* **A package name should not contain** ``ros`` **as it is redundant.**
6074
Exceptions include core packages and ROS bindings of an upstream library
6175
(e.g. ``moveit_ros``)
62-
* one of ROS's goals is to develop a canonical set of tools for making robots do
76+
* **The package name should describe what the package does, not where it came from.**
77+
One of ROS's goals is to develop a canonical set of tools for making robots do
6378
interesting things.
64-
The package name should describe what the package does, not where it came from.
6579
Then again, as stated in the rules below, ``if a package is specialized
6680
by an entity (lab, company, ...), prepend the name of the entity``.
6781
But once the package is commonly used, owned and maintained, that name can be dropped
6882
as the package becomes the reference
69-
* to check whether a name is taken, consult [2]_. If you'd like your
83+
* **Do not use a name that's already been taken.**
84+
To check whether a name is taken, consult [2]_. If you'd like your
7085
repository included in that list, see the tutorial at [3]_
7186

7287
Naming Rules

0 commit comments

Comments
 (0)