├── .gitignore ├── ErrTab.json ├── ExtendedComboBox.py ├── JsonView.py ├── LogViewer.py ├── MapWidget.py ├── MotorRead.py ├── MyToolBar.py ├── README.md ├── ReadThread.py ├── TargetPrecision.py ├── Widget.py ├── getMotorErr.py ├── get_report.py ├── images └── ruler_large.png ├── log_config.json ├── loggui.py ├── loggui.spec ├── loglib.py ├── loglibPlus.py ├── rbk.ico ├── requirements.txt ├── screen_shot.PNG ├── screen_shot2.PNG ├── screen_shot3.PNG ├── test.py ├── test1.log ├── test2.log └── test_ell.py /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | *.txt 6 | *.csv 7 | *.bat 8 | *.rar 9 | *.smap 10 | *.model 11 | *.zip 12 | *.7z 13 | *.xml 14 | *.iml 15 | 16 | # C extensions 17 | *.so 18 | 19 | # Distribution / packaging 20 | .Python 21 | build/ 22 | develop-eggs/ 23 | dist/ 24 | log_data/ 25 | test_*/ 26 | LOG/ 27 | downloads/ 28 | eggs/ 29 | .eggs/ 30 | lib/ 31 | lib64/ 32 | parts/ 33 | sdist/ 34 | var/ 35 | wheels/ 36 | share/python-wheels/ 37 | *.egg-info/ 38 | .installed.cfg 39 | *.egg 40 | MANIFEST 41 | 42 | # PyInstaller 43 | # Usually these files are written by a python script from a template 44 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 45 | *.manifest 46 | *.spec 47 | 48 | # Installer logs 49 | pip-log.txt 50 | pip-delete-this-directory.txt 51 | 52 | # Unit test / coverage reports 53 | htmlcov/ 54 | .tox/ 55 | .nox/ 56 | .coverage 57 | .coverage.* 58 | .cache 59 | nosetests.xml 60 | coverage.xml 61 | *.cover 62 | *.py,cover 63 | .hypothesis/ 64 | .pytest_cache/ 65 | cover/ 66 | 67 | # Translations 68 | *.mo 69 | *.pot 70 | 71 | # Django stuff: 72 | *.log 73 | local_settings.py 74 | db.sqlite3 75 | db.sqlite3-journal 76 | 77 | # Flask stuff: 78 | instance/ 79 | .webassets-cache 80 | 81 | # Scrapy stuff: 82 | .scrapy 83 | 84 | # Sphinx documentation 85 | docs/_build/ 86 | 87 | # PyBuilder 88 | .pybuilder/ 89 | target/ 90 | 91 | # Jupyter Notebook 92 | .ipynb_checkpoints 93 | 94 | # IPython 95 | profile_default/ 96 | ipython_config.py 97 | 98 | # pyenv 99 | # For a library or package, you might want to ignore these files since the code is 100 | # intended to run in multiple environments; otherwise, check them in: 101 | # .python-version 102 | 103 | # pipenv 104 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 105 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 106 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 107 | # install all needed dependencies. 108 | #Pipfile.lock 109 | 110 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 111 | __pypackages__/ 112 | 113 | # Celery stuff 114 | celerybeat-schedule 115 | celerybeat.pid 116 | 117 | # SageMath parsed files 118 | *.sage.py 119 | 120 | # Environments 121 | .env 122 | .venv 123 | env/ 124 | venv/ 125 | ENV/ 126 | env.bak/ 127 | venv.bak/ 128 | 129 | # Spyder project settings 130 | .spyderproject 131 | .spyproject 132 | 133 | # Rope project settings 134 | .ropeproject 135 | 136 | # mkdocs documentation 137 | /site 138 | 139 | # mypy 140 | .mypy_cache/ 141 | .dmypy.json 142 | dmypy.json 143 | 144 | # Pyre type checker 145 | .pyre/ 146 | 147 | # pytype static type analyzer 148 | .pytype/ 149 | 150 | # Cython debug symbols 151 | cython_debug/ 152 | -------------------------------------------------------------------------------- /ExtendedComboBox.py: -------------------------------------------------------------------------------- 1 | from PyQt5 import QtCore, QtGui, QtWidgets 2 | from PyQt5.QtCore import Qt, QSortFilterProxyModel 3 | from PyQt5.QtWidgets import QCompleter, QComboBox 4 | 5 | class ExtendedComboBox(QComboBox): 6 | def __init__(self, parent=None): 7 | super(ExtendedComboBox, self).__init__(parent) 8 | 9 | self.setFocusPolicy(Qt.StrongFocus) 10 | self.setEditable(True) 11 | self.setInsertPolicy(QComboBox.NoInsert) 12 | 13 | # add a filter model to filter matching items 14 | self.pFilterModel = QSortFilterProxyModel(self) 15 | self.pFilterModel.setFilterCaseSensitivity(Qt.CaseInsensitive) 16 | self.pFilterModel.setSourceModel(self.model()) 17 | 18 | # add a completer, which uses the filter model 19 | self.completer = QCompleter(self.pFilterModel, self) 20 | # always show all (filtered) completions 21 | self.completer.setCompletionMode(QCompleter.UnfilteredPopupCompletion) 22 | self.setCompleter(self.completer) 23 | 24 | # connect signals 25 | self.lineEdit().textEdited.connect(self.pFilterModel.setFilterFixedString) 26 | self.completer.activated.connect(self.on_completer_activated) 27 | 28 | 29 | # on selection of an item from the completer, select the corresponding item from combobox 30 | def on_completer_activated(self, text): 31 | if text: 32 | index = self.findText(text) 33 | if index < 0: 34 | index = self.currentIndex() 35 | self.setCurrentIndex(index) 36 | self.activated[str].emit(self.itemText(index)) 37 | 38 | 39 | # on model change, update the models of the filter and completer as well 40 | def setModel(self, model): 41 | super(ExtendedComboBox, self).setModel(model) 42 | self.pFilterModel.setSourceModel(model) 43 | self.completer.setModel(self.pFilterModel) 44 | 45 | 46 | # on model column change, update the model column of the filter and completer as well 47 | def setModelColumn(self, column): 48 | self.completer.setCompletionColumn(column) 49 | self.pFilterModel.setFilterKeyColumn(column) 50 | super(ExtendedComboBox, self).setModelColumn(column) 51 | 52 | 53 | if __name__ == "__main__": 54 | import sys 55 | from PyQt5.QtWidgets import QApplication 56 | from PyQt5.QtCore import QStringListModel 57 | 58 | app = QApplication(sys.argv) 59 | 60 | string_list = ['hola muchachos', 'adios amigos', 'hello world', 'good bye'] 61 | 62 | combo = ExtendedComboBox() 63 | 64 | # either fill the standard model of the combobox 65 | combo.addItems(string_list) 66 | 67 | # or use another model 68 | #combo.setModel(QStringListModel(string_list)) 69 | 70 | combo.resize(300, 40) 71 | combo.show() 72 | 73 | sys.exit(app.exec_()) -------------------------------------------------------------------------------- /JsonView.py: -------------------------------------------------------------------------------- 1 | # 2017 by Gregor Engberding , MIT License 2 | 3 | import sys 4 | 5 | from PyQt5.QtCore import QAbstractItemModel, QModelIndex, Qt , QItemSelectionModel, \ 6 | QDataStream, QByteArray, QJsonDocument, QVariant, QJsonValue, QJsonParseError, \ 7 | pyqtSignal 8 | from PyQt5.QtWidgets import QApplication, QTreeView, QStyledItemDelegate, QAbstractItemView, QMessageBox, QMenu 9 | import json 10 | from PyQt5 import QtCore, QtWidgets,QtGui 11 | from ExtendedComboBox import ExtendedComboBox 12 | 13 | class SelectOnlyDelegate(QStyledItemDelegate): 14 | def __init__(self, parent) -> None: 15 | super().__init__(parent) 16 | def createEditor(self, parent, option: 'QStyleOptionViewItem', index: QtCore.QModelIndex): 17 | editor = super().createEditor(parent, option, index) 18 | editor.setReadOnly(True) 19 | return editor 20 | 21 | class QJsonTreeItem(object): 22 | def __init__(self, parent=None): 23 | 24 | self.mParent = parent 25 | self.mChilds = [] 26 | self.mValue = None 27 | self.mKey = None 28 | 29 | def appendChild(self, item): 30 | self.mChilds.append(item) 31 | 32 | def child(self, row:int): 33 | return self.mChilds[row] 34 | 35 | def parent(self): 36 | return self.mParent 37 | 38 | def childCount(self): 39 | return len(self.mChilds) 40 | 41 | def row(self): 42 | if self.mParent is not None: 43 | return self.mParent.mChilds.index(self) 44 | return 0 45 | 46 | def setKey(self, key:str): 47 | self.mKey = key 48 | 49 | def setValue(self, value:str): 50 | self.mValue = value 51 | 52 | def key(self): 53 | return self.mKey 54 | 55 | def value(self): 56 | return self.mValue 57 | 58 | def load(self, value, parent=None): 59 | 60 | rootItem = QJsonTreeItem(parent) 61 | rootItem.setKey("root") 62 | 63 | if isinstance(value, dict): 64 | # process the key/value pairs 65 | rootItem.setValue("") 66 | for key in value: 67 | v = value[key] 68 | child = self.load(v, rootItem) 69 | child.setKey(key) 70 | rootItem.appendChild(child) 71 | 72 | elif isinstance(value, list): 73 | # process the values in the list 74 | rootItem.setValue("") 75 | for i, v in enumerate(value): 76 | child = self.load(v, rootItem) 77 | child.setKey(str(i)) 78 | if child.value() == "" or child.value() == None: 79 | child.setValue(str(v)) 80 | rootItem.appendChild(child) 81 | 82 | else: 83 | # value is processed 84 | rootItem.setValue(value) 85 | return rootItem 86 | 87 | 88 | class QJsonModel(QAbstractItemModel): 89 | def __init__(self, parent =None): 90 | super().__init__(parent) 91 | self.mRootItem = QJsonTreeItem() 92 | self.mHeaders = ["key","value"] 93 | 94 | def load(self,fileName): 95 | if fileName is None or fileName is False: 96 | return False 97 | with open(fileName, 'r',encoding= 'UTF-8') as fid: 98 | try: 99 | j = json.load(fid) 100 | self.loadJson(j) 101 | except: 102 | print("load json file {} error".format(fileName)) 103 | 104 | def loadJson(self, json): 105 | error = QJsonParseError() 106 | self.mDocument = json 107 | 108 | if self.mDocument is not None: 109 | self.beginResetModel() 110 | if isinstance(self.mDocument, list): 111 | self.mRootItem.load(self.mDocument) 112 | else: 113 | self.mRootItem = self.mRootItem.load(self.mDocument) 114 | self.endResetModel() 115 | 116 | return True 117 | 118 | print("QJsonModel: error loading Json") 119 | return False 120 | 121 | def data(self, index: QModelIndex, role: int = ...): 122 | if not index.isValid(): 123 | return QVariant() 124 | 125 | item = index.internalPointer() 126 | col = index.column() 127 | if role == Qt.DisplayRole or role == Qt.EditRole: 128 | if col == 0: 129 | return str(item.key()) 130 | elif col == 1: 131 | return str(item.value()) 132 | 133 | return QVariant() 134 | 135 | def headerData(self, section: int, orientation: Qt.Orientation, role: int = ...): 136 | if role != Qt.DisplayRole: 137 | return QVariant() 138 | 139 | if orientation == Qt.Horizontal: 140 | return self.mHeaders[section] 141 | 142 | return QVariant() 143 | 144 | def index(self, row: int, column: int, parent: QModelIndex = ...): 145 | if not self.hasIndex(row, column, parent): 146 | return QModelIndex() 147 | 148 | if not parent.isValid(): 149 | parentItem = self.mRootItem 150 | else: 151 | parentItem = parent.internalPointer() 152 | try: 153 | childItem = parentItem.child(row) 154 | return self.createIndex(row, column, childItem) 155 | except IndexError: 156 | return QModelIndex() 157 | 158 | def parent(self, index: QModelIndex): 159 | if not index.isValid(): 160 | return QModelIndex() 161 | 162 | childItem = index.internalPointer() 163 | parentItem = childItem.parent() 164 | 165 | if parentItem == self.mRootItem: 166 | return QModelIndex() 167 | 168 | return self.createIndex(parentItem.row(),0, parentItem) 169 | 170 | def rowCount(self, parent: QModelIndex = ...): 171 | if parent.column() > 0: 172 | return 0 173 | if not parent.isValid(): 174 | parentItem = self.mRootItem 175 | else: 176 | parentItem = parent.internalPointer() 177 | 178 | return parentItem.childCount() 179 | 180 | def columnCount(self, parent: QModelIndex = ...): 181 | return 2 182 | 183 | def flags(self, index: QModelIndex): 184 | return Qt.ItemFlag.ItemIsEnabled | Qt.ItemFlag.ItemIsSelectable | Qt.ItemFlag.ItemIsEditable 185 | 186 | 187 | class JsonView(QTreeView): 188 | hiddened = pyqtSignal('PyQt_PyObject') 189 | plotAction = pyqtSignal('PyQt_PyObject') 190 | def __init__(self, parent =None): 191 | super().__init__(parent) 192 | self.model = QJsonModel() 193 | self.setModel(self.model) 194 | self.resize(520, 435) 195 | self.setWindowTitle("Status") 196 | self.setItemDelegate(SelectOnlyDelegate(self)) 197 | self.setEditTriggers(QAbstractItemView.EditTrigger.DoubleClicked) 198 | # TODO plot the select key 199 | # self.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) 200 | # self.customContextMenuRequested.connect(self.showContextMenu) 201 | 202 | def contextMenuEvent(self, event): 203 | index = self.indexAt(event.pos()) 204 | print(index.column(), self.model.rowCount(index), self.model.rowCount(index.sibling(index.row(), 0))) 205 | if not index.isValid(): 206 | return 207 | kindex = index.sibling(index.row(), 0) 208 | keys = [kindex.data()] 209 | pindex = index.parent() 210 | while pindex.data() != None: 211 | keys.insert(0, pindex.data()) 212 | print(pindex.row(),pindex.column(), pindex.data()) 213 | pindex = pindex.parent() 214 | print("keys", keys) 215 | print("role", index.data(Qt.UserRole)) 216 | if index.column() == 1 and self.model.rowCount(index.sibling(index.row(), 0)) == 0: 217 | menu = QMenu(self) 218 | action0 = menu.addAction("plot in figure 1") 219 | action1 = menu.addAction("plot in figure 2") 220 | action2 = menu.addAction("plot in figure 3") 221 | action = menu.exec_(self.mapToGlobal(event.pos())) 222 | if action == action0: 223 | self.plotAction.emit([keys, 0]) 224 | elif action == action1: 225 | self.plotAction.emit([keys, 1]) 226 | elif action == action2: 227 | self.plotAction.emit([keys, 2]) 228 | 229 | def loadJson(self, bytes_json): 230 | self.model.loadJson(bytes_json) 231 | def loadJsonFile(self, fileName): 232 | self.model.load(fileName) 233 | def closeEvent(self, event): 234 | self.hide() 235 | self.hiddened.emit(True) 236 | 237 | 238 | class DataSelection: 239 | def __init__(self): 240 | self.y_label = QtWidgets.QLabel('Data') 241 | self.y_combo = ExtendedComboBox() 242 | y_form = QtWidgets.QFormLayout() 243 | y_form.addRow(self.y_label,self.y_combo) 244 | self.vbox = QtWidgets.QVBoxLayout() 245 | self.vbox.addLayout(y_form) 246 | 247 | class DataView(QtWidgets.QMainWindow): 248 | closeMsg = pyqtSignal('PyQt_PyObject') 249 | newOneMsg = pyqtSignal('PyQt_PyObject') 250 | dataViewMsg = pyqtSignal('PyQt_PyObject') 251 | plotMsg = pyqtSignal('PyQt_PyObject') 252 | def __init__(self, parent =None): 253 | self.parent = parent 254 | super().__init__(parent) 255 | self.setWindowTitle("DataView") 256 | self._main = QtWidgets.QWidget() 257 | self.setCentralWidget(self._main) 258 | self.layout = QtWidgets.QVBoxLayout(self._main) 259 | self.newbtn = QtWidgets.QPushButton("new",self._main) 260 | self.newbtn.clicked.connect(self.newOne) 261 | self.layout.addWidget(self.newbtn) 262 | self.selection = DataSelection() 263 | self.layout.addLayout(self.selection.vbox) 264 | self.jsonView = JsonView() 265 | self.layout.addWidget(self.jsonView) 266 | self.selection.y_combo.activated.connect(self.dataViewUpdate) 267 | self.jsonView.plotAction.connect(self.plotAction) 268 | 269 | def loadJson(self, data): 270 | self.jsonView.loadJson(data) 271 | self.jsonView.expandToDepth(1) 272 | 273 | def loadJsonFile(self, fileName): 274 | self.jsonView.loadJsonFile(fileName) 275 | self.jsonView.expandToDepth(1) 276 | 277 | def setSelectionItems(self, data): 278 | self.selection.y_combo.addItems(data) 279 | first_k = self.selection.y_combo.currentText() 280 | if first_k != "": 281 | self.setWindowTitle(first_k) 282 | 283 | def newOne(self): 284 | self.newOneMsg.emit(self) 285 | 286 | def dataViewUpdate(self): 287 | first_k = self.selection.y_combo.currentText() 288 | if first_k != "": 289 | self.setWindowTitle(first_k) 290 | self.dataViewMsg.emit(self) 291 | 292 | def closeEvent(self, a0: QtGui.QCloseEvent) -> None: 293 | self.closeMsg.emit(self) 294 | return super().closeEvent(a0) 295 | 296 | def plotAction(self, event): 297 | print("plotAction:", self.selection.y_combo.currentText(),) 298 | self.plotMsg.emit([self.selection.y_combo.currentText(), event[0], event[1]]) 299 | 300 | if __name__ == '__main__': 301 | app = QApplication(sys.argv) 302 | 303 | view = DataView() 304 | view.loadJsonFile("log_config.json") 305 | view.show() 306 | sys.exit(app.exec_()) -------------------------------------------------------------------------------- /LogViewer.py: -------------------------------------------------------------------------------- 1 | from PyQt5 import QtGui 2 | from PyQt5.QtWidgets import QApplication, QWidget, QPlainTextEdit, QVBoxLayout, QHBoxLayout 3 | from PyQt5 import QtGui, QtCore,QtWidgets 4 | import gzip 5 | import re 6 | from loglibPlus import rbktimetodate 7 | 8 | class LogViewer(QWidget): 9 | hiddened = QtCore.pyqtSignal('PyQt_PyObject') 10 | moveHereSignal = QtCore.pyqtSignal('PyQt_PyObject') 11 | def __init__(self): 12 | super().__init__() 13 | self.lines = [] 14 | self.title = "LogViewer" 15 | self.InitWindow() 16 | self.resize(600,800) 17 | self.moveHere_flag = False 18 | 19 | def InitWindow(self): 20 | self.setWindowTitle(self.title) 21 | vbox = QVBoxLayout() 22 | self.plainText = QPlainTextEdit() 23 | self.plainText.setPlaceholderText("This is LogViewer") 24 | self.plainText.setReadOnly(True) 25 | self.plainText.setUndoRedoEnabled(False) 26 | self.plainText.setLineWrapMode(QPlainTextEdit.NoWrap) 27 | self.plainText.setBackgroundVisible(True) 28 | self.plainText.ensureCursorVisible() 29 | self.plainText.contextMenuEvent = self.contextMenuEvent 30 | 31 | hbox = QHBoxLayout() 32 | self.find_edit = QtWidgets.QLineEdit() 33 | self.find_up = QtWidgets.QPushButton("Up") 34 | self.find_up.clicked.connect(self.findUp) 35 | self.find_down = QtWidgets.QPushButton("Down") 36 | self.find_down.clicked.connect(self.findDown) 37 | hbox.addWidget(self.find_edit) 38 | hbox.addWidget(self.find_up) 39 | hbox.addWidget(self.find_down) 40 | vbox.addWidget(self.plainText) 41 | vbox.addLayout(hbox) 42 | self.setLayout(vbox) 43 | self.find_cursor = None 44 | self.find_set_cursor = None 45 | self.highlightFormat = QtGui.QTextCharFormat() 46 | self.highlightFormat.setForeground(QtGui.QColor("red")) 47 | self.plainText.cursorPositionChanged.connect(self.cursorChanged) 48 | self.last_cursor = None 49 | def setText(self, lines): 50 | self.plainText.setPlainText(''.join(lines)) 51 | def setLineNum(self, ln): 52 | if not self.moveHere_flag: 53 | cursor = QtGui.QTextCursor(self.plainText.document().findBlockByLineNumber(ln)) 54 | self.plainText.setTextCursor(cursor) 55 | else: 56 | self.moveHere_flag = False 57 | def closeEvent(self,event): 58 | self.hide() 59 | self.hiddened.emit(True) 60 | def readFilies(self,files): 61 | for file in files: 62 | if os.path.exists(file): 63 | if file.endswith(".log"): 64 | try: 65 | with open(file,'rb') as f: 66 | self.readData(f,file) 67 | except: 68 | continue 69 | else: 70 | try: 71 | with gzip.open(file,'rb') as f: 72 | self.readData(f, file) 73 | except: 74 | continue 75 | self.setText(self.lines) 76 | 77 | # def mousePressEvent(self, event): 78 | # self.popMenu = self.plainText.createStandardContextMenu() 79 | # self.popMenu.addAction('&Move Here',self.moveHere) 80 | # cursor = QtGui.QCursor() 81 | # self.popMenu.exec_(cursor.pos()) 82 | 83 | def contextMenuEvent(self, event): 84 | popMenu = self.plainText.createStandardContextMenu() 85 | popMenu.addAction('&Move Here',self.moveHere) 86 | cursor = QtGui.QCursor() 87 | popMenu.exec_(cursor.pos()) 88 | 89 | def moveHere(self): 90 | cur_cursor = self.plainText.textCursor() 91 | cur_cursor.select(QtGui.QTextCursor.LineUnderCursor) 92 | line = cur_cursor.selectedText() 93 | regex = re.compile("\[(.*?)\].*") 94 | out = regex.match(line) 95 | if out: 96 | self.moveHere_flag = True 97 | mtime = rbktimetodate(out.group(1)) 98 | self.moveHereSignal.emit(mtime) 99 | 100 | def readData(self, f, file): 101 | for line in f.readlines(): 102 | try: 103 | line = line.decode('utf-8') 104 | except UnicodeDecodeError: 105 | try: 106 | line = line.decode('gbk') 107 | except UnicodeDecodeError: 108 | print("{} {}:{}".format(file,"Skipped due to decoding failure!", line)) 109 | continue 110 | self.lines.append(line) 111 | 112 | def findUp(self): 113 | searchStr = self.find_edit.text() 114 | if searchStr != "": 115 | doc = self.plainText.document() 116 | cur_highlightCursor = self.plainText.textCursor() 117 | if self.find_cursor: 118 | if self.find_set_cursor and \ 119 | self.find_set_cursor.position() == cur_highlightCursor.position(): 120 | cur_highlightCursor = QtGui.QTextCursor(self.find_cursor) 121 | cur_highlightCursor.setPosition(cur_highlightCursor.anchor()) 122 | 123 | cur_highlightCursor = doc.find(searchStr, cur_highlightCursor, QtGui.QTextDocument.FindBackward) 124 | if cur_highlightCursor.position() >= 0: 125 | if self.find_cursor: 126 | fmt = QtGui.QTextCharFormat() 127 | self.find_cursor.setCharFormat(fmt) 128 | cur_highlightCursor.movePosition(QtGui.QTextCursor.NoMove,QtGui.QTextCursor.KeepAnchor) 129 | cur_highlightCursor.mergeCharFormat(self.highlightFormat) 130 | self.find_cursor = QtGui.QTextCursor(cur_highlightCursor) 131 | cur_highlightCursor.setPosition(cur_highlightCursor.anchor()) 132 | self.find_set_cursor = cur_highlightCursor 133 | self.plainText.setTextCursor(cur_highlightCursor) 134 | 135 | def findDown(self): 136 | searchStr = self.find_edit.text() 137 | if searchStr != "": 138 | doc = self.plainText.document() 139 | cur_highlightCursor = self.plainText.textCursor() 140 | if self.find_cursor: 141 | if self.find_set_cursor and \ 142 | cur_highlightCursor.position() == self.find_set_cursor.position(): 143 | cur_highlightCursor = QtGui.QTextCursor(self.find_cursor) 144 | cur_highlightCursor.clearSelection() 145 | 146 | cur_highlightCursor = doc.find(searchStr, cur_highlightCursor) 147 | if cur_highlightCursor.position()>=0: 148 | if self.find_cursor: 149 | fmt = QtGui.QTextCharFormat() 150 | self.find_cursor.setCharFormat(fmt) 151 | cur_highlightCursor.movePosition(QtGui.QTextCursor.NoMove,QtGui.QTextCursor.KeepAnchor) 152 | cur_highlightCursor.setCharFormat(self.highlightFormat) 153 | self.find_cursor = QtGui.QTextCursor(cur_highlightCursor) 154 | cur_highlightCursor.clearSelection() 155 | self.find_set_cursor = cur_highlightCursor 156 | self.plainText.setTextCursor(cur_highlightCursor) 157 | 158 | def cursorChanged(self): 159 | 160 | fmt= QtGui.QTextBlockFormat() 161 | fmt.setBackground(QtGui.QColor("light blue")) 162 | cur_cursor = self.plainText.textCursor() 163 | cur_cursor.select(QtGui.QTextCursor.LineUnderCursor) 164 | cur_cursor.setBlockFormat(fmt) 165 | if self.last_cursor: 166 | if cur_cursor.blockNumber() != self.last_cursor.blockNumber(): 167 | fmt = QtGui.QTextBlockFormat() 168 | self.last_cursor.select(QtGui.QTextCursor.LineUnderCursor) 169 | self.last_cursor.setBlockFormat(fmt) 170 | self.last_cursor = self.plainText.textCursor() 171 | 172 | if __name__ == "__main__": 173 | import sys 174 | import os 175 | app = QApplication(sys.argv) 176 | view = LogViewer() 177 | filenames = ["test1.log"] 178 | view.readFilies(filenames) 179 | view.show() 180 | app.exec_() 181 | 182 | -------------------------------------------------------------------------------- /MotorRead.py: -------------------------------------------------------------------------------- 1 | import json, gzip, re 2 | from os import close, name 3 | 4 | def getMotorFromModel(model_path): 5 | path = model_path 6 | file = open(path, "rb") 7 | fileJson = json.load(file) 8 | crop_cells = fileJson["model"] 9 | device_types = fileJson["deviceTypes"] 10 | for type in device_types: 11 | if type["name"] == "motor": 12 | devices = type["devices"] 13 | # print(devices) 14 | file.close() 15 | return devices 16 | 17 | 18 | def getMotorNameTypeDict(model_path): 19 | name_type_dict = {} 20 | for device in getMotorFromModel(model_path): 21 | motor_name = device["name"] 22 | device_params = device["deviceParams"] 23 | for param in device_params: 24 | if param["key"] == "func": 25 | motor_type = param["comboParam"]["childKey"] 26 | name_type_dict[motor_name] = motor_type 27 | # print("name %s: %s" % (motor_name, motor_type)) 28 | return name_type_dict 29 | 30 | def getMotorNameBrandDict(model_path): 31 | name_brand_dict = {} 32 | for device in getMotorFromModel(model_path): 33 | motor_name = device["name"] 34 | device_params = device["deviceParams"] 35 | for param in device_params: 36 | if param["key"] == "brand": 37 | motor_brand = param["comboParam"]["childKey"] 38 | name_brand_dict[motor_name] = motor_brand 39 | # print("name %s: %s" % (motor_name, motor_type)) 40 | return name_brand_dict 41 | 42 | def getMotorNames(model_path): 43 | name_list = [] 44 | for device in getMotorFromModel(model_path): 45 | motor_name = device["name"] 46 | name_list.append(motor_name) 47 | return name_list 48 | 49 | def getNameMotorInfoDict(file_name, motor_name_list): 50 | name_motorinfo = {} 51 | if file_name.endswith(".log"): 52 | try: 53 | file = open(file_name,'rb') 54 | except: 55 | print("fail") 56 | else: 57 | try: 58 | file = gzip.open(file_name,'rb') 59 | except: 60 | print("fail") 61 | 62 | match_dict = {} 63 | for i in motor_name_list: 64 | match_dict[i] = False 65 | 66 | for line in file.readlines(): 67 | try: 68 | line = line.decode('utf-8') 69 | except UnicodeDecodeError: 70 | try: 71 | line = line.decode('gbk') 72 | except UnicodeDecodeError: 73 | continue 74 | regex = re.compile("\[(.*?)\].*\[(.*?)\]\[(.*?)\]") 75 | out = regex.match(line) 76 | if out: 77 | if ("MotorInfo" in out.group(2)) and (not "MotorInfoISO" in out.group(2)): 78 | motor_name = out.group(3).split("|")[10] 79 | match_dict[motor_name] = True 80 | name_motorinfo[motor_name] = out.group(2) 81 | all_match = True 82 | for key in match_dict: 83 | all_match = all_match and match_dict[key] 84 | 85 | if not all_match: 86 | continue 87 | else: 88 | break 89 | # print(name_motorinfo) 90 | file.close() 91 | return name_motorinfo; 92 | 93 | def getNameMotorCmdDict(file_name, motor_name_list): 94 | name_motorcmd = {} 95 | if file_name.endswith(".log"): 96 | try: 97 | file = open(file_name,'rb') 98 | except: 99 | print("fail") 100 | else: 101 | try: 102 | file = gzip.open(file_name,'rb') 103 | except: 104 | print("fail") 105 | 106 | match_dict = {} 107 | for i in motor_name_list: 108 | match_dict[i] = False 109 | 110 | for line in file.readlines(): 111 | try: 112 | line = line.decode('utf-8') 113 | except UnicodeDecodeError: 114 | try: 115 | line = line.decode('gbk') 116 | except UnicodeDecodeError: 117 | continue 118 | regex = re.compile("\[(.*?)\].*\["+"MotorCmd"+"\]\[(.*?)\]") 119 | out = regex.match(line) 120 | if out: 121 | data = out.group(2).split("|") 122 | for index, d in enumerate(range(0, len(data), 2)): 123 | match_dict[data[d]] = True 124 | name_motorcmd[data[d]] = "motor" + str(index) 125 | all_match = True 126 | for key in match_dict: 127 | all_match = all_match and match_dict[key] 128 | 129 | if not all_match: 130 | continue 131 | else: 132 | break 133 | # print(name_motorcmd) 134 | file.close() 135 | return name_motorcmd; 136 | 137 | 138 | if __name__ == "__main__": 139 | print(getMotorNames("robot.model")) 140 | print(getMotorNameTypeDict("robot.model")) 141 | getNameMotorInfoDict("222.log", getMotorNames("robot.model")) 142 | getNameMotorCmdDict("222.log", getMotorNames("robot.model")) -------------------------------------------------------------------------------- /MyToolBar.py: -------------------------------------------------------------------------------- 1 | from matplotlib.backend_tools import ToolBase, ToolToggleBase 2 | import matplotlib.lines as lines 3 | import matplotlib.text as text 4 | import math, os 5 | from matplotlib.backends.backend_qt5agg import FigureCanvas, NavigationToolbar2QT 6 | from PyQt5 import QtGui, QtCore,QtWidgets 7 | from datetime import datetime 8 | from loglibPlus import num2date 9 | from enum import IntEnum 10 | def keepRatio(xmin, xmax, ymin, ymax, fig_ratio, bigger = True): 11 | ax_ratio = (xmax - xmin)/(ymax - ymin) 12 | spanx = xmax - xmin 13 | xmid = (xmax+xmin)/2 14 | spany = ymax - ymin 15 | ymid = (ymax+ymin)/2 16 | if bigger: 17 | if ax_ratio > fig_ratio: 18 | ymax = ymid + spany*ax_ratio/fig_ratio/2 19 | ymin = ymid - spany*ax_ratio/fig_ratio/2 20 | elif ax_ratio < fig_ratio: 21 | xmax = xmid + spanx*fig_ratio/ax_ratio/2 22 | xmin = xmid - spanx*fig_ratio/ax_ratio/2 23 | else: 24 | if ax_ratio < fig_ratio: 25 | ymax = ymid + spany*ax_ratio/fig_ratio/2 26 | ymin = ymid - spany*ax_ratio/fig_ratio/2 27 | elif ax_ratio > fig_ratio: 28 | xmax = xmid + spanx*fig_ratio/ax_ratio/2 29 | xmin = xmid - spanx*fig_ratio/ax_ratio/2 30 | return xmin, xmax, ymin ,ymax 31 | 32 | class TriggleFlag(IntEnum): 33 | ZOOM = 0 34 | PAN = 1 35 | RULER = 2 36 | NONE = 3 37 | class MyToolBar(NavigationToolbar2QT): 38 | toolitems = ( 39 | ('Home', 'Reset original view', 'home', 'home'), 40 | (None, None, None, None), 41 | ('Pan', 42 | 'Left button pans, Right button zooms\n' 43 | 'x/y fixes axis, CTRL fixes aspect', 44 | 'move', 'pan'), 45 | ('Zoom', 'Zoom to rectangle\nx/y fixes axis', 'zoom_to_rect', 'zoom'), 46 | ('Save', 'Save the figure', 'filesave', 'save_figure'), 47 | (None, None, None, None), 48 | ) 49 | def __init__(self, canvas, parent, ruler, coordinates=True): 50 | """coordinates: should we show the coordinates on the right?""" 51 | NavigationToolbar2QT.__init__(self, canvas, parent, False) 52 | icon = QtGui.QIcon("images/ruler_large.png") 53 | a = self.addAction(icon,"ruler", self.ruler) 54 | a.setCheckable(True) 55 | 56 | self._actions["ruler"] = a 57 | self.triggle_mode = TriggleFlag.NONE 58 | self._idPress = None 59 | self._idRelease = None 60 | self._idDrag = None 61 | self._ruler = ruler 62 | self._rulerXY = [] 63 | self._has_home_back = False 64 | 65 | def home(self, *args): 66 | if self._has_home_back: 67 | return True 68 | xmax = None 69 | xmin = None 70 | for a in self.canvas.figure.get_axes(): 71 | ymax = None 72 | ymin = None 73 | lines = a.get_lines() 74 | for l in lines: 75 | data = l.get_data() 76 | if xmax is None and len(data[0]) > 0: 77 | xmax = max(data[0]) 78 | else: 79 | xmax = max(data[0] + [xmax]) 80 | if xmin is None and len(data[0]) > 0: 81 | xmin = min(data[0]) 82 | else: 83 | xmin = min(data[0]+[xmin]) 84 | if ymax is None and len(data[1]) > 0: 85 | ymax = max(data[1]) 86 | else: 87 | ymax = max(data[1]+[ymax]) 88 | if ymin is None and len(data[1]) > 0: 89 | ymin = min(data[1]) 90 | else: 91 | ymin = min(data[1]+[ymin]) 92 | if ymax != None and ymin != None: 93 | dy = (ymax - ymin) * 0.05 94 | a.set_ylim(ymin - dy, ymax + dy) 95 | if xmax != None and xmin != None: 96 | dx = (xmax - xmin) * 0.05 97 | for a in self.canvas.figure.get_axes(): 98 | a.set_xlim(xmin - dx, xmax + dx) 99 | self.canvas.figure.canvas.draw() 100 | 101 | 102 | def update_home_callBack(self, func): 103 | self._has_home_back = True 104 | self._actions["home"].triggered.connect(func) 105 | 106 | 107 | def my_update_buttons_checked(self): 108 | if self.triggle_mode != TriggleFlag.RULER: 109 | if self._idPress is not None: 110 | self._idPress = self.canvas.mpl_disconnect(self._idPress) 111 | if self._idRelease is not None: 112 | self._idRelease = self.canvas.mpl_disconnect(self._idRelease) 113 | elif self.triggle_mode != TriggleFlag.NONE: 114 | if self._actions['pan'].isChecked(): 115 | super().pan(None) 116 | if self._actions['zoom'].isChecked(): 117 | super().zoom(None) 118 | self._actions['ruler'].setChecked(self.triggle_mode == TriggleFlag.RULER) 119 | self._actions['zoom'].setChecked(self.triggle_mode == TriggleFlag.ZOOM) 120 | self._actions['pan'].setChecked(self.triggle_mode == TriggleFlag.PAN) 121 | 122 | def pan(self, *args): 123 | # print("pan", self.triggle_mode) 124 | super().pan(*args) 125 | self.triggle_mode = TriggleFlag.NONE if self.triggle_mode == TriggleFlag.PAN else TriggleFlag.PAN 126 | self.my_update_buttons_checked() 127 | 128 | def zoom(self, *args): 129 | # print("zoom", self.triggle_mode) 130 | super().zoom(*args) 131 | self.triggle_mode = TriggleFlag.NONE if self.triggle_mode == TriggleFlag.ZOOM else TriggleFlag.ZOOM 132 | self.my_update_buttons_checked() 133 | 134 | def ruler(self): 135 | # print("ruler", self.triggle_mode) 136 | """Activate ruler.""" 137 | self.triggle_mode = TriggleFlag.NONE if self.triggle_mode == TriggleFlag.RULER else TriggleFlag.RULER 138 | active = self.triggle_mode == TriggleFlag.RULER 139 | 140 | if active: 141 | self._idPress = self.canvas.mpl_connect('button_press_event', 142 | self.press_ruler) 143 | self._idRelease = self.canvas.mpl_connect('button_release_event', 144 | self.release_ruler) 145 | self.canvas.widgetlock(self) 146 | else: 147 | self.canvas.widgetlock.release(self) 148 | self._ruler.hide_all() 149 | self.canvas.figure.canvas.draw() 150 | 151 | for a in self.canvas.figure.get_axes(): 152 | a.set_navigate_mode(active) 153 | self.my_update_buttons_checked() 154 | 155 | def press_ruler(self, event): 156 | """Callback for mouse button press in Ruler mode.""" 157 | if self.triggle_mode != TriggleFlag.RULER: 158 | return 159 | if event.button == 1 and event.inaxes: 160 | self._button_pressed = 1 161 | else: 162 | self._button_pressed = None 163 | return 164 | self._rulerXY = [[event.xdata, event.ydata],[event.xdata, event.ydata]] 165 | if self._idDrag is not None: 166 | self._idDrag = self.canvas.mpl_disconnect(self._idDrag) 167 | self._idDrag = self.canvas.mpl_connect('motion_notify_event', self.move_ruler) 168 | self._ruler.update(event.inaxes, self._rulerXY) 169 | self._ruler.set_visible(event.inaxes, True) 170 | 171 | def release_ruler(self, event): 172 | """Callback for mouse button release in Ruler mode.""" 173 | if self.triggle_mode != TriggleFlag.RULER: 174 | return 175 | if event.button == 1 and event.inaxes: 176 | self._button_pressed = 1 177 | else: 178 | self._button_pressed = None 179 | return 180 | if self._idDrag is not None: 181 | self._idDrag = self.canvas.mpl_disconnect(self._idDrag) 182 | 183 | def move_ruler(self, event): 184 | """Callback for mouse button move in Ruler mode.""" 185 | if self.triggle_mode != TriggleFlag.RULER: 186 | return 187 | if event.button == 1 and event.inaxes: 188 | self._button_pressed = 1 189 | else: 190 | self._button_pressed = None 191 | return 192 | self._rulerXY[1] = [event.xdata, event.ydata] 193 | self._ruler.update(event.inaxes, self._rulerXY) 194 | self.canvas.figure.canvas.draw() 195 | 196 | def isActive(self): 197 | for a in self._actions: 198 | if self._actions[a].isChecked(): 199 | return True 200 | return False 201 | 202 | class RulerShape: 203 | def __init__(self): 204 | self._lines = [] 205 | self._texts = [] 206 | self._axs = [] 207 | 208 | def clear_rulers(self): 209 | self._lines = [] 210 | self._texts = [] 211 | self._axs = [] 212 | 213 | def add_ruler(self,ax): 214 | ruler_t = text.Text(0, 0, '') 215 | ruler_t.set_bbox(dict(facecolor='white', alpha=0.5)) 216 | ruler_l = lines.Line2D([],[], marker = '+', linestyle = '-', color = 'black', markersize = 10.0) 217 | ruler_t.set_visible(False) 218 | ruler_l.set_visible(False) 219 | ruler_l.set_zorder(101) 220 | ruler_t.set_zorder(100) 221 | ax.add_line(ruler_l) 222 | ax.add_artist(ruler_t) 223 | if ax not in self._axs: 224 | self._lines.append(ruler_l) 225 | self._texts.append(ruler_t) 226 | self._axs.append(ax) 227 | else: 228 | indx = self._axs.index(ax) 229 | self._lines[indx] = ruler_l 230 | self._texts[indx] = ruler_t 231 | 232 | def update(self, ax, data): 233 | indx = self._axs.index(ax) 234 | self._lines[indx].set_xdata([data[0][0],data[1][0]]) 235 | self._lines[indx].set_ydata([data[0][1],data[1][1]]) 236 | (xmin, xmax) = ax.get_xlim() 237 | (ymin, ymax) = ax.get_ylim() 238 | xmid = (xmin + xmax)/2.0 239 | ymid = (ymin + ymax)/2.0 240 | text_x = (data[1][0]+data[0][0])/2.0 241 | text_y = (data[1][1]+data[0][1])/2.0 242 | if ymid < text_y: 243 | self._texts[indx].set_verticalalignment("top") 244 | else: 245 | self._texts[indx].set_verticalalignment("bottom") 246 | if xmid < text_x: 247 | self._texts[indx].set_horizontalalignment("right") 248 | else: 249 | self._texts[indx].set_horizontalalignment("left") 250 | self._texts[indx].set_x(text_x) 251 | self._texts[indx].set_y(text_y) 252 | dx = data[1][0] - data[0][0] 253 | dy = data[1][1] - data[0][1] 254 | ds = math.sqrt(dx * dx + dy * dy) 255 | degree = math.atan2(dy, dx) * 180.0 /math.pi 256 | self._texts[indx].set_text('X:{:.3f} m\nY:{:.3f} m\nD:{:.3f} m\nA:{:.3f}$\degree$'.format(dx, dy, ds, degree)) 257 | 258 | def set_visible(self, ax, value): 259 | indx = self._axs.index(ax) 260 | self._texts[indx].set_visible(value) 261 | self._lines[indx].set_visible(value) 262 | 263 | def hide_all(self): 264 | for t,l in zip(self._texts, self._lines): 265 | t.set_visible(False) 266 | l.set_visible(False) 267 | 268 | class RulerShapeMap(RulerShape): 269 | def __init__(self): 270 | super(RulerShapeMap, self).__init__() 271 | 272 | def update(self, ax, data): 273 | indx = self._axs.index(ax) 274 | self._lines[indx].set_xdata([data[0][0],data[1][0]]) 275 | self._lines[indx].set_ydata([data[0][1],data[1][1]]) 276 | (xmin, xmax) = ax.get_xlim() 277 | (ymin, ymax) = ax.get_ylim() 278 | xmid = (xmin + xmax)/2.0 279 | ymid = (ymin + ymax)/2.0 280 | text_x = (data[1][0]+data[0][0])/2.0 281 | text_y = (data[1][1]+data[0][1])/2.0 282 | if ymid < text_y: 283 | self._texts[indx].set_verticalalignment("top") 284 | else: 285 | self._texts[indx].set_verticalalignment("bottom") 286 | if xmid < text_x: 287 | self._texts[indx].set_horizontalalignment("right") 288 | else: 289 | self._texts[indx].set_horizontalalignment("left") 290 | self._texts[indx].set_x(text_x) 291 | self._texts[indx].set_y(text_y) 292 | dt = data[1][0] - data[0][0] 293 | try: 294 | t1 = num2date(data[1][0]) 295 | t0 = num2date(data[0][0]) 296 | dt = (t1 - t0).total_seconds() 297 | except: 298 | pass 299 | dy = data[1][1] - data[0][1] 300 | dydt = 0 301 | if abs(dt) > 1e-9: 302 | dydt = dy/dt 303 | self._texts[indx].set_text('dY:{:.3e}\ndT:{:.3e} s\n dY/dT:{:.3e}'.format(dy, dt, dydt)) 304 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # LogReader 2 | 从log文件中读取IMU, Odometer, MCLoc, Send, Get, Laser, fatal, error, warning and notice信息 3 | 4 | 使用环境**Python 3.9.12**, 推荐使用[Anaconda](https://www.anaconda.com/download/) 5 | * get_report.py 为生成错误报告的脚本。在命名窗口输入:
python test_get_report.py test1.log test2.log
6 | 将test1.log和test2.log替换为所需的log文件即可 7 | 8 | **将release中的get_report.exe置于rbk目录下,运行get_report.exe可以自动读取diagnosis\\log下的log文件,并生成报告** 9 | * test.py 为调用 loglib.py的示例。在命名窗口输入:
python test.py test1.log test2.log
10 | test1.log, test2.log 为测试读取的log 11 | 12 | * loggui.py 为PyQt5图形化的log解析器 13 | * 使用方式:直接运行即可 14 | * 支持两条曲线比较 15 | * 支持时间窗口选取 16 | * 支持定位(mcl), 里程(odo), 惯性传感器(imu), 下发速度(send), 获取速度(get) 17 | * Evaluate可以输入的参数: 18 | * 定位: mcl.x, mcl.y, mcl.theta, mcl.confidence 19 | * 惯性传感器: imu.yaw, imu.pitch, imu.roll, imu.ax, imu.ay, imu.gz, imu.gx, imu.gy, imu.gz, imu.offx, imu.offy, imu.offz 20 | * 里程: odo.x, odo.y, odo.theta, odo.stop, odo.vx, odo.vy, odo.vw, odo.steer_angle, odo.encode0, odo.encode1, odo.encode2, odo.encode3 21 | * 手动的速度数据: manual.vx, manual.vy, manual.vw, steer_angle 22 | * 下发速度: send.vx, send.vy, send.vw, send.steer_angle, send.max_vx, send.max_vw 23 | * 获取速度:get.vx, get.vy, get.vw, get.steer_angle, get.max_vx, get.max_vw 24 | * 激光里程: laserOdo.ts, laserOdo.x, laserOdo.y, laserOdo.angle 25 | * 电池数据:battery.percentage, battery.current, battery.voltage, battery.ischarging, battery.temperature, battery.cycle 26 | * 控制器数据: controller.tmp, controller.humi, controller.emc, controller.brake, controller.driveremc, controller.autocharge, controller.electric 27 | * 阻挡障碍物信息: stop.x, stop.y, stop.type, stop.id, stop.dist 28 | * 减速障碍物信息: slowdown.x, slowdown.y, slowdown.type, slowdown.id, slowdown.dist 29 | * 传感器融合信息: sensorfuser.localnum, sensorfuser.globalnum 30 | * 激光雷达的数据: laser.ts 31 | 32 | * 打包生成exe文件 33 | 34 |
 pyinstaller -w loggui.py
35 | 或者 36 |
 pyinstaller loggui.spec
37 | * 如果在打包的时候出现字体错误,则先在控制台运行下面的命令 38 | * 如果没有尺子图标,把images文件夹拷贝到dist/loggui文件夹下 39 |
 chcp 65001 
40 | * 图形界面截图 41 | 42 | ![screen shot](screen_shot.PNG) -------------------------------------------------------------------------------- /ReadThread.py: -------------------------------------------------------------------------------- 1 | from PyQt5.QtCore import QThread, pyqtSignal 2 | from loglibPlus import Data, Laser, ErrorLine, WarningLine, ReadLog, FatalLine, NoticeLine, TaskStart, TaskFinish, Service, ParticleState 3 | from loglibPlus import Memory, DepthCamera, RobotStatus 4 | from datetime import timedelta 5 | from datetime import datetime 6 | import os 7 | import json as js 8 | import logging 9 | import math 10 | import time 11 | 12 | def decide_old_imu(gx,gy,gz): 13 | for v in gx: 14 | if abs(round(v) - v) > 1e-5: 15 | return True 16 | for v in gy: 17 | if abs(round(v) - v) > 1e-5: 18 | return True 19 | for v in gz: 20 | if abs(round(v) - v) > 1e-5: 21 | return True 22 | return False 23 | 24 | def rad2LSB(data): 25 | new_data = [v/math.pi*180.0*16.4 for v in data] 26 | return new_data 27 | 28 | def Fdir2Flink(f): 29 | flink = " "+f+"" 30 | return flink 31 | 32 | def printData(data, fid): 33 | try: 34 | print(data, file= fid) 35 | except UnicodeEncodeError: 36 | data = data.encode(errors='ignore') 37 | print(data, file= fid) 38 | return 39 | 40 | class ReadThread(QThread): 41 | signal = pyqtSignal('PyQt_PyObject') 42 | 43 | def __init__(self): 44 | QThread.__init__(self) 45 | self.filenames = [] 46 | self.log_config = "log_config.json" 47 | self.js = dict() 48 | self.content = dict() 49 | self.data = dict() 50 | self.data_org_key = dict() 51 | self.ylabel = dict() 52 | self.laser = Laser(1000.0) 53 | self.err = ErrorLine() 54 | self.war = WarningLine() 55 | self.fatal = FatalLine() 56 | self.notice = NoticeLine() 57 | self.taskstart = TaskStart() 58 | self.taskfinish = TaskFinish() 59 | self.service = Service() 60 | self.memory = Memory() 61 | self.depthcamera = DepthCamera() 62 | self.particle = ParticleState() 63 | self.rstatus = RobotStatus() 64 | self.log = [] 65 | self.tlist = [] 66 | self.cpu_num = 4 67 | self.reader = None 68 | try: 69 | f = open('log_config.json',encoding= 'UTF-8') 70 | self.js = js.load(f) 71 | except FileNotFoundError: 72 | logging.error('Failed to open log_config.json') 73 | self.log.append('Failed to open log_config.json') 74 | 75 | # run method gets called when we start the thread 76 | def run(self): 77 | """读取log""" 78 | #初始化log数据 79 | try: 80 | with open(self.log_config,encoding= 'UTF-8') as f: 81 | self.js = js.load(f) 82 | f.close() 83 | logging.info("Load {}".format(self.log_config)) 84 | self.log.append("Load {}".format(self.log_config)) 85 | except FileNotFoundError: 86 | logging.error("Failed to open {}".format(self.log_config)) 87 | self.log.append("Failed to open {}".format(self.log_config)) 88 | self.content = dict() 89 | content_delay = dict() 90 | for k in self.js: 91 | if "type" in self.js[k] and "content" in self.js[k]: 92 | if k == "LocationEachFrame" or k == "StopPoints" or k == "SlowDownPoints" or self.js[k]["content"] == "key|value": 93 | self.content[self.js[k]["type"]] = Data(self.js[k], self.js[k]["type"]) 94 | else: 95 | if isinstance(self.js[k]['type'], list): 96 | for type in self.js[k]["type"]: 97 | content_delay[type] = Data(self.js[k], type) 98 | elif isinstance(self.js[k]['type'], str): 99 | if self.js[k]['type'] == "Text" and isinstance(self.js[k].get("textKey", None), str): 100 | content_delay[self.js[k]['textKey']] = Data(self.js[k], self.js[k]['type'], self.js[k]['textKey']) 101 | else: 102 | content_delay[self.js[k]['type']] = Data(self.js[k], self.js[k]['type'], None) 103 | self.err = ErrorLine() 104 | self.war = WarningLine() 105 | self.fatal = FatalLine() 106 | self.notice = NoticeLine() 107 | self.taskstart = TaskStart() 108 | self.taskfinish = TaskFinish() 109 | self.service = Service() 110 | self.memory = Memory() 111 | self.depthcamera = DepthCamera() 112 | self.particle = ParticleState() 113 | self.rstatus = RobotStatus() 114 | self.tlist = [] 115 | self.log = [] 116 | self.output_fname = "" 117 | if self.filenames: 118 | if self.reader == None: 119 | self.reader = ReadLog(self.filenames) 120 | else: 121 | self.reader.filenames = self.filenames 122 | self.reader.thread_num = self.cpu_num 123 | time_start=time.time() 124 | self.reader.parse(self.content, self.laser, self.err, 125 | self.war, self.fatal, self.notice, 126 | self.taskstart, self.taskfinish, self.service, 127 | self.memory, self.depthcamera, self.particle, 128 | self.rstatus) 129 | time_end=time.time() 130 | self.log.append('read time cost: ' + str(time_end-time_start)) 131 | self.content.update(content_delay) 132 | #analyze content 133 | # old_imu_flag = False 134 | # if 'IMU' in self.js: 135 | # old_imu_flag = decide_old_imu(self.content['IMU']['gx'], self.content['IMU']['gy'], self.content['IMU']['gz']) 136 | # if old_imu_flag: 137 | # self.content['IMU']['gx'] = rad2LSB(self.content['IMU']['gx']) 138 | # self.content['IMU']['gy'] = rad2LSB(self.content['IMU']['gy']) 139 | # self.content['IMU']['gz'] = rad2LSB(self.content['IMU']['gz']) 140 | # logging.info('The unit of gx, gy, gz in file is rad/s.') 141 | # self.log.append('The unit of gx, gy, gz in file is rad/s.') 142 | # else: 143 | # logging.info('The org unit of gx, gy, gz in IMU is LSB/s.') 144 | # self.log.append('The org unit of gx, gy, gz in IMU is LSB/s.') 145 | tmp_tlist = self.err.t() + self.fatal.t() + self.notice.t() + self.memory.t() + self.service.t() 146 | tmax, tmin = None, None 147 | if len(tmp_tlist) > 0: 148 | tmax = max(self.err.t() + self.fatal.t() + self.notice.t() + self.memory.t() + self.service.t()) 149 | tmin = min(self.err.t() + self.fatal.t() + self.notice.t() + self.memory.t() + self.service.t()) 150 | if tmax != None: 151 | tmax = max(tmax, self.reader.tmax) 152 | else: 153 | tmax = self.reader.tmax 154 | if tmin != None: 155 | tmin = min(tmin, self.reader.tmin) 156 | else: 157 | tmin = self.reader.tmin 158 | dt = tmax - tmin 159 | self.tlist = [tmin, tmax] 160 | #save Error 161 | ts = datetime.now().strftime("%Y-%m-%d_%H-%M-%S") 162 | self.output_fname = "Report_" + str(ts).replace(':','-').replace(' ','_') + ".txt" 163 | path = os.path.dirname(self.filenames[0]) 164 | self.output_fname = path + "/" + self.output_fname 165 | self.log.append("Report File:" + Fdir2Flink(self.output_fname)) 166 | fid = open(self.output_fname,"w") 167 | print("="*20, file = fid) 168 | print("Files: ", self.filenames, file = fid) 169 | print(len(self.fatal.content()[0]), " FATALs, ", len(self.err.content()[0]), " ERRORs, ", 170 | len(self.war.content()[0]), " WARNINGs, ", len(self.notice.content()[0]), " NOTICEs", file = fid) 171 | self.log.append(str(len(self.fatal.content()[0])) + " FATALs, " + str(len(self.err.content()[0])) + 172 | " ERRORs, " + str(len(self.war.content()[0])) + " WARNINGs, " + str(len(self.notice.content()[0])) + " NOTICEs") 173 | print("FATALs:", file = fid) 174 | for data in self.fatal.content()[0]: 175 | printData(data, fid) 176 | print("ERRORs:", file = fid) 177 | for data in self.err.content()[0]: 178 | printData(data, fid) 179 | print("WARNINGs:", file = fid) 180 | for data in self.war.content()[0]: 181 | printData(data, fid) 182 | print("NOTICEs:", file = fid) 183 | for data in self.notice.content()[0]: 184 | printData(data, fid) 185 | fid.close() 186 | #creat dic 187 | for k in self.content.keys(): 188 | for name in self.content[k].data.keys(): 189 | if name != 't': 190 | self.data[k+'.'+name] = (self.content[k][name], self.content[k]['t']) 191 | self.ylabel[k+'.'+name] = self.content[k].description[name] 192 | self.data_org_key[k+'.'+name] = k 193 | if 'IMU' in self.js: 194 | self.data["IMU.org_gx"] = ([i+j for (i,j) in zip(self.content['IMU']['gx'],self.content['IMU']['offx'])], self.content['IMU']['t']) 195 | self.data["IMU.org_gy"] = ([i+j for (i,j) in zip(self.content['IMU']['gy'],self.content['IMU']['offy'])], self.content['IMU']['t']) 196 | self.data["IMU.org_gz"] = ([i+j for (i,j) in zip(self.content['IMU']['gz'],self.content['IMU']['offz'])], self.content['IMU']['t']) 197 | self.ylabel["IMU.org_gx"] = "原始的gx degree/s" 198 | self.ylabel["IMU.org_gy"] = "原始的gy degree/s" 199 | self.ylabel["IMU.org_gz"] = "原始的gz degree/s" 200 | self.data_org_key["IMU.org_gx"] = "IMU" 201 | self.data_org_key["IMU.org_gy"] = "IMU" 202 | self.data_org_key["IMU.org_gz"] = "IMU" 203 | 204 | self.data.update({"memory.used_sys":self.memory.used_sys(), "memory.free_sys":self.memory.free_sys(), "memory.rbk_phy": self.memory.rbk_phy(), 205 | "memory.rbk_vir":self.memory.rbk_vir(),"memory.rbk_max_phy":self.memory.rbk_max_phy(),"memory.rbk_max_vir":self.memory.rbk_max_vir(), 206 | "memory.cpu":self.memory.rbk_cpu(),"memory.sys_cpu":self.memory.sys_cpu()}) 207 | self.ylabel.update({"memory.used_sys": "used_sys MB", "memory.free_sys":"free_sys MB", "memory.rbk_phy": "rbk_phy MB", 208 | "memory.rbk_vir":"rbk_vir MB","memory.rbk_max_phy":"rbk_max_phy MB","memory.rbk_max_vir":"rbk_max_vir MB", 209 | "memory.cpu":"cpu %", "memory.sys_cpu":"sys_cpu %"}) 210 | 211 | for k in self.laser.datas.keys(): 212 | self.data["laser"+str(k)+'.'+"ts"] = self.laser.ts(k) 213 | self.data["laser"+str(k)+'.'+"number"] = self.laser.number(k) 214 | self.ylabel["laser"+str(k)+'.'+"ts"] = "激光的时间戳" 215 | self.ylabel["laser"+str(k)+'.'+"number"] = "激光的id" 216 | 217 | self.data["depthcamera.number"] = self.depthcamera.number() 218 | self.data["depthcamera.ts"] = self.depthcamera.ts() 219 | self.ylabel["depthcamera.number"] = "深度摄像头id" 220 | self.ylabel["depthcamera.ts"] = "深度摄像头时间戳" 221 | 222 | self.data["particle.number"] = self.particle.number() 223 | self.data["particle.ts"] = self.particle.ts() 224 | self.ylabel["particle.number"] = "粒子数目" 225 | self.ylabel["particle.ts"] = "粒子时间戳" 226 | 227 | self.signal.emit(self.filenames) 228 | 229 | def getData(self, vkey): 230 | if vkey in self.data: 231 | if not self.data[vkey][0]: 232 | if vkey in self.data_org_key: 233 | org_key = self.data_org_key[vkey] 234 | if not self.content[org_key].parsed_flag: 235 | # time_start=time.time() 236 | self.content[org_key].parse_now(self.reader.lines) 237 | for name in self.content[org_key].data.keys(): 238 | if name != 't': 239 | self.ylabel[org_key+'.'+name] = self.content[org_key].description[name] 240 | # time_end=time.time() 241 | # print('real read time cost: ' + str(time_end-time_start)) 242 | tmp = vkey.split(".") 243 | k = tmp[0] 244 | name = tmp[1] 245 | if k == "IMU" and "org" in name: 246 | if len(name) == 6: 247 | g = name[4::] #org_gx, org_gy, org_gz 248 | off = "off" + name[-1] #offx, offy, offz 249 | self.data[vkey] = ([i+j for (i,j) in zip(self.content[k][g],self.content[k][off])], self.content[k]['t']) 250 | else: 251 | self.data[vkey] = ([], []) 252 | else: 253 | self.data[vkey] = (self.content[k][name], self.content[k]['t']) 254 | return self.data[vkey] 255 | else: 256 | return [[],[]] 257 | 258 | def getReportFileAddr(self): 259 | return self.output_fname 260 | 261 | 262 | -------------------------------------------------------------------------------- /TargetPrecision.py: -------------------------------------------------------------------------------- 1 | from datetime import datetime 2 | import matplotlib 3 | matplotlib.use('Qt5Agg') 4 | from matplotlib.backends.backend_qt5agg import ( 5 | FigureCanvas, NavigationToolbar2QT as NavigationToolbar) 6 | from matplotlib.figure import Figure 7 | import matplotlib.lines as lines 8 | from matplotlib.patches import Circle, Polygon 9 | from PyQt5 import QtGui, QtCore,QtWidgets 10 | from PyQt5.QtCore import QThread, pyqtSignal, pyqtSlot,Qt 11 | import numpy as np 12 | import json as js 13 | import os 14 | from MyToolBar import MyToolBar, keepRatio, RulerShape, RulerShapeMap 15 | from matplotlib.path import Path 16 | import matplotlib.patches as patches 17 | from matplotlib.textpath import TextPath 18 | import math 19 | import logging 20 | import copy 21 | import time 22 | from matplotlib.collections import LineCollection 23 | from matplotlib.patches import Circle 24 | from matplotlib.collections import PatchCollection 25 | from ReadThread import ReadThread 26 | import logging 27 | from datetime import timedelta 28 | from loglibPlus import num2date, date2num 29 | from MapWidget import normalize_theta_deg, Pos2Base, GetGlobalPos, P2G 30 | class TargetPrecision(QtWidgets.QWidget): 31 | dropped = pyqtSignal('PyQt_PyObject') 32 | hiddened = pyqtSignal('PyQt_PyObject') 33 | def __init__(self, loggui = None): 34 | super(QtWidgets.QWidget, self).__init__() 35 | self.setWindowTitle('TargetPrecision') 36 | self.robot_log = loggui 37 | self.log_data = None 38 | if self.robot_log is not None: 39 | self.log_data = self.robot_log.read_thread 40 | self.targetName = "" 41 | self.xdata = [] 42 | self.ydata = [] 43 | self.adata = [] 44 | self.tdata = [] 45 | self.draw_size = [] 46 | self.xy_data_old = lines.Line2D([],[], marker = '.', linestyle = '', markersize=10, color= 'darkblue') # 当前时间线之前的数据 47 | self.xy_data_new = lines.Line2D([],[], marker = '.', linestyle = '', markersize=10, color= 'skyblue') # 当前时间线之后的数据 48 | self.map_xy = lines.Line2D([],[], marker = '*', linestyle = '', markersize=10, color='r') 49 | self.map_x = lines.Line2D([],[], linestyle = '-', markersize=10, color= 'r') 50 | self.map_y = lines.Line2D([],[], linestyle = '-', markersize=10, color='r') 51 | self.map_a = lines.Line2D([],[], linestyle = '-', markersize=10, color='r') 52 | self.mid_xy = lines.Line2D([],[], marker = 'x', linestyle = '', markersize=10, color= 'g') 53 | self.mid_x = lines.Line2D([],[], linestyle = '-', markersize=10, color= 'g') 54 | self.mid_y = lines.Line2D([],[], linestyle = '-', markersize=10, color='g') 55 | self.mid_a = lines.Line2D([],[], linestyle = '-', markersize=10, color='g') 56 | self.px_data = lines.Line2D([],[], marker = '.', linestyle = '', markersize=10) 57 | self.py_data = lines.Line2D([],[], marker = '.', linestyle = '', markersize=10) 58 | self.pa_data = lines.Line2D([],[], marker = '.', linestyle = '', markersize=10) 59 | self.setupUI() 60 | 61 | def mouse_press(self, event): 62 | if not event.inaxes: 63 | return 64 | if event.button == 3: 65 | self.popMenu = QtWidgets.QMenu(self) 66 | self.popMenu.addAction('&Save Data',lambda:self.saveData()) 67 | cursor = QtGui.QCursor() 68 | self.popMenu.exec_(cursor.pos()) 69 | 70 | def saveData(self): 71 | fname, _ = QtWidgets.QFileDialog.getSaveFileName(self,"选取log文件", "","PY Files (*.py)") 72 | # 获取数据 73 | outdata = [] 74 | xdata = 'x='+str(self.xdata) 75 | ydata = 'y='+str(self.ydata) 76 | adata = "a="+str(self.adata) 77 | outdata.append(xdata) 78 | outdata.append(ydata) 79 | outdata.append(adata) 80 | # 写数据 81 | if fname: 82 | try: 83 | with open(fname, 'w') as fn: 84 | for d in outdata: 85 | fn.write(d+'\n') 86 | except: 87 | pass 88 | 89 | def analysis(self): 90 | self.targetName = "Task finished : "+ self.find_edit.text()+"]" 91 | sleepTime = float(self.st_edit.text()) 92 | logging.debug("Analysis target: {}. Sleep Time {}".format(self.targetName, sleepTime)) 93 | sleepTime = timedelta(seconds=sleepTime) 94 | if not isinstance(self.log_data, ReadThread): 95 | logging.debug("log_data type is error. {}".format(type(self.log_data))) 96 | return 97 | if 'LocationEachFrame' not in self.log_data.content: 98 | logging.debug("LocationEachFrame is not in the log") 99 | return 100 | map_x = None # 地图点的坐标 101 | map_y = None 102 | map_a = None 103 | try: 104 | lm_id = self.find_edit.text() 105 | lm_name = "" 106 | self.ax.set_title('') 107 | if lm_id in self.robot_log.map_widget.read_map.p_names: 108 | lm_id = self.robot_log.map_widget.read_map.p_names[lm_id] 109 | if lm_id in self.robot_log.map_widget.read_map.points: 110 | m_xy = self.robot_log.map_widget.read_map.points[lm_id] 111 | map_x = [m_xy[0]] 112 | map_y = [m_xy[1]] 113 | map_a = [m_xy[2]/math.pi *180.0] 114 | print("map_a", map_a) 115 | lm_name = m_xy[3] 116 | self.ax.set_title(lm_name) 117 | except: 118 | pass 119 | data = self.log_data.taskfinish.content() 120 | print("map_a", map_a, "finish data ", len(data[1])) 121 | valid = [] 122 | vx = self.log_data.getData('Speed2DSP.vx')[0] 123 | vy = self.log_data.content['Speed2DSP']['vy'] 124 | vt = np.array(self.log_data.content['Speed2DSP']['t']) 125 | if self.choose.currentText() == 'Localization': 126 | locx = self.log_data.content['LocationEachFrame']['x'] 127 | locy = self.log_data.content['LocationEachFrame']['y'] 128 | loca = self.log_data.content['LocationEachFrame']['theta'] 129 | loc_t = np.array(self.log_data.content['LocationEachFrame']['t']) 130 | valid = [1.0 for _ in loc_t] 131 | elif self.choose.currentText() == 'pgv0': 132 | map_x = [0] 133 | map_y = [0] 134 | map_a = [0] 135 | locx = self.log_data.getData('pgv0.tag_x')[0] 136 | locy = self.log_data.content['pgv0']['tag_y'] 137 | loca = self.log_data.content['pgv0']['tag_angle'] 138 | loc_t = np.array(self.log_data.content['pgv0']['t']) 139 | valid = self.log_data.content['pgv0']['is_DMT_detected'] 140 | elif self.choose.currentText() == 'pgv1': 141 | map_x = [0] 142 | map_y = [0] 143 | map_a = [0] 144 | locx = self.log_data.getData('pgv1.tag_x')[0] 145 | locy = self.log_data.content['pgv1']['tag_y'] 146 | loca = self.log_data.content['pgv1']['tag_angle'] 147 | loc_t = np.array(self.log_data.content['pgv1']['t']) 148 | valid = self.log_data.content['pgv1']['is_DMT_detected'] 149 | elif self.choose.currentText() == 'SimLocation': 150 | locx = self.log_data.getData('SimLocation.x')[0] 151 | locy = self.log_data.content['SimLocation']['y'] 152 | loca = self.log_data.content['SimLocation']['theta'] 153 | loc_t = np.array(self.log_data.content['SimLocation']['t']) 154 | valid = [1.0 for _ in loc_t] 155 | elif self.choose.currentText() == 'OptLocation': 156 | locx = self.log_data.getData('OptLocation.x')[0] 157 | locy = self.log_data.content['OptLocation']['y'] 158 | loca = self.log_data.content['OptLocation']['theta'] 159 | loc_t = np.array(self.log_data.content['OptLocation']['t']) 160 | valid = [1.0 for _ in loc_t] 161 | else: 162 | logging.debug("source name is wrong! {}".format(self.choose.currentText())) 163 | if len(loc_t) < 1: 164 | logging.debug("data time is emtpy {}".format(self.choose.currentText())) 165 | return 166 | last_ind = 0 167 | mid_t = self.robot_log.mid_line_t # 中间线的时间 168 | tmid = None # 对应的序号 169 | xdata = [] 170 | ydata = [] 171 | adata = [] 172 | tdata = [] 173 | tl, tr = None, None 174 | drange = self.r.currentText() 175 | if drange == "View": 176 | xmin, xmax = self.robot_log.axs[0].get_xlim() 177 | tl = num2date(xmin) 178 | tr = num2date(xmax) 179 | elif drange == "Selection": 180 | tl = self.robot_log.left_line_t 181 | tr = self.robot_log.right_line_t 182 | if tl is not None and tr is not None and tl >= tr: 183 | # 如果左边大于右边则忽略 184 | tl = None 185 | tr = None 186 | goal_pos = None # 地图点的坐标 187 | if map_a != None and map_x != None and map_y != None: 188 | goal_pos = [copy.deepcopy(map_x[0]), copy.deepcopy(map_y[0]), copy.deepcopy(map_a[0])/180.0*math.pi] 189 | map_x[0] = 0 190 | map_y[0] = 0 191 | map_a[0] = 0 192 | regex = None 193 | if self.s_edit.text() != "": 194 | regex = self.s_edit.text()+"]" 195 | for ind, t in enumerate(data[1]): 196 | if self.targetName in data[0][ind]: 197 | ok_ind = False 198 | if regex == None: 199 | ok_ind = True 200 | else: 201 | if ind > 0: 202 | if regex in data[0][ind-1].split(" ")[-1]: 203 | ok_ind = True 204 | if not ok_ind: 205 | continue 206 | t = t + sleepTime 207 | 208 | if tl is not None and tr is not None: 209 | if t < tl or t > tr: 210 | continue 211 | if tmid == None and mid_t != None and t > mid_t: 212 | tmid = len(xdata) # 中间线的序号 213 | # 如果到点的速度很大表示,这个是中间点 214 | if len(vt) > 0: 215 | v_idx = (np.abs(vt - t)).argmin() 216 | vl_idx = v_idx 217 | vr_idx = v_idx 218 | if vr_idx + 1 < len(vt): 219 | vr_idx += 1 220 | if vl_idx - 1 >= 0: 221 | vl_idx -= 1 222 | if (abs(vx[vl_idx]) > 0.0001 or abs(vy[vl_idx]) > 0.0001) \ 223 | and (abs(vx[vr_idx]) > 0.0001 or abs(vy[vr_idx]) > 0.0001) \ 224 | and (abs(vx[v_idx]) > 0.0001 or abs(vy[v_idx]) > 0.0001): 225 | continue 226 | loc_idx = (np.abs(loc_t - t)).argmin() 227 | if loc_idx+1 < len(loc_t): 228 | loc_idx += 1 229 | if valid[loc_idx] > 0.1: 230 | if goal_pos != None: 231 | tmp_pos = [locx[loc_idx],locy[loc_idx],loca[loc_idx]/180.0*math.pi] 232 | 233 | pos2goal = Pos2Base(tmp_pos, goal_pos) # 转换成地图点坐标系 234 | xdata.append(pos2goal[0]) 235 | ydata.append(pos2goal[1]) 236 | adata.append(pos2goal[2]/math.pi*180.0) 237 | else: 238 | xdata.append(locx[loc_idx]) 239 | ydata.append(locy[loc_idx]) 240 | adata.append(loca[loc_idx]) 241 | tdata.append(loc_t[loc_idx]) 242 | if len(xdata) < 1 or len(ydata) < 1 or len(adata) < 1: 243 | title = "cannot find target name: {}".format(lm_id) 244 | logging.debug("cannot find target name: {}".format(lm_id)) 245 | self.ax.set_title(title) 246 | else: 247 | mx = float(self.mx_edit.text()) 248 | my = float(self.my_edit.text()) 249 | new_xdata = [] 250 | new_ydata = [] 251 | for it in range(len(xdata)): 252 | new_d = GetGlobalPos([mx, my], [xdata[it], ydata[it], adata[it]/180.0*math.pi]) 253 | new_xdata.append(new_d[0]) 254 | new_ydata.append(new_d[1]) 255 | org_xdata = xdata 256 | org_ydata = ydata 257 | xdata = new_xdata 258 | ydata = new_ydata 259 | out_xmin = min(xdata) 260 | out_xmax = max(xdata) 261 | out_xrange = (out_xmax - out_xmin) *1000 262 | out_xmid = 0 263 | if len(org_xdata) > 0: 264 | out_xmid = sum(org_xdata)/len(org_xdata) 265 | out_x_off = 0 266 | if map_x != None: 267 | out_x_off = (map_x[0] - out_xmid)*1000 268 | print("x", out_xmid, out_x_off, map_x[0]) 269 | 270 | out_ymin = min(ydata) 271 | out_ymax = max(ydata) 272 | out_yrange = (out_ymax-out_ymin)*1000 273 | out_ymid = 0 274 | if len(org_ydata) > 0: 275 | out_ymid = sum(org_ydata)/len(org_ydata) 276 | out_y_off = 0 277 | if map_y != None: 278 | out_y_off = (map_y[0] - out_ymid)*1000 279 | print("y",out_ymid, out_y_off, map_y[0]) 280 | 281 | out_amax = adata[0] 282 | out_amin = adata[0] 283 | for i, a in enumerate(adata): 284 | if i > 0: 285 | dtheta_max = normalize_theta_deg(out_amax - a) 286 | if dtheta_max < 0: 287 | out_amax = a 288 | else: 289 | dtheta_min = normalize_theta_deg(out_amin- a) 290 | if dtheta_min > 0: 291 | out_amin = a 292 | out_arange = normalize_theta_deg(out_amax - out_amin) 293 | out_amid = 0 294 | suma = adata[0] 295 | last_a = adata[0] 296 | for i, a in enumerate(adata): 297 | if i > 0: 298 | dtheta = normalize_theta_deg(a - last_a) 299 | last_a = dtheta + last_a 300 | suma += last_a 301 | out_amid = suma /(len(adata) * 1.0) 302 | out_a_off = 0 303 | if map_a != None: 304 | out_a_off = normalize_theta_deg((map_a[0] - out_amid)) 305 | print("a",out_amid, out_a_off, map_a[0]) 306 | result_str = "{}次到点{}\n".format(len(xdata), lm_name) 307 | result_str += "重复到点误差 x = {:4.1f} mm, y= {:4.1f} mm, theta = {:4.1f} ° \n".format( out_xrange, out_yrange, out_arange) 308 | result_str += "绝对到点误差 x = {:4.1f} mm, y= {:4.1f} mm, theta = {:4.1f} ° \n".format(out_x_off, out_y_off, out_a_off) 309 | if goal_pos != None: 310 | pos2map = P2G([out_xmid, out_ymid, out_amid/180.0*math.pi], goal_pos) # 转换成地图点坐标系 311 | result_str += "平均坐标 {:4.3f}, {:4.3f}, {:4.3f} °".format(pos2map[0], pos2map[1], pos2map[2]/math.pi*180.0) 312 | else: 313 | result_str += "平均坐标 {:4.3f}, {:4.3f}, {:4.3f} °".format(out_xmid, out_ymid, out_amid) 314 | self.result_label.setText(result_str) 315 | 316 | self.xdata = xdata 317 | self.ydata = ydata 318 | self.adata = adata 319 | self.tdata = tdata 320 | if tmid == None: 321 | self.xy_data_old.set_xdata(self.xdata) 322 | self.xy_data_old.set_ydata(self.ydata) 323 | self.xy_data_new.set_xdata([]) 324 | self.xy_data_new.set_ydata([]) 325 | else: 326 | self.xy_data_old.set_xdata(self.xdata[:tmid]) 327 | self.xy_data_old.set_ydata(self.ydata[:tmid]) 328 | self.xy_data_new.set_xdata(self.xdata[tmid:]) 329 | self.xy_data_new.set_ydata(self.ydata[tmid:]) 330 | self.px_data.set_xdata(self.tdata) 331 | self.px_data.set_ydata(self.xdata) 332 | self.py_data.set_xdata(self.tdata) 333 | self.py_data.set_ydata(self.ydata) 334 | self.pa_data.set_xdata(self.tdata) 335 | self.pa_data.set_ydata(self.adata) 336 | 337 | mid_x = [sum(self.xdata)*1.0/len(self.xdata)] 338 | mid_y = [sum(self.ydata)*1.0/len(self.ydata)] 339 | mid_a = [sum(self.adata)*1.0/len(self.adata)] 340 | self.mid_xy.set_xdata(mid_x) 341 | self.mid_xy.set_ydata(mid_y) 342 | self.mid_x.set_xdata(self.tdata) 343 | self.mid_x.set_ydata(mid_x*len(self.tdata)) 344 | self.mid_y.set_xdata(self.tdata) 345 | self.mid_y.set_ydata(mid_y*len(self.tdata)) 346 | self.mid_a.set_xdata(self.tdata) 347 | self.mid_a.set_ydata(mid_a*len(self.tdata)) 348 | 349 | if map_x != None and map_y != None and map_a != None: 350 | self.map_xy.set_xdata(map_x) 351 | self.map_xy.set_ydata(map_y) 352 | self.map_x.set_xdata(self.tdata) 353 | self.map_x.set_ydata(map_x*len(self.tdata)) 354 | self.map_y.set_xdata(self.tdata) 355 | self.map_y.set_ydata(map_y*len(self.tdata)) 356 | self.map_a.set_xdata(self.tdata) 357 | self.map_a.set_ydata(map_a*len(self.tdata)) 358 | tmpx = xdata + map_x 359 | tmpy = ydata + map_y 360 | tmpa = adata + map_a 361 | else: 362 | tmpx = xdata 363 | tmpy = ydata 364 | tmpa = adata 365 | 366 | xmin, ymin ,amin, tmin = 0.,0.,0.,0. 367 | xmax, ymax, amax, tmax = 1.,1.,1.,1. 368 | xrange, yrange, arange = 0., 0., 0. 369 | xmin = min(tmpx) 370 | xmax = max(tmpx) 371 | xrange = xmax - xmin 372 | if xrange < 1e-6: 373 | xrange = 1e-6 374 | ymin = min(tmpy) 375 | ymax = max(tmpy) 376 | yrange = ymax - ymin 377 | if yrange < 1e-6: 378 | yrange = 1e-6 379 | amin = min(tmpa) 380 | amax = max(tmpa) 381 | arange = amax - amin 382 | if arange < 1e-6: 383 | arange = 1e-6 384 | tmin = min(tdata) 385 | tmax = max(tdata) 386 | if tmin == tmax: 387 | tmax = num2date(date2num(tmin) + 0.0001) 388 | tmin = num2date(date2num(tmin) - 0.0001) 389 | xmin = xmin - 0.05 * xrange 390 | xmax = xmax + 0.05 * xrange 391 | ymin = ymin - 0.05 * yrange 392 | ymax = ymax + 0.05 * yrange 393 | amin = amin - 0.05 * arange 394 | amax = amax + 0.05 * arange 395 | 396 | self.ax.set_xlim(xmin, xmax) 397 | self.ax.set_ylim(ymin, ymax) 398 | 399 | 400 | for a in self.paxs: 401 | a.set_xlim(tmin, tmax) 402 | self.paxs[0].set_ylim(xmin, xmax) 403 | self.paxs[1].set_ylim(ymin, ymax) 404 | self.paxs[2].set_ylim(amin, amax) 405 | self.static_canvas.figure.canvas.draw() 406 | self.pstatic_canvas.figure.canvas.draw() 407 | 408 | def setupUI(self): 409 | self.static_canvas = FigureCanvas(Figure(figsize=(4,4))) 410 | self.static_canvas.setSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) 411 | self.static_canvas.figure.subplots_adjust(left = 0.1, right = 0.95, bottom = 0.1, top = 0.95) 412 | self.static_canvas.figure.tight_layout() 413 | self.ax = self.static_canvas.figure.subplots(1, 1) 414 | self.ax.add_line(self.xy_data_old) 415 | self.ax.add_line(self.xy_data_new) 416 | self.ax.add_line(self.map_xy) 417 | self.ax.add_line(self.mid_xy) 418 | self.ax.grid(True) 419 | self.ax.axis('auto') 420 | self.ax.set_xlabel('x (m)') 421 | self.ax.set_ylabel('y (m)') 422 | self.ruler = RulerShape() 423 | self.ruler.add_ruler(self.ax) 424 | self.toolbar = MyToolBar(self.static_canvas, self, ruler = self.ruler) 425 | w0 = QtWidgets.QWidget() 426 | v0 = QtWidgets.QVBoxLayout() 427 | v0.addWidget(self.toolbar) 428 | v0.addWidget(self.static_canvas) 429 | w0.setLayout(v0) 430 | 431 | self.pstatic_canvas = FigureCanvas(Figure(figsize=(6,6))) 432 | self.pstatic_canvas.setSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) 433 | self.pstatic_canvas.figure.subplots_adjust(left = 0.1, right = 0.95, bottom = 0.1, top = 0.95) 434 | self.pstatic_canvas.figure.tight_layout() 435 | self.paxs= self.pstatic_canvas.figure.subplots(3, 1, sharex = True) 436 | self.paxs[0].add_line(self.px_data) 437 | self.paxs[0].add_line(self.map_x) 438 | self.paxs[0].add_line(self.mid_x) 439 | self.paxs[0].set_ylabel('x (m)') 440 | self.paxs[1].add_line(self.py_data) 441 | self.paxs[1].add_line(self.map_y) 442 | self.paxs[1].add_line(self.mid_y) 443 | self.paxs[1].set_ylabel('y (m)') 444 | self.paxs[2].add_line(self.pa_data) 445 | self.paxs[2].add_line(self.map_a) 446 | self.paxs[2].add_line(self.mid_a) 447 | self.paxs[2].set_ylabel('theta (degree)') 448 | self.pruler = RulerShapeMap() 449 | for a in self.paxs: 450 | a.grid(True) 451 | a.axis('auto') 452 | self.pruler.add_ruler(a) 453 | self.ptoolbar = MyToolBar(self.pstatic_canvas, self, ruler = self.pruler) 454 | w1 = QtWidgets.QWidget() 455 | v1 = QtWidgets.QVBoxLayout() 456 | v1.addWidget(self.ptoolbar) 457 | v1.addWidget(self.pstatic_canvas) 458 | w1.setLayout(v1) 459 | 460 | self.find_label = QtWidgets.QLabel("Target Name:") 461 | valid = QtGui.QIntValidator() 462 | self.find_edit = QtWidgets.QLineEdit() 463 | self.find_edit.setValidator(valid) 464 | 465 | 466 | self.find_up = QtWidgets.QPushButton("Analysis") 467 | self.find_up.clicked.connect(self.analysis) 468 | hbox = QtWidgets.QHBoxLayout() 469 | hbox.addWidget(self.find_label) 470 | hbox.addWidget(self.find_edit) 471 | hbox.addWidget(self.find_up) 472 | 473 | self.stime_msg = QtWidgets.QLabel("SleepTime:") 474 | valid = QtGui.QDoubleValidator() 475 | self.st_edit = QtWidgets.QLineEdit("0.5") 476 | self.st_edit.setValidator(valid) 477 | hbox_s = QtWidgets.QFormLayout() 478 | hbox_s.addRow(self.stime_msg, self.st_edit) 479 | 480 | self.r_msg = QtWidgets.QLabel("Range:") 481 | self.r = QtWidgets.QComboBox() 482 | self.r.addItem("All") 483 | self.r.addItem("Selection") 484 | self.r.addItem("View") 485 | hbox_r = QtWidgets.QFormLayout() 486 | hbox_r.addRow(self.r_msg, self.r) 487 | 488 | hbox_st = QtWidgets.QHBoxLayout() 489 | hbox_st.addLayout(hbox_s) 490 | hbox_st.addLayout(hbox_r) 491 | 492 | 493 | self.choose_msg = QtWidgets.QLabel("Source:") 494 | self.choose = QtWidgets.QComboBox() 495 | self.choose.addItem("Localization") 496 | self.choose.addItem("pgv0") 497 | self.choose.addItem("pgv1") 498 | self.choose.addItem("SimLocation") 499 | self.choose.addItem("OptLocation") 500 | hbox2 = QtWidgets.QFormLayout() 501 | hbox2.addRow(self.choose_msg, self.choose) 502 | 503 | self.result_label = QtWidgets.QLabel() 504 | self.result_label.setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse) 505 | self.result_label.setWordWrap(True) # 自动折叠文字,使文字全部显示 506 | self.result_label.setAlignment(Qt.AlignCenter) 507 | font = QtGui.QFont() 508 | font.setPointSize(12) 509 | self.result_label.setFont(font) 510 | 511 | tab = QtWidgets.QTabWidget() 512 | tab.addTab(w0, "xy chart") 513 | tab.addTab(w1, "detail chart") 514 | 515 | 516 | self.s_label = QtWidgets.QLabel("PreTarget Name:") 517 | self.s_edit = QtWidgets.QLineEdit() 518 | sbox = QtWidgets.QHBoxLayout() 519 | sbox.addWidget(self.s_label) 520 | sbox.addWidget(self.s_edit) 521 | 522 | self.mx_label = QtWidgets.QLabel("MeasurePoint x:") 523 | self.mx_edit = QtWidgets.QLineEdit("0.0") 524 | valid = QtGui.QDoubleValidator() 525 | self.mx_edit.setValidator(valid) 526 | mxbox = QtWidgets.QHBoxLayout() 527 | mxbox.addWidget(self.mx_label) 528 | mxbox.addWidget(self.mx_edit) 529 | self.my_label = QtWidgets.QLabel("y:") 530 | self.my_edit = QtWidgets.QLineEdit("0.0") 531 | self.my_edit.setValidator(valid) 532 | mxbox.addWidget(self.my_label) 533 | mxbox.addWidget(self.my_edit) 534 | 535 | self.fig_layout = QtWidgets.QVBoxLayout(self) 536 | self.fig_layout.addLayout(hbox) 537 | self.fig_layout.addLayout(hbox_st) 538 | self.fig_layout.addLayout(hbox2) 539 | self.fig_layout.addLayout(sbox) 540 | self.fig_layout.addLayout(mxbox) 541 | self.fig_layout.addWidget(self.result_label) 542 | self.fig_layout.addWidget(tab) 543 | self.static_canvas.mpl_connect('button_press_event', self.mouse_press) 544 | 545 | if __name__ == '__main__': 546 | import sys 547 | import os 548 | app = QtWidgets.QApplication(sys.argv) 549 | form = TargetPrecision(None) 550 | form.show() 551 | app.exec_() -------------------------------------------------------------------------------- /Widget.py: -------------------------------------------------------------------------------- 1 | from PyQt5 import QtGui, QtCore,QtWidgets 2 | from PyQt5.QtCore import pyqtSignal, pyqtSlot 3 | 4 | class Widget(QtWidgets.QWidget): 5 | dropped = pyqtSignal('PyQt_PyObject') 6 | def __init__(self): 7 | super(QtWidgets.QWidget, self).__init__() 8 | self.setAcceptDrops(True) 9 | def dragEnterEvent(self, event): 10 | if event.mimeData().hasUrls: 11 | event.accept() 12 | else: 13 | event.ignore() 14 | 15 | def dragMoveEvent(self, event): 16 | if event.mimeData().hasUrls: 17 | event.setDropAction(QtCore.Qt.CopyAction) 18 | event.accept() 19 | else: 20 | event.ignore() 21 | 22 | def dropEvent(self, event): 23 | if event.mimeData().hasUrls: 24 | event.setDropAction(QtCore.Qt.CopyAction) 25 | event.accept() 26 | links = [] 27 | for url in event.mimeData().urls(): 28 | links.append(str(url.toLocalFile())) 29 | self.dropped.emit(links) 30 | else: 31 | event.ignore() 32 | 33 | if __name__ == '__main__': 34 | import sys 35 | import os 36 | app = QtWidgets.QApplication(sys.argv) 37 | form = Widget() 38 | form.show() 39 | app.exec_() 40 | -------------------------------------------------------------------------------- /getMotorErr.py: -------------------------------------------------------------------------------- 1 | import MotorRead as mr 2 | from PyQt5 import QtGui 3 | from PyQt5.QtWidgets import QApplication, QWidget, QPlainTextEdit, QVBoxLayout, QHBoxLayout 4 | from PyQt5 import QtGui, QtCore,QtWidgets 5 | import re,json 6 | from loglibPlus import rbktimetodate 7 | 8 | class MotorErrViewer(QWidget): 9 | hiddened = QtCore.pyqtSignal('PyQt_PyObject') 10 | moveHereSignal = QtCore.pyqtSignal('PyQt_PyObject') 11 | def __init__(self): 12 | super().__init__() 13 | self.lines = [] 14 | self.title = "MotorErr" 15 | self.InitWindow() 16 | self.resize(1200,800) 17 | self.moveHere_flag = False 18 | self.report_path = "" 19 | self.mode_path = "" 20 | 21 | def InitWindow(self): 22 | self.setWindowTitle(self.title) 23 | vbox = QVBoxLayout() 24 | self.plainText = QPlainTextEdit() 25 | self.plainText.setPlaceholderText("This is MotorErr") 26 | self.plainText.setReadOnly(True) 27 | self.plainText.setUndoRedoEnabled(False) 28 | self.plainText.setLineWrapMode(QPlainTextEdit.NoWrap) 29 | self.plainText.setBackgroundVisible(True) 30 | self.plainText.ensureCursorVisible() 31 | self.plainText.contextMenuEvent = self.contextMenuEvent 32 | 33 | hbox = QHBoxLayout() 34 | self.find_edit = QtWidgets.QLineEdit() 35 | self.find_up = QtWidgets.QPushButton("Up") 36 | self.find_up.clicked.connect(self.findUp) 37 | self.find_down = QtWidgets.QPushButton("Down") 38 | self.find_down.clicked.connect(self.findDown) 39 | hbox.addWidget(self.find_edit) 40 | hbox.addWidget(self.find_up) 41 | hbox.addWidget(self.find_down) 42 | vbox.addWidget(self.plainText) 43 | vbox.addLayout(hbox) 44 | self.setLayout(vbox) 45 | self.find_cursor = None 46 | self.find_set_cursor = None 47 | self.highlightFormat = QtGui.QTextCharFormat() 48 | self.highlightFormat.setForeground(QtGui.QColor("red")) 49 | self.plainText.cursorPositionChanged.connect(self.cursorChanged) 50 | self.last_cursor = None 51 | self.cursor_finish = False 52 | 53 | def setModelPath(self, path): 54 | self.mode_path = path 55 | 56 | def setReportPath(self, path): 57 | self.report_path = path 58 | 59 | def clearPlainText(self): 60 | self.plainText.appendPlainText("") 61 | 62 | def listMotorErr(self): 63 | if self.mode_path != "" and self.report_path != "": 64 | reg = re.compile("(.[a-zA-Z0-9]*-0x[a-zA-Z0-9]*)") 65 | model_m_b_dict = mr.getMotorNameBrandDict(self.mode_path) 66 | fid = open(self.report_path,"rb") 67 | for line in fid.readlines(): 68 | try: 69 | line = line.decode('utf-8') 70 | except UnicodeDecodeError: 71 | try: 72 | line = line.decode('gbk') 73 | except UnicodeDecodeError: 74 | line = "" 75 | if "52135|Motor Error:" in line and "|0]" not in line: 76 | self.plainText.appendPlainText(line.replace('\n', '').replace('\r', '')) 77 | motor_code_str = reg.findall(line) 78 | cnt = 1 79 | for pair in motor_code_str: 80 | motor_code_list = re.split("\W", pair) 81 | motor_name = motor_code_list[1] 82 | motor_code = motor_code_list[2] 83 | motor_code2num = int(motor_code, 16) 84 | motor_brand = model_m_b_dict[motor_name] 85 | index = str(cnt) + "名字:" 86 | cnt = cnt + 1 87 | self.plainText.appendPlainText("电机"+index+motor_name+" 品牌:"+motor_brand+" 错误码:"+motor_code) 88 | with open("ErrTab.json", "r", encoding='utf-8') as f: 89 | err_tab = json.loads(f.read()) 90 | all_err_in_brand = err_tab[motor_brand] 91 | cnt2 = 1 92 | if all_err_in_brand["match_bit"]: 93 | for key, err_info in all_err_in_brand.items(): 94 | if key != "match_bit": 95 | key2num = int(key, 16) 96 | if key2num & motor_code2num: 97 | index2 = "对应错误"+str(cnt2)+":" 98 | cnt2 = cnt2 + 1 99 | self.plainText.appendPlainText(" "+index2+ key + " ") 100 | self.plainText.appendPlainText(" 错误描述:" + err_info["des"]) 101 | self.plainText.appendPlainText(" 错误原因:" + err_info["reason"]) 102 | self.plainText.appendPlainText(" 解决方法:" + err_info["method"]) 103 | else: 104 | for key, err_info in all_err_in_brand.items(): 105 | if key != "match_bit": 106 | key2num = int(key, 16) 107 | if key2num == motor_code2num: 108 | index2 = "对应错误"+str(cnt2)+":" 109 | cnt2 = cnt2 + 1 110 | self.plainText.appendPlainText(" "+index2+ key + " ") 111 | self.plainText.appendPlainText(" 错误描述:" + err_info["des"]) 112 | self.plainText.appendPlainText(" 错误原因:" + err_info["reason"]) 113 | self.plainText.appendPlainText(" 解决方法:" + err_info["method"]) 114 | f.close() 115 | self.plainText.appendPlainText("") 116 | fid.close() 117 | self.cursor_finish = True 118 | else: 119 | self.plainText.setPlainText(''.join("The model should be add!")) 120 | 121 | def setLineNum(self, ln): 122 | if not self.moveHere_flag: 123 | cursor = QtGui.QTextCursor(self.plainText.document().findBlockByLineNumber(ln)) 124 | self.plainText.setTextCursor(cursor) 125 | else: 126 | self.moveHere_flag = False 127 | 128 | def closeEvent(self,event): 129 | self.plainText.appendPlainText("") 130 | self.hide() 131 | self.hiddened.emit(True) 132 | 133 | def contextMenuEvent(self, event): 134 | popMenu = self.plainText.createStandardContextMenu() 135 | popMenu.addAction('&Move Here',self.moveHere) 136 | cursor = QtGui.QCursor() 137 | popMenu.exec_(cursor.pos()) 138 | 139 | def moveHere(self): 140 | cur_cursor = self.plainText.textCursor() 141 | cur_cursor.select(QtGui.QTextCursor.LineUnderCursor) 142 | line = cur_cursor.selectedText() 143 | regex = re.compile("\[(.*?)\].*") 144 | out = regex.match(line) 145 | if out: 146 | self.moveHere_flag = True 147 | mtime = rbktimetodate(out.group(1)) 148 | self.moveHereSignal.emit(mtime) 149 | 150 | def findUp(self): 151 | searchStr = self.find_edit.text() 152 | if searchStr != "": 153 | doc = self.plainText.document() 154 | cur_highlightCursor = self.plainText.textCursor() 155 | if self.find_cursor: 156 | if self.find_set_cursor and \ 157 | self.find_set_cursor.position() == cur_highlightCursor.position(): 158 | cur_highlightCursor = QtGui.QTextCursor(self.find_cursor) 159 | cur_highlightCursor.setPosition(cur_highlightCursor.anchor()) 160 | 161 | cur_highlightCursor = doc.find(searchStr, cur_highlightCursor, QtGui.QTextDocument.FindBackward) 162 | if cur_highlightCursor.position() >= 0: 163 | if self.find_cursor: 164 | fmt = QtGui.QTextCharFormat() 165 | self.find_cursor.setCharFormat(fmt) 166 | cur_highlightCursor.movePosition(QtGui.QTextCursor.NoMove,QtGui.QTextCursor.KeepAnchor) 167 | cur_highlightCursor.mergeCharFormat(self.highlightFormat) 168 | self.find_cursor = QtGui.QTextCursor(cur_highlightCursor) 169 | cur_highlightCursor.setPosition(cur_highlightCursor.anchor()) 170 | self.find_set_cursor = cur_highlightCursor 171 | self.plainText.setTextCursor(cur_highlightCursor) 172 | 173 | def findDown(self): 174 | searchStr = self.find_edit.text() 175 | if searchStr != "": 176 | doc = self.plainText.document() 177 | cur_highlightCursor = self.plainText.textCursor() 178 | if self.find_cursor: 179 | if self.find_set_cursor and \ 180 | cur_highlightCursor.position() == self.find_set_cursor.position(): 181 | cur_highlightCursor = QtGui.QTextCursor(self.find_cursor) 182 | cur_highlightCursor.clearSelection() 183 | 184 | cur_highlightCursor = doc.find(searchStr, cur_highlightCursor) 185 | if cur_highlightCursor.position()>=0: 186 | if self.find_cursor: 187 | fmt = QtGui.QTextCharFormat() 188 | self.find_cursor.setCharFormat(fmt) 189 | cur_highlightCursor.movePosition(QtGui.QTextCursor.NoMove,QtGui.QTextCursor.KeepAnchor) 190 | cur_highlightCursor.setCharFormat(self.highlightFormat) 191 | self.find_cursor = QtGui.QTextCursor(cur_highlightCursor) 192 | cur_highlightCursor.clearSelection() 193 | self.find_set_cursor = cur_highlightCursor 194 | self.plainText.setTextCursor(cur_highlightCursor) 195 | 196 | def cursorChanged(self): 197 | if self.cursor_finish: 198 | fmt= QtGui.QTextBlockFormat() 199 | fmt.setBackground(QtGui.QColor("light blue")) 200 | cur_cursor = self.plainText.textCursor() 201 | cur_cursor.select(QtGui.QTextCursor.LineUnderCursor) 202 | cur_cursor.setBlockFormat(fmt) 203 | if self.last_cursor: 204 | if cur_cursor.blockNumber() != self.last_cursor.blockNumber(): 205 | fmt = QtGui.QTextBlockFormat() 206 | self.last_cursor.select(QtGui.QTextCursor.LineUnderCursor) 207 | self.last_cursor.setBlockFormat(fmt) 208 | self.last_cursor = self.plainText.textCursor() 209 | 210 | if __name__ == "__main__": 211 | import sys 212 | import os 213 | app = QApplication(sys.argv) 214 | view = MotorErrViewer() 215 | filenames = ["test1.log"] 216 | view.readFilies(filenames) 217 | view.show() 218 | app.exec_() 219 | 220 | -------------------------------------------------------------------------------- /get_report.py: -------------------------------------------------------------------------------- 1 | from loglibPlus import ErrorLine, WarningLine, ReadLog, FatalLine, NoticeLine 2 | import sys 3 | from os import listdir 4 | from os.path import isfile, join, isdir, splitext 5 | from termcolor import colored 6 | from colorama import init 7 | from datetime import datetime 8 | from multiprocessing import freeze_support 9 | 10 | if __name__ == '__main__': 11 | freeze_support() 12 | init() 13 | filenames = [] 14 | ts = datetime.now().strftime("%Y-%m-%d_%H-%M-%S") 15 | output_fname = "Report_" + str(ts).replace(':','-').replace(' ','_') + ".txt" 16 | if len(sys.argv) > 1: 17 | filenames = sys.argv[1:] 18 | if len(filenames) == 1 and isdir(filenames[0]): 19 | mypath = filenames[0] 20 | tmp_files = [join(mypath,f) for f in listdir(mypath) if isfile(join(mypath, f))] 21 | filenames = [] 22 | for file in tmp_files: 23 | if splitext(file)[1] == ".log": 24 | filenames.append(file) 25 | output_fname = mypath+"\\"+ output_fname 26 | else: 27 | mypath = "diagnosis\\log" 28 | tmp_files = [join(mypath,f) for f in listdir(mypath) if isfile(join(mypath, f))] 29 | filenames = [] 30 | for file in tmp_files: 31 | if splitext(file)[1] == ".log": 32 | filenames.append(file) 33 | output_fname = mypath+"\\"+ output_fname 34 | fid = open(output_fname, "w") 35 | for filename in filenames: 36 | log = ReadLog([filename]) 37 | log.thread_num = 1 38 | err = ErrorLine() 39 | war = WarningLine() 40 | fat = FatalLine() 41 | notice = NoticeLine() 42 | log.parse(err, war, fat, notice) 43 | print("="*20) 44 | if len(err.content()[0]) >= 1 or len(fat.content()[0]) >= 1 : 45 | print(colored("Files: "+ filename, 'red', None, ['bold'])) 46 | elif len(war.content()[0]) >=1: 47 | print(colored("Files: " + filename, 'yellow', None, ['bold'])) 48 | else: 49 | print("Files: ", filename) 50 | print( len(fat.content()[0]), " FATALs, ", len(err.content()[0]), " ERRORs, ", len(war.content()[0]), " WARNINGs, ", len(notice.content()[0]), " NOTICEs") 51 | if len(fat.alarmnum()[0]) >= 1: 52 | print("FATAL:") 53 | for iter in range(0, len(fat.alarmnum()[0])): 54 | print(' '*2, fat.alarmnum()[0][iter]," ",fat.alarminfo()[0][iter]) 55 | if len(err.alarmnum()[0]) >= 1: 56 | print("ERRORS:") 57 | for iter in range(0, len(err.alarmnum()[0])): 58 | print(' '*2,err.alarmnum()[0][iter]," ",err.alarminfo()[0][iter]) 59 | if len(war.alarmnum()[0]) >= 1: 60 | print("WARNING:") 61 | for iter in range(0, len(war.alarmnum()[0])): 62 | print(' '*2,war.alarmnum()[0][iter]," ",war.alarminfo()[0][iter]) 63 | if len(notice.alarmnum()[0]) >= 1: 64 | print("NOTICE:") 65 | for iter in range(0, len(notice.alarmnum()[0])): 66 | print(' '*2,notice.alarmnum()[0][iter]," ",notice.alarminfo()[0][iter]) 67 | 68 | 69 | print("="*20, file = fid) 70 | print("Files: ", filename, file = fid) 71 | print(len(fat.content()[0]), " FATALs, ", len(err.content()[0]), " ERRORs, ", len(war.content()[0]), " WARNINGs, ", len(notice.content()[0]), " NOTICEs", file = fid) 72 | print("FATALs:", file = fid) 73 | for data in fat.content()[0]: 74 | print(data, file = fid) 75 | print("ERRORs:", file = fid) 76 | for data in err.content()[0]: 77 | print(data,file = fid) 78 | print("WARNINGs:", file = fid) 79 | for data in war.content()[0]: 80 | print(data, file = fid) 81 | print("NOTICEs:", file = fid) 82 | for data in notice.content()[0]: 83 | print(data, file = fid) 84 | fid.close() 85 | print("Detail information is in the", colored(output_fname, 'yellow', 'on_red', ['bold']), "\nFINISHED!!!") 86 | ch = sys.stdin.read(1) -------------------------------------------------------------------------------- /images/ruler_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seer-robotics/LogReader/d16eb8daca0e4ed415837167ea1c91b73adf0e42/images/ruler_large.png -------------------------------------------------------------------------------- /loggui.spec: -------------------------------------------------------------------------------- 1 | # -*- mode: python ; coding: utf-8 -*- 2 | 3 | 4 | block_cipher = None 5 | 6 | 7 | a = Analysis( 8 | ['loggui.py'], 9 | pathex=[], 10 | binaries=[], 11 | datas=[('images/*','images'), 12 | ('log_config.json','.'), 13 | ('rbk.ico','.')], 14 | hiddenimports=[], 15 | hookspath=[], 16 | hooksconfig={}, 17 | runtime_hooks=[], 18 | excludes=[], 19 | win_no_prefer_redirects=False, 20 | win_private_assemblies=False, 21 | cipher=block_cipher, 22 | noarchive=False, 23 | ) 24 | pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) 25 | 26 | exe = EXE( 27 | pyz, 28 | a.scripts, 29 | [], 30 | exclude_binaries=True, 31 | name='loggui', 32 | debug=False, 33 | bootloader_ignore_signals=False, 34 | strip=False, 35 | upx=True, 36 | console=False, 37 | icon='rbk.ico', 38 | disable_windowed_traceback=False, 39 | argv_emulation=False, 40 | target_arch=None, 41 | codesign_identity=None, 42 | entitlements_file=None, 43 | ) 44 | coll = COLLECT( 45 | exe, 46 | a.binaries, 47 | a.zipfiles, 48 | a.datas, 49 | strip=False, 50 | upx=True, 51 | upx_exclude=[], 52 | name='loggui', 53 | ) 54 | -------------------------------------------------------------------------------- /loglib.py: -------------------------------------------------------------------------------- 1 | import re 2 | import math 3 | from datetime import datetime 4 | import logging 5 | import numpy as np 6 | import gzip 7 | 8 | def rbktimetodate(rbktime): 9 | """ 将rbk的时间戳转化为datatime """ 10 | return datetime.strptime(rbktime, '%Y-%m-%d %H:%M:%S.%f') 11 | 12 | def findrange(ts, t1, t2): 13 | """ 在ts中寻找大于t1小于t2对应的下标 """ 14 | small_ind = -1 15 | large_ind = len(ts)-1 16 | for i, data in enumerate(ts): 17 | large_ind = i 18 | if(t1 <= data and small_ind < 0): 19 | small_ind = i 20 | if(t2 <= data): 21 | break 22 | return small_ind, large_ind 23 | 24 | def polar2xy(angle, dist): 25 | """ 将极坐标angle,dist 转化为xy坐标 """ 26 | x , y = [], [] 27 | for a, d in zip(angle, dist): 28 | x.append(d * math.cos(a)) 29 | y.append(d * math.sin(a)) 30 | return x,y 31 | 32 | class ReadLog: 33 | """ 读取Log """ 34 | def __init__(self, filenames): 35 | """ 支持传入多个文件名称""" 36 | self.filenames = filenames 37 | def _readData(self, f, file, argv): 38 | line_num = 0 39 | for line in f.readlines(): 40 | try: 41 | line = line.decode('utf-8') 42 | except UnicodeDecodeError: 43 | try: 44 | line = line.decode('gbk') 45 | except UnicodeDecodeError: 46 | print(file, " L:",line_num+1, " is skipped due to decoding failure!", " ", line) 47 | continue 48 | line_num += 1 49 | break_flag = False 50 | for data in argv: 51 | if type(data).__name__ == 'dict': 52 | for k in data.keys(): 53 | if data[k].parse(line): 54 | break_flag = True 55 | break 56 | if break_flag: 57 | break_flag = False 58 | break 59 | elif data.parse(line): 60 | break 61 | def parse(self,*argv): 62 | """依据输入的正则进行解析""" 63 | for file in self.filenames: 64 | if file.endswith(".log"): 65 | with open(file,'rb') as f: 66 | self._readData(f,file, argv) 67 | else: 68 | with gzip.open(file,'rb') as f: 69 | self._readData(f, file, argv) 70 | 71 | 72 | class Data: 73 | def __init__(self, info): 74 | self.type = info['type'] 75 | self.regex = re.compile("\[(.*?)\].*\["+self.type+"\]\[(.*?)\]") 76 | self.short_regx = re.compile("\["+self.type+"\]\[") 77 | self.info = info['content'] 78 | self.data = dict() 79 | self.data['t'] = [] 80 | self.description = dict() 81 | self.unit = dict() 82 | self.parse_error = False 83 | for tmp in self.info: 84 | self.data[tmp['name']] = [] 85 | if 'unit' in tmp: 86 | self.unit[tmp['name']] = tmp['unit'] 87 | else: 88 | self.unit[tmp['name']] = "" 89 | if 'description' in tmp: 90 | self.description[tmp['name']] = tmp['description'] + " " + self.unit[tmp['name']] 91 | else: 92 | self.description[tmp['name']] = self.type + '.' + tmp['name'] + " " + self.unit[tmp['name']] 93 | 94 | def _storeData(self, tmp, ind, values): 95 | if tmp['type'] == 'double' or tmp['type'] == 'int64': 96 | try: 97 | self.data[tmp['name']].append(float(values[ind])) 98 | except: 99 | self.data[tmp['name']].append(0.0) 100 | elif tmp['type'] == 'mm': 101 | try: 102 | self.data[tmp['name']].append(float(values[ind])/1000.0) 103 | except: 104 | self.data[tmp['name']].append(0.0) 105 | elif tmp['type'] == 'cm': 106 | try: 107 | self.data[tmp['name']].append(float(values[ind])/100.0) 108 | except: 109 | self.data[tmp['name']].append(0.0) 110 | elif tmp['type'] == 'rad': 111 | try: 112 | self.data[tmp['name']].append(float(values[ind])/math.pi * 180.0) 113 | except: 114 | self.data[tmp['name']].append(0.0) 115 | elif tmp['type'] == 'm': 116 | try: 117 | self.data[tmp['name']].append(float(values[ind])) 118 | except: 119 | self.data[tmp['name']].append(0.0) 120 | elif tmp['type'] == 'LSB': 121 | try: 122 | self.data[tmp['name']].append(float(values[ind])/16.03556) 123 | except: 124 | self.data[tmp['name']].append(0.0) 125 | elif tmp['type'] == 'bool': 126 | try: 127 | if values[ind] == "true" or values[ind] == "1": 128 | self.data[tmp['name']].append(1.0) 129 | else: 130 | self.data[tmp['name']].append(0.0) 131 | except: 132 | self.data[tmp['name']].append(0.0) 133 | def parse(self, line): 134 | short_out = self.short_regx.search(line) 135 | if short_out: 136 | out = self.regex.match(line) 137 | if out: 138 | datas = out.groups() 139 | values = datas[1].split('|') 140 | self.data['t'].append(rbktimetodate(datas[0])) 141 | for tmp in self.info: 142 | if 'type' in tmp and 'index' in tmp and 'name' in tmp: 143 | if tmp['index'] < len(values): 144 | self._storeData(tmp, int(tmp['index']), values) 145 | else: 146 | self.data[tmp['name']].append(np.nan) 147 | elif 'type' in tmp and 'name' in tmp: 148 | ind = values.index(tmp['name']) if tmp['name'] in values else -1 149 | if ind >= 0 and ind + 1 < len(values): 150 | self._storeData(tmp, ind+1, values) 151 | else: 152 | self.data[tmp['name']].append(np.nan) 153 | else: 154 | if not self.parse_error: 155 | logging.error("Error in {} {} ".format(self.type, tmp.keys())) 156 | self.parse_error = True 157 | return True 158 | return False 159 | return False 160 | def __getitem__(self,k): 161 | return self.data[k] 162 | def __setitem__(self,k,value): 163 | self.data[k] = value 164 | 165 | class Laser: 166 | """ 激光雷达的数据 167 | data[0]: t 168 | data[1]: ts 激光点的时间戳 169 | data[2]: angle rad 170 | data[3]: dist m 171 | data[4]: x m 172 | data[5]: y m 173 | data[6]: number 174 | """ 175 | def __init__(self, max_dist): 176 | """ max_dist 为激光点的最远距离,大于此距离激光点无效""" 177 | self.regex = re.compile('\[(.*?)\].*\[Laser:? ?(\d*?)\]\[(.*?)\]') 178 | self.short_regx = re.compile("\[Laser") 179 | #self.data = [[] for _ in range(7)] 180 | self.datas = dict() 181 | self.max_dist = max_dist 182 | def parse(self, line): 183 | short_out = self.short_regx.search(line) 184 | if short_out: 185 | out = self.regex.match(line) 186 | if out: 187 | datas = out.groups() 188 | laser_id = 0 189 | if datas[1] != "": 190 | laser_id = int(datas[1]) 191 | if laser_id not in self.datas: 192 | self.datas[laser_id] = [[] for _ in range(7)] 193 | self.datas[laser_id][0].append(rbktimetodate(datas[0])) 194 | tmp_datas = datas[2].split('|') 195 | self.datas[laser_id][1].append(float(tmp_datas[0])) 196 | #min_angle = float(tmp_datas[1]) 197 | #max_angle = float(tmp_datas[2]) 198 | #step_angle = float(tmp_datas[3]) 199 | #data_number = int((max_angle - min_angle) / step_angle) 200 | angle = [float(tmp)/180.0*math.pi for tmp in tmp_datas[4::2]] 201 | dist = [float(tmp) for tmp in tmp_datas[5::2]] 202 | tmp_a, tmp_d = [], [] 203 | for a, d in zip(angle,dist): 204 | if d < self.max_dist: 205 | tmp_a.append(a) 206 | tmp_d.append(d) 207 | angle = tmp_a 208 | dist = tmp_d 209 | self.datas[laser_id][2].append(angle) 210 | self.datas[laser_id][3].append(dist) 211 | x , y = polar2xy(angle, dist) 212 | self.datas[laser_id][4].append(x) 213 | self.datas[laser_id][5].append(y) 214 | self.datas[laser_id][6].append(len(x)) 215 | return True 216 | return False 217 | return False 218 | def t(self, laser_index): 219 | return self.datas[laser_index][0] 220 | def ts(self, laser_index): 221 | return self.datas[laser_index][1], self.datas[laser_index][0] 222 | def angle(self, laser_index): 223 | return self.datas[laser_index][2], self.datas[laser_index][0] 224 | def dist(self, laser_index): 225 | return self.datas[laser_index][3], self.datas[laser_index][0] 226 | def x(self, laser_index): 227 | return self.datas[laser_index][4], self.datas[laser_index][0] 228 | def y(self, laser_index): 229 | return self.datas[laser_index][5], self.datas[laser_index][0] 230 | def number(self, laser_index): 231 | return self.datas[laser_index][6], self.datas[laser_index][0] 232 | 233 | class DepthCamera: 234 | """ 深度摄像头的数据 235 | data[0]: t 236 | data[1]: x m 237 | data[2]: y m 238 | data[3]: z m 239 | data[4]: number 240 | data[5]: ts 241 | """ 242 | def __init__(self): 243 | """ max_dist 为激光点的最远距离,大于此距离激光点无效""" 244 | self.regex = re.compile('\[(.*?)\].* \[DepthCamera\d*?\]\[(.*?)\]') 245 | self.short_regx = re.compile("\[DepthCamera\d*?\]\[") 246 | #self.data = [[] for _ in range(7)] 247 | self.datas = [[] for _ in range(6)] 248 | def parse(self, line): 249 | short_out = self.short_regx.search(line) 250 | if short_out: 251 | out = self.regex.match(line) 252 | if out: 253 | datas = out.groups() 254 | tmp_datas = datas[1].split('|') 255 | if(len(tmp_datas) < 2): 256 | return True 257 | self.datas[0].append(rbktimetodate(datas[0])) 258 | ts = 0 259 | if len(tmp_datas[1:]) %3 == 0: 260 | dx = [float(tmp) for tmp in tmp_datas[1::3]] 261 | dy = [float(tmp) for tmp in tmp_datas[2::3]] 262 | dz = [float(tmp) for tmp in tmp_datas[3::3]] 263 | ts = float(tmp_datas[0]) 264 | elif len(tmp_datas)%2 == 0: 265 | dx = [float(tmp) for tmp in tmp_datas[0::2]] 266 | dy = [float(tmp) for tmp in tmp_datas[1::2]] 267 | dz = [0 for tmp in dx] 268 | else: 269 | dx = [float(tmp) for tmp in tmp_datas[1::2]] 270 | dy = [float(tmp) for tmp in tmp_datas[2::2]] 271 | dz = [0 for tmp in dx] 272 | ts = float(tmp_datas[0]) 273 | self.datas[1].append(dx) 274 | self.datas[2].append(dy) 275 | self.datas[3].append(dz) 276 | self.datas[4].append(len(tmp_datas)) 277 | self.datas[5].append(ts) 278 | return True 279 | return False 280 | return False 281 | def t(self): 282 | return self.datas[0] 283 | def x(self): 284 | return self.datas[1], self.datas[0] 285 | def y(self): 286 | return self.datas[2], self.datas[0] 287 | def z(self): 288 | return self.datas[3], self.datas[0] 289 | def number(self): 290 | return self.datas[4], self.datas[0] 291 | def ts(self): 292 | return self.datas[5], self.datas[0] 293 | 294 | class ParticleState: 295 | """ 粒子滤波数据 296 | data[0]: t 297 | data[1]: x m 298 | data[2]: y m 299 | data[3]: theta m 300 | data[4]: number 301 | data[5]: ts 302 | """ 303 | def __init__(self): 304 | 305 | self.regex = re.compile('\[(.*?)\].* \[Particle State: \]\[(.*?)\]') 306 | self.short_regx = re.compile("\[Particle State: \]\[") 307 | #self.data = [[] for _ in range(7)] 308 | self.datas = [[] for _ in range(6)] 309 | def parse(self, line): 310 | short_out = self.short_regx.search(line) 311 | if short_out: 312 | out = self.regex.match(line) 313 | if out: 314 | datas = out.groups() 315 | tmp_datas = datas[1].split('|') 316 | if(len(tmp_datas) < 2): 317 | return True 318 | dx, dy, dz, ts = [], [], [], 0 319 | if len(tmp_datas[1:]) %3 == 0: 320 | dx = [float(tmp) for tmp in tmp_datas[1::3]] 321 | dy = [float(tmp) for tmp in tmp_datas[2::3]] 322 | dz = [float(tmp) for tmp in tmp_datas[3::3]] 323 | ts = float(tmp_datas[0]) 324 | else: 325 | return True 326 | self.datas[0].append(rbktimetodate(datas[0])) 327 | self.datas[1].append(dx) 328 | self.datas[2].append(dy) 329 | self.datas[3].append(dz) 330 | self.datas[4].append(len(dx)) 331 | self.datas[5].append(ts) 332 | return True 333 | return False 334 | return False 335 | def t(self): 336 | return self.datas[0] 337 | def x(self): 338 | return self.datas[1], self.datas[0] 339 | def y(self): 340 | return self.datas[2], self.datas[0] 341 | def theta(self): 342 | return self.datas[3], self.datas[0] 343 | def number(self): 344 | return self.datas[4], self.datas[0] 345 | def ts(self): 346 | return self.datas[5], self.datas[0] 347 | 348 | class ErrorLine: 349 | """ 错误信息 350 | data[0]: t 351 | data[1]: 错误信息内容 352 | data[2]: Alarm 错误编号 353 | data[3]: Alarm 内容 354 | """ 355 | def __init__(self): 356 | self.general_regex = re.compile("\[(.*?)\].*\[error\].*") 357 | self.regex = re.compile("\[(.*?)\].*\[error\].*\[Alarm\]\[.*?\|(.*?)\|(.*?)\|.*") 358 | self.short_regx = re.compile("\[error\]") 359 | self.data = [[] for _ in range(4)] 360 | def parse(self, line): 361 | short_out = self.short_regx.search(line) 362 | if short_out: 363 | out = self.regex.match(line) 364 | if out: 365 | self.data[0].append(rbktimetodate(out.group(1))) 366 | self.data[1].append(out.group(0)) 367 | new_num = out.group(2) 368 | if not new_num in self.data[2]: 369 | self.data[2].append(new_num) 370 | self.data[3].append(out.group(3)) 371 | return True 372 | else: 373 | out = self.general_regex.match(line) 374 | if out: 375 | self.data[0].append(rbktimetodate(out.group(1))) 376 | self.data[1].append(out.group(0)) 377 | new_num = '00000' 378 | if not new_num in self.data[2]: 379 | self.data[2].append(new_num) 380 | self.data[3].append('unKnown Error') 381 | return True 382 | return False 383 | return False 384 | def t(self): 385 | return self.data[0] 386 | def content(self): 387 | return self.data[1], self.data[0] 388 | def alarmnum(self): 389 | return self.data[2], self.data[0] 390 | def alarminfo(self): 391 | return self.data[3], self.data[0] 392 | 393 | class WarningLine: 394 | """ 报警信息 395 | data[0]: t 396 | data[1]: 报警信息内容 397 | data[2]: Alarm 错误编号 398 | data[3]: Alarm 内容 399 | """ 400 | def __init__(self): 401 | self.general_regex = re.compile("\[(.*?)\].*\[warning\].*") 402 | self.regex = re.compile("\[(.*?)\].*\[warning\].*\[Alarm\]\[.*?\|(.*?)\|(.*?)\|.*") 403 | self.short_regx = re.compile("\[warning\]") 404 | self.data = [[] for _ in range(4)] 405 | def parse(self, line): 406 | short_out = self.short_regx.search(line) 407 | if short_out: 408 | out = self.regex.match(line) 409 | if out: 410 | self.data[0].append(rbktimetodate(out.group(1))) 411 | self.data[1].append(out.group(0)) 412 | new_num = out.group(2) 413 | if not new_num in self.data[2]: 414 | self.data[2].append(new_num) 415 | self.data[3].append(out.group(3)) 416 | return True 417 | else: 418 | out = self.general_regex.match(line) 419 | if out: 420 | self.data[0].append(rbktimetodate(out.group(1))) 421 | self.data[1].append(out.group(0)) 422 | new_num = '00000' 423 | if not new_num in self.data[2]: 424 | self.data[2].append(new_num) 425 | self.data[3].append('unKnown Warning') 426 | return True 427 | return False 428 | return False 429 | def t(self): 430 | return self.data[0] 431 | def content(self): 432 | return self.data[1], self.data[0] 433 | def alarmnum(self): 434 | return self.data[2], self.data[0] 435 | def alarminfo(self): 436 | return self.data[3], self.data[0] 437 | 438 | class FatalLine: 439 | """ 错误信息 440 | data[0]: t 441 | data[1]: 报警信息内容 442 | data[2]: Alarm 错误编号 443 | data[3]: Alarm 内容 444 | """ 445 | def __init__(self): 446 | self.regex = re.compile("\[(.*?)\].*\[fatal\].*\[Alarm\]\[.*?\|(.*?)\|(.*?)\|.*") 447 | self.short_regx = re.compile("\[fatal\]") 448 | self.data = [[] for _ in range(4)] 449 | def parse(self, line): 450 | short_out = self.short_regx.search(line) 451 | if short_out: 452 | out = self.regex.match(line) 453 | if out: 454 | self.data[0].append(rbktimetodate(out.group(1))) 455 | self.data[1].append(out.group(0)) 456 | new_num = out.group(2) 457 | new_data_flag = True 458 | if not new_num in self.data[2]: 459 | self.data[2].append(new_num) 460 | self.data[3].append(out.group(3)) 461 | return True 462 | return False 463 | return False 464 | def t(self): 465 | return self.data[0] 466 | def content(self): 467 | return self.data[1], self.data[0] 468 | def alarmnum(self): 469 | return self.data[2], self.data[0] 470 | def alarminfo(self): 471 | return self.data[3], self.data[0] 472 | 473 | class NoticeLine: 474 | """ 注意信息 475 | data[0]: t 476 | data[1]: 注意信息内容 477 | data[2]: Alarm 错误编号 478 | data[3]: Alarm 内容 479 | """ 480 | def __init__(self): 481 | self.regex = re.compile("\[(.*?)\].*\[Alarm\]\[Notice\|(.*?)\|(.*?)\|.*") 482 | self.short_regx = re.compile("\[Alarm\]\[Notice\|") 483 | self.data = [[] for _ in range(4)] 484 | def parse(self, line): 485 | short_out = self.short_regx.search(line) 486 | if short_out: 487 | out = self.regex.match(line) 488 | if out: 489 | self.data[0].append(rbktimetodate(out.group(1))) 490 | self.data[1].append(out.group(0)) 491 | new_num = out.group(2) 492 | if not new_num in self.data[2]: 493 | self.data[2].append(new_num) 494 | self.data[3].append(out.group(3)) 495 | return True 496 | return False 497 | return False 498 | def t(self): 499 | return self.data[0] 500 | def content(self): 501 | return self.data[1], self.data[0] 502 | def alarmnum(self): 503 | return self.data[2], self.data[0] 504 | def alarminfo(self): 505 | return self.data[3], self.data[0] 506 | 507 | class TaskStart: 508 | """ 任务开始信息 509 | data[0]: t 510 | data[1]: 开始信息内容 511 | """ 512 | def __init__(self): 513 | self.regex = re.compile("\[(.*?)\].*\[Text\]\[cnt:.*") 514 | self.short_regx = re.compile("\[Text\]\[cnt:") 515 | self.data = [[] for _ in range(2)] 516 | def parse(self, line): 517 | short_out = self.short_regx.search(line) 518 | if short_out: 519 | out = self.regex.match(line) 520 | if out: 521 | self.data[0].append(rbktimetodate(out.group(1))) 522 | self.data[1].append(out.group(0)) 523 | return True 524 | return False 525 | return False 526 | def t(self): 527 | return self.data[0] 528 | def content(self): 529 | return self.data[1], self.data[0] 530 | 531 | class TaskFinish: 532 | """ 任务结束信息 533 | data[0]: t 534 | data[1]: 结束信息内容 535 | """ 536 | def __init__(self): 537 | self.regex = re.compile("\[(.*?)\].*\[Text\]\[Task finished.*") 538 | self.short_regx = re.compile("\[Text\]\[Task finished.") 539 | self.data = [[] for _ in range(2)] 540 | def parse(self, line): 541 | short_out = self.short_regx.search(line) 542 | if short_out: 543 | out = self.regex.match(line) 544 | if out: 545 | self.data[0].append(rbktimetodate(out.group(1))) 546 | self.data[1].append(out.group(0)) 547 | return True 548 | return False 549 | return False 550 | def t(self): 551 | return self.data[0] 552 | def content(self): 553 | return self.data[1], self.data[0] 554 | 555 | class Service: 556 | """ 服务信息 557 | data[0]: t 558 | data[1]: 服务内容 559 | """ 560 | def __init__(self): 561 | self.regex = re.compile("\[(.*?)\].*\[Service\].*") 562 | self.short_regx = re.compile("\[Service\].") 563 | self.data = [[] for _ in range(2)] 564 | def parse(self, line): 565 | short_out = self.short_regx.search(line) 566 | if short_out: 567 | out = self.regex.match(line) 568 | if out: 569 | self.data[0].append(rbktimetodate(out.group(1))) 570 | self.data[1].append(out.group(0)) 571 | return True 572 | return False 573 | return False 574 | def t(self): 575 | return self.data[0] 576 | def content(self): 577 | return self.data[1], self.data[0] 578 | 579 | class Memory: 580 | """ 内存信息 581 | t[0]: 582 | t[1]: 583 | t[2]: 584 | t[3]: 585 | t[4]: 586 | t[5]: 587 | data[0]: used_sys 588 | data[1]: free_sys 589 | data[2]: rbk_phy 590 | data[3]: rbk_vir 591 | data[4]: rbk_max_phy 592 | data[5]: rbk_max_vir 593 | data[6]: cpu_usage 594 | """ 595 | def __init__(self): 596 | self.regex = [re.compile("\[(.*?)\].*\[Text\]\[Used system memory *: *(.*?) *([MG])B\]"), 597 | re.compile("\[(.*?)\].*\[Text\]\[Free system memory *: *(.*?) *([MG])B\]"), 598 | re.compile("\[(.*?)\].*\[Text\]\[Robokit physical memory usage *: *(.*?) *([GM])B\]"), 599 | re.compile("\[(.*?)\].*\[Text\]\[Robokit virtual memory usage *: *(.*?) *([GM])B\]"), 600 | re.compile("\[(.*?)\].*\[Text\]\[Robokit Max physical memory usage *: *(.*?) *([GM])B\]"), 601 | re.compile("\[(.*?)\].*\[Text\]\[Robokit Max virtual memory usage *: *(.*?) *([GM])B\]"), 602 | re.compile("\[(.*?)\].*\[Text\]\[Robokit CPU usage *: *(.*?)%\]"), 603 | re.compile("\[(.*?)\].*\[Text\]\[System CPU usage *: *(.*?)%\]"),] 604 | self.short_regx = re.compile("memory|CPU") 605 | self.time = [[] for _ in range(8)] 606 | self.data = [[] for _ in range(8)] 607 | def parse(self, line): 608 | short_out = self.short_regx.search(line) 609 | if short_out: 610 | for iter in range(0,8): 611 | out = self.regex[iter].match(line) 612 | if out: 613 | self.time[iter].append(rbktimetodate(out.group(1))) 614 | if iter == 6: 615 | self.data[iter].append(float(out.group(2))) 616 | else: 617 | if out.group(3) == "G": 618 | self.data[iter].append(float(out.group(2)) * 1024.0) 619 | else: 620 | self.data[iter].append(float(out.group(2))) 621 | return True 622 | return False 623 | return False 624 | def t(self): 625 | return self.time[0] 626 | def used_sys(self): 627 | return self.data[0], self.time[0] 628 | def free_sys(self): 629 | return self.data[1], self.time[1] 630 | def rbk_phy(self): 631 | return self.data[2], self.time[2] 632 | def rbk_vir(self): 633 | return self.data[3], self.time[3] 634 | def rbk_max_phy(self): 635 | return self.data[4], self.time[4] 636 | def rbk_max_vir(self): 637 | return self.data[5], self.time[5] 638 | def rbk_cpu(self): 639 | return self.data[6], self.time[6] 640 | def sys_cpu(self): 641 | return self.data[7], self.time[7] 642 | -------------------------------------------------------------------------------- /rbk.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seer-robotics/LogReader/d16eb8daca0e4ed415837167ea1c91b73adf0e42/rbk.ico -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | matplotlib==3.5.1 2 | numpy==1.22.3 3 | pyinstaller==5.0.1 4 | PyQt5==5.15.6 5 | -------------------------------------------------------------------------------- /screen_shot.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seer-robotics/LogReader/d16eb8daca0e4ed415837167ea1c91b73adf0e42/screen_shot.PNG -------------------------------------------------------------------------------- /screen_shot2.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seer-robotics/LogReader/d16eb8daca0e4ed415837167ea1c91b73adf0e42/screen_shot2.PNG -------------------------------------------------------------------------------- /screen_shot3.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seer-robotics/LogReader/d16eb8daca0e4ed415837167ea1c91b73adf0e42/screen_shot3.PNG -------------------------------------------------------------------------------- /test.py: -------------------------------------------------------------------------------- 1 | from loglib import MCLoc, IMU, Odometer, Send, Get, Laser, ErrorLine, WarningLine, ReadLog, FatalLine, NoticeLine 2 | import matplotlib.pyplot as plt 3 | from matplotlib.widgets import Slider,RadioButtons 4 | import sys 5 | mcl = MCLoc() 6 | imu = IMU() 7 | odo = Odometer() 8 | send = Send() 9 | get = Get() 10 | laser = Laser(1000.0) 11 | err = ErrorLine() 12 | war = WarningLine() 13 | fat = FatalLine() 14 | notice = NoticeLine() 15 | log = ReadLog(sys.argv[1:]) 16 | log.parse(mcl, imu, odo, send, get, laser, err, war, fat, notice) 17 | 18 | f = open("Report.txt", "w", encoding='utf-8') 19 | print("Files: ", sys.argv[1:], file = f) 20 | print(len(err.content()[0]), " ERRORs, ", len(war.content()[0]), " WARNINGs, ", len(fat.content()[0]), " FATALs, ", len(notice.content()[0]), " NOTICEs", file = f) 21 | print("ERRORs:", file = f) 22 | for data in err.content()[0]: 23 | print(data,file = f) 24 | print("WARNINGs:", file = f) 25 | for data in war.content()[0]: 26 | print(data, file = f) 27 | print("FATALs:", file = f) 28 | for data in fat.content()[0]: 29 | print(data, file = f) 30 | print("NOTICEs:", file = f) 31 | for data in notice.content()[0]: 32 | print(data, file = f) 33 | f.close() 34 | 35 | plt.figure(1) 36 | plt.subplot(4,1,1) 37 | plt.title('MCLoc') 38 | plt.plot(mcl.t(), mcl.x()[0],'.', label = 'x') 39 | plt.legend() 40 | plt.subplot(4,1,2) 41 | plt.plot(mcl.t(), mcl.y()[0],'.', label = 'y') 42 | plt.legend() 43 | plt.subplot(4,1,3) 44 | plt.plot(mcl.t(), mcl.theta()[0],'.', label = 'theta') 45 | plt.legend() 46 | plt.subplot(4,1,4) 47 | plt.plot(mcl.t(), mcl.confidence()[0],'.', label = 'confidence') 48 | plt.legend() 49 | 50 | plt.figure(21) 51 | plt.title('IMU Yaw') 52 | plt.plot(imu.t(), imu.yaw()[0],'.') 53 | plt.figure(2) 54 | plt.subplot(3,3,1) 55 | plt.title('IMU') 56 | plt.plot(imu.t(), imu.ax()[0],'.', label = 'ax') 57 | plt.legend() 58 | plt.subplot(3,3,2) 59 | plt.plot(imu.t(), imu.ay()[0],'.', label = 'ay') 60 | plt.legend() 61 | plt.subplot(3,3,3) 62 | plt.plot(imu.t(), imu.az()[0],'.', label = 'az') 63 | plt.legend() 64 | plt.subplot(3,3,4) 65 | plt.plot(imu.t(), imu.gx()[0],'.', label = 'gx') 66 | plt.legend() 67 | plt.subplot(3,3,5) 68 | plt.plot(imu.t(), imu.gy()[0],'.', label = 'gy') 69 | plt.legend() 70 | plt.subplot(3,3,6) 71 | plt.plot(imu.t(), imu.gz()[0],'.', label = 'gz') 72 | plt.legend() 73 | plt.subplot(3,3,7) 74 | plt.plot(imu.t(), imu.offx()[0],'.', label = 'offx') 75 | plt.legend() 76 | plt.subplot(3,3,8) 77 | plt.plot(imu.t(), imu.offy()[0],'.', label = 'offy') 78 | plt.legend() 79 | plt.subplot(3,3,9) 80 | plt.plot(imu.t(), imu.offz()[0],'.', label = 'offz') 81 | plt.legend() 82 | 83 | plt.figure(3) 84 | plt.subplot(2,3,1) 85 | plt.title('Odometer') 86 | plt.plot(odo.t(), odo.x()[0],'.', label = 'x') 87 | plt.legend() 88 | plt.subplot(2,3,2) 89 | plt.plot(odo.t(), odo.y()[0],'.', label = 'y') 90 | plt.legend() 91 | plt.subplot(2,3,3) 92 | plt.plot(odo.t(), odo.theta()[0],'.', label = 'theta') 93 | plt.legend() 94 | plt.subplot(2,3,4) 95 | plt.plot(odo.t(), odo.vx()[0],'.', label = 'vx') 96 | plt.legend() 97 | plt.subplot(2,3,5) 98 | plt.plot(odo.t(), odo.vy()[0],'.', label = 'vy') 99 | plt.legend() 100 | plt.subplot(2,3,6) 101 | plt.plot(odo.t(), odo.vw()[0],'.', label = 'vw') 102 | plt.legend() 103 | 104 | plt.figure(4) 105 | plt.subplot(2,2,1) 106 | plt.title('Send And Get Velocity') 107 | plt.plot(send.t(), send.vx()[0], 'o', label= 'send vx') 108 | plt.plot(get.t(), get.vx()[0], '.', label= 'get vx') 109 | plt.plot(send.t(), send.max_vx()[0], 'o', label= 'send max vx') 110 | plt.plot(get.t(), get.max_vx()[0], '.', label= 'get max vx') 111 | plt.legend() 112 | plt.subplot(2,2,2) 113 | plt.plot(send.t(), send.vy()[0], 'o', label= 'send vy') 114 | plt.plot(get.t(), get.vy()[0], '.', label= 'get vy') 115 | plt.legend() 116 | plt.subplot(2,2,3) 117 | plt.plot(send.t(), send.vw()[0], 'o', label= 'send vw') 118 | plt.plot(get.t(), get.vw()[0], '.', label= 'get vw') 119 | plt.plot(send.t(), send.max_vw()[0], 'o', label= 'send max vw') 120 | plt.plot(get.t(), get.max_vw()[0], '.', label= 'get max vw') 121 | plt.legend() 122 | plt.subplot(2,2,4) 123 | plt.plot(send.t(), send.steer_angle()[0], 'o', label= 'send steer_angle') 124 | plt.plot(get.t(), get.steer_angle()[0], '.', label= 'get steer_angle') 125 | plt.legend() 126 | 127 | if len(laser.x()[0]) > 0: 128 | plt.figure(5) 129 | plt.subplot(2,1,1) 130 | plt.title("Laser") 131 | plt.subplots_adjust(bottom=0.2,left=0.1) 132 | l1, = plt.plot(laser.x()[0][0], laser.y()[0][0], '.') 133 | plt.axis('equal') 134 | plt.grid() 135 | plt.subplot(2,1,2,projection = 'polar') 136 | plt.subplots_adjust(bottom=0.2,left=0.1) 137 | l2, = plt.plot(laser.angle()[0][0], laser.dist()[0][0], '.') 138 | axcolor = 'lightgoldenrodyellow' # slider的颜色 139 | om1= plt.axes([0.1, 0.08, 0.8, 0.02], facecolor=axcolor) # 第一slider的位置 140 | som1 = Slider(om1, r'Time', 0, len(laser.ts()[0])-1, valinit=0, valfmt='%i') #产生第二slider 141 | def update(val): 142 | s1 = int(som1.val) 143 | l1.set_xdata(laser.x()[0][s1]) 144 | l1.set_ydata(laser.y()[0][s1]) 145 | l2.set_xdata(laser.angle()[0][s1]) 146 | l2.set_ydata(laser.dist()[0][s1]) 147 | som1.on_changed(update) 148 | plt.show() -------------------------------------------------------------------------------- /test1.log: -------------------------------------------------------------------------------- 1 | [2018-12-24 14:55:49.954423][debug] [DO]: 0 0 1 0 1 1 0 0 0 0 1 1 1 1 1 1 2 | [2018-12-24 14:55:49.954423][debug] [DI]: 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 3 | [2018-12-24 14:55:49.954423][debug] [Controller][0.000000|0.000000|0.000000|false|false|false|false|false|false] 4 | [2018-12-24 14:55:49.954423][debug] [Odometer][0|1545634549954720974|5.962220|-0.673270|2.954311|false|-0.001209|0.000000|0.137647|0.000000] 5 | [2018-12-24 14:55:49.970023][debug] DDD: task.parms_size = 1 6 | [2018-12-24 14:55:49.970023][debug] [Get][0.000000|0.000000|0.143552|0.000000|0.500000|0.349066] 7 | [2018-12-24 14:55:49.970023][debug] DDD: curdir_dist2goal = 0.00862632; delta_start_angle = 3.08556 delta_goal_angle =0.0560339; cur_dist2goal =0 m_near_ind 172 m_state = 3 total_size = 173 goal_vel = 0 8 | [2018-12-24 14:55:49.970023][debug] [Send][0.000000|0.000000|0.136906|0.000000|0.500000|0.349066] 9 | [2018-12-24 14:55:49.970023][debug] [IMU][2.823943|1545634549959596381|-0.144751|0.011365|9.591248|0.002128|0.001064|0.145799|-29|-6|-1] 10 | [2018-12-24 14:55:49.970023][debug] [Data][Time Cost|0.068000] 11 | [2018-12-24 14:55:49.970023][debug] m_spin = false m_spin_state = 3 12 | [2018-12-24 14:55:49.970023][debug] DDD: Ouput vx = 0 vw = 0.136906 spin_speed = 0 13 | [2018-12-24 14:55:49.970023][debug] Goto Time = -1.749 14 | [2018-12-24 14:55:49.970023][debug] DDD: local_points_num = 380 global_points_num = 375 15 | [2018-12-24 14:55:49.970023][debug] [Odometer][0|1545634549964989103|5.962167|-0.673260|2.955878|false|0.005222|0.000000|0.152586|0.000000] 16 | [2018-12-24 14:55:49.970023][debug] [Battery][0.575500|-1.158000|47.452999|false|25.000000|0] 17 | [2018-12-24 14:55:49.985623][debug] [Odometer][0|1545634549974312768|5.962148|-0.673257|2.957424|false|0.002156|0.000000|0.165831|0.000000] 18 | [2018-12-24 14:55:49.985623][debug] [IMU][2.827433|1545634549982312819|-0.101086|-0.102881|9.607397|0.005321|-0.001064|0.157505|-29|-6|-1] 19 | [2018-12-24 14:55:49.985623][debug] [Odometer][0|1545634549984449129|5.962128|-0.673253|2.958929|false|0.001984|0.000000|0.148468|0.000000] 20 | [2018-12-24 14:55:50.001223][debug] DDD: local_points_num = 380 global_points_num = 0 21 | [2018-12-24 14:55:50.001223][debug] DDD: task.parms_size = 1 22 | [2018-12-24 14:55:50.001223][debug] [Get][0.000000|0.000000|0.136906|0.000000|0.500000|0.349066] 23 | [2018-12-24 14:55:50.001223][debug] DDD: curdir_dist2goal = 0.00884319; delta_start_angle = 3.0892 delta_goal_angle =0.0523877; cur_dist2goal =0 m_near_ind 172 m_state = 3 total_size = 173 goal_vel = 0 24 | [2018-12-24 14:55:50.001223][debug] [Send][0.000000|0.000000|0.130282|0.000000|0.500000|0.349066] 25 | [2018-12-24 14:55:50.001223][debug] [Data][Time Cost|0.103000] 26 | [2018-12-24 14:55:50.001223][debug] m_spin = false m_spin_state = 3 27 | [2018-12-24 14:55:50.001223][debug] DDD: Ouput vx = 0 vw = 0.130282 spin_speed = 0 28 | [2018-12-24 14:55:50.001223][debug] Goto Time = -1.882 29 | [2018-12-24 14:55:50.001223][debug] [Odometer][0|1545634549997242419|5.962121|-0.673252|2.960475|false|0.000524|0.000000|0.120857|0.000000] 30 | [2018-12-24 14:55:50.016823][debug] [IMU][2.830924|1545634550004971090|-0.068188|-0.227295|9.649268|0.002128|0.000000|0.160698|-29|-6|-1] 31 | [2018-12-24 14:55:50.016823][debug] [Odometer][0|1545634550006432458|5.962135|-0.673254|2.962083|false|-0.001459|0.000000|0.174972|0.000000] 32 | [2018-12-24 14:55:50.016823][debug] [Odometer][0|1545634550016527271|5.962121|-0.673252|2.963526|false|0.001328|0.000000|0.142952|0.000000] 33 | [2018-12-24 14:55:50.016823][debug] [Location][-770.279465|-83636.560624|85.921744|0.862803|0|0|0|0] 34 | [2018-12-24 14:55:50.032423][debug] DDD: local_points_num = 377 global_points_num = 381 35 | [2018-12-24 14:55:50.032423][debug] DDD: task.parms_size = 1 36 | [2018-12-24 14:55:50.032423][debug] [Get][0.000000|0.000000|0.130282|0.000000|0.500000|0.349066] 37 | [2018-12-24 14:55:50.032423][debug] DDD: curdir_dist2goal = 0.0089695; delta_start_angle = 3.09165 delta_goal_angle =0.0499433; cur_dist2goal =0 m_near_ind 172 m_state = 3 total_size = 173 goal_vel = 0 38 | [2018-12-24 14:55:50.032423][debug] [Send][0.000000|0.000000|0.125725|0.000000|0.500000|0.349066] 39 | [2018-12-24 14:55:50.032423][debug] [Data][Time Cost|0.105000] 40 | [2018-12-24 14:55:50.032423][debug] m_spin = false m_spin_state = 3 41 | [2018-12-24 14:55:50.032423][debug] DDD: Ouput vx = 0 vw = 0.125725 spin_speed = 0 42 | [2018-12-24 14:55:50.032423][debug] Goto Time = -1.772 43 | [2018-12-24 14:55:50.032423][debug] [IMU][2.834414|1545634550027658729|0.018542|-0.369653|9.609790|0.003193|0.001064|0.156441|-29|-6|-1] 44 | [2018-12-24 14:55:50.032423][debug] [Odometer][0|1545634550029045310|5.962115|-0.673251|2.966392|false|0.000535|0.000000|0.228913|0.000000] 45 | [2018-12-24 14:55:50.048023][debug] [Odometer][0|1545634550037423116|5.961910|-0.673214|2.967031|false|0.024799|0.000000|0.076282|0.000000] 46 | [2018-12-24 14:55:50.048023][debug] [Odometer][0|1545634550047307864|5.962115|-0.673250|2.967670|false|-0.021019|0.000000|0.064653|0.000000] 47 | [2018-12-24 14:55:50.048023][debug] [IMU][2.837905|1545634550050294806|0.076563|-0.458777|9.667212|0.002128|-0.002128|0.141542|-29|-6|-1] 48 | [2018-12-24 14:55:50.063623][debug] DDD: local_points_num = 376 global_points_num = 0 49 | [2018-12-24 14:55:50.063623][debug] [DO]: 0 0 1 0 1 1 0 0 0 0 1 1 1 1 1 1 50 | [2018-12-24 14:55:50.063623][debug] [DI]: 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 51 | [2018-12-24 14:55:50.063623][debug] [Controller][0.000000|0.000000|0.000000|false|false|false|false|false|false] 52 | [2018-12-24 14:55:50.063623][debug] DDD: task.parms_size = 1 53 | [2018-12-24 14:55:50.063623][debug] [Get][0.000000|0.000000|0.125725|0.000000|0.500000|0.349066] 54 | [2018-12-24 14:55:50.063623][debug] DDD: curdir_dist2goal = 0.00918651; delta_start_angle = 3.10253 delta_goal_angle =0.0390621; cur_dist2goal =0 m_near_ind 172 m_state = 3 total_size = 173 goal_vel = 0 55 | [2018-12-24 14:55:50.063623][debug] [Send][0.000000|0.000000|0.104050|0.000000|0.500000|0.349066] 56 | [2018-12-24 14:55:50.063623][debug] [Data][Time Cost|0.067000] 57 | [2018-12-24 14:55:50.063623][debug] m_spin = false m_spin_state = 3 58 | [2018-12-24 14:55:50.063623][debug] DDD: Ouput vx = 0 vw = 0.10405 spin_speed = 0 59 | [2018-12-24 14:55:50.063623][debug] Goto Time = -2.203 60 | [2018-12-24 14:55:50.063623][debug] [Odometer][0|1545634550059847581|5.962101|-0.673248|2.970144|false|0.001069|0.000000|0.197281|0.000000] 61 | [2018-12-24 14:55:50.079223][debug] [Odometer][0|1545634550069926548|5.962108|-0.673249|2.971236|false|-0.000665|0.000000|0.108406|0.000000] 62 | [2018-12-24 14:55:50.079223][debug] [IMU][2.841396|1545634550073008819|0.062805|-0.463562|9.615173|0.001064|0.003193|0.125579|-29|-6|-1] 63 | [2018-12-24 14:55:50.079223][debug] [Odometer][0|1545634550079274471|5.962101|-0.673248|2.972288|false|0.000717|0.000000|0.112473|0.000000] 64 | [2018-12-24 14:55:50.094823][debug] DDD: task.parms_size = 1 65 | [2018-12-24 14:55:50.094823][debug] [Get][0.000000|0.000000|0.104050|0.000000|0.500000|0.349066] 66 | [2018-12-24 14:55:50.094823][debug] DDD: curdir_dist2goal = 0.00913049; delta_start_angle = 3.10173 delta_goal_angle =0.0398662; cur_dist2goal =0 m_near_ind 172 m_state = 3 total_size = 173 goal_vel = 0 67 | [2018-12-24 14:55:50.094823][debug] [Send][0.000000|0.000000|0.105742|0.000000|0.500000|0.349066] 68 | [2018-12-24 14:55:50.094823][debug] [Data][Time Cost|0.115000] 69 | [2018-12-24 14:55:50.094823][debug] m_spin = false m_spin_state = 3 70 | [2018-12-24 14:55:50.094823][debug] DDD: Ouput vx = 0 vw = 0.105742 spin_speed = 0 71 | [2018-12-24 14:55:50.094823][debug] Goto Time = -1.825 72 | [2018-12-24 14:55:50.094823][debug] [Odometer][0|1545634550090250006|5.962121|-0.673252|2.973298|false|-0.001832|0.000000|0.092037|0.000000] 73 | [2018-12-24 14:55:50.094823][debug] [IMU][2.843141|1545634550095688922|0.059814|-0.415710|9.664221|0.004257|0.001064|0.110679|-29|-6|-1] 74 | [2018-12-24 14:55:50.110423][debug] [Location][-770.136075|-83635.763156|86.821041|0.901932|0|0|0|0] 75 | [2018-12-24 14:55:50.110423][debug] DDD: local_points_num = 377 global_points_num = 377 76 | [2018-12-24 14:55:50.110423][debug] [Odometer][0|1545634550099585439|5.962161|-0.673258|2.974370|false|-0.004308|0.000000|0.114831|0.000000] 77 | [2018-12-24 14:55:50.110423][debug] [Laser][1545634550110423600|-90|90|1|-90|1048.58|-89|1.135|-88|1.51|-87|1.216|-86|1.174|-85|1.203|-84|3.625|-83|3.619|-82|3.627|-81|3.583|-80|3.282|-79|3.646|-78|3.667|-77|3.664|-76|3.628|-75|3.583|-74|3.603|-73|3.622|-72|3.653|-71|3.756|-70|3.777|-69|3.802|-68|3.814|-67|3.795|-66|3.849|-65|3.489|-64|3.914|-63|3.958|-62|3.99|-61|4.02|-60|4.057|-59|4.096|-58|4.139|-57|4.189|-56|4.23|-55|4.262|-54|4.321|-53|4.321|-52|4.424|-51|4.26|-50|4.47|-49|4.47|-48|4.518|-47|4.595|-46|4.794|-45|4.868|-44|4.893|-43|5.03|-42|5.125|-41|5.216|-40|5.48|-39|5.587|-38|5.693|-37|5.825|-36|5.944|-35|7.051|-34|6.916|-33|6.798|-32|6.692|-31|6.659|-30|6.653|-29|6.848|-28|7.074|-27|7.282|-26|7.485|-25|7.732|-24|8.012|-23|8.29|-22|8.619|-21|8.948|-20|9.349|-19|9.718|-18|10.187|-17|10.028|-16|9.965|-15|9.91|-14|11.06|-13|10.856|-12|10.786|-11|13.382|-10|1048.58|-9|1048.58|-8|16.634|-7|18.112|-6|20.495|-5|22.877|-4|1048.58|-3|1048.58|-2|1048.58|-1|1048.58|0|1048.58|1|1048.58|2|11.64|3|1048.58|4|1048.58|5|12.663|6|29.173|7|12.232|8|25.256|9|1048.58|10|16.298|11|16.348|12|16.769|13|19.619|14|19.738|15|12.128|16|20.178|17|7.985|18|7.45|19|7.484|20|7.505|21|7.546|22|7.583|23|12.674|24|1048.58|25|1048.58|26|1048.58|27|25.393|28|22.317|29|12.503|30|13.489|31|13.337|32|15.335|33|1048.58|34|1048.58|35|1048.58|36|14.589|37|14.199|38|19.792|39|1048.58|40|1048.58|41|15.792|42|15.487|43|14.752|44|19.7|45|1048.58|46|22.273|47|1048.58|48|20.162|49|20.354|50|1048.58|51|24.284|52|23.911|53|23.582|54|23.253|55|22.911|56|22.605|57|1048.58|58|1048.58|59|12.893|60|13.228|61|13.582|62|21.085|63|20.874|64|21.077|65|20.731|66|20.572|67|20.429|68|18.793|69|19.797|70|18.589|71|18.963|72|19.357|73|19.221|74|19.472|75|19.301|76|19.214|77|19.114|78|18.85|79|16.838|80|16.72|81|16.696|82|16.69|83|16.532|84|1048.58|85|16.449|86|16.395|87|16.372|88|16.355|89|16.318|90|16.324] 78 | [2018-12-24 14:55:50.110423][debug] [Odometer][0|1545634550109763968|5.962168|-0.673259|2.975421|false|-0.000658|0.000000|0.103294|0.000000] 79 | [2018-12-24 14:55:50.126023][debug] DDD: task.parms_size = 1 80 | [2018-12-24 14:55:50.126023][debug] [Get][0.000000|0.000000|0.105742|0.000000|0.500000|0.349066] 81 | [2018-12-24 14:55:50.126023][debug] DDD: curdir_dist2goal = 0.00932409; delta_start_angle = 3.10501 delta_goal_angle =0.0365786; cur_dist2goal =0 m_near_ind 172 m_state = 3 total_size = 173 goal_vel = 0 82 | [2018-12-24 14:55:50.126023][debug] [Send][0.000000|0.000000|0.098706|0.000000|0.500000|0.349066] 83 | [2018-12-24 14:55:50.126023][debug] [Data][Time Cost|0.070000] 84 | [2018-12-24 14:55:50.126023][debug] m_spin = false m_spin_state = 3 85 | [2018-12-24 14:55:50.126023][debug] DDD: Ouput vx = 0 vw = 0.0987061 spin_speed = 0 86 | [2018-12-24 14:55:50.126023][debug] Goto Time = -1.942 87 | [2018-12-24 14:55:50.126023][debug] [IMU][2.846632|1545634550118349568|0.041870|-0.340344|9.650464|0.002128|0.000000|0.097909|-29|-6|-1] 88 | [2018-12-24 14:55:50.126023][debug] [Odometer][0|1545634550121735684|5.962168|-0.673259|2.976329|false|0.000000|0.000000|0.075768|0.000000] 89 | [2018-12-24 14:55:50.141623][debug] DDD: local_points_num = 374 global_points_num = 379 90 | [2018-12-24 14:55:50.141623][debug] [Odometer][0|1545634550131867142|5.962174|-0.673261|2.977174|false|-0.000662|0.000000|0.083426|0.000000] 91 | [2018-12-24 14:55:50.141623][debug] [IMU][2.848377|1545634550141039477|-0.025122|-0.222510|9.658838|0.002128|0.001064|0.087266|-29|-6|-1] 92 | [2018-12-24 14:55:50.141623][debug] [Odometer][0|1545634550141341516|5.962154|-0.673257|2.978019|false|0.002122|0.000000|0.089212|0.000000] 93 | [2018-12-24 14:55:50.157223][debug] DDD: task.parms_size = 1 94 | [2018-12-24 14:55:50.157223][debug] [Get][0.000000|0.000000|0.098706|0.000000|0.500000|0.349066] 95 | [2018-12-24 14:55:50.157223][debug] DDD: curdir_dist2goal = 0.00896147; delta_start_angle = 3.11095 delta_goal_angle =0.0306414; cur_dist2goal =0 m_near_ind 172 m_state = 3 total_size = 173 goal_vel = 0 96 | [2018-12-24 14:55:50.157223][debug] [Send][0.000000|0.000000|0.085118|0.000000|0.500000|0.349066] 97 | [2018-12-24 14:55:50.157223][debug] [Data][Time Cost|0.065000] 98 | [2018-12-24 14:55:50.157223][debug] m_spin = false m_spin_state = 3 99 | [2018-12-24 14:55:50.157223][debug] DDD: Ouput vx = 0 vw = 0.0851177 spin_speed = 0 100 | [2018-12-24 14:55:50.157223][debug] Goto Time = -1.739 101 | [2018-12-24 14:55:50.157223][debug] [Odometer][0|1545634550152448871|5.962154|-0.673257|2.978926|false|0.000000|0.000000|0.081665|0.000000] 102 | [2018-12-24 14:55:50.157223][debug] [DO]: 0 0 1 0 1 1 0 0 0 0 1 1 1 1 1 1 103 | [2018-12-24 14:55:50.157223][debug] [DI]: 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 104 | [2018-12-24 14:55:50.157223][debug] [Controller][0.000000|0.000000|0.000000|false|false|false|false|false|false] 105 | [2018-12-24 14:55:50.172823][debug] [Odometer][0|1545634550161659916|5.962115|-0.673251|2.979833|false|0.004366|0.000000|0.098477|0.000000] 106 | [2018-12-24 14:55:50.172823][debug] DDD: local_points_num = 380 global_points_num = 0 107 | [2018-12-24 14:55:50.172823][debug] [IMU][2.850123|1545634550163749671|-0.059814|-0.171069|9.599622|0.001064|0.001064|0.085138|-29|-6|-1] 108 | [2018-12-24 14:55:50.172823][debug] [Odometer][0|1545634550171775632|5.962101|-0.673249|2.980699|false|0.001325|0.000000|0.085594|0.000000] 109 | [2018-12-24 14:55:50.188423][debug] [Odometer][0|1545634550181943581|5.962088|-0.673246|2.981565|false|0.001318|0.000000|0.085154|0.000000] 110 | [2018-12-24 14:55:50.188423][debug] [IMU][2.851868|1545634550186406600|-0.057422|-0.143555|9.658838|0.001064|0.001064|0.086202|-29|-6|-1] 111 | [2018-12-24 14:55:50.188423][debug] [Location][-770.144838|-83634.768029|87.558340|0.898571|0|0|0|0] 112 | [2018-12-24 14:55:50.188423][debug] [Odometer][0|1545634550191339245|5.962075|-0.673244|2.982472|false|0.001427|0.000000|0.096542|0.000000] 113 | [2018-12-24 14:55:50.188423][debug] DDD: task.parms_size = 1 114 | [2018-12-24 14:55:50.188423][debug] [Get][0.000000|0.000000|0.085118|0.000000|0.500000|0.349066] 115 | [2018-12-24 14:55:50.188423][debug] DDD: curdir_dist2goal = 0.00908946; delta_start_angle = 3.11228 delta_goal_angle =0.0293153; cur_dist2goal =0 m_near_ind 172 m_state = 3 total_size = 173 goal_vel = 0 116 | [2018-12-24 14:55:50.188423][debug] [Send][0.000000|0.000000|0.081894|0.000000|0.500000|0.349066] 117 | [2018-12-24 14:55:50.188423][debug] [Data][Time Cost|0.069000] 118 | [2018-12-24 14:55:50.188423][debug] m_spin = false m_spin_state = 3 119 | [2018-12-24 14:55:50.188423][debug] DDD: Ouput vx = 0 vw = 0.0818944 spin_speed = 0 120 | [2018-12-24 14:55:50.188423][debug] Goto Time = -14.995 121 | [2018-12-24 14:55:50.204023][debug] DDD: local_points_num = 381 global_points_num = 373 122 | [2018-12-24 14:55:50.204023][debug] [Odometer][0|1545634550201449335|5.962061|-0.673242|2.983338|false|0.001326|0.000000|0.085642|0.000000] 123 | [2018-12-24 14:55:50.219623][debug] [IMU][2.853613|1545634550209065490|-0.090918|-0.189612|9.646277|0.002128|0.001064|0.091523|-29|-6|-1] 124 | [2018-12-24 14:55:50.219623][debug] DDD: task.parms_size = 1 125 | [2018-12-24 14:55:50.219623][debug] [Get][0.000000|0.000000|0.081894|0.000000|0.500000|0.349066] 126 | [2018-12-24 14:55:50.219623][debug] DDD: curdir_dist2goal = 0.00822071; delta_start_angle = 3.11536 delta_goal_angle =0.0262361; cur_dist2goal =0 m_near_ind 172 m_state = 3 total_size = 173 goal_vel = 0 127 | [2018-12-24 14:55:50.219623][debug] [Send][0.000000|0.000000|0.074067|0.000000|0.500000|0.349066] 128 | [2018-12-24 14:55:50.219623][debug] [Data][Time Cost|0.062000] 129 | [2018-12-24 14:55:50.219623][debug] m_spin = false m_spin_state = 3 130 | [2018-12-24 14:55:50.219623][debug] DDD: Ouput vx = 0 vw = 0.0740672 spin_speed = 0 131 | [2018-12-24 14:55:50.219623][debug] Goto Time = -1.995 132 | [2018-12-24 14:55:50.219623][debug] [Odometer][0|1545634550211500690|5.962088|-0.673246|2.984287|false|-0.002667|0.000000|0.094346|0.000000] 133 | [2018-12-24 14:55:50.219623][debug] [Odometer][0|1545634550221658006|5.962088|-0.673246|2.985111|false|0.000000|0.000000|0.081184|0.000000] 134 | [2018-12-24 14:55:50.235223][debug] DDD: local_points_num = 377 global_points_num = 381 135 | [2018-12-24 14:55:50.235223][debug] [Odometer][0|1545634550231635039|5.962095|-0.673247|2.985956|false|-0.000672|0.000000|0.084718|0.000000] 136 | [2018-12-24 14:55:50.235223][debug] [IMU][2.855359|1545634550231854290|-0.057422|-0.287109|9.617566|0.001064|0.001064|0.092588|-29|-6|-1] 137 | [2018-12-24 14:55:50.250823][debug] DDD: task.parms_size = 1 138 | [2018-12-24 14:55:50.250823][debug] [Get][0.000000|0.000000|0.074067|0.000000|0.500000|0.349066] 139 | [2018-12-24 14:55:50.250823][debug] DDD: curdir_dist2goal = 0.00826198; delta_start_angle = 3.11731 delta_goal_angle =0.0242816; cur_dist2goal =0 m_near_ind 172 m_state = 3 total_size = 173 goal_vel = 0 140 | [2018-12-24 14:55:50.250823][debug] [Send][0.000000|0.000000|0.068807|0.000000|0.500000|0.349066] 141 | [2018-12-24 14:55:50.250823][debug] [Data][Time Cost|0.068000] 142 | [2018-12-24 14:55:50.250823][debug] m_spin = false m_spin_state = 3 143 | [2018-12-24 14:55:50.250823][debug] DDD: Ouput vx = 0 vw = 0.0688069 spin_speed = 0 144 | [2018-12-24 14:55:50.250823][debug] Goto Time = -1.959 145 | [2018-12-24 14:55:50.250823][debug] [Odometer][0|1545634550241640355|5.962108|-0.673250|2.986740|false|-0.001340|0.000000|0.078297|0.000000] 146 | [2018-12-24 14:55:50.250823][debug] [Odometer][0|1545634550251743529|5.962095|-0.673247|2.987565|false|0.001327|0.000000|0.081619|0.000000] 147 | [2018-12-24 14:55:50.250823][debug] [DO]: 0 0 1 0 1 1 0 0 0 0 1 1 1 1 1 1 148 | [2018-12-24 14:55:50.250823][debug] [DI]: 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 149 | [2018-12-24 14:55:50.250823][debug] [Controller][0.000000|0.000000|0.000000|false|false|false|false|false|false] 150 | [2018-12-24 14:55:50.266423][debug] [IMU][2.858849|1545634550254462910|0.026318|-0.334961|9.625342|0.002128|0.003193|0.086202|-29|-6|-1] 151 | [2018-12-24 14:55:50.266423][debug] DDD: local_points_num = 377 global_points_num = 0 152 | [2018-12-24 14:55:50.266423][debug] [Odometer][0|1545634550261670187|5.962115|-0.673251|2.988286|false|-0.002025|0.000000|0.072687|0.000000] 153 | [2018-12-24 14:55:50.266423][debug] [Location][-769.907383|-83633.759862|87.946212|0.902288|0|0|0|0] 154 | [2018-12-24 14:55:50.282023][debug] DDD: task.parms_size = 1 155 | [2018-12-24 14:55:50.282023][debug] [Odometer][0|1545634550271567529|5.962108|-0.673250|2.989007|false|0.000677|0.000000|0.072902|0.000000] 156 | [2018-12-24 14:55:50.282023][debug] [Get][0.000000|0.000000|0.068807|0.000000|0.500000|0.349066] 157 | [2018-12-24 14:55:50.282023][debug] DDD: curdir_dist2goal = 0.00829338; delta_start_angle = 3.11802 delta_goal_angle =0.0235734; cur_dist2goal =0 m_near_ind 172 m_state = 3 total_size = 173 goal_vel = 0 158 | [2018-12-24 14:55:50.282023][debug] [Send][0.000000|0.000000|0.066832|0.000000|0.500000|0.349066] 159 | [2018-12-24 14:55:50.282023][debug] [Data][Time Cost|0.100000] 160 | [2018-12-24 14:55:50.282023][debug] m_spin = false m_spin_state = 3 161 | [2018-12-24 14:55:50.282023][debug] DDD: Ouput vx = 0 vw = 0.0668325 spin_speed = 0 162 | [2018-12-24 14:55:50.282023][debug] Goto Time = -1.824 163 | [2018-12-24 14:55:50.282023][debug] [IMU][2.860595|1545634550277187968|0.014954|-0.333167|9.651660|0.002128|0.002128|0.076624|-29|-6|-1] 164 | [2018-12-24 14:55:50.282023][debug] [Odometer][0|1545634550281662703|5.962115|-0.673251|2.989646|false|-0.000664|0.000000|0.063305|0.000000] 165 | [2018-12-24 14:55:50.297623][debug] DDD: local_points_num = 378 global_points_num = 378 166 | [2018-12-24 14:55:50.297623][debug] [Odometer][0|1545634550291610626|5.962115|-0.673251|2.990224|false|0.000000|0.000000|0.058025|0.000000] 167 | [2018-12-24 14:55:50.297623][debug] [IMU][2.860595|1545634550299816355|0.020337|-0.324792|9.622949|0.000000|0.001064|0.064918|-29|-6|-1] 168 | [2018-12-24 14:55:50.313224][debug] [Odometer][0|1545634550301642264|5.962115|-0.673251|2.990842|false|0.000000|0.000000|0.061651|0.000000] 169 | [2018-12-24 14:55:50.313224][debug] DDD: task.parms_size = 1 170 | [2018-12-24 14:55:50.313224][debug] [Get][0.000000|0.000000|0.066832|0.000000|0.500000|0.349066] 171 | [2018-12-24 14:55:50.313224][debug] DDD: curdir_dist2goal = 0.00777362; delta_start_angle = 3.12426 delta_goal_angle =0.0173285; cur_dist2goal =0 m_near_ind 172 m_state = 3 total_size = 173 goal_vel = 0 172 | [2018-12-24 14:55:50.313224][debug] [Send][0.000000|0.000000|0.047281|0.000000|0.500000|0.349066] 173 | [2018-12-24 14:55:50.313224][debug] [Data][Time Cost|0.065000] 174 | [2018-12-24 14:55:50.313224][debug] m_spin = false m_spin_state = 3 175 | [2018-12-24 14:55:50.313224][debug] DDD: Ouput vx = 0 vw = 0.0472806 spin_speed = 0 176 | [2018-12-24 14:55:50.313224][debug] Goto Time = -1.81 177 | [2018-12-24 14:55:50.313224][debug] [Odometer][0|1545634550311776664|5.962115|-0.673251|2.991378|false|0.000000|0.000000|0.052889|0.000000] 178 | [2018-12-24 14:55:50.328824][debug] DDD: local_points_num = 375 global_points_num = 377 179 | [2018-12-24 14:55:50.328824][debug] [Odometer][0|1545634550321855116|5.962101|-0.673249|2.991914|false|0.001330|0.000000|0.053183|0.000000] 180 | [2018-12-24 14:55:50.328824][debug] [IMU][2.862340|1545634550322496819|-0.041870|-0.256006|9.649268|0.001064|0.000000|0.056404|-29|-6|-1] 181 | [2018-12-24 14:55:50.328824][debug] [Odometer][0|1545634550331973722|5.962108|-0.673250|2.992429|false|-0.000662|0.000000|0.050934|0.000000] 182 | [2018-12-24 14:55:50.344424][debug] [Odometer][0|1545634550341325826|5.962029|-0.673238|2.992677|false|0.008600|0.000000|0.026452|0.000000] 183 | [2018-12-24 14:55:50.344424][debug] [IMU][2.864085|1545634550345152355|-0.034094|-0.265576|9.627136|0.001064|-0.001064|0.054275|-29|-6|-1] 184 | [2018-12-24 14:55:50.344424][debug] [Location][-769.911729|-83633.699663|88.284498|0.901753|0|0|0|0] 185 | [2018-12-24 14:55:50.344424][debug] DDD: task.parms_size = 1 186 | [2018-12-24 14:55:50.344424][debug] [Get][0.000000|0.000000|0.047281|0.000000|0.500000|0.349066] 187 | [2018-12-24 14:55:50.344424][debug] DDD: curdir_dist2goal = 0.00764685; delta_start_angle = 3.12209 delta_goal_angle =0.0194998; cur_dist2goal =0 m_near_ind 172 m_state = 3 total_size = 173 goal_vel = 0 188 | [2018-12-24 14:55:50.344424][debug] [Send][0.000000|0.000000|0.054615|0.000000|0.500000|0.349066] 189 | [2018-12-24 14:55:50.344424][debug] [Data][Time Cost|0.063000] 190 | [2018-12-24 14:55:50.344424][debug] m_spin = false m_spin_state = 3 191 | [2018-12-24 14:55:50.344424][debug] DDD: Ouput vx = 0 vw = 0.0546152 spin_speed = 0 192 | [2018-12-24 14:55:50.344424][debug] Goto Time = -14.714 193 | [2018-12-24 14:55:50.360024][debug] DDD: local_points_num = 375 global_points_num = 377 194 | [2018-12-24 14:55:50.360024][debug] [Odometer][0|1545634550352479684|5.962108|-0.673249|2.993419|false|-0.007210|0.000000|0.066538|0.000000] 195 | [2018-12-24 14:55:50.360024][debug] [DO]: 0 0 1 0 1 1 0 0 0 0 1 1 1 1 1 1 196 | [2018-12-24 14:55:50.360024][debug] [DI]: 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 197 | [2018-12-24 14:55:50.360024][debug] [Controller][0.000000|0.000000|0.000000|false|false|false|false|false|false] 198 | [2018-12-24 14:55:50.360024][debug] [Odometer][0|1545634550361581310|5.962035|-0.673239|2.993646|false|0.008100|0.000000|0.024915|0.000000] 199 | [2018-12-24 14:55:50.375624][debug] DDD: task.parms_size = 1 200 | [2018-12-24 14:55:50.375624][debug] [Get][0.000000|0.000000|0.054615|0.000000|0.500000|0.349066] 201 | [2018-12-24 14:55:50.375624][debug] DDD: curdir_dist2goal = 0.00757441; delta_start_angle = 3.12257 delta_goal_angle =0.0190181; cur_dist2goal =0 m_near_ind 172 m_state = 3 total_size = 173 goal_vel = 0 202 | [2018-12-24 14:55:50.375624][debug] [Send][0.000000|0.000000|0.053049|0.000000|0.500000|0.349066] 203 | [2018-12-24 14:55:50.375624][debug] [Data][Time Cost|0.099000] 204 | [2018-12-24 14:55:50.375624][debug] m_spin = false m_spin_state = 3 205 | [2018-12-24 14:55:50.375624][debug] DDD: Ouput vx = 0 vw = 0.0530491 spin_speed = 0 206 | [2018-12-24 14:55:50.375624][debug] Goto Time = -1.82 207 | [2018-12-24 14:55:50.375624][debug] [IMU][2.865830|1545634550367830084|-0.002393|-0.296680|9.657642|-0.001064|-0.003193|0.048954|-29|-6|-1] 208 | [2018-12-24 14:55:50.375624][debug] [Odometer][0|1545634550371764690|5.962108|-0.673249|2.993873|false|-0.007240|0.000000|0.022269|0.000000] 209 | [2018-12-24 14:55:50.391224][debug] DDD: local_points_num = 380 global_points_num = 379 210 | [2018-12-24 14:55:50.391224][debug] [Odometer][0|1545634550381925516|5.962101|-0.673248|2.994306|false|0.000660|0.000000|0.042607|0.000000] 211 | [2018-12-24 14:55:50.391224][debug] [IMU][2.865830|1545634550390499813|-0.030505|-0.216528|9.643884|0.002128|0.000000|0.044697|-29|-6|-1] 212 | [2018-12-24 14:55:50.391224][debug] [Odometer][0|1545634550391288200|5.962101|-0.673248|2.994759|false|0.000000|0.000000|0.048441|0.000000] 213 | [2018-12-24 14:55:50.406824][debug] DDD: task.parms_size = 1 214 | [2018-12-24 14:55:50.406824][debug] [Get][0.000000|0.000000|0.053049|0.000000|0.500000|0.349066] 215 | [2018-12-24 14:55:50.406824][debug] DDD: curdir_dist2goal = 0.00765371; delta_start_angle = 3.12539 delta_goal_angle =0.0162059; cur_dist2goal =0 m_near_ind 172 m_state = 3 total_size = 173 goal_vel = 0 216 | [2018-12-24 14:55:50.406824][debug] [Send][0.000000|0.000000|0.043161|0.000000|0.500000|0.349066] 217 | [2018-12-24 14:55:50.406824][debug] [Data][Time Cost|0.070000] 218 | [2018-12-24 14:55:50.406824][debug] m_spin = false m_spin_state = 3 219 | [2018-12-24 14:55:50.406824][debug] DDD: Ouput vx = 0 vw = 0.043161 spin_speed = 0 220 | [2018-12-24 14:55:50.406824][debug] Goto Time = -1.782 221 | [2018-12-24 14:55:50.406824][debug] [Odometer][0|1545634550402439271|5.962015|-0.673236|2.995481|false|0.007813|0.000000|0.064706|0.000000] 222 | [2018-12-24 14:55:50.422424][debug] [Odometer][0|1545634550411758703|5.962095|-0.673247|2.995728|false|-0.008630|0.000000|0.026545|0.000000] 223 | [2018-12-24 14:55:50.422424][debug] DDD: local_points_num = 377 global_points_num = 384 224 | [2018-12-24 14:55:50.422424][debug] [IMU][2.867576|1545634550413201697|-0.070581|-0.158508|9.635510|0.004257|0.001064|0.044697|-29|-6|-1] 225 | [2018-12-24 14:55:50.422424][debug] [Odometer][0|1545634550421905335|5.962095|-0.673247|2.996181|false|0.000000|0.000000|0.044698|0.000000] 226 | [2018-12-24 14:55:50.422424][debug] [Location][-770.950735|-83633.424101|88.648834|0.910179|0|0|0|0] 227 | [2018-12-24 14:55:50.438024][debug] DDD: task.parms_size = 1 228 | [2018-12-24 14:55:50.438024][debug] [Get][0.000000|0.000000|0.043161|0.000000|0.500000|0.349066] 229 | [2018-12-24 14:55:50.438024][debug] DDD: curdir_dist2goal = 0.00770627; delta_start_angle = 3.1254 delta_goal_angle =0.0161966; cur_dist2goal =0 m_near_ind 172 m_state = 3 total_size = 173 goal_vel = 0 230 | [2018-12-24 14:55:50.438024][debug] [Send][0.000000|0.000000|0.043126|0.000000|0.500000|0.349066] 231 | [2018-12-24 14:55:50.438024][debug] [Data][Time Cost|0.068000] 232 | [2018-12-24 14:55:50.438024][debug] m_spin = false m_spin_state = 3 233 | [2018-12-24 14:55:50.438024][debug] DDD: Ouput vx = 0 vw = 0.0431258 spin_speed = 0 234 | [2018-12-24 14:55:50.438024][debug] Goto Time = -1.768 235 | [2018-12-24 14:55:50.438024][debug] [Odometer][0|1545634550434757155|5.962088|-0.673246|2.997109|false|0.000521|0.000000|0.072184|0.000000] 236 | [2018-12-24 14:55:50.438024][debug] [IMU][2.867576|1545634550435911890|-0.056824|-0.143555|9.622351|0.002128|0.000000|0.048954|-29|-6|-1] 237 | [2018-12-24 14:55:50.453624][debug] DDD: local_points_num = 378 global_points_num = 0 238 | [2018-12-24 14:55:50.453624][debug] [Odometer][0|1545634550443292845|5.962008|-0.673235|2.997357|false|0.009422|0.000000|0.028982|0.000000] 239 | [2018-12-24 14:55:50.453624][debug] [DO]: 0 0 1 0 1 1 0 0 0 0 1 1 1 1 1 1 240 | [2018-12-24 14:55:50.453624][debug] [DI]: 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 241 | [2018-12-24 14:55:50.453624][debug] [Controller][0.000000|0.000000|0.000000|false|false|false|false|false|false] 242 | [2018-12-24 14:55:50.453624][debug] [Odometer][0|1545634550453508897|5.962015|-0.673236|2.997831|false|-0.000656|0.000000|0.046413|0.000000] 243 | [2018-12-24 14:55:50.469224][debug] [IMU][2.869321|1545634550458529955|-0.037683|-0.211743|9.636108|0.000000|0.000000|0.048954|-29|-6|-1] 244 | [2018-12-24 14:55:50.469224][debug] DDD: task.parms_size = 1 245 | [2018-12-24 14:55:50.469224][debug] [Get][0.000000|0.000000|0.043126|0.000000|0.500000|0.349066] 246 | [2018-12-24 14:55:50.469224][debug] DDD: curdir_dist2goal = 0.00758005; delta_start_angle = 3.12669 delta_goal_angle =0.014904; cur_dist2goal =0 m_near_ind 172 m_state = 3 total_size = 173 goal_vel = 0 247 | [2018-12-24 14:55:50.469224][debug] [Send][0.000000|0.000000|0.037996|0.000000|0.500000|0.349066] 248 | [2018-12-24 14:55:50.469224][debug] [Data][Time Cost|0.062000] 249 | [2018-12-24 14:55:50.469224][debug] m_spin = false m_spin_state = 3 250 | [2018-12-24 14:55:50.469224][debug] DDD: Ouput vx = 0 vw = 0.0379964 spin_speed = 0 251 | [2018-12-24 14:55:50.469224][debug] Goto Time = -1.911 252 | [2018-12-24 14:55:50.469224][debug] [Odometer][0|1545634550464448974|5.962075|-0.673244|2.998552|false|-0.005514|0.000000|0.065954|0.000000] 253 | [2018-12-24 14:55:50.484824][debug] [Odometer][0|1545634550473763968|5.962002|-0.673234|2.998779|false|0.007914|0.000000|0.024345|0.000000] 254 | [2018-12-24 14:55:50.484824][debug] DDD: local_points_num = 378 global_points_num = 378 255 | [2018-12-24 14:55:50.484824][debug] [IMU][2.871067|1545634550481228226|-0.040076|-0.229688|9.640295|0.001064|-0.002128|0.046826|-29|-6|-1] 256 | [2018-12-24 14:55:50.484824][debug] [Odometer][0|1545634550483743993|5.961995|-0.673233|2.999212|false|0.000672|0.000000|0.043379|0.000000] 257 | [2018-12-24 14:55:50.500424][debug] DDD: task.parms_size = 1 258 | [2018-12-24 14:55:50.500424][debug] [Get][0.000000|0.000000|0.037996|0.000000|0.500000|0.349066] 259 | [2018-12-24 14:55:50.500424][debug] DDD: curdir_dist2goal = 0.00759946; delta_start_angle = 3.12745 delta_goal_angle =0.0141463; cur_dist2goal =0 m_near_ind 172 m_state = 3 total_size = 173 goal_vel = 0 260 | [2018-12-24 14:55:50.500424][debug] [Send][0.000000|0.000000|0.034757|0.000000|0.500000|0.349066] 261 | [2018-12-24 14:55:50.500424][debug] [Data][Time Cost|0.068000] 262 | [2018-12-24 14:55:50.500424][debug] m_spin = false m_spin_state = 3 263 | [2018-12-24 14:55:50.500424][debug] DDD: Ouput vx = 0 vw = 0.0347567 spin_speed = 0 264 | [2018-12-24 14:55:50.500424][debug] Goto Time = -1.74 265 | [2018-12-24 14:55:50.500424][debug] [Odometer][0|1545634550495643348|5.962068|-0.673243|2.999851|false|-0.006196|0.000000|0.053707|0.000000] 266 | [2018-12-24 14:55:50.516024][debug] [IMU][2.871067|1545634550503935374|-0.028113|-0.284717|9.655249|0.001064|0.003193|0.043633|-29|-6|-1] 267 | [2018-12-24 14:55:50.516024][debug] [Odometer][0|1545634550504970368|5.962055|-0.673242|3.000222|false|0.001437|0.000000|0.039785|0.000000] 268 | [2018-12-24 14:55:50.516024][debug] DDD: local_points_num = 377 global_points_num = 378 269 | [2018-12-24 14:55:50.516024][debug] [NetworkCmd][Status|1100|0|192.168.0.100|50828|true] 270 | [2018-12-24 14:55:50.516024][debug] [Odometer][0|1545634550514320355|5.962002|-0.673234|3.000387|false|0.005734|0.000000|0.017639|0.000000] 271 | [2018-12-24 14:55:50.531624][debug] [Location][-771.915137|-83633.004837|88.879408|0.904056|0|0|0|0] 272 | [2018-12-24 14:55:50.531624][debug] DDD: task.parms_size = 1 273 | [2018-12-24 14:55:50.531624][debug] [Get][0.000000|0.000000|0.034757|0.000000|0.500000|0.349066] 274 | [2018-12-24 14:55:50.531624][debug] DDD: curdir_dist2goal = 0.00759439; delta_start_angle = 3.1285 delta_goal_angle =0.0130955; cur_dist2goal =0 m_near_ind 172 m_state = 3 total_size = 173 goal_vel = 0 275 | [2018-12-24 14:55:50.531624][debug] [Send][0.000000|0.000000|0.029848|0.000000|0.500000|0.349066] 276 | [2018-12-24 14:55:50.531624][debug] [Data][Time Cost|0.097000] 277 | [2018-12-24 14:55:50.531624][debug] m_spin = false m_spin_state = 3 278 | [2018-12-24 14:55:50.531624][debug] DDD: Ouput vx = 0 vw = 0.0298477 spin_speed = 0 279 | [2018-12-24 14:55:50.531624][debug] Goto Time = -1.904 280 | [2018-12-24 14:55:50.531624][debug] [Odometer][0|1545634550524775787|5.962002|-0.673234|3.000799|false|0.000000|0.000000|0.039435|0.000000] 281 | [2018-12-24 14:55:50.531624][debug] [IMU][2.872812|1545634550526558393|-0.041272|-0.293091|9.655249|0.001064|-0.002128|0.039376|-29|-6|-1] 282 | [2018-12-24 14:55:50.547224][debug] [Odometer][0|1545634550536488303|5.962055|-0.673241|3.001294|false|-0.004578|0.000000|0.042243|0.000000] 283 | [2018-12-24 14:55:50.547224][debug] DDD: local_points_num = 380 global_points_num = 0 284 | [2018-12-24 14:55:50.547224][debug] [Odometer][0|1545634550545747813|5.962061|-0.673242|3.001603|false|-0.000724|0.000000|0.033396|0.000000] 285 | [2018-12-24 14:55:50.547224][debug] [IMU][2.872812|1545634550549239529|-0.001196|-0.297278|9.634314|0.001064|-0.001064|0.034055|-29|-6|-1] 286 | [2018-12-24 14:55:50.562824][debug] DDD: task.parms_size = 1 287 | [2018-12-24 14:55:50.562824][debug] [Get][0.000000|0.000000|0.029848|0.000000|0.500000|0.349066] 288 | [2018-12-24 14:55:50.562824][debug] DDD: curdir_dist2goal = 0.00731076; delta_start_angle = 3.12971 delta_goal_angle =0.0118831; cur_dist2goal =0 m_near_ind 172 m_state = 3 total_size = 173 goal_vel = 0 289 | [2018-12-24 14:55:50.562824][debug] [Send][0.000000|0.000000|0.023286|0.000000|0.500000|0.349066] 290 | [2018-12-24 14:55:50.562824][debug] [Data][Time Cost|0.069000] 291 | [2018-12-24 14:55:50.562824][debug] m_spin = false m_spin_state = 3 292 | [2018-12-24 14:55:50.562824][debug] DDD: Ouput vx = 0 vw = 0.0232859 spin_speed = 0 293 | [2018-12-24 14:55:50.562824][debug] Goto Time = -1.644 294 | [2018-12-24 14:55:50.562824][debug] [DO]: 0 0 1 0 1 1 0 0 0 0 1 1 1 1 1 1 295 | [2018-12-24 14:55:50.562824][debug] [DI]: 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 296 | [2018-12-24 14:55:50.562824][debug] [Controller][0.000000|0.000000|0.000000|false|false|false|false|false|false] 297 | [2018-12-24 14:55:50.562824][debug] [Odometer][0|1545634550558554935|5.962075|-0.673244|3.001892|false|-0.001047|0.000000|0.022536|0.000000] 298 | [2018-12-24 14:55:50.578424][debug] [Odometer][0|1545634550567884845|5.962075|-0.673244|3.002139|false|0.000000|0.000000|0.026515|0.000000] 299 | [2018-12-24 14:55:50.578424][debug] DDD: local_points_num = 377 global_points_num = 378 -------------------------------------------------------------------------------- /test2.log: -------------------------------------------------------------------------------- 1 | [2018-12-24 14:55:50.578424][debug] [IMU][2.874557|1545634550571943735|-0.014355|-0.279333|9.616370|0.001064|-0.004257|0.026606|-29|-6|-1] 2 | [2018-12-24 14:55:50.578424][debug] [Odometer][0|1545634550578935064|5.962075|-0.673244|3.002387|false|0.000000|0.000000|0.022387|0.000000] 3 | [2018-12-24 14:55:50.594024][debug] DDD: task.parms_size = 1 4 | [2018-12-24 14:55:50.594024][debug] [Get][0.000000|0.000000|0.023286|0.000000|0.500000|0.349066] 5 | [2018-12-24 14:55:50.594024][debug] DDD: curdir_dist2goal = 0.007333; delta_start_angle = 3.13001 delta_goal_angle =0.0115826; cur_dist2goal =0 m_near_ind 172 m_state = 3 total_size = 173 goal_vel = 0 6 | [2018-12-24 14:55:50.594024][debug] [Send][0.000000|0.000000|0.021442|0.000000|0.500000|0.349066] 7 | [2018-12-24 14:55:50.594024][debug] [Data][Time Cost|0.066000] 8 | [2018-12-24 14:55:50.594024][debug] m_spin = false m_spin_state = 3 9 | [2018-12-24 14:55:50.594024][debug] DDD: Ouput vx = 0 vw = 0.0214417 spin_speed = 0 10 | [2018-12-24 14:55:50.594024][debug] Goto Time = -1.793 11 | [2018-12-24 14:55:50.594024][debug] [Odometer][0|1545634550589174548|5.962088|-0.673246|3.002593|false|-0.001309|0.000000|0.020133|0.000000] 12 | [2018-12-24 14:55:50.594024][debug] [IMU][2.874557|1545634550594631374|-0.028113|-0.279333|9.632520|0.001064|-0.001064|0.023413|-29|-6|-1] 13 | [2018-12-24 14:55:50.609624][debug] [Odometer][0|1545634550598479529|5.962088|-0.673246|3.002799|false|0.000000|0.000000|0.022155|0.000000] 14 | [2018-12-24 14:55:50.609624][debug] DDD: local_points_num = 375 global_points_num = 0 15 | [2018-12-24 14:55:50.609624][debug] [Odometer][0|1545634550608547813|5.962088|-0.673246|3.003006|false|0.000000|0.000000|0.020476|0.000000] 16 | [2018-12-24 14:55:50.609624][debug] [Location][-772.230495|-83632.375420|89.042260|0.893181|0|0|0|0] 17 | [2018-12-24 14:55:50.625224][debug] DDD: task.parms_size = 1 18 | [2018-12-24 14:55:50.625224][debug] [Get][0.000000|0.000000|0.021442|0.000000|0.500000|0.349066] 19 | [2018-12-24 14:55:50.625224][debug] DDD: curdir_dist2goal = 0.00738453; delta_start_angle = 3.12982 delta_goal_angle =0.0117714; cur_dist2goal =0 m_near_ind 172 m_state = 3 total_size = 173 goal_vel = 0 20 | [2018-12-24 14:55:50.625224][debug] [Send][0.000000|0.000000|0.022596|0.000000|0.500000|0.349066] 21 | [2018-12-24 14:55:50.625224][debug] [Data][Time Cost|0.068000] 22 | [2018-12-24 14:55:50.625224][debug] m_spin = false m_spin_state = 3 23 | [2018-12-24 14:55:50.625224][debug] DDD: Ouput vx = 0 vw = 0.0225956 spin_speed = 0 24 | [2018-12-24 14:55:50.625224][debug] Goto Time = -1.85 25 | [2018-12-24 14:55:50.625224][debug] [IMU][2.874557|1545634550617260277|-0.028113|-0.238062|9.624744|0.002128|0.002128|0.018092|-29|-6|-1] 26 | [2018-12-24 14:55:50.625224][debug] [Odometer][0|1545634550620393490|5.962088|-0.673246|3.003129|false|0.000000|0.000000|0.010442|0.000000] 27 | [2018-12-24 14:55:50.640824][debug] [Odometer][0|1545634550629591013|5.962095|-0.673247|3.003315|false|-0.000729|0.000000|0.020173|0.000000] 28 | [2018-12-24 14:55:50.640824][debug] DDD: local_points_num = 381 global_points_num = 375 29 | [2018-12-24 14:55:50.640824][debug] [Laser][1545634550640824500|-90|90|1|-90|1048.58|-89|1.241|-88|1.195|-87|1048.58|-86|3.636|-85|3.654|-84|3.649|-83|3.62|-82|3.642|-81|3.663|-80|3.681|-79|3.694|-78|3.646|-77|3.59|-76|3.637|-75|3.632|-74|3.665|-73|3.784|-72|3.808|-71|3.815|-70|3.844|-69|3.812|-68|3.847|-67|3.617|-66|3.957|-65|3.986|-64|4.024|-63|4.05|-62|4.082|-61|4.113|-60|4.153|-59|4.202|-58|4.24|-57|4.29|-56|4.36|-55|4.386|-54|4.453|-53|4.032|-52|4.492|-51|4.488|-50|4.568|-49|4.619|-48|4.835|-47|4.91|-46|4.979|-45|5.075|-44|4.785|-43|5.253|-42|5.516|-41|5.614|-40|5.745|-39|5.865|-38|5.985|-37|7.023|-36|6.901|-35|6.784|-34|6.696|-33|6.666|-32|6.697|-31|6.891|-30|7.13|-29|7.333|-28|7.565|-27|7.822|-26|8.101|-25|8.39|-24|8.696|-23|9.046|-22|9.424|-21|9.834|-20|10.283|-19|10.008|-18|9.946|-17|9.961|-16|11.052|-15|10.821|-14|12.209|-13|10.806|-12|14.49|-11|15.762|-10|16.778|-9|1048.58|-8|20.506|-7|22.937|-6|26.452|-5|1048.58|-4|1048.58|-3|1048.58|-2|1048.58|-1|1048.58|0|11.672|1|1048.58|2|1048.58|3|11.779|4|1048.58|5|11.838|6|25.263|7|1048.58|8|16.315|9|16.347|10|16.532|11|19.614|12|19.756|13|12.088|14|20.138|15|7.845|16|7.439|17|7.481|18|7.516|19|7.55|20|7.59|21|12.544|22|17.255|23|1048.58|24|1048.58|25|27.623|26|1048.58|27|12.504|28|13.386|29|1048.58|30|19.574|31|15.337|32|1048.58|33|13.24|34|14.687|35|14.321|36|19.798|37|15.853|38|1048.58|39|15.743|40|15.369|41|14.782|42|19.768|43|22.651|44|1048.58|45|20.372|46|20.111|47|20.421|48|1048.58|49|24.25|50|23.905|51|23.528|52|23.171|53|22.862|54|22.568|55|1048.58|56|1048.58|57|12.908|58|13.279|59|21.266|60|21.063|61|20.833|62|20.976|63|20.686|64|20.557|65|18.76|66|18.79|67|19.766|68|18.475|69|18.995|70|19.339|71|19.207|72|19.465|73|19.272|74|19.184|75|19.092|76|18.69|77|16.847|78|16.744|79|16.672|80|16.667|81|16.536|82|16.464|83|16.415|84|16.391|85|16.349|86|16.33|87|16.315|88|16.31|89|18.122|90|16.363] 30 | [2018-12-24 14:55:50.640824][debug] [Odometer][0|1545634550639796845|5.962088|-0.673246|3.003500|false|0.000657|0.000000|0.018180|0.000000] 31 | [2018-12-24 14:55:50.640824][debug] [IMU][2.874557|1545634550640015735|-0.040674|-0.191406|9.616370|0.001064|0.000000|0.014899|-29|-6|-1] 32 | [2018-12-24 14:55:50.656424][debug] DDD: task.parms_size = 1 33 | [2018-12-24 14:55:50.656424][debug] [Get][0.000000|0.000000|0.022596|0.000000|0.500000|0.349066] 34 | [2018-12-24 14:55:50.656424][debug] DDD: curdir_dist2goal = 0.00679788; delta_start_angle = 3.1311 delta_goal_angle =0.0104922; cur_dist2goal =0 m_near_ind 172 m_state = 3 total_size = 173 goal_vel = 0 35 | [2018-12-24 14:55:50.656424][debug] [Send][0.000000|0.000000|0.013423|0.000000|0.500000|0.349066] 36 | [2018-12-24 14:55:50.656424][debug] [Data][Time Cost|0.065000] 37 | [2018-12-24 14:55:50.656424][debug] m_spin = false m_spin_state = 3 38 | [2018-12-24 14:55:50.656424][debug] DDD: Ouput vx = 0 vw = 0.0134229 spin_speed = 0 39 | [2018-12-24 14:55:50.656424][debug] Goto Time = -1.978 40 | [2018-12-24 14:55:50.656424][debug] [Odometer][0|1545634550652359684|5.962095|-0.673247|3.003644|false|-0.000533|0.000000|0.011487|0.000000] 41 | [2018-12-24 14:55:50.656424][debug] [DO]: 0 0 1 0 1 1 0 0 0 0 1 1 1 1 1 1 42 | [2018-12-24 14:55:50.656424][debug] [DI]: 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 43 | [2018-12-24 14:55:50.656424][debug] [Controller][0.000000|0.000000|0.000000|false|false|false|false|false|false] 44 | [2018-12-24 14:55:50.672024][debug] DDD: local_points_num = 376 global_points_num = 0 45 | [2018-12-24 14:55:50.672024][debug] [Odometer][0|1545634550661577593|5.962081|-0.673245|3.003809|false|0.001454|0.000000|0.017892|0.000000] 46 | [2018-12-24 14:55:50.672024][debug] [IMU][2.876303|1545634550662619090|-0.054431|-0.174658|9.652258|-0.001064|-0.001064|0.017028|-29|-6|-1] 47 | [2018-12-24 14:55:50.672024][debug] [Odometer][0|1545634550671648097|5.962081|-0.673245|3.004016|false|0.000000|0.000000|0.020471|0.000000] 48 | [2018-12-24 14:55:50.687624][debug] [Odometer][0|1545634550681733361|5.962081|-0.673245|3.004181|false|0.000000|0.000000|0.016353|0.000000] 49 | [2018-12-24 14:55:50.687624][debug] [IMU][2.876303|1545634550685286600|-0.080750|-0.193201|9.665417|0.000000|-0.002128|0.019156|-29|-6|-1] 50 | [2018-12-24 14:55:50.687624][debug] [Location][-772.730900|-83632.419180|89.178290|0.907268|0|0|0|0] 51 | [2018-12-24 14:55:50.687624][debug] DDD: task.parms_size = 1 52 | [2018-12-24 14:55:50.687624][debug] [Get][0.000000|0.000000|0.013423|0.000000|0.500000|0.349066] 53 | [2018-12-24 14:55:50.687624][debug] DDD: curdir_dist2goal = 0.00670246; delta_start_angle = 3.12931 delta_goal_angle =0.0122823; cur_dist2goal =0 m_near_ind 172 m_state = 3 total_size = 173 goal_vel = 0 54 | [2018-12-24 14:55:50.687624][debug] [Send][0.000000|0.000000|0.025600|0.000000|0.500000|0.349066] 55 | [2018-12-24 14:55:50.687624][debug] [Data][Time Cost|0.064000] 56 | [2018-12-24 14:55:50.687624][debug] m_spin = false m_spin_state = 3 57 | [2018-12-24 14:55:50.687624][debug] DDD: Ouput vx = 0 vw = 0.0255997 spin_speed = 0 58 | [2018-12-24 14:55:50.687624][debug] Goto Time = -14.238 59 | [2018-12-24 14:55:50.703224][debug] [Odometer][0|1545634550691791426|5.962075|-0.673244|3.004366|false|0.000666|0.000000|0.018447|0.000000] 60 | [2018-12-24 14:55:50.703224][debug] DDD: local_points_num = 376 global_points_num = 381 61 | [2018-12-24 14:55:50.703224][debug] [Odometer][0|1545634550701907658|5.962075|-0.673244|3.004490|false|0.000000|0.000000|0.012227|0.000000] 62 | [2018-12-24 14:55:50.718824][debug] [IMU][2.876303|1545634550707998187|-0.067590|-0.206958|9.628931|0.002128|0.002128|0.018092|-29|-6|-1] 63 | [2018-12-24 14:55:50.718824][debug] DDD: task.parms_size = 1 64 | [2018-12-24 14:55:50.718824][debug] [Get][0.000000|0.000000|0.025600|0.000000|0.500000|0.349066] 65 | [2018-12-24 14:55:50.718824][debug] DDD: curdir_dist2goal = 0.00689992; delta_start_angle = 3.13237 delta_goal_angle =0.00922144; cur_dist2goal =0 m_near_ind 172 m_state = 3 total_size = 173 goal_vel = 0 66 | [2018-12-24 14:55:50.718824][debug] [Send][0.000000|0.000000|0.001925|0.000000|0.500000|0.349066] 67 | [2018-12-24 14:55:50.718824][debug] [Data][Time Cost|0.063000] 68 | [2018-12-24 14:55:50.718824][debug] m_spin = false m_spin_state = 3 69 | [2018-12-24 14:55:50.718824][debug] DDD: Ouput vx = 0 vw = 0.00192465 spin_speed = 0 70 | [2018-12-24 14:55:50.718824][debug] Goto Time = -1.907 71 | [2018-12-24 14:55:50.718824][debug] [Odometer][0|1545634550712328303|5.962068|-0.673243|3.004675|false|0.000643|0.000000|0.017805|0.000000] 72 | [2018-12-24 14:55:50.718824][debug] [Odometer][0|1545634550721359993|5.962068|-0.673243|3.004882|false|0.000000|0.000000|0.022826|0.000000] 73 | [2018-12-24 14:55:50.734424][debug] DDD: local_points_num = 376 global_points_num = 377 74 | [2018-12-24 14:55:50.734424][debug] [IMU][2.876303|1545634550730668329|-0.069983|-0.197388|9.640295|0.000000|-0.001064|0.013835|-29|-6|-1] 75 | [2018-12-24 14:55:50.734424][debug] [Odometer][0|1545634550731458058|5.962068|-0.673243|3.005005|false|0.000000|0.000000|0.012249|0.000000] 76 | [2018-12-24 14:55:50.750024][debug] DDD: task.parms_size = 1 77 | [2018-12-24 14:55:50.750024][debug] [Get][0.000000|0.000000|0.001925|0.000000|0.500000|0.349066] 78 | [2018-12-24 14:55:50.750024][debug] DDD: curdir_dist2goal = 0.00671412; delta_start_angle = 3.12919 delta_goal_angle =0.0124005; cur_dist2goal =0 m_near_ind 172 m_state = 3 total_size = 173 goal_vel = 0 79 | [2018-12-24 14:55:50.750024][debug] [Send][0.000000|0.000000|0.017633|0.000000|0.500000|0.349066] 80 | [2018-12-24 14:55:50.750024][debug] [Data][Time Cost|0.066000] 81 | [2018-12-24 14:55:50.750024][debug] m_spin = false m_spin_state = 3 82 | [2018-12-24 14:55:50.750024][debug] DDD: Ouput vx = 0 vw = 0.0176326 spin_speed = 0 83 | [2018-12-24 14:55:50.750024][debug] Goto Time = -1.765 84 | [2018-12-24 14:55:50.750024][debug] [Odometer][0|1545634550741540742|5.962081|-0.673245|3.005129|false|-0.001329|0.000000|0.012268|0.000000] 85 | [2018-12-24 14:55:50.750024][debug] [Odometer][0|1545634550751678961|5.962075|-0.673244|3.005273|false|0.000661|0.000000|0.014234|0.000000] 86 | [2018-12-24 14:55:50.750024][debug] [DO]: 0 0 1 0 1 1 0 0 0 0 1 1 1 1 1 1 87 | [2018-12-24 14:55:50.750024][debug] [DI]: 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 88 | [2018-12-24 14:55:50.765624][debug] [Controller][0.000000|0.000000|0.000000|false|false|false|false|false|false] 89 | [2018-12-24 14:55:50.765624][debug] [IMU][2.876303|1545634550753458935|-0.017346|-0.243445|9.628931|0.000000|0.001064|0.017028|-29|-6|-1] 90 | [2018-12-24 14:55:50.765624][debug] DDD: local_points_num = 375 global_points_num = 377 91 | [2018-12-24 14:55:50.765624][debug] [Odometer][0|1545634550761771452|5.962081|-0.673245|3.005376|false|-0.000664|0.000000|0.010213|0.000000] 92 | [2018-12-24 14:55:50.765624][debug] [Battery][0.577833|-1.166000|47.466999|false|24.000000|0] 93 | [2018-12-24 14:55:50.765624][debug] [Location][-773.782582|-83632.170204|89.220002|0.907546|0|0|0|0] 94 | [2018-12-24 14:55:50.781224][debug] DDD: task.parms_size = 1 95 | [2018-12-24 14:55:50.781224][debug] [Get][0.000000|0.000000|0.017633|0.000000|0.500000|0.349066] 96 | [2018-12-24 14:55:50.781224][debug] DDD: curdir_dist2goal = 0.00689095; delta_start_angle = 3.13249 delta_goal_angle =0.00910518; cur_dist2goal =0 m_near_ind 172 m_state = 3 total_size = 173 goal_vel = 0 97 | [2018-12-24 14:55:50.781224][debug] [Send][0.000000|0.000000|0.001701|0.000000|0.500000|0.349066] 98 | [2018-12-24 14:55:50.781224][debug] [Data][Time Cost|0.069000] 99 | [2018-12-24 14:55:50.781224][debug] m_spin = false m_spin_state = 3 100 | [2018-12-24 14:55:50.781224][debug] DDD: Ouput vx = 0 vw = 0.00170078 spin_speed = 0 101 | [2018-12-24 14:55:50.781224][debug] Goto Time = -1.885 102 | [2018-12-24 14:55:50.781224][debug] [Odometer][0|1545634550771845877|5.962081|-0.673245|3.005500|false|0.000000|0.000000|0.012278|0.000000] 103 | [2018-12-24 14:55:50.781224][debug] [IMU][2.876303|1545634550776016045|-0.026318|-0.264380|9.600818|0.001064|0.001064|0.009578|-29|-6|-1] 104 | [2018-12-24 14:55:50.781224][debug] [Odometer][0|1545634550781303581|5.962081|-0.673245|3.005583|false|0.000000|0.000000|0.008719|0.000000] 105 | [2018-12-24 14:55:50.796824][debug] DDD: local_points_num = 375 global_points_num = 0 106 | [2018-12-24 14:55:50.796824][debug] [Odometer][0|1545634550791341103|5.962081|-0.673245|3.005624|false|0.000000|0.000000|0.004108|0.000000] 107 | [2018-12-24 14:55:50.796824][debug] [IMU][2.878047|1545634550798683658|-0.040674|-0.225500|9.629529|-0.001064|-0.001064|0.007450|-29|-6|-1] 108 | [2018-12-24 14:55:50.812424][debug] [Odometer][0|1545634550801372587|5.962081|-0.673245|3.005706|false|0.000000|0.000000|0.008220|0.000000] 109 | [2018-12-24 14:55:50.812424][debug] DDD: task.parms_size = 1 110 | [2018-12-24 14:55:50.812424][debug] [Get][0.000000|0.000000|0.001701|0.000000|0.500000|0.349066] 111 | [2018-12-24 14:55:50.812424][debug] DDD: curdir_dist2goal = 0.0064439; delta_start_angle = 3.12836 delta_goal_angle =0.0132359; cur_dist2goal =0 m_near_ind 172 m_state = 3 total_size = 173 goal_vel = 0 112 | [2018-12-24 14:55:50.812424][debug] [Send][0.000000|0.000000|0.017409|0.000000|0.500000|0.349066] 113 | [2018-12-24 14:55:50.812424][debug] [Data][Time Cost|0.063000] 114 | [2018-12-24 14:55:50.812424][debug] m_spin = false m_spin_state = 3 115 | [2018-12-24 14:55:50.812424][debug] DDD: Ouput vx = 0 vw = 0.0174087 spin_speed = 0 116 | [2018-12-24 14:55:50.812424][debug] Goto Time = -2.046 117 | [2018-12-24 14:55:50.812424][debug] [Odometer][0|1545634550811531710|5.962081|-0.673245|3.005748|false|0.000000|0.000000|0.004058|0.000000] 118 | [2018-12-24 14:55:50.828024][debug] DDD: local_points_num = 378 global_points_num = 375 119 | [2018-12-24 14:55:50.828024][debug] [IMU][2.878047|1545634550821355193|-0.034692|-0.242249|9.648071|0.001064|0.000000|0.005321|-29|-6|-1] 120 | [2018-12-24 14:55:50.828024][debug] [Odometer][0|1545634550821635090|5.962081|-0.673245|3.005789|false|0.000000|0.000000|0.004081|0.000000] 121 | [2018-12-24 14:55:50.843624][debug] [Odometer][0|1545634550831645619|5.962081|-0.673245|3.005830|false|0.000000|0.000000|0.004119|0.000000] 122 | [2018-12-24 14:55:50.843624][debug] DDD: task.parms_size = 1 123 | [2018-12-24 14:55:50.843624][debug] [Get][0.000000|0.000000|0.017409|0.000000|0.500000|0.349066] 124 | [2018-12-24 14:55:50.843624][debug] DDD: curdir_dist2goal = 0.00662211; delta_start_angle = 3.13151 delta_goal_angle =0.01008; cur_dist2goal =0 m_near_ind 172 m_state = 3 total_size = 173 goal_vel = 0 125 | [2018-12-24 14:55:50.843624][debug] [Send][0.000000|0.000000|0.009331|0.000000|0.500000|0.349066] 126 | [2018-12-24 14:55:50.843624][debug] [Data][Time Cost|0.098000] 127 | [2018-12-24 14:55:50.843624][debug] m_spin = false m_spin_state = 3 128 | [2018-12-24 14:55:50.843624][debug] DDD: Ouput vx = 0 vw = 0.00933065 spin_speed = 0 129 | [2018-12-24 14:55:50.843624][debug] Goto Time = -1.789 130 | [2018-12-24 14:55:50.843624][debug] [Odometer][0|1545634550841792561|5.962081|-0.673245|3.005954|false|0.000000|0.000000|0.012190|0.000000] 131 | [2018-12-24 14:55:50.843624][debug] [IMU][2.878047|1545634550843983426|-0.064001|-0.175854|9.641492|0.001064|0.000000|0.002128|-29|-6|-1] 132 | [2018-12-24 14:55:50.859224][debug] [Odometer][0|1545634550851890987|5.962075|-0.673244|3.006016|false|0.000664|0.000000|0.006124|0.000000] 133 | [2018-12-24 14:55:50.859224][debug] [DO]: 0 0 1 0 1 1 0 0 0 0 1 1 1 1 1 1 134 | [2018-12-24 14:55:50.859224][debug] [DI]: 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 135 | [2018-12-24 14:55:50.859224][debug] [Controller][0.000000|0.000000|0.000000|false|false|false|false|false|false] 136 | [2018-12-24 14:55:50.859224][debug] [Odometer][0|1545634550861935064|5.962068|-0.673244|3.006119|false|0.000667|0.000000|0.010262|0.000000] 137 | [2018-12-24 14:55:50.874824][debug] DDD: task.parms_size = 1 138 | [2018-12-24 14:55:50.874824][debug] [Get][0.000000|0.000000|0.009331|0.000000|0.500000|0.349066] 139 | [2018-12-24 14:55:50.874824][debug] DDD: curdir_dist2goal = 0.00659461; delta_start_angle = 3.13102 delta_goal_angle =0.0105774; cur_dist2goal =0 m_near_ind 172 m_state = 3 total_size = 173 goal_vel = 0 140 | [2018-12-24 14:55:50.874824][debug] [Send][0.000000|0.000000|0.014121|0.000000|0.500000|0.349066] 141 | [2018-12-24 14:55:50.874824][debug] [Data][Time Cost|0.067000] 142 | [2018-12-24 14:55:50.874824][debug] m_spin = false m_spin_state = 3 143 | [2018-12-24 14:55:50.874824][debug] DDD: Ouput vx = 0 vw = 0.0141209 spin_speed = 0 144 | [2018-12-24 14:55:50.874824][debug] Goto Time = -1.701 145 | [2018-12-24 14:55:50.874824][debug] [IMU][2.878047|1545634550866692071|-0.115442|-0.126807|9.636707|0.001064|-0.001064|0.005321|-29|-6|-1] 146 | [2018-12-24 14:55:50.874824][debug] [Odometer][0|1545634550871321955|5.962075|-0.673244|3.006222|false|-0.000714|0.000000|0.010981|0.000000] 147 | [2018-12-24 14:55:50.890425][debug] [Odometer][0|1545634550882113129|5.962068|-0.673244|3.006366|false|0.000621|0.000000|0.013373|0.000000] 148 | [2018-12-24 14:55:50.890425][debug] [IMU][2.878047|1545634550889365052|-0.076563|-0.140564|9.615173|0.000000|0.002128|0.010642|-29|-6|-1] 149 | [2018-12-24 14:55:50.890425][debug] [Odometer][0|1545634550891242316|5.962075|-0.673244|3.006469|false|-0.000734|0.000000|0.011291|0.000000] 150 | [2018-12-24 14:55:50.906025][debug] DDD: task.parms_size = 1 151 | [2018-12-24 14:55:50.906025][debug] [Get][0.000000|0.000000|0.014121|0.000000|0.500000|0.349066] 152 | [2018-12-24 14:55:50.906025][debug] DDD: curdir_dist2goal = 0.00664758; delta_start_angle = 3.13197 delta_goal_angle =0.00961931; cur_dist2goal =0 m_near_ind 172 m_state = 3 total_size = 173 goal_vel = 0 153 | [2018-12-24 14:55:50.906025][debug] [Send][0.000000|0.000000|0.002546|0.000000|0.500000|0.349066] 154 | [2018-12-24 14:55:50.906025][debug] [Data][Time Cost|0.065000] 155 | [2018-12-24 14:55:50.906025][debug] m_spin = false m_spin_state = 3 156 | [2018-12-24 14:55:50.906025][debug] DDD: Ouput vx = 0 vw = 0.00254597 spin_speed = 0 157 | [2018-12-24 14:55:50.906025][debug] Goto Time = -1.672 158 | [2018-12-24 14:55:50.906025][debug] [Odometer][0|1545634550901361232|5.962075|-0.673244|3.006675|false|0.000000|0.000000|0.020373|0.000000] 159 | [2018-12-24 14:55:50.921625][debug] [Odometer][0|1545634550911356277|5.962068|-0.673244|3.006819|false|0.000671|0.000000|0.014438|0.000000] 160 | [2018-12-24 14:55:50.921625][debug] DDD: local_points_num = 378 global_points_num = 378 161 | [2018-12-24 14:55:50.921625][debug] [IMU][2.878047|1545634550911988329|-0.064600|-0.171069|9.648669|0.000000|0.001064|0.012771|-29|-6|-1] 162 | [2018-12-24 14:55:50.921625][debug] [Location][-773.931071|-83631.701052|89.377089|0.895020|0|0|0|0] 163 | [2018-12-24 14:55:50.921625][debug] [Odometer][0|1545634550922109826|5.962081|-0.673245|3.006943|false|-0.001246|0.000000|0.011502|0.000000] 164 | [2018-12-24 14:55:50.937225][debug] DDD: task.parms_size = 1 165 | [2018-12-24 14:55:50.937225][debug] [Get][0.000000|0.000000|0.002546|0.000000|0.500000|0.349066] 166 | [2018-12-24 14:55:50.937225][debug] DDD: curdir_dist2goal = 0.00651958; delta_start_angle = 3.12966 delta_goal_angle =0.0119343; cur_dist2goal =0 m_near_ind 172 m_state = 3 total_size = 173 goal_vel = 0 167 | [2018-12-24 14:55:50.937225][debug] [Send][0.000000|0.000000|0.018254|0.000000|0.500000|0.349066] 168 | [2018-12-24 14:55:50.937225][debug] [Data][Time Cost|0.067000] 169 | [2018-12-24 14:55:50.937225][debug] m_spin = false m_spin_state = 3 170 | [2018-12-24 14:55:50.937225][debug] DDD: Ouput vx = 0 vw = 0.0182539 spin_speed = 0 171 | [2018-12-24 14:55:50.937225][debug] Goto Time = -1.741 172 | [2018-12-24 14:55:50.937225][debug] [Odometer][0|1545634550933010368|5.962068|-0.673244|3.007067|false|0.001230|0.000000|0.011347|0.000000] 173 | [2018-12-24 14:55:50.937225][debug] [IMU][2.878047|1545634550934697077|-0.047852|-0.253613|9.619360|0.001064|0.002128|0.018092|-29|-6|-1] 174 | [2018-12-24 14:55:50.952825][debug] [Odometer][0|1545634550942304664|5.962081|-0.673245|3.007190|false|-0.001442|0.000000|0.013308|0.000000] 175 | [2018-12-24 14:55:50.952825][debug] DDD: local_points_num = 380 global_points_num = 379 176 | [2018-12-24 14:55:50.952825][debug] [Odometer][0|1545634550952240613|5.962075|-0.673244|3.007335|false|0.000675|0.000000|0.014524|0.000000] 177 | [2018-12-24 14:55:50.952825][debug] [DO]: 0 0 1 0 1 1 0 0 0 0 1 1 1 1 1 1 178 | [2018-12-24 14:55:50.952825][debug] [DI]: 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 179 | [2018-12-24 14:55:50.952825][debug] [Controller][0.000000|0.000000|0.000000|false|false|false|false|false|false] 180 | [2018-12-24 14:55:50.968425][debug] [IMU][2.878047|1545634550957317000|-0.015552|-0.284717|9.634912|0.001064|0.001064|0.012771|-29|-6|-1] 181 | [2018-12-24 14:55:50.968425][debug] DDD: task.parms_size = 1 182 | [2018-12-24 14:55:50.968425][debug] [Get][0.000000|0.000000|0.018254|0.000000|0.500000|0.349066] 183 | [2018-12-24 14:55:50.968425][debug] DDD: curdir_dist2goal = 0.00632967; delta_start_angle = 3.13496 delta_goal_angle =0.00663539; cur_dist2goal =0 m_near_ind 172 m_state = 3 total_size = 173 goal_vel = 0 184 | [2018-12-24 14:55:50.968425][debug] [DATA][xy_error|double|0.055474|theta_error|double|0.006635] 185 | [2018-12-24 14:55:50.968425][debug] [Send][0.000000|0.000000|0.000000|0.000000|0.500000|0.349066] 186 | [2018-12-24 14:55:50.968425][debug] [Data][Time Cost|0.082000] 187 | [2018-12-24 14:55:50.968425][debug] m_spin = false m_spin_state = 3 188 | [2018-12-24 14:55:50.968425][debug] DDD: Ouput vx = 0 vw = 0 spin_speed = 0 189 | [2018-12-24 14:55:50.968425][error] [Alarm][Error|52600|精度误差过大(xy):0.0554745|1] 190 | [2018-12-24 14:55:50.968425][error] [Alarm][Error|52600|hqshqs精度误差过大(xy):0.0554745|1] 191 | [2018-12-24 14:55:50.968425][error] [Alarm][Error|52600|hqshqshqs精度误差过大(xy):0.0554745|1] 192 | [2018-12-24 14:55:50.968425][debug] [Odometer][0|1545634550964764535|5.962081|-0.673245|3.007438|false|-0.000535|0.000000|0.008230|0.000000] 193 | [2018-12-24 14:55:50.968425][debug] Goto Time = -8.353 194 | [2018-12-24 14:55:50.984025][debug] DDD: local_points_num = 382 global_points_num = 0 195 | [2018-12-24 14:55:50.984025][debug] [Odometer][0|1545634550974790342|5.962068|-0.673244|3.007520|false|0.001337|0.000000|0.008225|0.000000] 196 | [2018-12-24 14:55:50.984025][debug] [IMU][2.879793|1545634550980006497|-0.041272|-0.232080|9.630127|-0.002128|0.001064|0.009578|-29|-6|-1] 197 | [2018-12-24 14:55:50.984025][debug] [Odometer][0|1545634550984739193|5.962081|-0.673245|3.007603|false|-0.001347|0.000000|0.008289|0.000000] 198 | [2018-12-24 14:55:50.999625][debug] [Odometer][0|1545634550994786264|5.962075|-0.673244|3.007664|false|0.000667|0.000000|0.006156|0.000000] 199 | [2018-12-24 14:55:50.999625][debug] [Location][-773.792900|-83631.019916|89.421192|0.893867|0|0|0|0] 200 | [2018-12-24 14:55:50.999625][debug] [IMU][2.879793|1545634551002688148|-0.020337|-0.250623|9.647473|0.001064|-0.001064|0.007450|-29|-6|-1] 201 | [2018-12-24 14:55:51.015225][debug] [Odometer][0|1545634551004824664|5.962068|-0.673244|3.007726|false|0.000668|0.000000|0.006161|0.000000] 202 | [2018-12-24 14:55:51.015225][debug] DDD: local_points_num = 382 global_points_num = 380 203 | [2018-12-24 14:55:51.015225][debug] [Odometer][0|1545634551014781516|5.962068|-0.673244|3.007726|false|0.000000|0.000000|0.000000|0.000000] 204 | [2018-12-24 14:55:51.030825][debug] [IMU][2.879793|1545634551025361593|-0.043665|-0.265576|9.633716|0.001064|0.002128|0.004257|-29|-6|-1] 205 | [2018-12-24 14:55:51.030825][debug] [Odometer][0|1545634551025652019|5.962068|-0.673244|3.007726|false|0.000000|0.000000|0.000000|0.000000] 206 | [2018-12-24 14:55:51.046425][warning] [Text][update hostErrorState to true] 207 | [2018-12-24 14:55:51.046425][debug] [Odometer][0|1545634551034852329|5.962068|-0.673244|3.007726|false|0.000000|0.000000|0.000000|0.000000] 208 | [2018-12-24 14:55:51.046425][debug] DDD: local_points_num = 381 global_points_num = 383 209 | [2018-12-24 14:55:51.046425][debug] [Odometer][0|1545634551044813155|5.962068|-0.673244|3.007726|false|0.000000|0.000000|0.000000|0.000000] 210 | [2018-12-24 14:55:51.046425][debug] [IMU][2.879793|1545634551047963761|-0.061609|-0.233276|9.608594|0.000000|-0.003193|-0.001064|-29|-6|-1] 211 | [2018-12-24 14:55:51.062025][debug] [DO]: 0 0 1 0 1 1 0 0 0 0 1 1 1 1 1 1 212 | [2018-12-24 14:55:51.062025][debug] [DI]: 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 213 | [2018-12-24 14:55:51.062025][debug] [Controller][0.000000|0.000000|0.000000|false|false|false|false|false|false] 214 | [2018-12-24 14:55:51.062025][debug] [Odometer][0|1545634551055705232|5.962068|-0.673244|3.007726|false|0.000000|0.000000|0.000000|0.000000] 215 | [2018-12-24 14:55:51.077625][debug] [Odometer][0|1545634551065718393|5.962068|-0.673244|3.007726|false|0.000000|0.000000|0.000000|0.000000] 216 | [2018-12-24 14:55:51.077625][debug] DDD: local_points_num = 382 global_points_num = 0 217 | [2018-12-24 14:55:51.077625][debug] [IMU][2.879793|1545634551070627761|-0.087927|-0.160901|9.614575|0.001064|0.000000|-0.001064|-29|-6|-1] 218 | [2018-12-24 14:55:51.077625][debug] [Odometer][0|1545634551075679064|5.962068|-0.673244|3.007726|false|0.000000|0.000000|0.000000|0.000000] 219 | [2018-12-24 14:55:51.077625][debug] [Location][-774.012709|-83631.200923|89.551396|0.901485|0|0|0|0] 220 | [2018-12-24 14:55:51.093225][debug] [Odometer][0|1545634551086580690|5.962068|-0.673244|3.007726|false|0.000000|0.000000|0.000000|0.000000] 221 | [2018-12-24 14:55:51.093225][debug] [IMU][2.879793|1545634551093318032|-0.033496|-0.205762|9.640894|0.000000|-0.001064|0.001064|-29|-6|-1] 222 | [2018-12-24 14:55:51.093225][debug] [Odometer][0|1545634551095761387|5.962068|-0.673244|3.007726|false|0.000000|0.000000|0.000000|0.000000] 223 | [2018-12-24 14:55:51.108825][debug] [Odometer][0|1545634551105746832|5.962068|-0.673244|3.007726|false|0.000000|0.000000|0.000000|0.000000] 224 | [2018-12-24 14:55:51.124425][debug] [IMU][2.879793|1545634551115949000|-0.056824|-0.183032|9.651062|0.002128|-0.002128|-0.001064|-29|-6|-1] 225 | [2018-12-24 14:55:51.124425][debug] [Odometer][0|1545634551118285568|5.962068|-0.673244|3.007726|false|0.000000|0.000000|0.000000|0.000000] 226 | [2018-12-24 14:55:51.140025][debug] [Odometer][0|1545634551128300587|5.962068|-0.673244|3.007726|false|0.000000|0.000000|0.000000|0.000000] 227 | [2018-12-24 14:55:51.140025][debug] [Odometer][0|1545634551138343116|5.962068|-0.673244|3.007726|false|0.000000|0.000000|0.000000|0.000000] 228 | [2018-12-24 14:55:51.140025][debug] [IMU][2.879793|1545634551138552974|-0.053235|-0.210547|9.631323|-0.001064|0.001064|0.001064|-29|-6|-1] 229 | [2018-12-24 14:55:51.155625][debug] [Odometer][0|1545634551149219193|5.962068|-0.673244|3.007726|false|0.000000|0.000000|0.000000|0.000000] 230 | [2018-12-24 14:55:51.155625][debug] [DO]: 0 0 1 0 1 1 0 0 0 0 1 1 1 1 1 1 231 | [2018-12-24 14:55:51.155625][debug] [DI]: 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 232 | [2018-12-24 14:55:51.155625][debug] [Controller][0.000000|0.000000|0.000000|false|false|false|false|false|false] 233 | [2018-12-24 14:55:51.155625][debug] [Odometer][0|1545634551158395193|5.962068|-0.673244|3.007726|false|0.000000|0.000000|0.000000|0.000000] 234 | [2018-12-24 14:55:51.171225][debug] [IMU][2.879793|1545634551161167581|-0.057422|-0.191406|9.639697|0.001064|0.001064|-0.001064|-29|-6|-1] 235 | [2018-12-24 14:55:51.171225][debug] [Odometer][0|1545634551168343116|5.962068|-0.673244|3.007726|false|0.000000|0.000000|0.000000|0.000000] 236 | [2018-12-24 14:55:51.171225][debug] [Laser][1545634551171225500|-90|90|1|-90|1.222|-89|1.197|-88|1.199|-87|3.648|-86|3.643|-85|3.652|-84|3.636|-83|3.281|-82|3.671|-81|3.683|-80|3.687|-79|3.703|-78|3.606|-77|3.608|-76|3.618|-75|3.65|-74|3.665|-73|3.801|-72|3.802|-71|3.828|-70|3.868|-69|3.86|-68|3.599|-67|3.937|-66|3.961|-65|4.001|-64|4.026|-63|4.058|-62|4.104|-61|4.14|-60|4.172|-59|4.218|-58|4.254|-57|4.32|-56|4.326|-55|4.427|-54|4.458|-53|4.198|-52|4.494|-51|4.506|-50|4.592|-49|4.776|-48|4.871|-47|4.899|-46|5.014|-45|5.095|-44|4.66|-43|5.404|-42|5.561|-41|5.658|-40|5.784|-39|5.905|-38|7.115|-37|6.976|-36|6.863|-35|6.753|-34|6.743|-33|6.68|-32|6.79|-31|7.004|-30|7.2|-29|7.427|-28|7.668|-27|7.923|-26|8.212|-25|8.494|-24|8.828|-23|9.174|-22|9.559|-21|10.004|-20|10.07|-19|10.002|-18|9.934|-17|10.194|-16|11.037|-15|10.848|-14|10.788|-13|13.347|-12|14.541|-11|15.764|-10|1048.58|-9|19.236|-8|21.634|-7|1048.58|-6|27.501|-5|1048.58|-4|1048.58|-3|1048.58|-2|29.525|-1|1048.58|0|1048.58|1|1048.58|2|1048.58|3|1048.58|4|1048.58|5|25.243|6|12.906|7|1048.58|8|16.31|9|16.372|10|19.553|11|19.674|12|12.557|13|12.388|14|20.257|15|7.675|16|7.448|17|7.492|18|7.528|19|7.577|20|7.625|21|12.732|22|1048.58|23|1048.58|24|23.57|25|1048.58|26|12.523|27|13.681|28|13.292|29|1048.58|30|23.709|31|15.281|32|1048.58|33|14.721|34|14.304|35|14.232|36|20.077|37|15.838|38|1048.58|39|15.613|40|14.753|41|19.492|42|19.897|43|22.481|44|21.698|45|20.292|46|20.042|47|20.573|48|24.483|49|24.112|50|23.739|51|23.402|52|23.063|53|22.765|54|22.493|55|1048.58|56|13.013|57|13.051|58|13.407|59|13.447|60|20.964|61|20.887|62|20.791|63|20.621|64|20.507|65|18.795|66|19.387|67|19.733|68|18.387|69|19.431|70|19.293|71|19.161|72|19.384|73|19.245|74|19.167|75|19.057|76|16.799|77|16.801|78|18.52|79|16.676|80|16.48|81|16.508|82|18.324|83|16.388|84|16.293|85|16.351|86|16.338|87|16.307|88|16.307|89|18.107|90|16.355] 237 | [2018-12-24 14:55:51.186825][debug] DDD: local_points_num = 380 global_points_num = 381 238 | [2018-12-24 14:55:51.186825][debug] [NetworkCmd][Status|1100|0|192.168.0.100|50828|true] 239 | [2018-12-24 14:55:51.186825][debug] [Odometer][0|1545634551180927942|5.962068|-0.673244|3.007726|false|0.000000|0.000000|0.000000|0.000000] 240 | [2018-12-24 14:55:51.186825][debug] [IMU][2.879793|1545634551183854858|-0.050244|-0.177051|9.639697|0.000000|-0.001064|0.000000|-29|-6|-1] 241 | [2018-12-24 14:55:51.202425][debug] [Odometer][0|1545634551190904716|5.962068|-0.673244|3.007726|false|0.000000|0.000000|0.000000|0.000000] 242 | [2018-12-24 14:55:51.202425][debug] [Odometer][0|1545634551201225852|5.962068|-0.673244|3.007726|false|0.000000|0.000000|0.000000|0.000000] 243 | [2018-12-24 14:55:51.218025][debug] [IMU][2.879793|1545634551206481077|-0.052039|-0.199780|9.616968|-0.002128|-0.001064|0.000000|-29|-6|-1] 244 | [2018-12-24 14:55:51.218025][debug] DDD: local_points_num = 383 global_points_num = 0 245 | [2018-12-24 14:55:51.218025][debug] [Odometer][0|1545634551211795761|5.962068|-0.673244|3.007726|true|0.000000|0.000000|0.000000|0.000000] 246 | [2018-12-24 14:55:51.233625][debug] [Odometer][0|1545634551221756432|5.962068|-0.673244|3.007726|true|0.000000|0.000000|0.000000|0.000000] 247 | [2018-12-24 14:55:51.233625][debug] [IMU][2.879793|1545634551229149206|-0.078357|-0.192603|9.640295|0.000000|-0.003193|0.001064|-29|-6|-1] 248 | [2018-12-24 14:55:51.233625][debug] [Odometer][0|1545634551231735581|5.962068|-0.673244|3.007726|true|0.000000|0.000000|0.000000|0.000000] 249 | [2018-12-24 14:55:51.249225][debug] DDD: local_points_num = 383 global_points_num = 380 250 | [2018-12-24 14:55:51.249225][debug] [Odometer][0|1545634551243466832|5.962068|-0.673244|3.007726|true|0.000000|0.000000|0.000000|0.000000] 251 | [2018-12-24 14:55:51.249225][debug] [IMU][2.879793|1545634551251820484|-0.062805|-0.193201|9.642688|-0.001064|0.000000|0.001064|-29|-6|-1] 252 | [2018-12-24 14:55:51.249225][debug] [Odometer][0|1545634551252033903|5.962068|-0.673244|3.007726|true|0.000000|0.000000|0.000000|0.000000] 253 | [2018-12-24 14:55:51.264825][debug] [DO]: 0 0 1 0 1 1 0 0 0 0 1 1 1 1 1 1 254 | [2018-12-24 14:55:51.264825][debug] [DI]: 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 255 | [2018-12-24 14:55:51.264825][debug] [Controller][0.000000|0.000000|0.000000|false|false|false|false|false|false] 256 | [2018-12-24 14:55:51.264825][debug] [Location][-774.621886|-83631.018429|89.599125|0.893017|0|0|0|0] 257 | [2018-12-24 14:55:51.264825][debug] [Odometer][0|1545634551261786626|5.962068|-0.673244|3.007726|true|0.000000|0.000000|0.000000|0.000000] 258 | [2018-12-24 14:55:51.280425][debug] DDD: local_points_num = 382 global_points_num = 383 259 | [2018-12-24 14:55:51.280425][debug] [IMU][2.879793|1545634551274460742|-0.031104|-0.188416|9.636108|0.002128|-0.001064|0.001064|-29|-6|-1] 260 | [2018-12-24 14:55:51.280425][debug] [Odometer][0|1545634551275173774|5.962068|-0.673244|3.007726|true|0.000000|0.000000|0.000000|0.000000] 261 | [2018-12-24 14:55:51.296025][debug] [Odometer][0|1545634551284364690|5.962068|-0.673244|3.007726|true|0.000000|0.000000|0.000000|0.000000] 262 | [2018-12-24 14:55:51.296025][debug] [Odometer][0|1545634551294347864|5.962068|-0.673244|3.007726|true|0.000000|0.000000|0.000000|0.000000] 263 | [2018-12-24 14:55:51.296025][debug] [IMU][2.879793|1545634551297083039|-0.055029|-0.185425|9.664819|0.002128|-0.001064|0.000000|-29|-6|-1] 264 | [2018-12-24 14:55:51.311625][debug] DDD: local_points_num = 382 global_points_num = 384 265 | [2018-12-24 14:55:51.311625][debug] [Odometer][0|1545634551305223426|5.962068|-0.673244|3.007726|true|0.000000|0.000000|0.000000|0.000000] 266 | [2018-12-24 14:55:51.327225][debug] [Odometer][0|1545634551315200200|5.962068|-0.673244|3.007726|true|0.000000|0.000000|0.000000|0.000000] 267 | [2018-12-24 14:55:51.327225][debug] [IMU][2.879793|1545634551319743684|-0.042468|-0.208154|9.635510|0.001064|-0.002128|0.000000|-29|-6|-1] 268 | [2018-12-24 14:55:51.327225][debug] [Odometer][0|1545634551325206806|5.962068|-0.673244|3.007726|true|0.000000|0.000000|0.000000|0.000000] 269 | [2018-12-24 14:55:51.342825][debug] DDD: local_points_num = 382 global_points_num = 384 270 | [2018-12-24 14:55:51.342825][debug] [Location][-774.621886|-83631.018429|89.599125|0.893017|0|0|0|0] 271 | [2018-12-24 14:55:51.342825][debug] [Service][pause|SoundPlayer|(call from C++)] 272 | [2018-12-24 14:55:51.342825][debug] [Service][pause|SoundPlayer] 273 | [2018-12-24 14:55:51.342825][debug] [Odometer][0|1545634551336042987|5.962068|-0.673244|3.007726|true|0.000000|0.000000|0.000000|0.000000] 274 | [2018-12-24 14:55:51.342825][debug] [IMU][2.879793|1545634551342428226|-0.056226|-0.175854|9.631921|0.000000|-0.001064|0.000000|-29|-6|-1] 275 | [2018-12-24 14:55:51.342825][debug] [Odometer][0|1545634551345302032|5.962068|-0.673244|3.007726|true|0.000000|0.000000|0.000000|0.000000] 276 | [2018-12-24 14:55:51.358425][debug] [DO]: 0 0 1 0 1 1 0 0 0 0 1 1 1 1 1 1 277 | [2018-12-24 14:55:51.358425][debug] [DI]: 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 278 | [2018-12-24 14:55:51.358425][debug] [Controller][0.000000|0.000000|0.000000|false|false|false|false|false|false] 279 | [2018-12-24 14:55:51.358425][debug] [Odometer][0|1545634551356120716|5.962068|-0.673244|3.007726|true|0.000000|0.000000|0.000000|0.000000] 280 | [2018-12-24 14:55:51.374025][debug] DDD: local_points_num = 382 global_points_num = 384 281 | [2018-12-24 14:55:51.374025][debug] [IMU][2.879793|1545634551365096045|-0.051440|-0.197986|9.651660|0.001064|-0.001064|0.001064|-29|-6|-1] 282 | [2018-12-24 14:55:51.374025][debug] [Odometer][0|1545634551367823787|5.962068|-0.673244|3.007726|true|0.000000|0.000000|0.000000|0.000000] 283 | [2018-12-24 14:55:51.389625][debug] [Odometer][0|1545634551378249955|5.962068|-0.673244|3.007726|true|0.000000|0.000000|0.000000|0.000000] 284 | [2018-12-24 14:55:51.389625][debug] [IMU][2.879793|1545634551387720510|-0.033496|-0.202173|9.646875|0.000000|-0.001064|0.001064|-29|-6|-1] 285 | [2018-12-24 14:55:51.389625][debug] [Odometer][0|1545634551388001387|5.962068|-0.673244|3.007726|true|0.000000|0.000000|0.000000|0.000000] 286 | [2018-12-24 14:55:51.405225][debug] DDD: local_points_num = 382 global_points_num = 384 287 | [2018-12-24 14:55:51.405225][debug] [Odometer][0|1545634551399657593|5.962068|-0.673244|3.007726|true|0.000000|0.000000|0.000000|0.000000] 288 | [2018-12-24 14:55:51.420825][debug] [Odometer][0|1545634551408646910|5.962068|-0.673244|3.007726|true|0.000000|0.000000|0.000000|0.000000] 289 | [2018-12-24 14:55:51.420825][debug] [Location][-774.621886|-83631.018429|89.599125|0.893017|0|0|0|0] 290 | [2018-12-24 14:55:51.420825][debug] [IMU][2.879793|1545634551410388639|-0.050244|-0.187817|9.606799|-0.001064|-0.001064|0.001064|-29|-6|-1] 291 | [2018-12-24 14:55:51.420825][debug] [Odometer][0|1545634551418685619|5.962068|-0.673244|3.007726|true|0.000000|0.000000|0.000000|0.000000] 292 | [2018-12-24 14:55:51.436425][debug] DDD: local_points_num = 383 global_points_num = 384 293 | [2018-12-24 14:55:51.436425][debug] [Odometer][0|1545634551430402006|5.962068|-0.673244|3.007726|true|0.000000|0.000000|0.000000|0.000000] 294 | [2018-12-24 14:55:51.436425][debug] [IMU][2.879793|1545634551433020484|-0.063403|-0.215930|9.619360|0.000000|0.000000|0.001064|-29|-6|-1] 295 | [2018-12-24 14:55:51.452026][debug] [Odometer][0|1545634551439796432|5.962068|-0.673244|3.007726|true|0.000000|0.000000|0.000000|0.000000] 296 | [2018-12-24 14:55:51.452026][debug] [Odometer][0|1545634551449535116|5.962068|-0.673244|3.007726|true|0.000000|0.000000|0.000000|0.000000] 297 | [2018-12-24 14:55:51.452026][debug] [DO]: 0 0 1 0 1 1 0 0 0 0 1 1 1 1 1 1 298 | [2018-12-24 14:55:51.452026][debug] [DI]: 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 299 | [2018-12-24 14:55:51.452026][debug] [Controller][0.000000|0.000000|0.000000|false|false|false|false|false|false] 300 | [2018-12-24 14:55:51.467626][debug] [IMU][2.879793|1545634551455658987|-0.038281|-0.196191|9.652258|0.000000|-0.001064|0.001064|-29|-6|-1] 301 | [2018-12-24 14:55:51.467626][debug] DDD: local_points_num = 383 global_points_num = 0 302 | [2018-12-24 14:55:51.467626][debug] [Odometer][0|1545634551461241645|5.962068|-0.673244|3.007726|true|0.000000|0.000000|0.000000|0.000000] 303 | [2018-12-24 14:55:51.467626][debug] [Odometer][0|1545634551470391942|5.962068|-0.673244|3.007726|true|0.000000|0.000000|0.000000|0.000000] 304 | -------------------------------------------------------------------------------- /test_ell.py: -------------------------------------------------------------------------------- 1 | import matplotlib.pyplot as plt 2 | import numpy as np 3 | from matplotlib.collections import EllipseCollection 4 | 5 | x = np.arange(10) 6 | y = np.arange(15) 7 | X, Y = np.meshgrid(x, y) 8 | 9 | XY = np.column_stack((X.ravel(), Y.ravel())) 10 | 11 | ww = X / 10.0 12 | hh = Y / 15.0 13 | aa = X * 9 14 | 15 | 16 | fig, ax = plt.subplots() 17 | 18 | ec = EllipseCollection(ww, hh, aa, units='x', offsets=XY, 19 | transOffset=ax.transData) 20 | ec.set_array((X + Y).ravel()) 21 | ax.add_collection(ec) 22 | ax.autoscale_view() 23 | ax.set_xlabel('X') 24 | ax.set_ylabel('y') 25 | cbar = plt.colorbar(ec) 26 | cbar.set_label('X+Y') 27 | plt.show() --------------------------------------------------------------------------------