Esempio n. 1
0
 def __init__(self):
     rospy.loginfo("Starting '%s'." % ACTION_ID)
     super(ROSPlanFeedbackServer, self).__init__()
     self._sps = PNPSimplePluginServer(ACTION_ID,
                                       ROSPlanAction,
                                       self.execute_cb,
                                       auto_start=False)
     self.client = SimpleActionClient("/kcl_rosplan/start_planning",
                                      PlanAction)
     self.client.wait_for_server()
     self.pub = rospy.Publisher("/kcl_rosplan/action_feedback",
                                ActionFeedback,
                                queue_size=1)
     self.state_pub = rospy.Publisher("~current_state",
                                      String,
                                      queue_size=1,
                                      latch=False)
     self.state_pub.publish("")
     self.commands_pub = rospy.Publisher("/kcl_rosplan/planning_commands",
                                         String,
                                         queue_size=1)
     self.f = {
         END: self.set_succeeded,
         START: self.set_enabled,
         FAIL: self.set_failed
     }
     self._sps.start()
     rospy.loginfo("Started '%s'." % ACTION_ID)
Esempio n. 2
0
 def __init__(self, name):
     rospy.loginfo("Starting %s ..." % name)
     self.pub = rospy.Publisher("/cmd_vel", Twist, queue_size=10)
     self._as = PNPSimplePluginServer(name,
                                      RouteDescriptionAction,
                                      execute_cb=self.execute_cb,
                                      auto_start=False)
     self.listener = tf.TransformListener()
     client = MongoClient(rospy.get_param("~db_host", "localhost"),
                          int(rospy.get_param("~db_port", 62345)))
     rospy.loginfo("Creating move_base client")
     self.move_client = SimpleActionClient("/move_base", MoveBaseAction)
     self.move_client.wait_for_server()
     rospy.loginfo("Move_base client connected")
     rospy.loginfo("Creating tracker client")
     self.start_client = SimpleActionClient("/start_tracking_person",
                                            TrackPersonAction)
     self.start_client.wait_for_server()
     self.stop_client = SimpleActionClient("/stop_tracking_person",
                                           TrackPersonAction)
     self.stop_client.wait_for_server()
     rospy.loginfo("Tracker client connected")
     self.db_name = rospy.get_param("~db_name", "semantic_map")
     self.collection_name = rospy.get_param("~collection_name", "idea_park")
     self.semantic_map_name = rospy.get_param("~semantic_map_name")
     self._as.start()
     self.db = client[self.db_name]
     self.tts = rospy.Publisher("/speech", String, queue_size=1)
     self.joints = rospy.Publisher("/joint_angles",
                                   JointAnglesWithSpeed,
                                   queue_size=10)
     rospy.loginfo("... done")
 def __init__(self, name):
     rospy.loginfo("Starting %s ..." % name)
     self._ps = PNPSimplePluginServer(name=name,
                                      ActionSpec=FindInteractantAction,
                                      execute_cb=self.execute_cb,
                                      auto_start=False)
     self._ps.start()
     rospy.loginfo("... done")
Esempio n. 4
0
 def __init__(self, name):
     rospy.loginfo("Starting %s ..." % name)
     self._as = PNPSimplePluginServer(name,
                                      FinishRouteDescriptionAction,
                                      execute_cb=self.execute_cb,
                                      auto_start=False)
     self._as.start()
     rospy.loginfo("... done")
 def __init__(self, name):
     rospy.loginfo("Starting %s ..." % name)
     self.predicate = rospy.get_param("~predicate", "human_exists")
     self._ps = PNPSimplePluginServer(name=name,
                                      ActionSpec=CheckHumanExistsAction,
                                      execute_cb=self.execute_cb,
                                      auto_start=False)
     self._ps.start()
     rospy.loginfo("... done")
Esempio n. 6
0
 def __init__(self, name):
     rospy.loginfo("Starting '%s'." % name)
     self._ps = PNPSimplePluginServer(name=name,
                                      ActionSpec=StringAction,
                                      execute_cb=self.execute_cb,
                                      auto_start=False)
     self.pub = rospy.Publisher("/speech", String, queue_size=1)
     self._ps.start()
     rospy.loginfo("Done")
Esempio n. 7
0
 def __init__(self, name):
     rospy.loginfo("Starting '%s'." % name)
     self._ps = PNPSimplePluginServer(name=name,
                                      ActionSpec=StringAction,
                                      execute_cb=self.execute_cb,
                                      auto_start=False)
     self._ps.register_preempt_callback(self.preempt_cb)
     self.client = SimpleActionClient('topological_navigation',
                                      GotoNodeAction)
     self.client.wait_for_server()
     self._ps.start()
     rospy.loginfo("Done")
 def __init__(self, name):
     rospy.loginfo("Starting '%s'." % name)
     self._ps = PNPSimplePluginServer(name=name,
                                      ActionSpec=StringAction,
                                      execute_cb=self.execute_cb,
                                      auto_start=False)
     self.listener = tf.TransformListener()
     self.pub = rospy.Publisher("/move_base_simple/goal",
                                PoseStamped,
                                queue_size=1)
     self._ps.start()
     rospy.loginfo("Done")
Esempio n. 9
0
 def __init__(self, name):
     rospy.loginfo("Starting %s ..." % name)
     super(StartStopPeopleTracking, self).__init__()
     self.listener = tf.TransformListener()
     self.id = 0
     self.target_frame = "base_link"
     self._ps = PNPSimplePluginServer(
         name=name,
         ActionSpec=TrackPersonAction,
         execute_cb=self.start_cb if "start" in name else self.stop_cb,
         auto_start=False)
     self._ps.start()
     rospy.loginfo("... done")
Esempio n. 10
0
 def __init__(self, name):
     rospy.loginfo("Starting %s ..." % name)
     self._ps = PNPSimplePluginServer(
         name=name,
         ActionSpec=FindInteractantAction,
         execute_cb=self.execute_cb,
         auto_start=False
     )
     rospy.loginfo("Creating tracker client")
     self.start_client = SimpleActionClient("/start_tracking_person", TrackPersonAction)
     self.start_client.wait_for_server()
     rospy.loginfo("Tracker client connected")
     self._ps.start()
     rospy.loginfo("... done")
Esempio n. 11
0
 def __init__(self, name):
     rospy.loginfo("Starting %s ..." % name)
     self.listener = tf.TransformListener()
     self.target_frame = rospy.get_param("~target_frame", "base_link")
     with open(rospy.get_param("~config_file"), 'r') as f:
         self.distance = yaml.load(f)["distances"]
     self.move_client = SimpleActionClient("move_base", MoveBaseAction)
     self._ps = PNPSimplePluginServer(
         name=name,
         ActionSpec=QualitativeMovePepperAction,
         execute_cb=self.execute_cb,
         auto_start=False)
     rospy.loginfo("Creating tracker client")
     self.start_client = SimpleActionClient("/start_tracking_person",
                                            TrackPersonAction)
     self.start_client.wait_for_server()
     rospy.loginfo("Tracker client connected")
     self._ps.start()
     rospy.loginfo("... done")
Esempio n. 12
0
 def __init__(self, name):
     rospy.loginfo("Starting %s ..." % name)
     self.texts = {"hello": "Hello, I am pepper!"}
     self.predicate = rospy.get_param("~predicate", "said")
     rospy.loginfo("Starting dialogue client")
     self.client = SimpleActionClient("/dialogue_start", dialogueAction)
     rospy.loginfo("Waiting for dialogue client")
     self.client.wait_for_server()
     rospy.loginfo("Dialogue client started")
     self.pub = rospy.Publisher("/animated_speech", String, queue_size=10)
     self._ps = PNPSimplePluginServer(name=name,
                                      ActionSpec=SpeakAction,
                                      execute_cb=self.execute_cb,
                                      auto_start=False)
     rospy.loginfo("Creating tracker client")
     self.start_client = SimpleActionClient("/start_tracking_person",
                                            TrackPersonAction)
     self.start_client.wait_for_server()
     rospy.loginfo("Tracker client connected")
     self._ps.start()
     rospy.loginfo("... done")
Esempio n. 13
0
 def __init__(self, name):
     rospy.loginfo("Starting %s ..." % name)
     self._as = PNPSimplePluginServer(
         name,
         MoveToWaypointAction,
         execute_cb=self.execute_cb,
         auto_start=False
     )
     self.msg_store = MessageStoreProxy(
         database=rospy.get_param("~db_name", "semantic_map"), 
         collection=rospy.get_param("~collection_name", "waypoints")
     )
     rospy.loginfo("Creating tracker client")
     self.stop_client = SimpleActionClient("/stop_tracking_person", TrackPersonAction)
     self.stop_client.wait_for_server()
     rospy.loginfo("Tracker client connected")
     self.client = SimpleActionClient("move_base", MoveBaseAction)
     rospy.loginfo("Waiting for move_base client.")
     self.client.wait_for_server()
     self._as.start()
     rospy.loginfo("... done")