Hi, I have already compiled successfully my_custom_srv_msg_pkg in the exercise 4.3 and found the package
user:~/catkin_ws$ rossrv list | grep MyCustomServiceMessage
my_custom_srv_msg_pkg/MyCustomServiceMessage
but I have given an error Importing the package as in the title. This is part of the code:
#! /usr/bin/env python
import rospy
from my_custom_srv_msg_pkg.srv import MyCustomServiceMessage, MyCustomServiceMessageResponse
from geometry_msgs.msg import Twist
import time
process[custom_circle_bb8-1]: started with pid [3616]
Traceback (most recent call last):
File “/home/user/catkin_ws/src/unit_4_services/src/bb8_move_custom_service_server.py”, line 3, in
from my_custom_srv_msg_pkg.srv import MyCustomServiceMessage, MyCustomServiceMessageResponse
ImportError: No module named my_custom_srv_msg_pkg.srv
[custom_circle_bb8-1] process has died [pid 3616, exit code 1, cmd /home/user/catkin_ws/src/unit_4_services/src/bb8_move_custom_service_server.py __name:=custom_circle_bb8 __log:=/home/user/.ros/log/d389b0e4-04bc-11eb-992c-028fede41e2b/custom_circle_bb8-1.log].
log file: /home/user/.ros/log/d389b0e4-04bc-11eb-992c-028fede41e2b/custom_circle_bb8-1*.log
all processes on machine have died, roslaunch will exit
shutting down processing monitor…
… shutting down processing monitor complete
done
Thanks in advance for any help that i can be given.
That would have created the needed dependencies for you in CMakeLists.txt and package.xml. You could modify these manually, but because of the possible errors that modifying CMakeLists.txt and package.xml to support this dependency might introduce, I recommend that you recreate the unit_4_services package including this dependency.
Hi, I am getting the same error as the screenshots shared earlier in the thread. I tried the ‘source devel/setup.bash’, even after doing the remove the build and build all packages (as mentioned by @92felix, it worked out for him).
I even built a new package and in the dependencies of this one, I included the package which contains my custom service files. Still I’m getting the same error that the module doesn’t exist.
Kindly let me know if someone has figured out the issue.
Hi, it’s definitely strange that removing your build/ and devel/ folders and compiling again does not work for you, I just tried that and it work. Could you please share your file configuration and the error message that is showing up?