pbd_interaction_node.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 '''This runs the "core" of the PbD backend. 
00003 It handles the interactions between the GUI and the state of the world
00004 and recorded actions. 
00005 It coordinates responses from the head and arms of the robot. 
00006 '''
00007 
00008 # ######################################################################
00009 # Imports
00010 # ######################################################################
00011 
00012 # Core ROS imports come first.
00013 import rospy
00014 
00015 # Local
00016 from fetch_pbd_interaction import Interaction
00017 
00018 # ######################################################################
00019 # Main Function
00020 # ######################################################################
00021 
00022 if __name__ == '__main__':
00023 
00024     # Register as a ROS node.
00025     rospy.init_node('interaction', anonymous=True)
00026     grasp_suggestion_service = rospy.get_param('~grasp_suggestion_service')
00027     external_ee_link = rospy.get_param('~grasp_suggestion_ee_link')
00028     grasp_feedback_topic = rospy.get_param('~grasp_feedback_topic')
00029     to_file = rospy.get_param('~to_file')
00030     from_file = rospy.get_param('~from_file')
00031     play_sound = rospy.get_param('~play_sound')
00032     social_gaze = rospy.get_param('~social_gaze')
00033 
00034     # Run the system    
00035     interaction = Interaction(grasp_suggestion_service, 
00036                                 grasp_feedback_topic, 
00037                                 external_ee_link, 
00038                                 to_file, from_file, 
00039                                 play_sound, social_gaze)
00040 
00041     while not rospy.is_shutdown():
00042         interaction.update()
00043 
00044         # This is the pause between update runs. Note that this doesn't
00045         # guarantee an update rate, only that there is this amount of
00046         # pause between udpates.
00047         rospy.sleep(0.1)


fetch_pbd_interaction
Author(s): Sarah Elliott
autogenerated on Thu Jun 6 2019 18:27:21