Home        Store        Docs        Blog

Help adding new modules


(Seth) #1

I used the custom image from Ardusub to setup my raspberry pi (which connects to a PixHawk to control the motors). I am able to use mavproxy modules that currently exist to control the motors but I am unable to use new modules. I add them to /MAVProxy/modules and then run setup.py build etc but when I try to load the modules with module load newMod, it doesn’t work. Please help


(Jacob) #2

Can you share your code?


(Seth) #3

I would love to but I am not sure what I am sharing. I tested adding new modules by duplicating the mavproxy_example.py module and changing everywhere where it said example to example2, thus creating the mavproxy_example2.py module.
This is stored in /usr/local/lib/python2.7/dist-packages/MAVProxy/modules

In a prior robot, I was able to then go to /usr/local/lib/python2.7/dist-packages and run the setup.py script:

sudo python setup.py build install --user

to make mavproxy_example2.py usable by mavproxy. However, mavproxy tells me no module: mavproxy_example2.py found which is odd because the statements from setup.py tell me that a byte compiled version of example was created and stored in

copying build/lib.linux-armv7l-2.7/MAVProxy/modules/mavproxy_example2.py -> build/bdist.linux-armv7l/egg/MAVProxy/modules

However after running mavproxy, I used the command module load example2 and received the aforementioned error message.


(Jacob) #4

Please provide the file example2.py and screenshots, or paste of the terminal commands for build install and running mavproxy to show what it looks like to you (directory and everything).


(Seth) #5

Thanks anyways. Solved the issue. called mavproxy.py in a different directory and it solved my issues