Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Latest commit

 

History

History
66 lines (61 loc) · 3.23 KB

README.md

File metadata and controls

66 lines (61 loc) · 3.23 KB

💾 l3xz-leg-ctrl-firmware

General Formatting Checks Spell Check Compile Examples

Firmware for the L3X-Z leg controller.

How-to-build/upload

arduino-cli compile -b rp2040:rp2040:arduino_nano_connect -v .
arduino-cli upload -b rp2040:rp2040:arduino_nano_connect -v .. -p /dev/ttyACM0

or

arduino-cli compile -b rp2040:rp2040:arduino_nano_connect -v . --build-property compiler.cpp.extra_flags="-DCYPHAL_NODE_INFO_GIT_VERSION=0x$(git rev-parse --short=16 HEAD)"

Adding argument --build-property compiler.cpp.extra_flags="-DCYPHAL_NODE_INFO_GIT_VERSION=0x$(git rev-parse --short=16 HEAD)" allows to feed the Git hash of the current software version to 107-Arduino-Cyphal stack from where it can be retrieved via i.e. yakut.

How-to-yakut

Install and configure yakut:

. setup_yakut.sh

Subscribe via yakut:

yakut sub 1001:uavcan.si.unit.angle.Scalar.1.0 --with-metadata
...
---
1001:
  _meta_: {ts_system: 1679050084.745943, ts_monotonic: 91027.725109, source_node_id: 6, transfer_id: 18, priority: nominal, dtype: uavcan.si.unit.angle.Scalar.1.0}
  radian: 3.814626693725586
---
1001:
  _meta_: {ts_system: 1679050084.797002, ts_monotonic: 91027.773986, source_node_id: 6, transfer_id: 19, priority: nominal, dtype: uavcan.si.unit.angle.Scalar.1.0}
  radian: 3.814626693725586
---
...

or

yakut sub 1003:uavcan.primitive.scalar.Bit.1.0 --with-metadata
...
---
1003:
  _meta_: {ts_system: 1681729517.634219, ts_monotonic: 24298.607404, source_node_id: 31, transfer_id: 10, priority: nominal, dtype: uavcan.primitive.scalar.Bit.1.0}
  value: false

Obtain offset from sensor values and store in registers (with 42 being the node id):

y call 42 435:uavcan.node.ExecuteCommand.1.1 'command: 0xCAFE'

Read offset value via register interface:

y r 42 cyphal.l3xz-leg-ctrl.angle_offset_deg.b
87.5390625

y r 42 cyphal.l3xz-leg-ctrl.angle_offset_deg.a
240.029296875