Skip to content

Commit

Permalink
Enhance and fix doc: how to use pre-commit to contribute, how to cont…
Browse files Browse the repository at this point in the history
…ribute to doc, check secureboot, fix rpdo tpdo typo (#102)

* Add documentation to install and use pre-commit
hooks.

* Describe where to modify files to contribute to
the documentation

* Correct use of rpdo and tpdo :
rpdo is MOSI: master (out) to slave (in)
whereas
tpdo is MISO: slave (out) to master (in).

* Explain that secure boot should be disabled to run the etherlab kernel module.
Show how to check if secure boot is enabled or not and
explain how to disable it.


---------

Co-authored-by: Manuel YGUEL <[email protected]>
  • Loading branch information
yguel and yguel committed Jan 10, 2024
1 parent 3cfebbe commit 9657cf3
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 8 deletions.
25 changes: 20 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,38 @@ Please try to include as much information as you can. Details like these are inc
* Any modifications you've made relevant to the bug
* Anything unusual about your environment or deployment

## Installation of pre-commit checks and hooks
To accelerate the rate of development and to ensure that the code is formatted correctly, we use pre-commit checks and hooks. To install these, please follow the instructions below:
1. Install packages used to check the code:
```bash
$ sudo apt-get -y install clang-format-10 python3-autopep8 ament-cmake-uncrustify python3-ament-cpplint python3-ament-lint-cmake python3-ament-copyright
$ pip install doc8
```
2. Install pre-commit: `pip install pre-commit`
3. Configure hook such that it runs on every commit: `pre-commit install`

You can run pre-commit manually on the repository to check if the code is formatted correctly.
To do so, run `pre-commit run --all-files` in the root of the repository.

## Contributing via Pull Requests
Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:

1. You are working against the latest source on the *main* branch.
2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.
3. You open an issue to discuss any significant work - we would hate for your time to be wasted.
3. You have used pre-commit checks to correct any formatting issues.
4. You open an issue to discuss any significant work - we would hate for your time to be wasted.

**NOTE:** For contributing to the documentation, contribute to the sphinx pages placed in the ethercat_driver_ros2/sphinx folder.

To send us a pull request, please:

1. Fork the repository.
2. Modify the source; please focus on the specific change you are contributing.
If you also reformat all the code, it will be hard for us to focus on your change.
3. Ensure local tests pass.
4. Commit to your fork using clear commit messages.
5. Send a pull request, answering any default questions in the pull request interface.
6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
1. Ensure local tests pass.
2. Commit to your fork using clear commit messages.
3. Send a pull request, answering any default questions in the pull request interface.
4. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.

GitHub provides additional documentation on [forking a repository](https://help.github.com/articles/fork-a-repo/) and [creating a pull request](https://help.github.com/articles/creating-a-pull-request/).

Expand Down
28 changes: 28 additions & 0 deletions ethercat_driver_ros2/sphinx/quickstart/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,34 @@ Installing EtherLab
The proposed development builds upon the `IgH EtherCAT Master <https://etherlab.org/en/ethercat/>`_.
Installation steps are summarized here:

* Verify that you can run unsigned kernel modules

Etherlab is a kernel module that is not signed by default.
To allow the kernel to load unsigned modules, you need to disable secure boot.

Verify if secure boot is enabled (you need to install ''mokutil'' first):
.. code-block:: console
$ sudo apt-get install mokutil
$ mokutil --sb-state
it should print:
.. code-block:: console
SecureBoot disabled
if it prints:
.. code-block:: console
SecureBoot enabled
Then you need to disable secure boot.
To do so:

1. reboot your computer and enter the BIOS settings.
2. In the security tab, disable secure boot.
3. Save and exit.

* Install required tools:

.. code-block:: console
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ Each PDO Channel has the following configuration flags:
* - :code:`type`
- Channel data type. Possible types: :code:`bool`, :code:`uint8`, :code:`int8`, :code:`uint16`, :code:`int16`, :code:`uint32`, :code:`uint32`, :code:`uint64`, :code:`uint64`, :code:`bitN` with N the number of bits required.
* - :code:`command_interface`
- **Only for** :code:`tpdo`. Name of the command interface to be used inside :code:`ros2_control`.
- **Only for** :code:`rpdo`. Name of the command interface to be used inside :code:`ros2_control`.
* - :code:`state_interface`
- **Only for** :code:`rpdo`. Name of the state interface to be used inside :code:`ros2_control`.
- **Only for** :code:`tpdo`. Name of the state interface to be used inside :code:`ros2_control`.
* - :code:`default`
- **Only for** :code:`tpdo`. Default value to be send to the drive if data received on the command interface is :code:`NaN`.
- **Only for** :code:`rpdo`. Default value to be send to the drive if data received on the command interface is :code:`NaN`.
* - :code:`mask`
- Data mask, to be used with :code:`type` = :code:`bool`.
* - :code:`factor`
Expand Down

0 comments on commit 9657cf3

Please sign in to comment.