There was an error that the library of my service could not be loaded in the Python node
my_server.py
...
from my_servs.srv import *
...
error
Traceback (most recent call last):
File "/home/hoshina/catkin_ws/src/pca_server/scripts/pca_server.py", line 3, in <module>
from pca_server_srvs.srv import *
ModuleNotFoundError: No module named 'pca_server_srvs'
ls ~/catkin_ws/devel/lib/python3/dist-packages
>> my_srvs
Okay if generated
>>
Nothing should come out
Build the following sample and check if the service library is generated https://github.com/fairlight1337/ros_service_examples
git clone https://github.com/fairlight1337/ros_service_examples.git
catkin build
ls ~/catkin_ws/devel/lib/python3/dist-packages
>> ros_service_examples
Okay,CMakeLists in this repository.txt and package.Refer to xml and modify your own
Add the following to python and check if the library path is in
import sys
print(sys.path)
If the pass does not pass
source ~/catkin_ws/devel/setup.bash
Or restart the terminal