Skip to content

Commit

Permalink
improve docs generator by updating libparams from v0.9.0 to v0.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
PonomarevDA committed Sep 29, 2024
1 parent 910aa03 commit 6004e9c
Show file tree
Hide file tree
Showing 9 changed files with 142 additions and 95 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ set(ROOT_DIR ${CMAKE_CURRENT_LIST_DIR})
set(SRC_DIR ${ROOT_DIR}/Src)
set(CMAKE_DIR ${ROOT_DIR}/cmake)
set(LIBPARAMS_PATH ${ROOT_DIR}/Libs/libparams)
set(DOC_PATH ${ROOT_DIR}/docs/${CAN_PROTOCOL}/README.md)

# Option 1. Choose the platform
option(USE_PLATFORM_UBUNTU "Build for SITL (Software In The Loop)" OFF)
Expand Down
2 changes: 1 addition & 1 deletion Libs/libparams
10 changes: 0 additions & 10 deletions Src/applications/both/README.md

This file was deleted.

46 changes: 0 additions & 46 deletions Src/applications/cyphal/README.md

This file was deleted.

35 changes: 0 additions & 35 deletions Src/applications/dronecan/README.md

This file was deleted.

10 changes: 7 additions & 3 deletions cmake/params.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,29 @@

if(NOT LIBPARAMS_PATH)
message(SEND_ERROR "LIBPARAMS_PATH is unknown.")
elseif(NOT DOC_PATH)
message(SEND_ERROR "ROOT_DIR is unknown.")
elseif(NOT BUILD_SRC_DIR)
message(SEND_ERROR "BUILD_SRC_DIR is unknown.")
elseif(NOT LIBPARAMS_PARAMS)
message(SEND_ERROR "LIBPARAMS_PARAMS is unknown.")
elseif(NOT APPLICATION_DIR)
message(SEND_ERROR "APPLICATION_DIR is unknown.")

endif()

execute_process(
COMMAND python ${LIBPARAMS_PATH}/scripts/generate_params.py --out-dir ${BUILD_SRC_DIR} -f ${LIBPARAMS_PARAMS}
RESULT_VARIABLE result
)

if(NOT result EQUAL 0)
message(FATAL_ERROR "Failed to execute generate_params.py script. Return code: ${result}")
endif()

execute_process(
COMMAND ${LIBPARAMS_PATH}/scripts/generate_docs.py ${LIBPARAMS_PARAMS}
COMMAND python3 ${LIBPARAMS_PATH}/scripts/generate_docs.py --output ${DOC_PATH} ${LIBPARAMS_PARAMS}
WORKING_DIRECTORY ${APPLICATION_DIR}
RESULT_VARIABLE result
)
if(NOT result EQUAL 0)
message(FATAL_ERROR "Failed to execute generate_docs.py script. Return code: ${result}")
endif()
51 changes: 51 additions & 0 deletions docs/both/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
The node has the following interface:

Cyphal Publishers:
| Data type and topic name | Description |
| ------------------------- | ----------- |
| [uavcan.si.sample.voltage.Scalar](https://github.com/OpenCyphal/public_regulated_data_types/blob/master/uavcan/si/sample/voltage/Scalar.1.0.dsdl) </br> crct.5v | Voltage 5V (after DC-DC).</br>The normal values are within [4.5, 5.5] Volts.</br>|
| [uavcan.si.sample.voltage.Scalar](https://github.com/OpenCyphal/public_regulated_data_types/blob/master/uavcan/si/sample/voltage/Scalar.1.0.dsdl) </br> crct.vin | Voltage Vin (before DC-DC).</br>It make sense only when you power up the node from Molex 6-pin connector.</br>The normal values are within [5.5, 55] Volts.</br>|
| [uavcan.si.sample.temperature.Scalar](https://github.com/OpenCyphal/public_regulated_data_types/blob/master/uavcan/si/sample/temperature/Scalar.1.0.dsdl) </br> crct.temperature | STM32 internal temperature.</br>It it expected that the temperature is a little bit higher then your room environment.</br>|
| [reg.udral.service.actuator.common.Feedback](https://github.com/OpenCyphal/public_regulated_data_types/blob/master/reg/udral/service/actuator/common/Feedback.0.1.dsdl) </br> feedback | |

Cyphal Subscribers:
| Data type and topic name | Description |
| ------------------------- | ----------- |
| [reg.udral.service.actuator.common.sp.Vector31](https://github.com/OpenCyphal/public_regulated_data_types/blob/master/reg/udral/service/actuator/common/sp/Vector31.0.1.dsdl) </br> setpoint | |

The node has the following registers:

| Register name | Description |
| ----------------------- | ----------- |
| uavcan.node.id | Defines a node-ID. Allowed values [0,127]. |
| uavcan.node.description | User/integrator-defined, human-readable description of this specific node. |
| system.can_terminator | Bitmask which switch can terminators (0 - both off, 1 - enables second, 2 - enables first, 3 - enables both). Works only for v3. |
| system.name | Defines custom node name. If empty, the node will use the default name. |
| system.protocol | Auto, Cyphal/CAN or DroneCAN |
| system.log_level | Log level. See [debug.LogLevel](https://dronecan.github.io/Specification/7._List_of_standard_data_types/#loglevel) and [diagnostic.Severity](https://github.com/OpenCyphal/public_regulated_data_types/blob/master/uavcan/diagnostic/Severity.1.0.dsdl). </br> 0 - Log everything (DEBUG, INFO, WARNING, ERROR) </br> 1 - Log at least INFO level </br> 2 - Log at least WARNING level </br> 3 - Log at least ERROR level </br> 4 - Disable logging </br> By default 3 to show only realy important messages. |
| pwm.cmd_ttl_ms | TTL of specified by pwm.cmd_type commands [ms]. |
| pwm.frequency | PWM frequency [Hz]. |
| pwm1.ch | Index of setpoint channel. [-1; 255]. -1 means disabled, |
| pwm1.min | PWM duration when setpoint is min (RawCommand is 0 or Command is -1.0) |
| pwm1.max | PWM duration when setpoint is max (RawCommand is 8191 or Command is 1.0) |
| pwm1.def | PWM duration when setpoint is negative or there is no setpoint at all. |
| pwm2.ch | Index of setpoint channel. [-1; 255]. -1 means disabled, |
| pwm2.min | PWM duration when setpoint is min (RawCommand is 0 or Command is -1.0) |
| pwm2.max | PWM duration when setpoint is max (RawCommand is 8191 or Command is 1.0) |
| pwm2.def | PWM duration when setpoint is negative or there is no setpoint at all. |
| pwm3.ch | Index of setpoint channel. [-1; 255]. -1 means disabled, |
| pwm3.min | PWM duration when setpoint is min (RawCommand is 0 or Command is -1.0) |
| pwm3.max | PWM duration when setpoint is max (RawCommand is 8191 or Command is 1.0) |
| pwm3.def | PWM duration when setpoint is negative or there is no setpoint at all. |
| pwm4.ch | Index of setpoint channel. [-1; 255]. -1 means disabled, |
| pwm4.min | PWM duration when setpoint is min (RawCommand is 0 or Command is -1.0) |
| pwm4.max | PWM duration when setpoint is max (RawCommand is 8191 or Command is 1.0) |
| pwm4.def | PWM duration when setpoint is negative or there is no setpoint at all. |
| pwm.cmd_type | 0 means RawCommand, 1 means ArrayCommand, 2 is reserved for hardpoint.Command. |
| stats.engaged_time | Total engaged time of node in seconds. |
| crct.bitmask | Bit mask to enable CircuitStatus features: </br> Bit 1 - enable dev.Temperature with device_id=NODE_ID, </br> Bit 2 - enable 5v publisher, </br> Bit 3 - enable Vin publisher. </br> Bit 4 - enable overvoltage, undervoltage, overcurrent and overheat checks. </br> By default 15 that mean enable all publishers |
| feedback.type | Indicates the operational mode of the node. 0 means disabled. When set to 1, the command of corresponding Status type for cmd_type will be transmitted (esc.RawCommand - esc.Status, actuator.ArrayCommand - actuator.Status) with frequency 1 Hz. When set to 2 - 10 Hz. |
| imu.enable | Enable or disable IMU publisher. |

> This docs was automatically generated. Do not edit it manually.
Loading

0 comments on commit 6004e9c

Please sign in to comment.