1
1
REP: 144
2
2
Title: ROS Package Naming
3
3
Author: Vincent Rabaud <
[email protected] >
4
- Status: Draft
4
+ Status: Active
5
5
Type: Informational
6
6
Content-Type: text/x-rst
7
7
Created: 28-Jan-2015
8
- Post-History:
8
+ Post-History: 21-Dec-2018
9
9
10
10
Abstract
11
11
========
@@ -22,7 +22,7 @@ Over time, the lack of naming conventions created problems like use of
22
22
unexplained acronyms or packages with the same functionality but different names.
23
23
24
24
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
26
26
be followed.
27
27
28
28
This REP proposes rules to name a ROS package properly.
@@ -31,42 +31,57 @@ Some of those rules are mandatory, others merely advised.
31
31
Package Naming
32
32
==============
33
33
34
- Mandatory Rules
35
- ---------------
36
-
37
34
By habit, a package name is often used as a namespace (in C++ or any other language).
38
35
Thus, the naming rules have to be strict.
39
36
37
+ Definitions
38
+ -----------
39
+
40
40
* ``alphanumerics `` are ``a-z0-9 `` only
41
41
* ``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. **
46
59
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.
47
61
48
62
Global Rules
49
63
------------
50
64
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.**
52
66
For example, a motion planner should not be called ``planner ``.
53
67
If it implements the wavefront propagation algorithm, it might be called
54
68
``wavefront_planner ``.
55
69
There's obviously tension between making a name specific and keeping it from becoming
56
70
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
58
72
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. **
60
74
Exceptions include core packages and ROS bindings of an upstream library
61
75
(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
63
78
interesting things.
64
- The package name should describe what the package does, not where it came from.
65
79
Then again, as stated in the rules below, ``if a package is specialized
66
80
by an entity (lab, company, ...), prepend the name of the entity ``.
67
81
But once the package is commonly used, owned and maintained, that name can be dropped
68
82
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
70
85
repository included in that list, see the tutorial at [3 ]_
71
86
72
87
Naming Rules
0 commit comments