Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime configuration of diagnostics related to the RX-DO-TX phases #971

Merged
merged 5 commits into from
Jul 8, 2024

Conversation

marcoaccame
Copy link
Contributor

@marcoaccame marcoaccame commented Jul 5, 2024

This PR introduces the xml parsing of configuration of the diagnostics associated to the execution loop and its transmission towards the ETH boards.

In particular, it will be possible to:

  • enable / disable the diagnostics about execution overflow of the RX, DO and TX phases. The default is enabled.
  • enable / disable the diagnostics about statistics of the RX, DO and TX phases. It will be reported minimum, average and maximum durations of the phases over a period configurable between 1 and 600 seconds. The default is disabled.

This latter feature is particularly useful when one wants to measure the effective duration of RX, DO and TX phases for a particular board over a period of time. As shown later It is possible to activate the section LOGGING.PERIODIC and set LOGGING.PERIODIC.emitRXDOTXstatistics = true to achieve such a statistics (min, average and max duration) over a period of time = LOGGING.PERIODIC.period seconds.

Format of xml file

The parsing will search for a group named LOGGING inside ETH_BOARD.ETH_BOARD_SETTINGS.RUNNINGMODE that has the following format:

<group name="LOGGING">

    <!-- Contains enabling / disabling of logging that must be emitted immediately as soon as the condition appears --> 
    <group name="IMMEDIATE">
        <!-- enable / disable the emission of diagnostics related to the measured execution time of RX higher than the configured
             maxTimeOfRXactivity and similarly for DO and tx
          -->
        <param name="emitRXDOTXoverflow">       true        </param>
    </group>
    
    <!-- Contains enabling / disabling of logging that must be emitted periodically -->
    <group name="PERIODIC">
        <!-- the period expressed in seconds in the interval [1.0, 600.0] -->
        <param name="period">                   10          </param>
        <!-- enable / disable the periodic emission of diagnostics about to the statistics of teh execution time of the RX, DO and TX phase
             in the form of minimul, average and maximum values.
          -->                        
        <param name="emitRXDOTXstatistics">     true        </param>
    </group>

</group>

Backwards compatibility

If the section ETH_BOARD.ETH_BOARD_SETTINGS.RUNNINGMODE.LOGGING is not present the following default values will be used that guarantee behavior as now:

  • LOGGING.IMMADIATE.emitRXDOTXoverflow = true;
  • LOGGING.PERIODIC.period = 0;
  • LOGGING.PERIODIC.emitRXDOTXstatistics = false;

Associated PRs

Tests

Performed on a dedicated setup.

Example of output with LOGGING.PERIODIC.period = 10.0 and LOGGING.PERIODIC.emitRXDOTXstatistics = true are:

[INFO] from BOARD 10.0.1.1 (left_arm-eb1-j0_3) time=4146s 479m 144u : SYS: execution time statistics (min, average, max) us in a period: runner.RX() -> (15, 16, 841) us over 10.000000 sec
[INFO] from BOARD 10.0.1.1 (left_arm-eb1-j0_3) time=4146s 479m 541u : SYS: execution time statistics (min, average, max) us in a period: runner.DO() -> (11, 12, 20) us over 10.000000 sec
[INFO] from BOARD 10.0.1.1 (left_arm-eb1-j0_3) time=4146s 479m 922u : SYS: execution time statistics (min, average, max) us in a period: runner.TX() -> (16, 24, 94) us over 10.000000 sec
[INFO] from BOARD 10.0.1.1 (left_arm-eb1-j0_3) time=4156s 479m 162u : SYS: execution time statistics (min, average, max) us in a period: runner.RX() -> (15, 16, 36) us over 10.000000 sec
[INFO] from BOARD 10.0.1.1 (left_arm-eb1-j0_3) time=4156s 479m 541u : SYS: execution time statistics (min, average, max) us in a period: runner.DO() -> (12, 12, 15) us over 10.000000 sec
[INFO] from BOARD 10.0.1.1 (left_arm-eb1-j0_3) time=4156s 479m 917u : SYS: execution time statistics (min, average, max) us in a period: runner.TX() -> (16, 24, 94) us over 10.000000 sec

Similar results with different values of the period such as LOGGING.PERIODIC.period = 60.0

[INFO] from BOARD 10.0.1.1 (left_arm-eb1-j0_3) time=4297s 3m 440u : SYS: execution time statistics (min, average, max) us in a period: runner.RX() -> (15, 16, 836) us over 60.000000 sec
[INFO] from BOARD 10.0.1.1 (left_arm-eb1-j0_3) time=4297s 3m 841u : SYS: execution time statistics (min, average, max) us in a period: runner.DO() -> (11, 11, 20) us over 60.000000 sec
[INFO] from BOARD 10.0.1.1 (left_arm-eb1-j0_3) time=4297s 4m 217u : SYS: execution time statistics (min, average, max) us in a period: runner.TX() -> (16, 23, 96) us over 60.000000 sec
[DEBUG] yarprobotinterface running happily
[ERROR] from BOARD 10.0.1.1 (left_arm-eb1-j0_3) time=4324s 840m 437u : HW: strain values saturation. 1 is the channel involved. In the last second, the lower saturation counts is 10000 and the upper one is 0
[INFO] from BOARD 10.0.1.1 (left_arm-eb1-j0_3) time=4357s 3m 440u : SYS: execution time statistics (min, average, max) us in a period: runner.RX() -> (15, 16, 145) us over 60.000000 sec
[INFO] from BOARD 10.0.1.1 (left_arm-eb1-j0_3) time=4357s 3m 839u : SYS: execution time statistics (min, average, max) us in a period: runner.DO() -> (11, 11, 15) us over 60.000000 sec
[INFO] from BOARD 10.0.1.1 (left_arm-eb1-j0_3) time=4357s 4m 217u : SYS: execution time statistics (min, average, max) us in a period: runner.TX() -> (16, 23, 96) us over 60.000000 sec

With no section on the xml file or with LOGGING.PERIODIC.emitRXDOTXstatistics = false the INFO messages are not sent.

Copy link
Member

@pattacini pattacini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI passed, merging.

@pattacini pattacini merged commit 1e1ce96 into robotology:devel Jul 8, 2024
4 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants