diff --git a/controller_manager/doc/userdoc.rst b/controller_manager/doc/userdoc.rst index 97d6b6e01d..de42850b6b 100644 --- a/controller_manager/doc/userdoc.rst +++ b/controller_manager/doc/userdoc.rst @@ -1,4 +1,4 @@ -:github_url: https://github.com/ros-controls/ros2_control/blob/|github_branch|/controller_manager/doc/userdoc.rst +:github_url: https://github.com/ros-controls/ros2_control/blob/{REPOS_FILE_BRANCH}/controller_manager/doc/userdoc.rst .. _controller_manager_userdoc: diff --git a/doc/index.rst b/doc/index.rst index b5e9c78fbe..196ea93285 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -1,4 +1,4 @@ -:github_url: https://github.com/ros-controls/ros2_control/blob/|github_branch|/doc/index.rst +:github_url: https://github.com/ros-controls/ros2_control/blob/{REPOS_FILE_BRANCH}/doc/index.rst .. _ros2_control_framework: diff --git a/hardware_interface/doc/hardware_components_userdoc.rst b/hardware_interface/doc/hardware_components_userdoc.rst index c6edc7b04d..cd93f472a5 100644 --- a/hardware_interface/doc/hardware_components_userdoc.rst +++ b/hardware_interface/doc/hardware_components_userdoc.rst @@ -1,4 +1,4 @@ -:github_url: https://github.com/ros-controls/ros2_control/blob/|github_branch|/hardware_interface/doc/hardware_components_userdoc.rst +:github_url: https://github.com/ros-controls/ros2_control/blob/{REPOS_FILE_BRANCH}/hardware_interface/doc/hardware_components_userdoc.rst .. _hardware_components_userdoc: diff --git a/hardware_interface/doc/mock_components_userdoc.rst b/hardware_interface/doc/mock_components_userdoc.rst index 3fbc1c4a14..7fd50fc9c8 100644 --- a/hardware_interface/doc/mock_components_userdoc.rst +++ b/hardware_interface/doc/mock_components_userdoc.rst @@ -1,4 +1,4 @@ -:github_url: https://github.com/ros-controls/ros2_control/blob/|github_branch|/hardware_interface/doc/mock_components_userdoc.rst +:github_url: https://github.com/ros-controls/ros2_control/blob/{REPOS_FILE_BRANCH}/hardware_interface/doc/mock_components_userdoc.rst .. _mock_components_userdoc: diff --git a/hardware_interface/doc/writing_new_hardware_interface.rst b/hardware_interface/doc/writing_new_hardware_interface.rst index a5ece92560..1ff4dc4420 100644 --- a/hardware_interface/doc/writing_new_hardware_interface.rst +++ b/hardware_interface/doc/writing_new_hardware_interface.rst @@ -1,4 +1,4 @@ -:github_url: https://github.com/ros-controls/ros2_control/blob/|github_branch|/hardware_interface/doc/writing_new_hardware_interface.rst +:github_url: https://github.com/ros-controls/ros2_control/blob/{REPOS_FILE_BRANCH}/hardware_interface/doc/writing_new_hardware_interface.rst .. _writing_new_hardware_interface: @@ -30,7 +30,7 @@ The following is a step-by-step guide to create source files, basic tests, and c 1. Take care that you use header guards. ROS2-style is using ``#ifndef`` and ``#define`` preprocessor directives. (For more information on this, a search engine is your friend :) ). 2. Include ``"hardware_interface/$interface_type$_interface.hpp"`` and ``visibility_control.h`` if you are using one. - ``$interface_type$`` can be ``Actuator``, ``Sensor`` or ``System`` depending on the type of hardware you are using. for more details about each type check `Hardware Components description `_. + ``$interface_type$`` can be ``Actuator``, ``Sensor`` or ``System`` depending on the type of hardware you are using. for more details about each type check :ref:`Hardware Components description `. 3. Define a unique namespace for your hardware_interface. This is usually the package name written in ``snake_case``. @@ -39,7 +39,7 @@ The following is a step-by-step guide to create source files, basic tests, and c class HardwareInterfaceName : public hardware_interface::$InterfaceType$Interface 5. Add a constructor without parameters and the following public methods implementing ``LifecycleNodeInterface``: ``on_configure``, ``on_cleanup``, ``on_shutdown``, ``on_activate``, ``on_deactivate``, ``on_error``; and overriding ``$InterfaceType$Interface`` definition: ``on_init``, ``export_state_interfaces``, ``export_command_interfaces``, ``prepare_command_mode_switch`` (optional), ``perform_command_mode_switch`` (optional), ``read``, ``write``. - For further explanation of hardware-lifecycle check the `pull request `_ and for exact definitions of methods check the ``"hardware_interface/$interface_type$_interface.hpp"`` header or `doxygen documentation `_ for *Actuator*, *Sensor* or *System*. + For further explanation of hardware-lifecycle check the `pull request `_ and for exact definitions of methods check the ``"hardware_interface/$interface_type$_interface.hpp"`` header or `doxygen documentation `_ for *Actuator*, *Sensor* or *System*. 4. **Adding definitions into source file (.cpp)** @@ -79,7 +79,7 @@ The following is a step-by-step guide to create source files, basic tests, and c 5. **Writing export definition for pluginlib** 1. Create the ``.xml`` file in the package and add a definition of the library and hardware interface's class which has to be visible for the pluginlib. - The easiest way to do that is to check definition for mock components in the `hardware_interface mock_components `_ section. + The easiest way to do that is to check definition for mock components in the :ref:`hardware_interface mock_components ` section. 2. Usually, the plugin name is defined by the package (namespace) and the class name, e.g., ``/``. @@ -90,7 +90,7 @@ The following is a step-by-step guide to create source files, basic tests, and c 1. Create the folder ``test`` in your package, if it does not exist already, and add a file named ``test_load_.cpp``. - 2. You can copy the ``load_generic_system_2dof`` content defined in the `test_generic_system.cpp `_ package. + 2. You can copy the ``load_generic_system_2dof`` content defined in the `test_generic_system.cpp `_ package. 3. Change the name of the copied test and in the last line, where hardware interface type is specified put the name defined in ``.xml`` file, e.g., ``/``. @@ -115,7 +115,7 @@ The following is a step-by-step guide to create source files, basic tests, and c 7. In the test section add the following dependencies: ``ament_cmake_gmock``, ``hardware_interface``. 8. Add compile definitions for the tests using the ``ament_add_gmock`` directive. - For details, see how it is done for mock hardware in the `ros2_control `_ package. + For details, see how it is done for mock hardware in the `ros2_control `_ package. 9. (optional) Add your hardware interface`s library into ``ament_export_libraries`` before ``ament_package()``. @@ -139,4 +139,6 @@ That's it! Enjoy writing great controllers! Useful External References --------------------------- -- `Templates and scripts for generating controllers shell `_ **NOTE**: The script is currently only recommended to use for Foxy, not compatible with the API from Galactic and onwards. +- `Templates and scripts for generating controllers shell `_ + + .. NOTE:: The script is currently only recommended to use for Foxy, not compatible with the API from Galactic and onwards. diff --git a/ros2controlcli/doc/userdoc.rst b/ros2controlcli/doc/userdoc.rst index c608c3a3de..dba173cfbf 100644 --- a/ros2controlcli/doc/userdoc.rst +++ b/ros2controlcli/doc/userdoc.rst @@ -1,4 +1,4 @@ -:github_url: https://github.com/ros-controls/ros2_control/blob/|github_branch|/ros2controlcli/doc/userdoc.rst +:github_url: https://github.com/ros-controls/ros2_control/blob/{REPOS_FILE_BRANCH}/ros2controlcli/doc/userdoc.rst .. _ros2controlcli_userdoc: