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
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!