Homepage GitHub

DSDL compiler for libcanard


(YANGGUOQIANG) #1

Hello, I want to use DSDL in my project, what should I do, shouldn’t he be a .c and .h file?
How can I get NodeStatus.h


(Pavel Kirienko) #2

This should help: https://github.com/UAVCAN/libcanard/tree/master/dsdl_compiler


(YANGGUOQIANG) #3

I have followed this operation, unfortunately, after running python3 libcanard_dsdlc --outdir he reported an error. Still can’t get .c and .h files


(Pavel Kirienko) #4

Can’t help unless I know what the error was.


(YANGGUOQIANG) #5

Error is as follows:

Internal error
Traceback (most recent call last):
  File "/home/stm32/Downloads/libcanard/dsdl_compiler/pyuavcan/uavcan/dsdl/parser.py", line 691, in parse
    return self.parse_source(filename, source_text)
  File "/home/stm32/Downloads/libcanard/dsdl_compiler/pyuavcan/uavcan/dsdl/parser.py", line 683, in parse_source
    raise ex
DsdlException: /home/stm32/Downloads/zubax_gnss/firmware/libuavcan/libuavcan/test/dsdl_test/root_ns_b/T.uavcan: Invalid namespace name [Downloads.zubax_gnss.firmware.libuavcan.libuavcan.test.dsdl_test.root_ns_b]
Compiler failure
Traceback (most recent call last):
  File "libcanard_dsdlc", line 73, in <module>
    dsdlc_run(args.source_dir, args.incdir, args.outdir, args.header_only)
  File "/home/stm32/Downloads/libcanard/dsdl_compiler/libcanard_dsdl_compiler/__init__.py", line 71, in run
    types = run_parser(source_dirs, include_dirs + source_dirs)
  File "/home/stm32/Downloads/libcanard/dsdl_compiler/libcanard_dsdl_compiler/__init__.py", line 127, in run_parser
    die(ex)
  File "/home/stm32/Downloads/libcanard/dsdl_compiler/libcanard_dsdl_compiler/__init__.py", line 119, in die
    raise DsdlCompilerException(str(text))

(Pavel Kirienko) #6

The path to the root namespace is clearly invalid. Please provide the correct path to the root namespace (such as /home/stm32/Downloads/zubax_gnss/firmware/libuavcan/libuavcan/test/dsdl_test/root_ns_b) when invoking the script.


(YANGGUOQIANG) #7

Thank you for your help, it has been solved.