Home        Store        Docs        Blog

Heading & Depth data to surface?


(Jacob) #21

I’m sorry, this module is only available in our fork, not the mainline code. This means that it is not packaged with that release executable based off the mainline code. We can try to get it or something like it in the next release.

@vatsal_shah Did you install mavproxy from source or using the executable? It will only work right now if you install from source using our fork.


(Vatsal Shah) #22

@jwalser I have installed it from the source.


(Jacob) #23

@vatsal_shah Repeat the same procedure, but use the Blue Robotics fork.


(Julian Hancock) #24

Jacob

I would like to extract temperature and depth to CSV so I can make a water column sound velocity profile. Would you be so kind as to shoot a few pointers on how this can be achieved please.

Julian


(Patrick José Pereira) #25

If you want to get the data after the dive, you can use the same command line but changing the message GPW_RAW_INT to GLOBAL_POSITION_INT for depth.


(Vatsal Shah) #26

Hi,
I want to get sensor data from pixhawk (IMU, Pressure sensor) on Rpi. How can I do that? Do I need to make Rpi a UDP host or skip that and store sensor data in variables?


(Patrick José Pereira) #27

If you want to get the data from your surface computer or in the Rpi, you can use this simple pymalink example:

# Float division
from __future__ import division
 
# Import mavutil
from pymavlink import mavutil
 
# Create the connection
# From topside computer
master = mavutil.mavlink_connection('udp:192.168.2.1:14550')
 
def update():
    # Get all messages
    msgs = []
    while True:
        msg = master.recv_match()
        if msg == None:
            break
        msgs.append(msg)
 
    # Create dict
    data = {}
    for msg in msgs:
        data[msg.get_type()] = msg.to_dict()
    # Return dict
    return data
 
while True:
    data = update()
    if 'RAW_IMU' in data:
        print('IMU [x,y,z] [mg]: ',data['RAW_IMU']['xacc'], data['RAW_IMU']['yacc'], data['RAW_IMU']['zacc'])
    if 'ATTITUDE' in data:
        print('ATTITUDE [r,p,y] [rad]: ', data['ATTITUDE']['roll'], data['ATTITUDE']['pitch'], data['ATTITUDE']['yaw'])

To allow your program to run parallel with QGC you will need to create a second output in mavproxy, like this: --out udp:192.168.2.1:14550 --out udp:192.168.2.1:14777.


(Julian Hancock) #28

Thank you Sir.

Julian


(Vatsal Shah) #29

Thanks a lot, Patrick. @patrickelectric. It really helped us a lot.


(Vatsal Shah) #30

Hi,
How do I close ongoing mavproxy screen using python script?


(Jacob) #31

Like this.


(Etienne Demers) #32

Hello guys,

I’m still pulling my hair out on this one.

I don’t understand where to install what and where I need to type the commands.

Any chance you guys can put a screenshot step by step of how to make this work from A to Z?

I am pretty sure the answer to this riddle is so simple you guys might be wondering what the heck but I can’t figure it out.

Cheers,
E.


(Etienne Demers) #33

I’ve installed python 37-32 and copied mavproxy files from your fork in the same directory as the python.

I am running cmd in admin mode and go the the directory where python is install and run

C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32>python setup.py build install

then loads of lines appear:

byte-compiling build\bdist.win32\egg\MAVProxy\modules\mavproxy_smartcamera\sc_vi
deo.py to sc_video.cpython-37.pyc
  File "build\bdist.win32\egg\MAVProxy\modules\mavproxy_smartcamera\sc_video.py"
, line 57
    print "failed to open camera, exiting!"
                                          ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("failed
to open camera, exiting!")?

byte-compiling build\bdist.win32\egg\MAVProxy\modules\mavproxy_smartcamera\sc_we
bcam.py to sc_webcam.cpython-37.pyc
  File "build\bdist.win32\egg\MAVProxy\modules\mavproxy_smartcamera\sc_webcam.py
", line 43
    print "failed to open webcam %d" % self.instance
                                   ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("failed
to open webcam %d" % self.instance)?

byte-compiling build\bdist.win32\egg\MAVProxy\modules\mavproxy_smartcamera\ssdp.
py to ssdp.cpython-37.pyc
byte-compiling build\bdist.win32\egg\MAVProxy\modules\mavproxy_smartcamera\__ini
t__.py to __init__.cpython-37.pyc
byte-compiling build\bdist.win32\egg\MAVProxy\modules\mavproxy_speech.py to mavp
roxy_speech.cpython-37.pyc
byte-compiling build\bdist.win32\egg\MAVProxy\modules\mavproxy_terrain.py to mav
proxy_terrain.cpython-37.pyc
byte-compiling build\bdist.win32\egg\MAVProxy\modules\mavproxy_test.py to mavpro
xy_test.cpython-37.pyc
byte-compiling build\bdist.win32\egg\MAVProxy\modules\mavproxy_tracker.py to mav
proxy_tracker.cpython-37.pyc
byte-compiling build\bdist.win32\egg\MAVProxy\modules\mavproxy_tuneopt.py to mav
proxy_tuneopt.cpython-37.pyc
byte-compiling build\bdist.win32\egg\MAVProxy\modules\mavproxy_wp.py to mavproxy
_wp.cpython-37.pyc
byte-compiling build\bdist.win32\egg\MAVProxy\modules\__init__.py to __init__.cp
ython-37.pyc
byte-compiling build\bdist.win32\egg\MAVProxy\__init__.py to __init__.cpython-37
.pyc
creating build\bdist.win32\egg\EGG-INFO
installing scripts to build\bdist.win32\egg\EGG-INFO\scripts
running install_scripts
creating build\bdist.win32\egg\EGG-INFO\scripts
copying build\scripts-3.7\MAVExplorer.py -> build\bdist.win32\egg\EGG-INFO\scrip
ts
copying build\scripts-3.7\mavflightview.py -> build\bdist.win32\egg\EGG-INFO\scr
ipts
copying build\scripts-3.7\mavproxy.py -> build\bdist.win32\egg\EGG-INFO\scripts
copying build\scripts-3.7\mp_slipmap.py -> build\bdist.win32\egg\EGG-INFO\script
s
copying build\scripts-3.7\mp_tile.py -> build\bdist.win32\egg\EGG-INFO\scripts
copying MAVProxy.egg-info\PKG-INFO -> build\bdist.win32\egg\EGG-INFO
copying MAVProxy.egg-info\SOURCES.txt -> build\bdist.win32\egg\EGG-INFO
copying MAVProxy.egg-info\dependency_links.txt -> build\bdist.win32\egg\EGG-INFO

copying MAVProxy.egg-info\requires.txt -> build\bdist.win32\egg\EGG-INFO
copying MAVProxy.egg-info\top_level.txt -> build\bdist.win32\egg\EGG-INFO
copying MAVProxy.egg-info\zip-safe -> build\bdist.win32\egg\EGG-INFO
creating 'dist\MAVProxy-1.6.1-py3.7.egg' and adding 'build\bdist.win32\egg' to i
t
removing 'build\bdist.win32\egg' (and everything under it)
Processing MAVProxy-1.6.1-py3.7.egg
Removing c:\users\etienne\appdata\local\programs\python\python37-32\lib\site-pac
kages\MAVProxy-1.6.1-py3.7.egg
Copying MAVProxy-1.6.1-py3.7.egg to c:\users\etienne\appdata\local\programs\pyth
on\python37-32\lib\site-packages
MAVProxy 1.6.1 is already the active version in easy-install.pth
Installing MAVExplorer.py script to C:\Users\Etienne\AppData\Local\Programs\Pyth
on\Python37-32\Scripts
Installing mavflightview.py script to C:\Users\Etienne\AppData\Local\Programs\Py
thon\Python37-32\Scripts
Installing mavproxy.py script to C:\Users\Etienne\AppData\Local\Programs\Python\
Python37-32\Scripts
Installing mp_slipmap.py script to C:\Users\Etienne\AppData\Local\Programs\Pytho
n\Python37-32\Scripts
Installing mp_tile.py script to C:\Users\Etienne\AppData\Local\Programs\Python\P
ython37-32\Scripts

Installed c:\users\etienne\appdata\local\programs\python\python37-32\lib\site-pa
ckages\mavproxy-1.6.1-py3.7.egg
Processing dependencies for MAVProxy==1.6.1
Searching for pyserial>=3.0
Reading https://pypi.python.org/simple/pyserial/
Downloading https://pypi.python.org/packages/cc/74/11b04703ec416717b247d78910327
7269d567db575d2fd88f25d9767fe3d/pyserial-3.4.tar.gz#md5=ed6183b15519a0ae96675e9c
3330c69b
Best match: pyserial 3.4
Processing pyserial-3.4.tar.gz
Writing C:\Users\Etienne\AppData\Local\Temp\easy_install-73zg0pew\pyserial-3.4\s
etup.cfg
Running pyserial-3.4\setup.py -q bdist_egg --dist-dir C:\Users\Etienne\AppData\L
ocal\Temp\easy_install-73zg0pew\pyserial-3.4\egg-dist-tmp-mn75_nfz
zip_safe flag not set; analyzing archive contents...
Traceback (most recent call last):
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\setuptools\sandbox.py", line 157, in save_modules
    yield saved
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\setuptools\sandbox.py", line 198, in setup_context
    yield
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\setuptools\sandbox.py", line 248, in run_setup
    DirectorySandbox(setup_dir).run(runner)
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\setuptools\sandbox.py", line 278, in run
    return func()
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\setuptools\sandbox.py", line 246, in runner
    _execfile(setup_script, ns)
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\setuptools\sandbox.py", line 47, in _execfile
    exec(code, globals, locals)
  File "C:\Users\Etienne\AppData\Local\Temp\easy_install-73zg0pew\pyserial-3.4\s
etup.py", line 99, in <module>
    scripts=['serial/tools/miniterm.py'],
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\distutils
\core.py", line 148, in setup
    dist.run_commands()
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\distutils
\dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\distutils
\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\setuptools\command\bdist_egg.py", line 209, in run
    os.path.join(archive_root, 'EGG-INFO'), self.zip_safe()
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\setuptools\command\bdist_egg.py", line 245, in zip_safe
    return analyze_egg(self.bdist_dir, self.stubs)
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\setuptools\command\bdist_egg.py", line 355, in analyze_egg
    safe = scan_module(egg_dir, base, name, stubs) and safe
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\setuptools\command\bdist_egg.py", line 392, in scan_module
    code = marshal.load(f)
ValueError: bad marshal data (unknown type code)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\setuptools\command\easy_install.py", line 665, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\setuptools\command\easy_install.py", line 695, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\setuptools\command\easy_install.py", line 876, in install_eggs
    return self.build_and_install(setup_script, setup_base)
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\setuptools\command\easy_install.py", line 1115, in build_and_install
    self.run_setup(setup_script, setup_base, args)
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\setuptools\command\easy_install.py", line 1101, in run_setup
    run_setup(setup_script, args)
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\setuptools\sandbox.py", line 251, in run_setup
    raise
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\contextli
b.py", line 130, in __exit__
    self.gen.throw(type, value, traceback)
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\setuptools\sandbox.py", line 198, in setup_context
    yield
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\contextli
b.py", line 130, in __exit__
    self.gen.throw(type, value, traceback)
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\setuptools\sandbox.py", line 169, in save_modules
    saved_exc.resume()
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\setuptools\sandbox.py", line 144, in resume
    six.reraise(type, exc, self._tb)
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\pkg_resources\_vendor\six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\setuptools\sandbox.py", line 157, in save_modules
    yield saved
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\setuptools\sandbox.py", line 198, in setup_context
    yield
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\setuptools\sandbox.py", line 248, in run_setup
    DirectorySandbox(setup_dir).run(runner)
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\setuptools\sandbox.py", line 278, in run
    return func()
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\setuptools\sandbox.py", line 246, in runner
    _execfile(setup_script, ns)
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\setuptools\sandbox.py", line 47, in _execfile
    exec(code, globals, locals)
  File "C:\Users\Etienne\AppData\Local\Temp\easy_install-73zg0pew\pyserial-3.4\s
etup.py", line 99, in <module>
    scripts=['serial/tools/miniterm.py'],
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\distutils
\core.py", line 148, in setup
    dist.run_commands()
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\distutils
\dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\distutils
\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\setuptools\command\bdist_egg.py", line 209, in run
    os.path.join(archive_root, 'EGG-INFO'), self.zip_safe()
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\setuptools\command\bdist_egg.py", line 245, in zip_safe
    return analyze_egg(self.bdist_dir, self.stubs)
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\setuptools\command\bdist_egg.py", line 355, in analyze_egg
    safe = scan_module(egg_dir, base, name, stubs) and safe
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\setuptools\command\bdist_egg.py", line 392, in scan_module
    code = marshal.load(f)
ValueError: bad marshal data (unknown type code)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\shutil.py
", line 389, in _rmtree_unsafe
    os.unlink(fullname)
PermissionError: [WinError 32] The process cannot access the file because it is
being used by another process: 'C:\\Users\\Etienne\\AppData\\Local\\Temp\\easy_i
nstall-73zg0pew\\pyserial-3.4\\build\\bdist.win32\\egg\\serial\\threaded\\__pyca
che__\\__init__.cpython-37.pyc'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "setup.py", line 75, in <module>
    package_data}
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\distutils
\core.py", line 148, in setup
    dist.run_commands()
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\distutils
\dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\distutils
\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\setuptools\command\install.py", line 67, in run
    self.do_egg_install()
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\setuptools\command\install.py", line 117, in do_egg_install
    cmd.run()
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\setuptools\command\easy_install.py", line 410, in run
    self.easy_install(spec, not self.no_deps)
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\setuptools\command\easy_install.py", line 646, in easy_install
    return self.install_item(None, spec, tmpdir, deps, True)
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\setuptools\command\easy_install.py", line 697, in install_item
    self.process_distribution(spec, dist, deps)
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\setuptools\command\easy_install.py", line 742, in process_distribution
    [requirement], self.local_index, self.easy_install
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\pkg_resources\__init__.py", line 850, in resolve
    dist = best[req.key] = env.best_match(req, ws, installer)
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\pkg_resources\__init__.py", line 1122, in best_match
    return self.obtain(req, installer)
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\pkg_resources\__init__.py", line 1134, in obtain
    return installer(requirement)
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\setuptools\command\easy_install.py", line 669, in easy_install
    rmtree(tmpdir)
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\setuptools\command\easy_install.py", line 2227, in rmtree
    return shutil.rmtree(path, ignore_errors, onerror)
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\shutil.py
", line 507, in rmtree
    return _rmtree_unsafe(path, onerror)
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\shutil.py
", line 386, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\shutil.py
", line 386, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\shutil.py
", line 386, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
  [Previous line repeated 3 more times]
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\shutil.py
", line 391, in _rmtree_unsafe
    onerror(os.unlink, fullname, sys.exc_info())
  File "C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32\lib\site-pack
ages\setuptools\command\easy_install.py", line 1677, in auto_chmod
    six.reraise(et, (ev[0], ev[1] + (" %s %s" % (func, arg))))
TypeError: 'PermissionError' object is not subscriptable

There seems to be a lot of errors scrolling to this text.

Then I try:

C:\Users\Etienne\AppData\Local\Programs\Python\Python37-32>python mavproxy\mavpr
oxy.py --master=udpin:0.0.0.0:14550 --out=udpout:0.0.0.0:14551

I get this:

File “mavproxy\mavproxy.py”, line 979
print “MAVProxy is a modular ground station using the mavlink protocol”
^
SyntaxError: Missing parentheses in call to ‘print’. Did you mean print(“MAVProx
y is a modular ground station using the mavlink protocol”)?


(Etienne Demers) #34

I’ve corrected the script but now I am getting:

C:\MP>python .\MAVProxy\mavproxy.py --master=udpin:0.0.0.0:14550 --out=udpout:0.
0.0.0:14551
Traceback (most recent call last):
File “.\MAVProxy\mavproxy.py”, line 12, in
import serial, Queue, select
ModuleNotFoundError: No module named ‘serial’

C:\MP>pause
Press any key to continue . . .


(Jacob) #35

You should not manually place files in the installation directory. You can put the MAVProxy source code in your documents folder, then run setup.py. The errors are because you installed python3, and mavproxy is only compatible with python2. The last error is because you do not have pyserial installed. Do sudo pip install pyserial.


(Patrick José Pereira) #36

To install all required libraries, you can run pip install -r requirements.txt in mavproxy root folder.


(Etienne Demers) #37

Hi guys,

Thanks, I’ll give it a go when I am back in the office.

Cheers,
e.


(Etienne Demers) #38

I now have got a bit farther where I load the module depthoutput but get the following error:

image


(Etienne Demers) #39

Hello Jacob,

How do I do that?

what I did so far is :

and I guess the rest is done because “For Getting Serial Data” is already configured in the Comm links section…

The


(Jacob) #40

How are you starting mavproxy? The errors look like you are trying to bind a port with an IP address that is not yours.

That check box configures a link on port 14550, the default telemetry port used by the ROV and other vehicles.

You can set up additional links in the Com Links tab.

and I guess the rest is done because “For Getting Serial Data” is already configured in the Comm links section…

I’m not sure what this means.