ROS Python Module - Autocompletion doesn't work when self-compiled

asked 2020-01-10 01:49:33 -0600

TobiMiller gravatar image


i have written a package with an python module in it. I can import it in my other packages but VSCode cannot autocomplete functions.

from <ros_python_module> import <class>

when i click on <ros_python_module>, it goes into an autogenerated "_" inside of my devel folder. There is no code from me.

# -*- coding: utf-8 -*-
# generated from catkin/cmake/template/
# keep symbol table as clean as possible by deleting all unnecessary symbols

Is it possible that catkin build makes a copy of the files and moves them into the devel folder?

Example: moveit_commander -> from package manager i can autocomplete inside vscode --> compiling by myself and it doesnt autocomplete

edit retag flag offensive close merge delete


VSCode needs to know where the actual code is. You probably need to edit the configuration file of VSCode or use a plugin that knows where to look for python code in ROS packages and does this for you. Copying the files to where VSCode is now looking doesn't sound like a good idea.

davekroezen gravatar imagedavekroezen ( 2020-01-10 09:07:46 -0600 )edit

VSCode knows the PYTHONPATH but how i said, catkin compiles an auto generated init py which is not introspecteable :/

TobiMiller gravatar imageTobiMiller ( 2020-01-11 04:37:02 -0600 )edit