I have been having a really tough time getting this exercise to work. I resorted to looking at the solutions and couldn’t find anything that would make a difference. I then directly copied the code from the solutions and re-made the catkin directory and I’m still unable to launch the package.
This is what I am getting so far:
Traceback (most recent call last):
File “/home/user/catkin_ws/src/my_custom_srv_msg_pkg/src/bb8_move_custom_service_server.py”, line 4, in
from my_custom_srv_msg_pkg.srv import MyCustomServiceMessage, MyCustomServiceMessageResponse
ImportError: No module named my_custom_srv_msg_pkg.srv
[service_move_bb8_in_circle_custom_server-1] process has died [pid 3557, exit code 1, cmd /home/user/catkin_ws/src/my_custom_srv_msg_pkg/src/bb8_move_custom_service_server.py __name:=service_move_bb8_in_circle_custom_server __log:=/home/user/.ros/log/ebef4f34-acc2-11e9-bcc3-0242ac120007/service_move_bb8_in_circle_custom_server-1.log].
log file: /home/user/.ros/log/ebef4f34-acc2-11e9-bcc3-0242ac120007/service_move_bb8_in_circle_custom_server-1*.log
Thank you for getting back to me @bayodesegun. Unfortunately, none of these troubleshooting steps have solved my problems so far. In my attempts to solve the problem I have had to directly copy the code from the examples and I’m still getting this issue, so the problem must stem from something else. Maybe an issue with the file names?
It’s usually one of the reasons stated in that post I shared. But it could also be a problem in the name of your message…are you trying to use a different name than the one defined.
It could also be a problem in the directory structure:
do you actually have a folder called srv in package my_custom_srv_msg_pkg?
is your service message properly defined in that folder?
in CMakeLists.txt, did you properly reference the service message as outlined in the note?
Please check all these again.
If you still can’t solve the error, you can send me a private message containing your package as a zip file. (You can download the package by right-clicking on the package folder name on the IDE and clicking “Download”). It might take some time before I’m able to review it.
I do think it’s probably a problem in the directory structure or the example code. I’d love to figure it out so I can learn more about custom services. Here are my answer to your proposed solutions:
Yes, I have a folder called srv in the package my_custom_srv_msg_pkg. You can see my file structure here:
My service message file is MyCustomServiceMessage.srv and contains exactly what was suggested in example 3.8
I defined the service exactly as was detailed in example 3.8 (After trying to solve this on my own, I broke down and just copied the code exactly)
One thing that is confusing is that the example code has the line:
from my_custom_srv_msg_pkg.srv import MyCustomServiceMessage, MyCustomServiceMessageResponse
But the instructions detail that the package should be called my_custom_srv_msg_pkg and the actual file in the srv folder should be called MyCustomServiceMessage.srv Could this be the issue?
No, that’s fine. The problem here seems to be that your custom message was not properly built. I replied your pm, please check it and send me your package .zip file.
I’m looking at your screenshot and I don’t know why you’re saying you have the same error. This post is about Exercise 3.3 and it looks like you are in Unit 6. What exercise are you on?
I’m trying to do the exercise 6.3 (I think the course was changed with more information) and I have the same problem. The strange thing is the custom message work before I create the new files at the working project! Also my_custom_msg… anda my_examples_pkg… Can anyone help me?
If you’ve tried deleting those folders and compiling again and it still doesn’t find your custom message package, then probably your best bet is to delete and create the package again