Need help with costum service message

Hey guys!

I need some help with a custom service message. I followed: ROS in 5 days “Understanding ROS services - server”

If I run my code it says that my service does not exist? Can sombody help me?


My server code:

#! /usr/bin/env python

import rospy

from my_turtlebot_topics.srv import customServiceMessage, response

def my_callback(request)
    print("Request Data==> duration="+str(request.duration))
    my_response = MyCustomServiceMessageResponse()
    if request.duration > 5.0:

        my_response.success = True


        my_response.success = False

    return  my_response # the service Response class, in this case MyCustomServiceMessageResponse


my_service = rospy.Service('/my_service', MyCustomServiceMessage , my_callback) # create the Service called my_service with the defined callback


Thank you!

HI @AxelDegrande1 could you send me your whole package so i can have a look? here is my email:

for now try to source your packages:

cd ~/catkin_ws
source devel/setup.bash
rospack profile

It looks like it might be something wrong with the compilation, can you find your package if you hit tab (autocomplete)?. If it doesn’t, follow @u1802520 advice and source your packages.