I am trying to use nunavut python library to generate support includes as I do from command line like:
nnvg --target-language c -O include --target-endianness little --generate-support only"
I am trying code like this but it do not generate any code:
from pydsdl import read_namespace
from nunavut import build_namespace_tree
from nunavut.lang import LanguageContext
from nunavut.jinja import DSDLCodeGenerator, SupportGenerator
from pathlib import Path
root_namespace_dir_uavcan = "data_types/uavcan"
root_namespace_dir_reg = "data_types/reg"
out_dir = "include"
lookup_directories = [root_namespace_dir_uavcan,root_namespace_dir_reg]
# parse the dsdl
compound_types = read_namespace(root_namespace_dir_reg, lookup_directories)
# select a target language
language_context = LanguageContext('c')
# build the namespace tree
root_namespace = build_namespace_tree(compound_types,
root_namespace_dir_reg,
out_dir,
language_context)
root_namespace.base_output_path = "include"
print(root_namespace.get_support_output_folder())
support_generator = SupportGenerator(root_namespace)
print(support_generator.get_templates())
support_generator.generate_all()
Thanks for any suggestion