Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions source/Tutorials/Intermediate/Creating-an-Action.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,32 @@ Tasks

$ mkdir -p ~/ros2_ws/src # you can reuse an existing workspace with this naming convention
$ cd ~/ros2_ws/src
$ ros2 pkg create --license Apache-2.0 custom_action_interfaces
$ ros2 pkg create --build-type ament_cmake --license Apache-2.0 custom_action_interfaces

.. group-tab:: macOS

.. code-block:: console

$ mkdir -p ~/ros2_ws/src
$ cd ~/ros2_ws/src
$ ros2 pkg create --license Apache-2.0 custom_action_interfaces
$ ros2 pkg create --build-type ament_cmake --license Apache-2.0 custom_action_interfaces

.. group-tab:: Windows

.. code-block:: console

$ md \ros2_ws\src
$ cd \ros2_ws\src
$ ros2 pkg create --license Apache-2.0 custom_action_interfaces
$ ros2 pkg create --build-type ament_cmake --license Apache-2.0 custom_action_interfaces

``custom_action_interfaces`` is the name of the new package.
Note that it is, and can only be, a CMake package, but this doesn't restrict in which type of packages you can use your actions.
You can create your own custom interfaces in a CMake package, and then use it in a C++ or Python node.

.. note::

It is good practice to keep ``.msg``, ``.srv``, and ``.action`` files in separate packages from the nodes that use them.
This makes it easier to reuse the interface definitions across different packages.


2 Defining an action
Expand Down