Using custom DSDL with 107-Arduino-OpenCyphal and PIO

What is recommended way to integrate project-specific namespace to an Arduino project? I’m using PlatformIO, which also has its own dependency management.

Should I generate my headers into src/types or .pio/libdeps/pico/107-Arduino-Cyphal/src/types?

ref: Extending DSDL · Issue #205 · 107-systems/107-Arduino-Cyphal
cc: @aentinger

Hi Norbert :coffee: :wave:

You can compile your custom DSDL using nnvg, i.e. see how its done here to automatically generate the C++ headers for 107-Arduino-Cyphal.

Then it should be possible to simply add your generated .hpp file to your sketch (basically adding it to the project, however that may be achieved on PlatformIO). You may include it and should then be able to instantiate Publishers/Subscribers like this:

auto my_type_pub = node_hdl.create_publisher<namespace1::namespace2::MyType>
  (MyTypeDefaultId, 1*1000*1000UL /* = 1 sec in usecs. */);

Note: This requires that you use the latest code from main.

If you are using the latest released version (v2.2.1) the steps for adding custom types are described here.

Please be advised that a 3.0.0 release of 107-Arduino-Cyphal is imminent and scheduled to happen within the next month.