Skip to content

Commit

Permalink
move the exlpanation to How To Guide section.
Browse files Browse the repository at this point in the history
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
  • Loading branch information
fujitatomoya committed Feb 18, 2022
1 parent 18949c6 commit 1f8ca65
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 47 deletions.
1 change: 1 addition & 0 deletions source/How-To-Guides.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ If you are new and looking to learn the ropes, start with the :doc:`Tutorials <T
How-To-Guides/Topics-Services-Actions
How-To-Guides/Using-Variants
How-To-Guides/Using-ros2-param
How-To-Guides/ZeroCopy-loaned-messages

.. toctree::
:hidden:
Expand Down
55 changes: 55 additions & 0 deletions source/How-To-Guides/ZeroCopy-loaned-messages.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
.. _ZeroCopyLoanedMessages:

Zero Copy Loaned Messages
=========================

.. contents:: Contents
:depth: 1
:local:

See the `Loaned Messages <https://design.ros2.org/articles/zero_copy.html>`__ article for details on ``ROS_DISABLE_LOANED_MESSAGES`` environment variable.

How to disable Loaned Messages
------------------------------

In default, *Loaned Messages* will try to borrow the memory from underlying middleware if it supports *Loaned Messages*.
``ROS_DISABLE_LOANED_MESSAGES`` environment variable is provided to user that allows to disable *Loaned Messages* and fallback to normal publisher / subscription w/o any code change or middleware configuration.
You can set the environment variable with the following command:

.. tabs::

.. group-tab:: Linux

.. code-block:: console
export ROS_DISABLE_LOANED_MESSAGES=1
To maintain this setting between shell sessions, you can add the command to your shell startup script:

.. code-block:: console
echo "export ROS_DISABLE_LOANED_MESSAGES=1" >> ~/.bashrc
.. group-tab:: macOS

.. code-block:: console
export ROS_DISABLE_LOANED_MESSAGES=1
To maintain this setting between shell sessions, you can add the command to your shell startup script:

.. code-block:: console
echo "export ROS_DISABLE_LOANED_MESSAGES=1" >> ~/.bash_profile
.. group-tab:: Windows

.. code-block:: console
set ROS_DISABLE_LOANED_MESSAGES=1
If you want to make this permanent between shell sessions, also run:

.. code-block:: console
setx ROS_DISABLE_LOANED_MESSAGES 1
47 changes: 0 additions & 47 deletions source/Tutorials/Configuring-ROS2-Environment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -196,53 +196,6 @@ Once you have determined a unique integer for your group of ROS 2 agents, you ca
setx ROS_DOMAIN_ID <your_domain_id>
3.2 The ``ROS_DISABLE_LOANED_MESSAGES`` variable
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

See the `Loaned Messages <https://design.ros2.org/articles/zero_copy.html>`__ article for details on ``ROS_DISABLE_LOANED_MESSAGES`` environment variable.

In default, *Loaned Messages* will try to borrow the memory from underlying middleware if it supports *Loaned Messages*.
``ROS_DISABLE_LOANED_MESSAGES`` environment variable is provided to user that allows to disable *Loaned Messages* and fallback to normal publisher / subscription w/o any code change or middleware configuration.
You can set the environment variable with the following command:

.. tabs::

.. group-tab:: Linux

.. code-block:: console
export ROS_DISABLE_LOANED_MESSAGES=1
To maintain this setting between shell sessions, you can add the command to your shell startup script:

.. code-block:: console
echo "export ROS_DISABLE_LOANED_MESSAGES=1" >> ~/.bashrc
.. group-tab:: macOS

.. code-block:: console
export ROS_DISABLE_LOANED_MESSAGES=1
To maintain this setting between shell sessions, you can add the command to your shell startup script:

.. code-block:: console
echo "export ROS_DISABLE_LOANED_MESSAGES=1" >> ~/.bash_profile
.. group-tab:: Windows

.. code-block:: console
set ROS_DISABLE_LOANED_MESSAGES=1
If you want to make this permanent between shell sessions, also run:

.. code-block:: console
setx ROS_DISABLE_LOANED_MESSAGES 1
Summary
-------
Expand Down

0 comments on commit 1f8ca65

Please sign in to comment.