Ulogtocsv convertion does not work

#1

Hello,

I’m trying to use the following script to convet .ulog file into matlab file in a mac computer (I also tried with W10 computer and obtain the same result):

I download the zip file in the link above.
Then in a terminal I wrote “pip install pyulog” and I obtain this result :

Collecting pyulog
Using cached https://files.pythonhosted.org/packages/bc/93/5cb8676d4ed4ee69778b4f8f55529265b083b099e367d9d6c3f791
Requirement already satisfied: numpy in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from pyulog)
Installing collected packages: pyulog
Running setup.py install for pyulog … error
Complete output from command /usr/bin/python -u -c “import setuptools, tokenize;file=’/private/var/folders/gg/3hb92bjx6tj8shv1656lcyh40000gn/T/pip-build-HUEceu/pyulog/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(’\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” install --record /var/folders/gg/3hb92bjx6tj8shv1656lcyh40000gn/T/pip-PiE7BY-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib
creating build/lib/pyulog
copying pyulog/params.py -> build/lib/pyulog
copying pyulog/_version.py -> build/lib/pyulog
copying pyulog/ulog2csv.py -> build/lib/pyulog
copying pyulog/init.py -> build/lib/pyulog
copying pyulog/core.py -> build/lib/pyulog
copying pyulog/px4.py -> build/lib/pyulog
copying pyulog/extract_gps_dump.py -> build/lib/pyulog
copying pyulog/messages.py -> build/lib/pyulog
copying pyulog/ulog2kml.py -> build/lib/pyulog
copying pyulog/info.py -> build/lib/pyulog
creating build/lib/test
copying test/test_ulog2csv.py -> build/lib/test
copying test/init.py -> build/lib/test
UPDATING build/lib/pyulog/_version.py
set build/lib/pyulog/_version.py to ‘0.6.0’
running install_lib
creating /Library/Python/2.7/site-packages/pyulog
error: could not create ‘/Library/Python/2.7/site-packages/pyulog’: Permission denied

----------------------------------------

Command “/usr/bin/python -u -c “import setuptools, tokenize;file=’/private/var/folders/gg/3hb92bjx6tj8shv1656lcyh40000gn/T/pip-build-HUEceu/pyulog/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(’\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” install --record /var/folders/gg/3hb92bjx6tj8shv1656lcyh40000gn/T/pip-PiE7BY-record/install-record.txt --single-version-externally-managed --compile” failed with error code 1 in /private/var/folders/gg/3hb92bjx6tj8shv1656lcyh40000gn/T/pip-build-HUEceu/pyulog/
You are using pip version 9.0.1, however version 18.1 is available.
You should consider upgrading via the ‘pip install --upgrade pip’ command.

Then I tried the ‘pip install --upgrade pip’ command but it didn’t seems to obtain a better result :

Collecting pip
Using cached https://files.pythonhosted.org/packages/c2/d7/90f34cb0d83a6c5631cf71dfe64cc1054598c843a92b400e55675c
Installing collected packages: pip
Found existing installation: pip 9.0.1
Uninstalling pip-9.0.1:
Exception:
Traceback (most recent call last):
File “/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py”, line 215, in main
status = self.run(options, args)
File “/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/commands/install.py”, line 342, in run
prefix=options.prefix_path,
File “/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_set.py”, line 778, in install
requirement.uninstall(auto_confirm=True)
File “/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py”, line 754, in uninstall
paths_to_remove.remove(auto_confirm)
File “/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_uninstall.py”, line 115, in remove
renames(path, new_path)
File “/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/utils/init.py”, line 267, in renames
shutil.move(old, new)
File “/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py”, line 300, in move
rmtree(src)
File “/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py”, line 247, in rmtree
rmtree(fullname, ignore_errors, onerror)
File “/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py”, line 252, in rmtree
onerror(os.remove, fullname, sys.exc_info())
File “/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py”, line 250, in rmtree
os.remove(fullname)
OSError: [Errno 13] Permission denied: ‘/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/EGG-INFO/PKG-INFO’
You are using pip version 9.0.1, however version 18.1 is available.
You should consider upgrading via the ‘pip install --upgrade pip’ command.

Which probably explain why when I try to run the logconv.m file in matlab it does not work properly :

logconv
INFO: Start importing the log data.
/bin/bash: ulog2csv: command not found
INFO: Converting the ulog file to csv took 0.045748 s.
INFO: Starting to import the csv data into matlab.
INFO: Importing the csv data to matlab took 0.056771 s.
Error using logconv/ImportPX4LogData (line 230)
Empty sysvector: Converted the ulog file to csv and parsed it.
Contains the logfile any topic specified in the setupTopics() function?
Error in logconv (line 113)
ImportPX4LogData();

Please do you have any idea to solve this issue ?

Thank you

Jeremy

1 Like
#2

Hi,

Seems like you have issues with permissions. Don’t know the best way to handle this on mac but you can probably run the command as root, i.e.

sudo pip install pyulog

If you want to use Matlab for analysis you can try out this software if you want to.

Best,
Carl