I have a problem with the quiz for unit 6. The package contains all launch files, python scripts, and a message file. The catkin_ws folder has been rebuilt with catkin_make. The CMakeLists.txt and package.xml have also been updated and names have been double-checked. However, I keep getting the following error when I try to launch the server:
Traceback (most recent call last):
File “/home/user/catkin_ws/src/services_quiz/src/bb8_move_custom_service_server.py”, line 4, in
from services_quiz.srv import BB8CustomServiceMessage, BB8CustomServiceMessageResponse
ModuleNotFoundError: No module named ‘services_quiz’
The error occurs in the python code. I have already tried to take over the complete package from someone else, where everything worked as expected, but I still get the same error. So I am wondering if I might be doing something wrong in creating the package. I use the following commands:
cd ~/catkin_ws/src/
catkin_create_pkg services_quiz rospy
roscd services_quiz
mkdir srv
mkdir launch
touch srv/BB8CustomServiceMessage.srv
touch launch/start_bb8_move_custom_service_server.launch
touch launch/call_bb8_move_in_square_custom_service_server.launch
touch src/bb8_move_custom_service_client.py
touch src/bb8_move_custom_service_server.py
touch src/move_bb8.py
cd src
chmod +x bb8_move_custom_service_client.py
chmod +x bb8_move_custom_service_server.py
chmod +x move_bb8.py
roscd;cd …
catkin_make clean
catkin_make
source devel/setup.bash
rossrv list | grep BB8CustomServiceMessage
Output:
services_quiz/BB8CustomServiceMessage
roslaunch services_quiz start_bb8_move_custom_service_server.launch
Output:
The error message as shown above.