Skip to content

Commit e6863e3

Browse files
authored
import package naming conventions (#4851)
Signed-off-by: Tully Foote <[email protected]>
1 parent 81ba7a1 commit e6863e3

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

source/The-ROS2-Project/Contributing/Developer-Guide.rst

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ The categories are differentiated by their policies on versioning, testing, docu
3636
The following sections are the specific development rules we follow to ensure core packages are of the highest quality ('Level 1').
3737
We recommend all ROS developers strive to adhere to the following policies to ensure quality across the ROS ecosystem.
3838

39+
For more specific code recommendations please see :doc:`the Quality Guide <Quality-Guide>`.
40+
3941
.. _semver:
4042

4143
Versioning
@@ -418,6 +420,44 @@ Depending on the complexity, it might be useful to describe how you plan to addr
418420
We will update the status (if you don't have the permission) and you can start working on a pull request.
419421
If you contribute regularly we will likely just grant you permission to manage the labels etc. yourself.
420422

423+
Package Naming Conventions
424+
^^^^^^^^^^^^^^^^^^^^^^^^^^
425+
426+
Names play an important role in ROS and following naming conventions simplifies the process of learning and understanding large systems.
427+
428+
The ROS packages occupy a flat namespace, so naming should be done carefully and consistently. There is a standard for package naming in `REP-144 <https://www.ros.org/reps/rep-0144.html>`__
429+
430+
* Package names should follow common C variable naming conventions: lower case, start with a letter, use underscore separators, e.g. laser_viewer
431+
432+
* Package names should be specific enough to identify what the package does.
433+
For example, a motion planner is not called planner.
434+
If it implements the wavefront propagation algorithm, it might be called wavefront_planner.
435+
There's obviously tension between making a name specific and keeping it from becoming overly verbose.
436+
437+
* Using catchall names such as utils should be avoided as they do not scope what goes into the package or what should be outside the package.
438+
439+
* To check whether a name is taken, consult `<https://index.ros.org/packages/>`__.
440+
If you'd like your repository included in that list, see the `rosdistro Contributing Guide <https://github.com/ros/rosdistro/blob/master/CONTRIBUTING.md>`__.
441+
442+
* Our goal is to develop a canonical set of tools for making robots do interesting things.
443+
The package name should tell you what the package does, not where it came from.
444+
It should be possible for us, as a community, to make this work.
445+
An Ubuntu distribution offers approximately 33,000 packages without inserting origin or authorship into names.
446+
447+
* Prefixing a package name is recommended only when the package is not meant to be used more widely (e.g., packages that are specific to the PR2 robot use the ``pr2_`` prefix).
448+
You might prefix the package name when forking an existing package, but again, the prefix would hopefully communicate what changed, not who changed it.
449+
450+
* Prefixing a package name with 'ros' is redundant for a ROS package.
451+
This is not recommended except for very core packages.
452+
453+
Units of Measure and Coordinate System Conventions
454+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
455+
456+
Standard units and coordinate conventions for use in ROS have been formalized in `REP-103 <https://www.ros.org/reps/rep-0103.html>`__.
457+
All messages should follow these guidelines unless there's a very strong reason which is very clearly documented to avoid confusion.
458+
459+
Representation of special conditions within distance measurements like "too close" or "too far" in ROS have been formalized in `REP-0117 <https://www.ros.org/reps/rep-0117.html>`__.
460+
421461
Programming conventions
422462
^^^^^^^^^^^^^^^^^^^^^^^
423463

0 commit comments

Comments
 (0)