diff --git a/controller_manager/doc/userdoc.rst b/controller_manager/doc/userdoc.rst index 66b19054f3..f8ee2a6ec5 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 5821b795f3..196ea93285 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -1,3 +1,5 @@ +: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 e6a9bf5029..cd93f472a5 100644 --- a/hardware_interface/doc/hardware_components_userdoc.rst +++ b/hardware_interface/doc/hardware_components_userdoc.rst @@ -1,3 +1,5 @@ +:github_url: https://github.com/ros-controls/ros2_control/blob/{REPOS_FILE_BRANCH}/hardware_interface/doc/hardware_components_userdoc.rst + .. _hardware_components_userdoc: Hardware Components diff --git a/hardware_interface/doc/mock_components_userdoc.rst b/hardware_interface/doc/mock_components_userdoc.rst index a285408b5f..25cfc72a27 100644 --- a/hardware_interface/doc/mock_components_userdoc.rst +++ b/hardware_interface/doc/mock_components_userdoc.rst @@ -1,3 +1,5 @@ +:github_url: https://github.com/ros-controls/ros2_control/blob/{REPOS_FILE_BRANCH}/hardware_interface/doc/mock_components_userdoc.rst + .. _mock_components_userdoc: Mock Components diff --git a/hardware_interface/doc/writing_new_hardware_interface.rst b/hardware_interface/doc/writing_new_hardware_interface.rst index fb748359eb..1ff4dc4420 100644 --- a/hardware_interface/doc/writing_new_hardware_interface.rst +++ b/hardware_interface/doc/writing_new_hardware_interface.rst @@ -1,3 +1,5 @@ +: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: Writing a new hardware interface @@ -28,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``. @@ -37,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)** @@ -77,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., ``/``. @@ -88,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., ``/``. @@ -113,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()``. @@ -137,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 3d0fd35a2e..9b9feecf26 100644 --- a/ros2controlcli/doc/userdoc.rst +++ b/ros2controlcli/doc/userdoc.rst @@ -1,3 +1,5 @@ +:github_url: https://github.com/ros-controls/ros2_control/blob/{REPOS_FILE_BRANCH}/ros2controlcli/doc/userdoc.rst + .. _ros2controlcli_userdoc: Command Line Interface