Homepage GitHub

Nunavut @extent and @sealed Directives

I able trying to generate C files from a PX4 fork of public_regulated_data_types. It seems that whenever I try to generate the files, the CLI prints an error like the following:

Either `@sealed` or `@extent ...` are required. The smallest valid extent for this type (i.e., its max bit length) is 32 bits (4 bytes). If you are not sure what this means, add the following line near the end of this definition: `@extent 64 * 8`

This is an issue with many of the files because this repository was forked before these directives were added to the end of files in the UAVCAN version of this repository. Is this a new requirement that was added for DSDL files recently? Or is there a command-line argument that will enable/disable these? I used this command:

nnvg --target-language c --target-endianness=little --enable-serialization-asserts c:/Path/To/Repo/public_regulated_data_types/regulated --lookup-dir c:/Path/To/Repo/public_regulated_data_types/uavcan  

Also, I’m trying to use Windows, but I verified this happens on a Linux machine as well.

P.S. When the CLI suggests an extent to use, it seems pretty big. If I’m understanding it right, it should be the number of bytes in the datatype * 8 at a minimum. Anymore than that would be for the sake of future compatibility if anything needs to be added to the data type. Am I getting that right?

The PX4 fork is not up-to-date with the current DSDL format. You rather rebase it or you use the UAVCAN one.

1 Like

I second Nuno’s response. Regarding this question:

Yes, you are getting this right. You can safely use large extent values because they do not affect the size of your transmissions or (generally) the size of your serialization buffers; the only affected parameter is the amount of memory allocated for deserialization buffers when receiving UAVCAN transfers.