Last active
August 11, 2018 13:08
-
-
Save bayodesegun/341e53cbc7771345c556197d806315cb to your computer and use it in GitHub Desktop.
A sample ROS Service (Server)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
# remember to make this file executable (`chmod +x`) before trying to run it | |
import rospy | |
from std_srvs.srv import Trigger, TriggerResponse | |
def trigger_response(request): | |
return TriggerResponse( | |
success=True, | |
message="Hey, roger that; we'll be right there!" | |
) | |
rospy.init_node('sos_service') | |
my_service = rospy.Service('/fake_911', Trigger, trigger_response) | |
rospy.spin() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment