Beispiel #1
0
    def bag_cap(self, request):
        # request.data => String array
        # sample args: ['rosbag', 'record', '/tf', '/rfid/ears_reader_arr', '-o', 'data/data']
        if (request.data == [] or request.data[0] == 'kill'):
            if self.bag_pid == None:
                rospy.logout('orient_node: No open bag to kill.')
            else:
                rospy.logout('orient_node: Killing open bag.')
                self.bag_pid.kill()
                self.bag_pid = None
            return int(True)

        s = reduce(lambda x, y: x + ' ' + y, request.data)
        rospy.logout('orient_node: Calling CmdProcess with args: %s' % s)
        self.bag_pid = CmdProcess(request.data)
        self.bag_pid.run()
        return int(True)