Not able to load Vicon module in mavproxy

Hi,

I’m trying to use Vicon to provide location information for my quadrotor. I followed the instructions here Using a Vicon indoor positioning system — Copter documentation

I followed all the steps all the way until “Starting Vicon”. In mavproxy, I entered “module load vicon” and then I got an error message:

Failed to load module: No module named ‘vicon’. Use ‘set moddebug 3’ in the MAVProxy console to enable traceback.

I then enable the traceback via “set moddebug 3”, and below is the detailed error I got

libViconDataStreamSDK_CPP.so: cannot open shared object file: No such file or directory
Traceback (most recent call last):
File “/home/sheng/.local/bin/mavproxy.py”, line 649, in import_package
mod = import(name)
File “/home/sheng/.local/lib/python3.6/site-packages/MAVProxy/modules/mavproxy_vicon.py”, line 17, in
from pyvicon import pyvicon
File “/home/sheng/.local/lib/python3.6/site-packages/pyvicon/pyvicon.py”, line 1, in
import pyvicon_module
ImportError: libViconDataStreamSDK_CPP.so: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/home/sheng/.local/bin/mavproxy.py”, line 496, in load_module
m = import_package(modpath)
File “/home/sheng/.local/bin/mavproxy.py”, line 652, in import_package
mod = import(name)
File “/home/sheng/.local/lib/python3.6/site-packages/MAVProxy/modules/mavproxy_vicon.py”, line 17, in
from pyvicon import pyvicon
File “/home/sheng/.local/lib/python3.6/site-packages/pyvicon/pyvicon.py”, line 1, in
import pyvicon_module
ImportError: libViconDataStreamSDK_CPP.so: cannot open shared object file: No such file or directory

No module named ‘vicon’
Traceback (most recent call last):
File “/home/sheng/.local/bin/mavproxy.py”, line 649, in import_package
mod = import(name)
ModuleNotFoundError: No module named ‘vicon’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/home/sheng/.local/bin/mavproxy.py”, line 496, in load_module
m = import_package(modpath)
File “/home/sheng/.local/bin/mavproxy.py”, line 652, in import_package
mod = import(name)
ModuleNotFoundError: No module named ‘vicon’

Failed to load module: No module named ‘vicon’.

I did have the file “libViconDataStreamSDK_CPP.so” from the Vicon SDK and it is located at /usr/local/lib per the instructions by pyvicon. I searched the Internet and didn’t find useful information. It seems other people can do vicon with ardupilot smoothly while I’m just stuck. Any suggestions would be appreciated!

Another issue is that “module load map” was also failed. Not sure if it is related to recent updates to mavproxy…

well, the issues were resolved after removing the python2 on my computer and installing mavproxy using the github repo (do not use the pip3 installation).

I was able to solve the issue by adding /usr/local/lib/ (where I added the vicon SDK .so files) to the LD_LIBRARY_PATH variable. You can use the following command:

export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH