Ros basic in 5 days,

Hello fellas!

I was doing the unit-6 exercises, specifically 6.3, and I countered some issue when try to launch a service that takes a custom message. according to the instruction it should show something like : Generating Python code from SRV my_custom_srv_msg_pkg/MyCustomServiceMessage
However, I’ve followed all the step and did compile with catkin_make then source devel/setup.bash. when running rossrv list I can find my custom service but when trying to run the launch file it says that it can’t not find the module although it exists. I tried all I can and think about but it didn’t resolve.

Hi @lawand-93 ,

Welcome to this Community!

Could you post the output of the error that you see on the terminal during execution?

That will help us point directly to what is the problem you are facing.

Regards,
Girish

user:~/catkin_ws/src/my_custom_srv_msg_pkg/src$ rosrun my_custom_srv_msg_pkg custom_service_server.py
Traceback (most recent call last):
File “/home/user/catkin_ws/src/my_custom_srv_msg_pkg/src/custom_service_server.py”, line 4, in
from my_custom_srv_msg_pkg.srv import MyCustomServiceMessage, MyCustomServiceMessageResponse # you import the service message python classes
ModuleNotFoundError: No module named ‘my_custom_srv_msg_pkg’

Did you run source ~/devel/setup.bash in the terminal where you are trying to run that program?

I suppose you compiled and sourced in one terminal. If you want to run the program in another terminal, you need to source on that terminal first.

I have same issue here I did the catkin_make, source devel/setup.bash and I tried to do the cMake file as well nothing works with me

@Ma3012
Not necessarily the same problem.

Please post your issue as a separate topic, giving details of the problem you are facing. Then we can decide if it’s the same as this one.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.