-
Notifications
You must be signed in to change notification settings - Fork 419
Description
My project looks like this:
src
lcm
message1.lcm
message2.lcm
python
interfaces
lcm_generated
I want to generate python messages into lcm_generated. When I run
lcm-gen -p --ppath src/python --package-prefix interfaces.lcm_generated src/lcm-types/*.lcm, I get an odd result, where the __init__.py in lcm_generated/package_name/__init__.py contains a subset of the LCM types, for example:
"""LCM package __init__.py file
This file automatically generated by lcm-gen.
DO NOT MODIFY BY HAND!!!!
lcm-gen 1.5.1
"""
from .message1 import foo as fooif I run the same command with a broken package prefix (notice the / instead of . to separate modules), e.g. lcm-gen -p --ppath src/python --package-prefix interfaces/lcm_generated src/lcm-types/*.lcm,
I get a complete list of the LCM types, such as
"""LCM package __init__.py file
This file automatically generated by lcm-gen.
DO NOT MODIFY BY HAND!!!!
lcm-gen 1.5.1
"""
from .message1 import foo as foo
from .message2 import foo as foobut the actual message1/2.py files will contain the broken prefix:
import interfaces/lcm_generated.std
if I set the prefix to just one module, the generated files are fine:
lcm-gen -p --ppath src/python --package-prefix lcm_generated src/lcm-types/*.lcm but they'll be generated in the wrong folder. I can extend the ppath like
lcm-gen -p --ppath src/python/interfaces --package-prefix lcm_generated src/lcm-types/*.lcm but that has other implications for my code.
No good solution other than keeping the generated code in the top level python path folder 🤷