ImportError: cannot import name 'bb8CustomServiceMessage' from 'bb8_custom_move.srv' (unknown location)

I’ve seen countless threads that should be solving this issue, but for some reason mine still prevails.
Here is the layout of my package…
image

The structure of the service message is

request: int32 duration
response: bool success

I’ve tried the following and it didn’t work.
rm -rf build then catkin_make then source devel/setup.bash

My python file imports the following…

import rospy
from bb8_custom_move.srv import bb8CustomServiceMessage, bb8CustomServiceMessageResponse
from geometry_msgs.msg import Twist

The error is…

Traceback (most recent call last):
File “/home/user/catkin_ws/src/bb8_custom_move/src/bb8_move_custom_service_server.py”, line 4, in
from bb8_custom_move.srv import bb8CustomServiceMessage, bb8CustomServiceMessageResponse
ImportError: cannot import name ‘bb8CustomServiceMessage’ from ‘bb8_custom_move.srv’ (unknown location)
[bb8_service_server-1] process has died [pid 3003, exit code 1, cmd /home/user/catkin_ws/src/bb8_custom_move/src/bb8_move_custom_service_server.py __name:=bb8_service_server __log:=/home/user/.ros/log/8df3e098-6a6c-11eb-921c-0242c0a8f007/bb8_service_server-1.log].
log file: /home/user/.ros/log/8df3e098-6a6c-11eb-921c-0242c0a8f007/bb8_service_server-1*.log

I checked rossrv list and my service message is there

Solved: catkin_make did not compile properly because of another package in catkin_ws/src. Make sure to double check other packages in case if catkin_make halts unexpectedly

2 Likes