Exemplo n.º 1
0
    def run_by_name_callback(self, request):
        name = request.name
        robot_name = rospy.get_param('/robot_name')
        path = os.path.join(rospack.get_path('robots_config'), robot_name,
                            'performances', name + '.yaml')

        if os.path.exists(path):
            with open(path, 'r') as f:
                data = yaml.load(f.read())

            if 'nodes' in data and isinstance(data['nodes'], list):
                return srv.RunByNameResponse(self.run(0, data['nodes']))

        return srv.RunByNameResponse(False)
Exemplo n.º 2
0
 def run_by_name_callback(self, request):
     self.stop()
     if not self.load(request.id):
         return srv.RunByNameResponse(False)
     return srv.RunByNameResponse(self.run(0.0))
Exemplo n.º 3
0
 def run_full_performance_callback(self, request):
     self.stop()
     performances = self.load_folder(request.id) or self.load(request.id)
     if not performances:
         return srv.RunByNameResponse(False)
     return srv.RunByNameResponse(self.run(0.0, unload_finished=True))
Exemplo n.º 4
0
 def run_by_name_callback(self, request):
     self.stop()
     performances = self.load_sequence([request.id])
     if not performances:
         return srv.RunByNameResponse(False)
     return srv.RunByNameResponse(self.run(0.0))