Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
PonomarevDA committed Nov 7, 2023
1 parent a017e5c commit 38e68c8
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Libs/libparams
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ If you are strugguling with the software building, please refer to the build wor

## 5. Customization

The peripherals are initialised in [Libs/mini-v2-software/Core/Src/main.c](Libs/mini-v2-software/Core/Src/main.c), which are automatically generated based on the configuratation file [can_pwm_v2.ioc](Libs/mini-v2-software/can_pwm_v2.ioc) file. If you want to use a different peripheral configuration, you should update can_pwm_v2.ioc with STM32CubeIDE or STM32CubeMX.
The peripherals are initialised in [Libs/mini-v2-software/Core/Src/main.c](https://github.com/RaccoonLabHardware/mini-v2-software/blob/main/Core/Src/main.c), which are automatically generated based on the configuratation file [can_pwm_v2.ioc](https://github.com/RaccoonLabHardware/mini-v2-software/blob/main/can_pwm_v2.ioc) file. If you want to use a different peripheral configuration, you should update can_pwm_v2.ioc with STM32CubeIDE or STM32CubeMX.

The main application is started in [Src/cyphal_application/application.cpp](Src/cyphal_application/application.cpp).
By default it just blinks the RGB LED, subscribes to the setpoint topic, controls a single PWM and publishes a feedback to the feedback topic. Note, that the application is as simple as possible and doesn't have safety features like TTL.
By default it just blinks the RGB LED, subscribes to the setpoint topic to control PWM1 and publishes a feedback with the latest applied setpoint. Note, that the application is as simple as possible: it controls only a single PWM and doesn't have safety features like TTL, but you are free to extend it as you want.

You may consider [Src/cyphal_application/setpoint](Src/cyphal_application/setpoint) and [Src/cyphal_application/feedback](Src/cyphal_application/feedback) as examples of Cyphal-subscriber and Cyphal-publisher. It is recommended to create subjects by inhereting from CyphalPublisher or CyphalSubscriber and creating required registers in yaml file. This approach automatically adds all topics to the port.List array, allowing the node is able to advertise its capabilities.
You may consider [Src/cyphal_application/setpoint](Src/cyphal_application/setpoint) and [Src/cyphal_application/feedback](Src/cyphal_application/feedback) as examples of Cyphal-subscriber and Cyphal-publisher. If you create subjects by inhereting from CyphalPublisher and CyphalSubscriber, it will automatically add all topics to the port.List array, so the node is able to advertise its capabilities. This approach doesn't automatically create registers, so you need to add them in yaml file as shown in the examples.

When you add your custom module, don't forget to add source file and path to the file with registers to [Src/cyphal_application/CMakeLists.txt](Src/cyphal_application/CMakeLists.txt).

Expand Down
19 changes: 19 additions & 0 deletions Src/cyphal_application/docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
The node has the following interface:

|| Type | Message | Topic name |
| -- | ---- | ------- | ----------- |
| 1 | sub | reg.udral.service.actuator.common.sp.Vector31 | setpoint | {'type': 'Port', 'data_type': 'reg.udral.service.actuator.common.sp.Vector31', 'enum_base': 'PARAM_SUB_SETPOINT'}|
| 2 | pub | reg.udral.service.actuator.common.Feedback.0.1 | feedback | {'type': 'Port', 'data_type': 'reg.udral.service.actuator.common.Feedback.0.1', 'enum_base': 'PARAM_PUB_FEEDBACK_1'}|

The node has the following registers:

|| Register name | Description |
| -- | ----------------------- | ----------- |
| 1 | uavcan.node.id | Defines a node-ID. Allowed values [0,127]. |
| 2 | system.name | Defines custom node name. If empty, the node will use the default name. |
| 3 | uavcan.node.description | User/integrator-defined, human-readable description of this specific node. |
| 4 | example.integer | Just an integer register example |
| 5 | example.string | Just a string register example |

> This docs was automatically generated on November 07, 2023. Do not edit it manually.
3 changes: 3 additions & 0 deletions scripts/prebuild_cyphal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ ${REPOSITORY_PATH}/Libs/libparams/scripts/params_generate_array_from_yaml.py \
c++ \
params \
$@

cd $REPOSITORY_PATH/Src/cyphal_application
${REPOSITORY_PATH}/Libs/libparams/scripts/generate_docs.py $@

0 comments on commit 38e68c8

Please sign in to comment.