Pylance cant find definition for custom message imported from other package.

asked 2023-07-19 06:01:49 -0600

Bogdan gravatar image

I am working in VS code, all the cesessary extensions are installed, and my code is working fine as well. The following line is nicely color-coded, and with "f12" I can easily jump to the definition of "Header".

from std_msgs.msg import Header

In this line, the package name and message name are black and I cannot jump to the definition of the file, furthermore the attributes of a msg instance are not detected etc.

from my_other_package.msg import my_msg

If I build my code and run the ROS node, everything works fine, importing and using my custom message does not cause any errors. Does somebody now, why this is happening? Something with VS code / pylance / VS workspace / catkin workspace etc. I cannot figure it out.

I am grateful for any ideas.

edit retag flag offensive close merge delete