본문 바로가기
  • 경제적 자유를 얻는 그날까지
엔지니어링/드론

pyulog를 이용한 ULog 파일 그래프 그리기

by 베니스상인 2022. 10. 20.

 

pyulog는 python 기반의 Ulog 분석프로그램이다.

 

https://github.com/PX4/pyulog

 

GitHub - PX4/pyulog: Python module & scripts for ULog files

Python module & scripts for ULog files. Contribute to PX4/pyulog development by creating an account on GitHub.

github.com

 

 

 

pyulog를 이용해서 매트랩으로 그림을 그려주는 유용한 자료가 있어서 사용방법을 확인하였다. 참고로 한 사이트는 plotUlog 이며, 링크는 아래와 같다.

 

https://github.com/kyuhyong/plotulog

 

GitHub - kyuhyong/plotulog: Plot px4 Ulog data for analyzing flight data.

Plot px4 Ulog data for analyzing flight data. Contribute to kyuhyong/plotulog development by creating an account on GitHub.

github.com

 

이 자료 저장소에 보면 대부분 매트랩 파일로 구성되어 있다. 매트랩이 있다면 매트랩에서 log파일을 불러와서 바로 실행할 수 있지만 매트랩이 없다면, octave를 이용하여 실행할 수 있다.

 

 

환경

  • Ubuntu 20.04 
  • python3의 pip 설치
  • octave 설치

 

설치

1) python3의 pip설치

swift@Swift:~/Desktop$ sudo apt-get update

swift@Swift:~/Desktop$ sudo apt install python3-pip

 

2) octave 설치

swift@Swift:~/Desktop$ sudo add-apt-repository ppa:octave/stable

 The latest version of GNU Octave built for all supported Ubuntu releases. GNU Octave is normally distributed with Ubuntu, this PPA is for you if you have a need to use a newer version of Octave than what you can already get from your installed version of Ubuntu.

Simply follow the instructions below to add this PPA to your system and install the octave package. If it's not that easy or you encounter any errors, contact the team and let us know.

Much credit goes to the Debian Octave Group who maintain the official Debian packages that this work is derived from. Without their efforts to bring Octave packaging to such a high level of quality in Debian and Debian derivatives, this PPA would not be here.
 More info: https://launchpad.net/~octave/+archive/ubuntu/stable
Press [ENTER] to continue or Ctrl-c to cancel adding it.

Hit:1 https://download.docker.com/linux/ubuntu focal InRelease
Hit:2 https://dl.google.com/linux/chrome/deb stable InRelease
Hit:3 http://packages.ros.org/ros/ubuntu focal InRelease                       
Hit:4 http://security.ubuntu.com/ubuntu focal-security InRelease               
Hit:5 http://kr.archive.ubuntu.com/ubuntu focal InRelease                      
Ign:6 http://ppa.launchpad.net/octave/stable/ubuntu focal InRelease
Hit:7 http://kr.archive.ubuntu.com/ubuntu focal-updates InRelease          
Hit:8 http://kr.archive.ubuntu.com/ubuntu focal-backports InRelease            
Err:9 http://ppa.launchpad.net/octave/stable/ubuntu focal Release              
  404  Not Found [IP: 185.125.190.52 80]
Reading package lists... Done
E: The repository 'http://ppa.launchpad.net/octave/stable/ubuntu focal Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

 

swift@Swift:~/Desktop$ sudo apt install octave

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libaopalliance-java libapache-pom-java libatinject-jsr330-api-java
  libcdi-api-java libcommons-cli-java libcommons-io-java libcommons-lang3-java
  libcommons-parent-java libfwupdplugin1 libgeronimo-annotation-1.3-spec-java
  libgeronimo-interceptor-3.0-spec-java libguava-java libguice-java
  libhawtjni-runtime-java libjansi-java libjansi-native-java libjsr305-java
  libmaven-parent-java libmaven-resolver-java libmaven-shared-utils-java
  libmaven3-core-java libplexus-cipher-java libplexus-classworlds-java
  libplexus-component-annotations-java libplexus-interpolation-java
  libplexus-sec-dispatcher-java libplexus-utils2-java libsisu-inject-java
  libsisu-plexus-java libslf4j-java libwagon-file-java
  libwagon-http-shaded-java libwagon-provider-api-java usb-modeswitch
  usb-modeswitch-data
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  aglfn epstool fonts-freefont-otf gnuplot-data gnuplot-qt gsfonts
  imagemagick-6-common libaec0 libamd2 libarpack2 libblas3 libcamd2
  libccolamd2 libcholmod3 libcxsparse3 libemf1 libfltk-gl1.3 libfltk1.3
  libgfortran5 libgl2ps1.4 libglpk40 libgraphicsmagick++-q16-12
  libgraphicsmagick-q16-3 libhdf5-103 liblapack3 liblqr-1-0
  libmagick++-6.q16-8 libmagickcore-6.q16-6 libmagickwand-6.q16-6 libmetis5
  liboctave7 libopenblas0 libopenblas0-pthread libplot2c2 libportaudio2
  libpstoedit0c2a libqhull7 libqrupdate1 libqscintilla2-qt5-15
  libqscintilla2-qt5-l10n libqt5help5 libqt5printsupport5 libqt5sql5
  libqt5sql5-sqlite libqt5xml5 libsz2 libtext-unidecode-perl libumfpack5
  libwxbase3.0-0v5 libwxgtk3.0-gtk3-0v5 libxml-libxml-perl
  libxml-namespacesupport-perl libxml-sax-base-perl libxml-sax-expat-perl
  libxml-sax-perl libzip5 octave-common octave-doc pstoedit tex-common texinfo
Suggested packages:
  gnuplot-doc libiodbc2-dev default-libmysqlclient-dev graphicsmagick-dbg
  libmagickcore-6.q16-6-extra libqscintilla2-doc libxml-sax-expatxs-perl
  liboctave-dev xfig | ivtools-bin | tgif | transfig debhelper texlive-base
  texlive-latex-base texlive-plain-generic texlive-fonts-recommended
The following NEW packages will be installed:
  aglfn epstool fonts-freefont-otf gnuplot-data gnuplot-qt gsfonts
  imagemagick-6-common libaec0 libamd2 libarpack2 libblas3 libcamd2
  libccolamd2 libcholmod3 libcxsparse3 libemf1 libfltk-gl1.3 libfltk1.3
  libgfortran5 libgl2ps1.4 libglpk40 libgraphicsmagick++-q16-12
  libgraphicsmagick-q16-3 libhdf5-103 liblapack3 liblqr-1-0
  libmagick++-6.q16-8 libmagickcore-6.q16-6 libmagickwand-6.q16-6 libmetis5
  liboctave7 libopenblas0 libopenblas0-pthread libplot2c2 libportaudio2
  libpstoedit0c2a libqhull7 libqrupdate1 libqscintilla2-qt5-15
  libqscintilla2-qt5-l10n libqt5help5 libqt5printsupport5 libqt5sql5
  libqt5sql5-sqlite libqt5xml5 libsz2 libtext-unidecode-perl libumfpack5
  libwxbase3.0-0v5 libwxgtk3.0-gtk3-0v5 libxml-libxml-perl
  libxml-namespacesupport-perl libxml-sax-base-perl libxml-sax-expat-perl
  libxml-sax-perl libzip5 octave octave-common octave-doc pstoedit tex-common
  texinfo
0 upgraded, 62 newly installed, 0 to remove and 65 not upgraded.
Need to get 59.1 MB of archives.
After this operation, 281 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://kr.archive.ubuntu.com/ubuntu focal/universe amd64 liblqr-1-0 amd64 0.4.2-2.1 [27.7 kB]
Get:2 http://kr.archive.ubuntu.com/ubuntu focal-updates/universe amd64 imagemagick-6-common all 8:6.9.10.23+dfsg-2.1ubuntu11.4 [60.9 kB]
Get:3 http://kr.archive.ubuntu.com/ubuntu focal-updates/universe amd64 libmagickcore-6.q16-6 amd64 8:6.9.10.23+dfsg-2.1ubuntu11.4 [1,647 kB]
Get:4 http://kr.archive.ubuntu.com/ubuntu focal-updates/universe amd64 libmagickwand-6.q16-6 amd64 8:6.9.10.23+dfsg-2.1ubuntu11.4 [303 kB]
Get:5 http://kr.archive.ubuntu.com/ubuntu focal/universe amd64 tex-common all 6.13 [32.7 kB]
Get:6 http://kr.archive.ubuntu.com/ubuntu focal/universe amd64 epstool amd64 3.09-2 [109 kB]
Get:7 http://kr.archive.ubuntu.com/ubuntu focal/universe amd64 fonts-freefont-otf all 20120503-10 [3,056 kB]
Get:8 http://kr.archive.ubuntu.com/ubuntu focal/universe amd64 aglfn all 1.7+git20191031.4036a9c-2 [30.6 kB]
Get:9 http://kr.archive.ubuntu.com/ubuntu focal/universe amd64 gnuplot-data all 5.2.8+dfsg1-2 [56.5 kB]
Get:10 http://kr.archive.ubuntu.com/ubuntu focal-updates/universe amd64 libqt5printsupport5 amd64 5.12.8+dfsg-0ubuntu2.1 [193 kB]
Get:11 http://kr.archive.ubuntu.com/ubuntu focal/universe amd64 libwxbase3.0-0v5 amd64 3.0.4+dfsg-15build1 [982 kB]
Get:12 http://kr.archive.ubuntu.com/ubuntu focal/universe amd64 libwxgtk3.0-gtk3-0v5 amd64 3.0.4+dfsg-15build1 [4,359 kB]
Get:13 http://kr.archive.ubuntu.com/ubuntu focal/universe amd64 gnuplot-qt amd64 5.2.8+dfsg1-2 [1,034 kB]
Get:14 http://kr.archive.ubuntu.com/ubuntu focal/universe amd64 gsfonts all 1:8.11+urwcyr1.0.7~pre44-4.4 [3,120 kB]
Get:15 http://kr.archive.ubuntu.com/ubuntu focal/universe amd64 libaec0 amd64 1.0.4-1 [19.1 kB]
Get:16 http://kr.archive.ubuntu.com/ubuntu focal/main amd64 libamd2 amd64 1:5.7.1+dfsg-2 [20.0 kB]
Get:17 http://kr.archive.ubuntu.com/ubuntu focal/main amd64 libblas3 amd64 3.9.0-1build1 [142 kB]
Get:18 http://kr.archive.ubuntu.com/ubuntu focal-updates/main amd64 libgfortran5 amd64 10.3.0-1ubuntu1~20.04 [736 kB]
Get:19 http://kr.archive.ubuntu.com/ubuntu focal-updates/universe amd64 libopenblas0-pthread amd64 0.3.8+ds-1ubuntu0.20.04.1 [9,127 kB]
Get:20 http://kr.archive.ubuntu.com/ubuntu focal/main amd64 liblapack3 amd64 3.9.0-1build1 [2,154 kB]
Get:21 http://kr.archive.ubuntu.com/ubuntu focal/universe amd64 libarpack2 amd64 3.7.0-3 [92.8 kB]
Get:22 http://kr.archive.ubuntu.com/ubuntu focal/main amd64 libcamd2 amd64 1:5.7.1+dfsg-2 [21.7 kB]
Get:23 http://kr.archive.ubuntu.com/ubuntu focal/main amd64 libccolamd2 amd64 1:5.7.1+dfsg-2 [23.2 kB]
Get:24 http://kr.archive.ubuntu.com/ubuntu focal/main amd64 libmetis5 amd64 5.1.0.dfsg-5 [169 kB]
Get:25 http://kr.archive.ubuntu.com/ubuntu focal/main amd64 libcholmod3 amd64 1:5.7.1+dfsg-2 [308 kB]
Get:26 http://kr.archive.ubuntu.com/ubuntu focal/main amd64 libcxsparse3 amd64 1:5.7.1+dfsg-2 [64.2 kB]
Get:27 http://kr.archive.ubuntu.com/ubuntu focal/universe amd64 libemf1 amd64 1.0.11-2ubuntu2 [59.4 kB]
Get:28 http://kr.archive.ubuntu.com/ubuntu focal/universe amd64 libfltk1.3 amd64 1.3.4-10build1 [545 kB]
Get:29 http://kr.archive.ubuntu.com/ubuntu focal/universe amd64 libfltk-gl1.3 amd64 1.3.4-10build1 [38.5 kB]
Get:30 http://kr.archive.ubuntu.com/ubuntu focal/universe amd64 libgl2ps1.4 amd64 1.4.0+dfsg1-2 [38.2 kB]
Get:31 http://kr.archive.ubuntu.com/ubuntu focal/universe amd64 libglpk40 amd64 4.65-2 [378 kB]
Get:32 http://kr.archive.ubuntu.com/ubuntu focal/universe amd64 libgraphicsmagick-q16-3 amd64 1.4+really1.3.35-1 [1,136 kB]
Get:33 http://kr.archive.ubuntu.com/ubuntu focal/universe amd64 libgraphicsmagick++-q16-12 amd64 1.4+really1.3.35-1 [103 kB]
Get:34 http://kr.archive.ubuntu.com/ubuntu focal/universe amd64 libsz2 amd64 1.0.4-1 [5,188 B]
Get:35 http://kr.archive.ubuntu.com/ubuntu focal/universe amd64 libhdf5-103 amd64 1.10.4+repack-11ubuntu1 [1,311 kB]
Get:36 http://kr.archive.ubuntu.com/ubuntu focal-updates/universe amd64 libmagick++-6.q16-8 amd64 8:6.9.10.23+dfsg-2.1ubuntu11.4 [133 kB]
Get:37 http://kr.archive.ubuntu.com/ubuntu focal/universe amd64 libqrupdate1 amd64 1.1.2-3 [36.2 kB]
Get:38 http://kr.archive.ubuntu.com/ubuntu focal/main amd64 libumfpack5 amd64 1:5.7.1+dfsg-2 [229 kB]
Get:39 http://kr.archive.ubuntu.com/ubuntu focal/universe amd64 liboctave7 amd64 5.2.0-1 [7,492 kB]
Get:40 http://kr.archive.ubuntu.com/ubuntu focal-updates/universe amd64 libopenblas0 amd64 0.3.8+ds-1ubuntu0.20.04.1 [5,892 B]
Get:41 http://kr.archive.ubuntu.com/ubuntu focal/universe amd64 libplot2c2 amd64 2.6-10build1 [506 kB]
Get:42 http://kr.archive.ubuntu.com/ubuntu focal/universe amd64 libportaudio2 amd64 19.6.0-1build1 [65.4 kB]
Get:43 http://kr.archive.ubuntu.com/ubuntu focal/universe amd64 libzip5 amd64 1.5.1-0ubuntu1 [46.7 kB]
Get:44 http://kr.archive.ubuntu.com/ubuntu focal/universe amd64 libpstoedit0c2a amd64 3.75-1build1 [370 kB]
Get:45 http://kr.archive.ubuntu.com/ubuntu focal/universe amd64 libqhull7 amd64 2015.2-4 [152 kB]
Get:46 http://kr.archive.ubuntu.com/ubuntu focal/universe amd64 libqscintilla2-qt5-l10n all 2.11.2+dfsg-6 [41.3 kB]
Get:47 http://kr.archive.ubuntu.com/ubuntu focal/universe amd64 libqscintilla2-qt5-15 amd64 2.11.2+dfsg-6 [1,238 kB]
Get:48 http://kr.archive.ubuntu.com/ubuntu focal-updates/universe amd64 libqt5sql5 amd64 5.12.8+dfsg-0ubuntu2.1 [121 kB]
Get:49 http://kr.archive.ubuntu.com/ubuntu focal/universe amd64 libqt5help5 amd64 5.12.8-0ubuntu1 [134 kB]
Get:50 http://kr.archive.ubuntu.com/ubuntu focal-updates/universe amd64 libqt5sql5-sqlite amd64 5.12.8+dfsg-0ubuntu2.1 [47.6 kB]
Get:51 http://kr.archive.ubuntu.com/ubuntu focal-updates/universe amd64 libqt5xml5 amd64 5.12.8+dfsg-0ubuntu2.1 [105 kB]
Get:52 http://kr.archive.ubuntu.com/ubuntu focal/universe amd64 libtext-unidecode-perl all 1.30-1 [99.0 kB]
Get:53 http://kr.archive.ubuntu.com/ubuntu focal/main amd64 libxml-namespacesupport-perl all 1.12-1 [13.2 kB]
Get:54 http://kr.archive.ubuntu.com/ubuntu focal/main amd64 libxml-sax-base-perl all 1.09-1 [18.8 kB]
Get:55 http://kr.archive.ubuntu.com/ubuntu focal/main amd64 libxml-sax-perl all 1.02+dfsg-1 [56.2 kB]
Get:56 http://kr.archive.ubuntu.com/ubuntu focal/main amd64 libxml-libxml-perl amd64 2.0134+dfsg-1build1 [320 kB]
Get:57 http://kr.archive.ubuntu.com/ubuntu focal/main amd64 libxml-sax-expat-perl all 0.51-1 [10.5 kB]
Get:58 http://kr.archive.ubuntu.com/ubuntu focal/universe amd64 pstoedit amd64 3.75-1build1 [392 kB]
Get:59 http://kr.archive.ubuntu.com/ubuntu focal/universe amd64 texinfo amd64 6.7.0.dfsg.2-5 [1,375 kB]
Get:60 http://kr.archive.ubuntu.com/ubuntu focal/universe amd64 octave-common all 5.2.0-1 [5,130 kB]
Get:61 http://kr.archive.ubuntu.com/ubuntu focal/universe amd64 octave amd64 5.2.0-1 [1,962 kB]
Get:62 http://kr.archive.ubuntu.com/ubuntu focal/universe amd64 octave-doc all 5.2.0-1 [7,505 kB]
Fetched 59.1 MB in 10s (5,869 kB/s)                                            
Extracting templates from packages: 100%
Selecting previously unselected package liblqr-1-0:amd64.
(Reading database ... 202589 files and directories currently installed.)
Preparing to unpack .../00-liblqr-1-0_0.4.2-2.1_amd64.deb ...
Unpacking liblqr-1-0:amd64 (0.4.2-2.1) ...
Selecting previously unselected package imagemagick-6-common.
Preparing to unpack .../01-imagemagick-6-common_8%3a6.9.10.23+dfsg-2.1ubuntu11.4
_all.deb ...
Unpacking imagemagick-6-common (8:6.9.10.23+dfsg-2.1ubuntu11.4) ...
Selecting previously unselected package libmagickcore-6.q16-6:amd64.
Preparing to unpack .../02-libmagickcore-6.q16-6_8%3a6.9.10.23+dfsg-2.1ubuntu11.
4_amd64.deb ...
Unpacking libmagickcore-6.q16-6:amd64 (8:6.9.10.23+dfsg-2.1ubuntu11.4) ...
Selecting previously unselected package libmagickwand-6.q16-6:amd64.
Preparing to unpack .../03-libmagickwand-6.q16-6_8%3a6.9.10.23+dfsg-2.1ubuntu11.
4_amd64.deb ...
Unpacking libmagickwand-6.q16-6:amd64 (8:6.9.10.23+dfsg-2.1ubuntu11.4) ...
Selecting previously unselected package tex-common.
Preparing to unpack .../04-tex-common_6.13_all.deb ...
Unpacking tex-common (6.13) ...
Selecting previously unselected package epstool.
Preparing to unpack .../05-epstool_3.09-2_amd64.deb ...
Unpacking epstool (3.09-2) ...
Selecting previously unselected package fonts-freefont-otf.
Preparing to unpack .../06-fonts-freefont-otf_20120503-10_all.deb ...
Unpacking fonts-freefont-otf (20120503-10) ...
Selecting previously unselected package aglfn.
Preparing to unpack .../07-aglfn_1.7+git20191031.4036a9c-2_all.deb ...
Unpacking aglfn (1.7+git20191031.4036a9c-2) ...
Selecting previously unselected package gnuplot-data.
Preparing to unpack .../08-gnuplot-data_5.2.8+dfsg1-2_all.deb ...
Unpacking gnuplot-data (5.2.8+dfsg1-2) ...
Selecting previously unselected package libqt5printsupport5:amd64.
Preparing to unpack .../09-libqt5printsupport5_5.12.8+dfsg-0ubuntu2.1_amd64.deb 
...
Unpacking libqt5printsupport5:amd64 (5.12.8+dfsg-0ubuntu2.1) ...
Selecting previously unselected package libwxbase3.0-0v5:amd64.
Preparing to unpack .../10-libwxbase3.0-0v5_3.0.4+dfsg-15build1_amd64.deb ...
Unpacking libwxbase3.0-0v5:amd64 (3.0.4+dfsg-15build1) ...
Selecting previously unselected package libwxgtk3.0-gtk3-0v5:amd64.
Preparing to unpack .../11-libwxgtk3.0-gtk3-0v5_3.0.4+dfsg-15build1_amd64.deb ..
.
Unpacking libwxgtk3.0-gtk3-0v5:amd64 (3.0.4+dfsg-15build1) ...
Selecting previously unselected package gnuplot-qt.
Preparing to unpack .../12-gnuplot-qt_5.2.8+dfsg1-2_amd64.deb ...
Unpacking gnuplot-qt (5.2.8+dfsg1-2) ...
Selecting previously unselected package gsfonts.
Preparing to unpack .../13-gsfonts_1%3a8.11+urwcyr1.0.7~pre44-4.4_all.deb ...
Unpacking gsfonts (1:8.11+urwcyr1.0.7~pre44-4.4) ...
Selecting previously unselected package libaec0:amd64.
Preparing to unpack .../14-libaec0_1.0.4-1_amd64.deb ...
Unpacking libaec0:amd64 (1.0.4-1) ...
Selecting previously unselected package libamd2:amd64.
Preparing to unpack .../15-libamd2_1%3a5.7.1+dfsg-2_amd64.deb ...
Unpacking libamd2:amd64 (1:5.7.1+dfsg-2) ...
Selecting previously unselected package libblas3:amd64.
Preparing to unpack .../16-libblas3_3.9.0-1build1_amd64.deb ...
Unpacking libblas3:amd64 (3.9.0-1build1) ...
Selecting previously unselected package libgfortran5:amd64.
Preparing to unpack .../17-libgfortran5_10.3.0-1ubuntu1~20.04_amd64.deb ...
Unpacking libgfortran5:amd64 (10.3.0-1ubuntu1~20.04) ...
Selecting previously unselected package libopenblas0-pthread:amd64.
Preparing to unpack .../18-libopenblas0-pthread_0.3.8+ds-1ubuntu0.20.04.1_amd64.
deb ...
Unpacking libopenblas0-pthread:amd64 (0.3.8+ds-1ubuntu0.20.04.1) ...
Selecting previously unselected package liblapack3:amd64.
Preparing to unpack .../19-liblapack3_3.9.0-1build1_amd64.deb ...
Unpacking liblapack3:amd64 (3.9.0-1build1) ...
Selecting previously unselected package libarpack2:amd64.
Preparing to unpack .../20-libarpack2_3.7.0-3_amd64.deb ...
Unpacking libarpack2:amd64 (3.7.0-3) ...
Selecting previously unselected package libcamd2:amd64.
Preparing to unpack .../21-libcamd2_1%3a5.7.1+dfsg-2_amd64.deb ...
Unpacking libcamd2:amd64 (1:5.7.1+dfsg-2) ...
Selecting previously unselected package libccolamd2:amd64.
Preparing to unpack .../22-libccolamd2_1%3a5.7.1+dfsg-2_amd64.deb ...
Unpacking libccolamd2:amd64 (1:5.7.1+dfsg-2) ...
Selecting previously unselected package libmetis5:amd64.
Preparing to unpack .../23-libmetis5_5.1.0.dfsg-5_amd64.deb ...
Unpacking libmetis5:amd64 (5.1.0.dfsg-5) ...
Selecting previously unselected package libcholmod3:amd64.
Preparing to unpack .../24-libcholmod3_1%3a5.7.1+dfsg-2_amd64.deb ...
Unpacking libcholmod3:amd64 (1:5.7.1+dfsg-2) ...
Selecting previously unselected package libcxsparse3:amd64.
Preparing to unpack .../25-libcxsparse3_1%3a5.7.1+dfsg-2_amd64.deb ...
Unpacking libcxsparse3:amd64 (1:5.7.1+dfsg-2) ...
Selecting previously unselected package libemf1:amd64.
Preparing to unpack .../26-libemf1_1.0.11-2ubuntu2_amd64.deb ...
Unpacking libemf1:amd64 (1.0.11-2ubuntu2) ...
Selecting previously unselected package libfltk1.3:amd64.
Preparing to unpack .../27-libfltk1.3_1.3.4-10build1_amd64.deb ...
Unpacking libfltk1.3:amd64 (1.3.4-10build1) ...
Selecting previously unselected package libfltk-gl1.3:amd64.
Preparing to unpack .../28-libfltk-gl1.3_1.3.4-10build1_amd64.deb ...
Unpacking libfltk-gl1.3:amd64 (1.3.4-10build1) ...
Selecting previously unselected package libgl2ps1.4.
Preparing to unpack .../29-libgl2ps1.4_1.4.0+dfsg1-2_amd64.deb ...
Unpacking libgl2ps1.4 (1.4.0+dfsg1-2) ...
Selecting previously unselected package libglpk40:amd64.
Preparing to unpack .../30-libglpk40_4.65-2_amd64.deb ...
Unpacking libglpk40:amd64 (4.65-2) ...
Selecting previously unselected package libgraphicsmagick-q16-3.
Preparing to unpack .../31-libgraphicsmagick-q16-3_1.4+really1.3.35-1_amd64.deb 
...
Unpacking libgraphicsmagick-q16-3 (1.4+really1.3.35-1) ...
Selecting previously unselected package libgraphicsmagick++-q16-12.
Preparing to unpack .../32-libgraphicsmagick++-q16-12_1.4+really1.3.35-1_amd64.d
eb ...
Unpacking libgraphicsmagick++-q16-12 (1.4+really1.3.35-1) ...
Selecting previously unselected package libsz2:amd64.
Preparing to unpack .../33-libsz2_1.0.4-1_amd64.deb ...
Unpacking libsz2:amd64 (1.0.4-1) ...
Selecting previously unselected package libhdf5-103:amd64.
Preparing to unpack .../34-libhdf5-103_1.10.4+repack-11ubuntu1_amd64.deb ...
Unpacking libhdf5-103:amd64 (1.10.4+repack-11ubuntu1) ...
Selecting previously unselected package libmagick++-6.q16-8:amd64.
Preparing to unpack .../35-libmagick++-6.q16-8_8%3a6.9.10.23+dfsg-2.1ubuntu11.4_
amd64.deb ...
Unpacking libmagick++-6.q16-8:amd64 (8:6.9.10.23+dfsg-2.1ubuntu11.4) ...
Selecting previously unselected package libqrupdate1:amd64.
Preparing to unpack .../36-libqrupdate1_1.1.2-3_amd64.deb ...
Unpacking libqrupdate1:amd64 (1.1.2-3) ...
Selecting previously unselected package libumfpack5:amd64.
Preparing to unpack .../37-libumfpack5_1%3a5.7.1+dfsg-2_amd64.deb ...
Unpacking libumfpack5:amd64 (1:5.7.1+dfsg-2) ...
Selecting previously unselected package liboctave7:amd64.
Preparing to unpack .../38-liboctave7_5.2.0-1_amd64.deb ...
Unpacking liboctave7:amd64 (5.2.0-1) ...
Selecting previously unselected package libopenblas0:amd64.
Preparing to unpack .../39-libopenblas0_0.3.8+ds-1ubuntu0.20.04.1_amd64.deb ...
Unpacking libopenblas0:amd64 (0.3.8+ds-1ubuntu0.20.04.1) ...
Selecting previously unselected package libplot2c2:amd64.
Preparing to unpack .../40-libplot2c2_2.6-10build1_amd64.deb ...
Unpacking libplot2c2:amd64 (2.6-10build1) ...
Selecting previously unselected package libportaudio2:amd64.
Preparing to unpack .../41-libportaudio2_19.6.0-1build1_amd64.deb ...
Unpacking libportaudio2:amd64 (19.6.0-1build1) ...
Selecting previously unselected package libzip5:amd64.
Preparing to unpack .../42-libzip5_1.5.1-0ubuntu1_amd64.deb ...
Unpacking libzip5:amd64 (1.5.1-0ubuntu1) ...
Selecting previously unselected package libpstoedit0c2a:amd64.
Preparing to unpack .../43-libpstoedit0c2a_3.75-1build1_amd64.deb ...
Unpacking libpstoedit0c2a:amd64 (3.75-1build1) ...
Selecting previously unselected package libqhull7:amd64.
Preparing to unpack .../44-libqhull7_2015.2-4_amd64.deb ...
Unpacking libqhull7:amd64 (2015.2-4) ...
Selecting previously unselected package libqscintilla2-qt5-l10n.
Preparing to unpack .../45-libqscintilla2-qt5-l10n_2.11.2+dfsg-6_all.deb ...
Unpacking libqscintilla2-qt5-l10n (2.11.2+dfsg-6) ...
Selecting previously unselected package libqscintilla2-qt5-15.
Preparing to unpack .../46-libqscintilla2-qt5-15_2.11.2+dfsg-6_amd64.deb ...
Unpacking libqscintilla2-qt5-15 (2.11.2+dfsg-6) ...
Selecting previously unselected package libqt5sql5:amd64.
Preparing to unpack .../47-libqt5sql5_5.12.8+dfsg-0ubuntu2.1_amd64.deb ...
Unpacking libqt5sql5:amd64 (5.12.8+dfsg-0ubuntu2.1) ...
Selecting previously unselected package libqt5help5:amd64.
Preparing to unpack .../48-libqt5help5_5.12.8-0ubuntu1_amd64.deb ...
Unpacking libqt5help5:amd64 (5.12.8-0ubuntu1) ...
Selecting previously unselected package libqt5sql5-sqlite:amd64.
Preparing to unpack .../49-libqt5sql5-sqlite_5.12.8+dfsg-0ubuntu2.1_amd64.deb ..
.
Unpacking libqt5sql5-sqlite:amd64 (5.12.8+dfsg-0ubuntu2.1) ...
Selecting previously unselected package libqt5xml5:amd64.
Preparing to unpack .../50-libqt5xml5_5.12.8+dfsg-0ubuntu2.1_amd64.deb ...
Unpacking libqt5xml5:amd64 (5.12.8+dfsg-0ubuntu2.1) ...
Selecting previously unselected package libtext-unidecode-perl.
Preparing to unpack .../51-libtext-unidecode-perl_1.30-1_all.deb ...
Unpacking libtext-unidecode-perl (1.30-1) ...
Selecting previously unselected package libxml-namespacesupport-perl.
Preparing to unpack .../52-libxml-namespacesupport-perl_1.12-1_all.deb ...
Unpacking libxml-namespacesupport-perl (1.12-1) ...
Selecting previously unselected package libxml-sax-base-perl.
Preparing to unpack .../53-libxml-sax-base-perl_1.09-1_all.deb ...
Unpacking libxml-sax-base-perl (1.09-1) ...
Selecting previously unselected package libxml-sax-perl.
Preparing to unpack .../54-libxml-sax-perl_1.02+dfsg-1_all.deb ...
Unpacking libxml-sax-perl (1.02+dfsg-1) ...
Selecting previously unselected package libxml-libxml-perl.
Preparing to unpack .../55-libxml-libxml-perl_2.0134+dfsg-1build1_amd64.deb ...
Unpacking libxml-libxml-perl (2.0134+dfsg-1build1) ...
Selecting previously unselected package libxml-sax-expat-perl.
Preparing to unpack .../56-libxml-sax-expat-perl_0.51-1_all.deb ...
Unpacking libxml-sax-expat-perl (0.51-1) ...
Selecting previously unselected package pstoedit.
Preparing to unpack .../57-pstoedit_3.75-1build1_amd64.deb ...
Unpacking pstoedit (3.75-1build1) ...
Selecting previously unselected package texinfo.
Preparing to unpack .../58-texinfo_6.7.0.dfsg.2-5_amd64.deb ...
Unpacking texinfo (6.7.0.dfsg.2-5) ...
Selecting previously unselected package octave-common.
Preparing to unpack .../59-octave-common_5.2.0-1_all.deb ...
Unpacking octave-common (5.2.0-1) ...
Selecting previously unselected package octave.
Preparing to unpack .../60-octave_5.2.0-1_amd64.deb ...
Unpacking octave (5.2.0-1) ...
Selecting previously unselected package octave-doc.
Preparing to unpack .../61-octave-doc_5.2.0-1_all.deb ...
Unpacking octave-doc (5.2.0-1) ...
Setting up libplot2c2:amd64 (2.6-10build1) ...
Setting up libamd2:amd64 (1:5.7.1+dfsg-2) ...
Setting up libportaudio2:amd64 (19.6.0-1build1) ...
Setting up imagemagick-6-common (8:6.9.10.23+dfsg-2.1ubuntu11.4) ...
Setting up libzip5:amd64 (1.5.1-0ubuntu1) ...
Setting up libqscintilla2-qt5-l10n (2.11.2+dfsg-6) ...
Setting up libfltk1.3:amd64 (1.3.4-10build1) ...
Setting up libfltk-gl1.3:amd64 (1.3.4-10build1) ...
Setting up fonts-freefont-otf (20120503-10) ...
Setting up libxml-namespacesupport-perl (1.12-1) ...
Setting up libqhull7:amd64 (2015.2-4) ...
Setting up libmetis5:amd64 (5.1.0.dfsg-5) ...
Setting up octave-doc (5.2.0-1) ...
Setting up octave-common (5.2.0-1) ...
Setting up libaec0:amd64 (1.0.4-1) ...
Setting up libgl2ps1.4 (1.4.0+dfsg1-2) ...
Setting up libqt5sql5:amd64 (5.12.8+dfsg-0ubuntu2.1) ...
Setting up libqt5printsupport5:amd64 (5.12.8+dfsg-0ubuntu2.1) ...
Setting up tex-common (6.13) ...
update-language: texlive-base not installed and configured, doing nothing!
Setting up libcamd2:amd64 (1:5.7.1+dfsg-2) ...
Setting up libxml-sax-base-perl (1.09-1) ...
Setting up libqt5xml5:amd64 (5.12.8+dfsg-0ubuntu2.1) ...
Setting up libblas3:amd64 (3.9.0-1build1) ...
update-alternatives: using /usr/lib/x86_64-linux-gnu/blas/libblas.so.3 to provid
e /usr/lib/x86_64-linux-gnu/libblas.so.3 (libblas.so.3-x86_64-linux-gnu) in auto
 mode
Setting up epstool (3.09-2) ...
Setting up libglpk40:amd64 (4.65-2) ...
Setting up aglfn (1.7+git20191031.4036a9c-2) ...
Setting up gsfonts (1:8.11+urwcyr1.0.7~pre44-4.4) ...
Setting up libgraphicsmagick-q16-3 (1.4+really1.3.35-1) ...
Setting up libgfortran5:amd64 (10.3.0-1ubuntu1~20.04) ...
Setting up liblqr-1-0:amd64 (0.4.2-2.1) ...
Setting up libccolamd2:amd64 (1:5.7.1+dfsg-2) ...
Setting up libwxbase3.0-0v5:amd64 (3.0.4+dfsg-15build1) ...
Setting up libgraphicsmagick++-q16-12 (1.4+really1.3.35-1) ...
Setting up libcxsparse3:amd64 (1:5.7.1+dfsg-2) ...
Setting up libtext-unidecode-perl (1.30-1) ...
Setting up libemf1:amd64 (1.0.11-2ubuntu2) ...
Setting up libsz2:amd64 (1.0.4-1) ...
Setting up gnuplot-data (5.2.8+dfsg1-2) ...
Setting up liblapack3:amd64 (3.9.0-1build1) ...
update-alternatives: using /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3 to pr
ovide /usr/lib/x86_64-linux-gnu/liblapack.so.3 (liblapack.so.3-x86_64-linux-gnu)
 in auto mode
Setting up libopenblas0-pthread:amd64 (0.3.8+ds-1ubuntu0.20.04.1) ...
update-alternatives: using /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so
.3 to provide /usr/lib/x86_64-linux-gnu/libblas.so.3 (libblas.so.3-x86_64-linux-
gnu) in auto mode
update-alternatives: using /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.
so.3 to provide /usr/lib/x86_64-linux-gnu/liblapack.so.3 (liblapack.so.3-x86_64-
linux-gnu) in auto mode
update-alternatives: using /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenbla
s.so.0 to provide /usr/lib/x86_64-linux-gnu/libopenblas.so.0 (libopenblas.so.0-x
86_64-linux-gnu) in auto mode
Setting up libqt5sql5-sqlite:amd64 (5.12.8+dfsg-0ubuntu2.1) ...
Setting up libarpack2:amd64 (3.7.0-3) ...
Setting up libqscintilla2-qt5-15 (2.11.2+dfsg-6) ...
Setting up libqrupdate1:amd64 (1.1.2-3) ...
Setting up libxml-sax-perl (1.02+dfsg-1) ...
update-perl-sax-parsers: Registering Perl SAX parser XML::SAX::PurePerl with pri
ority 10...
update-perl-sax-parsers: Updating overall Perl SAX parser modules info file...

Creating config file /etc/perl/XML/SAX/ParserDetails.ini with new version
Setting up libqt5help5:amd64 (5.12.8-0ubuntu1) ...
Setting up libwxgtk3.0-gtk3-0v5:amd64 (3.0.4+dfsg-15build1) ...
Setting up libmagickcore-6.q16-6:amd64 (8:6.9.10.23+dfsg-2.1ubuntu11.4) ...
Setting up libhdf5-103:amd64 (1.10.4+repack-11ubuntu1) ...
Setting up libxml-libxml-perl (2.0134+dfsg-1build1) ...
update-perl-sax-parsers: Registering Perl SAX parser XML::LibXML::SAX::Parser wi
th priority 50...
update-perl-sax-parsers: Registering Perl SAX parser XML::LibXML::SAX with prior
ity 50...
update-perl-sax-parsers: Updating overall Perl SAX parser modules info file...
Replacing config file /etc/perl/XML/SAX/ParserDetails.ini with new version
Setting up libxml-sax-expat-perl (0.51-1) ...
update-perl-sax-parsers: Registering Perl SAX parser XML::SAX::Expat with priori
ty 50...
update-perl-sax-parsers: Updating overall Perl SAX parser modules info file...
Replacing config file /etc/perl/XML/SAX/ParserDetails.ini with new version
Setting up libopenblas0:amd64 (0.3.8+ds-1ubuntu0.20.04.1) ...
Setting up libmagickwand-6.q16-6:amd64 (8:6.9.10.23+dfsg-2.1ubuntu11.4) ...
Setting up libmagick++-6.q16-8:amd64 (8:6.9.10.23+dfsg-2.1ubuntu11.4) ...
Setting up libcholmod3:amd64 (1:5.7.1+dfsg-2) ...
Setting up libpstoedit0c2a:amd64 (3.75-1build1) ...
Setting up gnuplot-qt (5.2.8+dfsg1-2) ...
update-alternatives: using /usr/bin/gnuplot-qt to provide /usr/bin/gnuplot (gnup
lot) in auto mode
Setting up libumfpack5:amd64 (1:5.7.1+dfsg-2) ...
Setting up texinfo (6.7.0.dfsg.2-5) ...
Setting up pstoedit (3.75-1build1) ...
Setting up liboctave7:amd64 (5.2.0-1) ...
Setting up octave (5.2.0-1) ...
Processing triggers for fontconfig (2.13.1-2ubuntu3) ...
Processing triggers for desktop-file-utils (0.24-1ubuntu3) ...
Processing triggers for mime-support (3.64ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.9) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for install-info (6.7.0.dfsg.2-5) ...

 

 

 

3) pyulog 설치

 

swift@Swift:~/Desktop$ pip install pyulog

Collecting pyulog
  Downloading pyulog-1.0.0-py3-none-any.whl (39 kB)
Collecting numpy
  Downloading numpy-1.23.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.1 MB)
     |████████████████████████████████| 17.1 MB 10.9 MB/s 
Installing collected packages: numpy, pyulog
  WARNING: The scripts f2py, f2py3 and f2py3.8 are installed in '/home/swift/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The scripts ulog2csv, ulog2kml, ulog2rosbag, ulog_extract_gps_dump, ulog_info, ulog_messages, ulog_migratedb and ulog_params are installed in '/home/swift/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

 

 

pylog 설치시 실행파일의 일부가 ~/.local/bin에 저장되기 때문에 환경변수를 설정해주어야 한다. 

HOME 디렉토리에서 .octaverc 파일을 생성하고 아래와 같이 작성한다.

swift@Swift:~/.local/bin$ ll
total 52
drwxrwxr-x 2 swift swift 4096 10월 20 04:32 ./
drwxr-xr-x 5 swift swift 4096 10월 20 04:32 ../
-rwxrwxr-x 1 swift swift  216 10월 20 04:32 f2py*
-rwxrwxr-x 1 swift swift  216 10월 20 04:32 f2py3*
-rwxrwxr-x 1 swift swift  216 10월 20 04:32 f2py3.8*
-rwxrwxr-x 1 swift swift  214 10월 20 04:32 ulog2csv*
-rwxrwxr-x 1 swift swift  214 10월 20 04:32 ulog2kml*
-rwxrwxr-x 1 swift swift  217 10월 20 04:32 ulog2rosbag*
-rwxrwxr-x 1 swift swift  222 10월 20 04:32 ulog_extract_gps_dump*
-rwxrwxr-x 1 swift swift  210 10월 20 04:32 ulog_info*
-rwxrwxr-x 1 swift swift  214 10월 20 04:32 ulog_messages*
-rwxrwxr-x 1 swift swift  216 10월 20 04:32 ulog_migratedb*
-rwxrwxr-x 1 swift swift  212 10월 20 04:32 ulog_params*

 

 

 

.octaverc의 작성내용

$HOME 디렉토리는 자신에게 맞게 작성하면 된다. 본인의 경우 $HOME=/home/swift

setenv ('PATH', ['/home/swift/.local/bin:', getenv('PATH')])

 

 

4) plotUlog를 다운받음

swift@Swift:~/workspace/PX4/UlogViewer$ git clone https://github.com/kyuhyong/plotulog.git

Cloning into 'plotulog'...
remote: Enumerating objects: 157, done.
remote: Counting objects: 100% (3/3), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 157 (delta 0), reused 1 (delta 0), pack-reused 154
Receiving objects: 100% (157/157), 44.25 KiB | 11.06 MiB/s, done.
Resolving deltas: 100% (93/93), done.

 

실행

불러올 Ulog 파일명을 아래와 같은 형식으로 이름을 변경한다. 

swift@Swift:~/workspace/PX4/UlogViewer/plotulog$ mv 22_10_18.ulg log001.ulg

 

plotUlog 경로에서 octave를 실행한다.

swift@Swift:~/workspace/PX4/UlogViewer/plotulog$ octave
GNU Octave, version 5.2.0
Copyright (C) 2020 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  For details, type 'warranty'.

Octave was configured for "x86_64-pc-linux-gnu".

Additional information about Octave is available at https://www.octave.org.

Please contribute if you find this software useful.
For more information, visit https://www.octave.org/get-involved.html

Read https://www.octave.org/bugs.html to learn how to submit bug reports.
For information about changes from previous versions, type 'news'.

 

아래와 같인 plotUlog를 실행한다.

octave:1> plotUlog("log001.ulg","Description")

ulogFileName = log001.ulg
folderName = 001_Description
Covnerting ulg to csv...
001_Description/log001_optical_flow_0.csv File not exists!

001_Description/log001_debug_vect_0.csv File not exists!

001_Description/log001_distance_sensor_0.csv File not exists!

001_Description/log001_input_rc_0.csv File not exists!

001_Description/log001_system_power_0.csv File not exists!

saveName = 001_Description/Attitude_Control
saveName = 001_Description/Attitude_Yaw_Control
saveName = 001_Description/Sensor_Data
saveName = 001_Description/Altitude_Control
saveName = 001_Description/Position_Control
saveName = 001_Description/Position_VelocityControl.png

 

 

실행되면 파일형식을 *.csv로 변환하고 그 결과들은 001_Description 폴더로 저장해준다.

swift@Swift:~/workspace/PX4/UlogViewer/plotulog$ ll
total 83532
drwxrwxr-x 4 swift swift     4096 10월 20 05:43 ./
drwxrwxr-x 3 swift swift     4096 10월 20 05:06 ../
drwxrwxr-x 2 swift swift    12288 10월 20 05:16 001_Description/
-rw-rw-r-- 1 swift swift     2693 10월 20 05:06 analyzeSensors.m
-rw-rw-r-- 1 swift swift      204 10월 20 05:06 checkFile.m
-rw-rw-r-- 1 swift swift     3007 10월 20 05:06 compareSensorLogs.m
-rw-rw-r-- 1 swift swift      186 10월 20 05:06 findMax.m
-rw-rw-r-- 1 swift swift     1008 10월 20 05:06 flagControlState.m
-rw-rw-r-- 1 swift swift     1402 10월 20 05:06 flagLandState.m
-rw-rw-r-- 1 swift swift     1243 10월 20 05:06 getNavState.m
drwxrwxr-x 8 swift swift     4096 10월 20 05:06 .git/
-rw-r--r-- 1 root  root  85429356 10월 20 05:11 log001.ulg
-rw-rw-r-- 1 swift swift     3492 10월 20 05:06 plotAltitudeControl.m
-rw-rw-r-- 1 swift swift     3184 10월 20 05:06 plotAttitudeControl.m
-rw-rw-r-- 1 swift swift     2061 10월 20 05:06 plotFFT.m
-rw-rw-r-- 1 swift swift     4907 10월 20 05:06 plotPositionControl.m
-rw-rw-r-- 1 swift swift     1071 10월 20 05:06 plotPower.m
-rw-rw-r-- 1 swift swift     1012 10월 20 05:06 plotSensorData.m
-rw-rw-r-- 1 swift swift     9232 10월 20 05:06 plotUlog.m
-rw-rw-r-- 1 swift swift     1010 10월 20 05:06 quaternionToEuler.m
-rw-rw-r-- 1 swift swift     3445 10월 20 05:06 README.md
-rw-rw-r-- 1 swift swift      718 10월 20 05:06 readSensorData.m

 

 

 

변환이 완료되면 미리 정의된 그래프를 그려준다.

 

saveName = 001_Description/Attitude_Control

 

 

saveName = 001_Description/Attitude_Yaw_Control

 

 

 

 

saveName = 001_Description/Sensor_Data

 

saveName = 001_Description/Altitude_Control

 

 

saveName = 001_Description/Position_Control

 

 

 

 

728x90

댓글