Skip to content

Commit

Permalink
Add doc about standard aliases in RTW. (StoglRobotics#113)
Browse files Browse the repository at this point in the history
Co-authored-by: muritane <[email protected]>
  • Loading branch information
destogl and muritane authored Mar 21, 2023
1 parent 44de18e commit 71a330e
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/use-cases/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ Check the repository and PRs for other, undocumented use-cases.
operating_system/*
ros_packages/*
ros2_control/*
ros_workspaces/*
100 changes: 100 additions & 0 deletions docs/use-cases/ros_workspaces/aliases.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
=====================
RTW Aliases
=====================
.. _uc-aliases:

Standard RTW Aliases
=====================

Standard RTW aliases are configured out-of-the-box and they enable you to use the same command independently of the workspace you are in and help you hide ``colcon`` complexities and minimize errors when interacting with it.
The aliases set for each workspace (see :ref:`ṁanaging multiple workspaces <tutorial-managing-multiple-workspaces>`) setup environment variables so that following aliases can interact with that specific workspace.


Explanation of Standard Aliases
--------------------------------
The standard aliases are callable from any folder as long as a workspace is sourced using ``_<workspace_name>`` alias.

.. note:: To make this reading short, Dr. Denis's favorite aliases are ``cb``, ``ca`` and ``crm`` - simply start with using those.


Entering Workspace Folders
^^^^^^^^^^^^^^^^^^^^^^^^^^^
rosd
Enter the root directory of the ROS workspace.
Alias for command: ``cd $ROS_WS``

rosds
Enter ``src`` directory of the ROS workspace.
Alias for command: ``cd $ROS_WS/src``

rosdb
Enter ``build`` directory of the ROS workspace.
Alias for command: ``cd $ROS_WS/build``

rosdi
Enter ``install`` directory of the ROS workspace.
Alias for command: ``cd $ROS_WS/install``


Building Packages in Workspace
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Every alias has optional package names. If none is provided the whole workspace is built.

cb [package1_name, package2_name]
Building named packages or the whole workspace.
Alias for command: ``colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo``.

cbup [package1_name, package2_name]
Building all packages up the named package (build all dependencies).
Alias for command: ``colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo --packages-up-to``.

cbd [package1_name, package2_name]
Building named packages or the whole workspace as *Debug* build type.
Alias for command: ``colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Debug``.

cbr [package1_name, package2_name]
Building named packages or the whole workspace as *Release* build type.
Alias for command: ``colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release``.


Executing Package Tests
^^^^^^^^^^^^^^^^^^^^^^^^
Every alias has optional package names. If none is provided the whole workspace is built.

ct [package1_name, package2_name]
Testing named packages or the whole workspace.
Alias for command: ``colcon test``.

ctup [package_name]
Testing named packages up to the workspace (build all dependencies).
Alias for command: ``colcon test --packages-up-to``.

ctres [package_name]
Get test results for the whole workspace or a package. If using package the output will be ``grep``-processed to filter-out the package you are looking for.
Alias for command: ``colcon test-result --all``


Executing Multiple Commands
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Every alias has optional package names. If none is provided the whole workspace is built.

ca [package1_name, package2_name]
Build, test and show test results for the named packages or the whole workspace.

caup [package_name]
Build, test and show test results for the package and all its dependencies.


Cleaning Workspace
^^^^^^^^^^^^^^^^^^^

crm [package1_name, package2_name]
Remove ``build``, ``log`` and ``install`` folders for the workspace or corresponding sub-folders for specific packages.


Defining Your Own Aliases
===========================

**TBD**

Idea: sharing aliases with your team that are very specific for your use-cases.

0 comments on commit 71a330e

Please sign in to comment.