geometry2 icon indicating copy to clipboard operation
geometry2 copied to clipboard

missing python API docs

Open dellaert opened this issue 6 years ago • 3 comments

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

dellaert avatar Nov 10 '18 20:11 dellaert

This is likely related to #250

tfoote avatar Nov 12 '18 20:11 tfoote

@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? https://github.com/ros/geometry2/blob/cd55e4506529723b3b0f30abd2b54d9beb284e3e/tf2_ros/doc/conf.py#L16-L19

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.

MichaelGrupp avatar Feb 20 '19 10:02 MichaelGrupp

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.

tfoote avatar Feb 20 '19 21:02 tfoote