Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing python API docs #340

Open
dellaert opened this issue Nov 10, 2018 · 3 comments
Open

missing python API docs #340

dellaert opened this issue Nov 10, 2018 · 3 comments

Comments

@dellaert
Copy link

Was looking for the python API of tf2_ros, and while the source has many nice comments (Thanks!) they don't seem to have made it to http://docs.ros.org/latest/api/tf2_ros/html/python/tf2_ros.html

@tfoote
Copy link
Member

tfoote commented Nov 12, 2018

This is likely related to #250

@MichaelGrupp
Copy link
Contributor

MichaelGrupp commented Feb 20, 2019

@tfoote autodoc fails to do imports on the buildfarm. E.g. here: http://build.ros.org/job/Mdoc__geometry2__ubuntu_bionic_amd64/28/console#console-section-3

#....
ImportError: No module named _tf2
#....

Maybe the import path needs to be set here?

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.append(os.path.abspath('.'))

I get a full documentation when I build locally on my PC with rosdoc_lite tf2_ros -o test_doc from the root folder of the repository. So the documentation script itself looks fine.

@tfoote
Copy link
Member

tfoote commented Feb 20, 2019

Thanks @MichaelGrupp for looking into this.

Looking closer at the import error it's failing on importing _tf2 which is the library wrapped c++ code. Which is not built in the rosdoc builds.

03:17:03 /tmp/ws/src/geometry2/tf2_ros/doc/tf2_ros.rst:44: WARNING: autodoc: failed to import exception u'TypeException' from module u'tf2_ros.buffer_interface'; the following exception was raised:
03:17:03 Traceback (most recent call last):
03:17:03   File "/usr/lib/python2.7/dist-packages/sphinx/ext/autodoc.py", line 658, in import_object
03:17:03     __import__(self.modname)
03:17:03   File "/tmp/ws/install_isolated/lib/python2.7/dist-packages/tf2_ros/__init__.py", line 38, in <module>
03:17:03     from tf2_py import *
03:17:03   File "/tmp/ws/install_isolated/lib/python2.7/dist-packages/tf2_py/__init__.py", line 38, in <module>
03:17:03     from ._tf2 import *
03:17:03 ImportError: No module named _tf2

It probably works locally because the package has already been built and consequently python can import the library.

I suspect switching away from the autoexception and autoclass might resolve this.

seanyen pushed a commit to ms-iot/geometry2 that referenced this issue Mar 22, 2021
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants