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?

afbeelding

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

    else:

        my_response.success = False

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

rospy.init_node('service_client') 

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

rospy.spin()

Thank you!

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

for now try to source your packages:

cd ~/catkin_ws
catkin_make
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.