1 2 Previous Next 23 Replies Latest reply on Aug 17, 2017 2:22 PM by Intel Corporation

    Issue during MAVLink installation

    rohanK23

      HI,

       

      I am trying to install MAVLink on my ubuntu machine following the instructions at

      Set Up a Simulation Environment with the Intel® Aero Compute Board Developer Guide | Intel® Software

      GitHub - mavlink/mavlink: Marshalling / communication library for drones.

       

      When I cd  to the mavlink directory and run cmake and then try a make or the python -m pymavlink.tools.mavgenerate command, I get the following error

      /usr/bin/python: No module named pymavlink.tools

       

      I have set my PYTHONPATH to /usr/bin/python.

       

      MartyG

      intel_corp

       

      Any idea what I am missing ?

       

      Thanks

      Rohan

        • 1. Re: Issue during MAVLink installation
          MartyG

          From the look of your instruction, it seems as though you are trying to use the command line installation for mavgenerate instead of the GUI installation approach.  The two have slightly different instructions, and it looks like you have mixed the two together into one.

           

          For GUI installation, you use:

           

          $ python -m mavgenerate

           

          For command line installation, you use:

           

          $ python -m pymavlink.tools.mavgen

           

          In the instruction you used, you have put mavgenerate instead of mavgen

          • 2. Re: Issue during MAVLink installation
            rohanK23

            I tried both. The git clone of GitHub - mavlink/mavlink: Marshalling / communication library for drones.  created a mavgenerate file. No mavgen

            • 3. Re: Issue during MAVLink installation
              Intel Corporation
              This message was posted on behalf of Intel Corporation

              Hello rohanK23,

              I was wondering if you have any updates regarding the MAVLink installation, or if you still require some sort of assistance.

              I’ll be waiting for your response

              Have a nice day.

              Regards,
              Andres V.

              • 4. Re: Issue during MAVLink installation
                rohanK23

                Hi Andres,

                 

                I have been stuck on that and havent had a chance to look further. Can you give me step by step instructions on how to install MAVLink and PX4 and make it work with the compute board ?

                 

                Thanks

                Rohan

                • 5. Re: Issue during MAVLink installation
                  Intel Corporation
                  This message was posted on behalf of Intel Corporation

                  Hello Rohan,

                  I’m trying to reproduce the issue you are experiencing, but I am not getting the /usr/bin/python: No module named pymavlink.tools error message.

                  By looking at the error message, the issue may not be related to the installation process, it seems to be related to setting the PYTHONPATH. You may want to check this couple of links just to make sure you are correctly setting the environmental variable:
                  https://stackoverflow.com/questions/18247333/python-pythonpath-in-linux 
                  https://stackoverflow.com/questions/16913086/ubuntu-add-directory-to-python-path 

                  As a side note, do you have Tkinter installed?

                  If you don’t, these are the commands that I ran on my Ubuntu 16.04 LTS system (that already had Python 2.7 installed):
                  sudo apt-get install python-tk
                  git clone –recursive https://github.com/mavlink/mavlink


                  If you have any update or question, don’t hesitate to contact us.

                  Have a nice day.

                  Regards,
                  Andres V.

                  • 6. Re: Issue during MAVLink installation
                    rohanK23

                    Hi Andres,

                     

                    I will try this soon.

                     

                    Couple questions -

                    1. How can I communicate between the compute board and a flight controller using MAVLink protocol ? Are there any code examples I can follow ?

                    2. Do I need any extra hardware for my compute board to connect the flight controller via UART ? I am planning to buy Pixhawk

                     

                    best

                    Rohan

                    • 7. Re: Issue during MAVLink installation
                      rohanK23

                      Hi Andres,

                       

                      Different error. I think I did not have --recursive the last time I did the clone.

                       

                      I ran out of my home directory /home/rohan-

                      sudo apt-get install python-tk     (Although I am not using GUI).
                      git clone –recursive https://github.com/mavlink/mavlink

                       

                      Then added /home/rohan/mavlink to the PYTHONPATH

                      export PYTHONPATH=/home/rohan/mavlink

                       

                      cd to mavlink

                      rohan@penguin:~/mavlink$ python -m pymavlink.tools.mavgen

                      Traceback (most recent call last):

                        File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main

                          "__main__", fname, loader, pkg_name)

                        File "/usr/lib/python2.7/runpy.py", line 72, in _run_code

                          exec code in run_globals

                        File "/home/rohan/mavlink/pymavlink/tools/mavgen.py", line 16, in <module>

                          from pymavlink.generator import mavgen

                        File "pymavlink/generator/mavgen.py", line 12, in <module>

                          from future import standard_library

                      ImportError: No module named future

                       

                      I did sudo pip install future and re-ran the command and still got the same error.

                       

                       

                      Let me know what I might be missing.

                       

                      best

                      Rohan

                      • 8. Re: Issue during MAVLink installation
                        Intel Corporation
                        This message was posted on behalf of Intel Corporation

                        Hello Rohan,
                         
                        Thank you for the updates.
                         
                        I fixed the “ImportError: No module named future” error message by running the following commands:
                         
                        sudo apt install python-pip
                        pip install future
                         
                        Are you sure you have pip installed?
                         
                        After that I ran the python –m mavgenerate command and the MAVLink generator window shows up.

                        Please let me know if this works for you.
                         
                        Have a nice day.
                         
                        Regards,
                        Andres V.
                         

                        • 9. Re: Issue during MAVLink installation
                          rohanK23

                          Hi Andres,

                           

                          rohan@penguin:~/mavlink$ sudo apt-get install python-pip

                          Reading package lists... Done

                          Building dependency tree      

                          Reading state information... Done

                          python-pip is already the newest version (8.1.1-2ubuntu0.4).

                          The following packages were automatically installed and are no longer required:

                            fonts-lato gir1.2-cryptui-0.0 libcryptui0a libepoxy-dev libruby2.3 libxtst-dev linux-headers-4.4.0-75 linux-headers-4.4.0-75-generic linux-image-4.4.0-75-generic linux-image-extra-4.4.0-75-generic rake ruby

                            ruby-did-you-mean ruby-minitest ruby-net-telnet ruby-power-assert ruby-test-unit ruby2.3 rubygems-integration seahorse-daemon ttf-liberation x11proto-record-dev

                          Use 'sudo apt autoremove' to remove them.

                          0 upgraded, 0 newly installed, 0 to remove and 21 not upgraded.

                           

                          rohan@penguin:~/mavlink$ pip install future

                          Requirement already satisfied: future in /usr/local/lib/python3.5/dist-packages

                           

                          rohan@penguin:~/mavlink$ python –m mavgenerate

                          python: can't open file '–m': [Errno 2] No such file or directory

                           

                          rohan@penguin:~/mavlink$ python -m pymavlink.tools.mavgen

                          Traceback (most recent call last):

                            File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main

                              "__main__", fname, loader, pkg_name)

                            File "/usr/lib/python2.7/runpy.py", line 72, in _run_code

                              exec code in run_globals

                            File "/home/rohan/mavlink/pymavlink/tools/mavgen.py", line 16, in <module>

                              from pymavlink.generator import mavgen

                            File "pymavlink/generator/mavgen.py", line 12, in <module>

                              from future import standard_library

                          ImportError: No module named future

                           

                          rohan@penguin:~/mavlink$ ls

                          cmake  CMakeLists.txt  config.h.in  COPYING  doc  examples  mavgenerate.py  message_definitions  missionlib  pc.in  pymavlink  README.md  scripts

                           

                          Please advise

                           

                          Thanks

                          Rohan

                          • 10. Re: Issue during MAVLink installation
                            rohanK23

                            Just a FYI..

                            rohan@penguin:~/mavlink$ ls /usr/lib/python*

                             

                            I see these 2

                            __future__.py

                            __future__.pyc

                             

                            My PYTHONPATH variable is set to the directory mavlink that got created after the clone of the mavlink.git. I assume thats what it should be , correct ?

                             

                            And also see

                            /usr/lib/python2.7/compiler/future.pyc

                            /usr/lib/python2.7/compiler/future.py

                            • 11. Re: Issue during MAVLink installation
                              Intel Corporation
                              This message was posted on behalf of Intel Corporation

                              Hello Rohan,
                               
                              Thank you for the information provided.
                               
                              Could you please try using the sudo apt install pythin-pip command instead of the sudo apt-get install python-pip command? Just to make sure you are following the same exact steps as I am.
                               
                              I’ll be waiting for your response.
                               
                              Have a nice day.
                               
                              Regards,
                              Andres V.

                              • 12. Re: Issue during MAVLink installation
                                rohanK23

                                Hi Andres,

                                 

                                rohan@penguin:~/mavlink$ sudo apt install python-pip

                                Reading package lists... Done

                                Building dependency tree     

                                Reading state information... Done

                                python-pip is already the newest version (8.1.1-2ubuntu0.4).

                                The following packages were automatically installed and are no longer required:

                                  fonts-lato gir1.2-cryptui-0.0 libcryptui0a libepoxy-dev libruby2.3

                                  libxtst-dev linux-headers-4.4.0-75 linux-headers-4.4.0-75-generic

                                  linux-image-4.4.0-75-generic linux-image-extra-4.4.0-75-generic rake ruby

                                  ruby-did-you-mean ruby-minitest ruby-net-telnet ruby-power-assert

                                  ruby-test-unit ruby2.3 rubygems-integration seahorse-daemon ttf-liberation

                                  x11proto-record-dev

                                Use 'sudo apt autoremove' to remove them.

                                0 upgraded, 0 newly installed, 0 to remove and 21 not upgraded.

                                 

                                rohan@penguin:~/mavlink$ pip install future

                                Requirement already satisfied: future in /usr/local/lib/python3.5/dist-packages

                                 

                                rohan@penguin:~/mavlink$ python -m pymavlink.tools.mavgen

                                Traceback (most recent call last):

                                  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main

                                    "__main__", fname, loader, pkg_name)

                                  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code

                                    exec code in run_globals

                                  File "/home/rohan/mavlink/pymavlink/tools/mavgen.py", line 16, in <module>

                                    from pymavlink.generator import mavgen

                                  File "pymavlink/generator/mavgen.py", line 12, in <module>

                                    from future import standard_library

                                ImportError: No module named future

                                 

                                 

                                 

                                What is your PYTHONPATH variable set to ?

                                Mine is

                                declare -x PYTHONPATH="/home/rohan/mavlink"

                                 

                                 

                                Rohan

                                • 13. Re: Issue during MAVLink installation
                                  rohanK23

                                  Hi Andres,

                                   

                                  Can you give me your step my step instructions you used to create mavlink.h ?  I am stuck

                                   

                                  here is what I did:

                                   

                                  1. From home dir:

                                  git clone --recursive https://github.com/mavlink/mavlink.git

                                   

                                  2. cd mavlink

                                   

                                  3. sudo apt install python-pip

                                  pip install future

                                   

                                  4. export PYTHONPATH=/usr/local/lib/python2.7/dist-packages:/home/rohan/mavlink

                                   

                                  5. Run command

                                   

                                  rohan@penguin:~/mavlink$ python -m pymavlink.tools.mavgen

                                  Traceback (most recent call last):

                                    File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main

                                      "__main__", fname, loader, pkg_name)

                                    File "/usr/lib/python2.7/runpy.py", line 72, in _run_code

                                      exec code in run_globals

                                    File "/home/rohan/mavlink/pymavlink/tools/mavgen.py", line 16, in <module>

                                      from pymavlink.generator import mavgen

                                    File "pymavlink/generator/mavgen.py", line 12, in <module>

                                      from future import standard_library

                                  ImportError: No module named future

                                   

                                   

                                  Also can you tell me where the header files are generated ?

                                   

                                  Its a bit confusing. I did a find . -name "*.h" from my mavlink directory and got this

                                  rohan@penguin:~/mavlink$ find /home/rohan/mavlink/ -name "*.h"

                                  /home/rohan/mavlink/missionlib/testing/mavlink_missionlib_data.h

                                  /home/rohan/mavlink/missionlib/mavlink_missionlib_data.h

                                  /home/rohan/mavlink/missionlib/mavlink_parameters.h

                                  /home/rohan/mavlink/missionlib/waypoints.h

                                  /home/rohan/mavlink/pymavlink/generator/C/include_v0.9/mavlink_types.h

                                  /home/rohan/mavlink/pymavlink/generator/C/include_v0.9/test/test.h

                                  /home/rohan/mavlink/pymavlink/generator/C/include_v0.9/test/version.h

                                  /home/rohan/mavlink/pymavlink/generator/C/include_v0.9/test/testsuite.h

                                  /home/rohan/mavlink/pymavlink/generator/C/include_v0.9/test/mavlink.h

                                  /home/rohan/mavlink/pymavlink/generator/C/include_v0.9/test/mavlink_msg_test_types.h

                                  /home/rohan/mavlink/pymavlink/generator/C/include_v0.9/checksum.h

                                  /home/rohan/mavlink/pymavlink/generator/C/include_v0.9/mavlink_helpers.h

                                  /home/rohan/mavlink/pymavlink/generator/C/include_v0.9/protocol.h

                                  /home/rohan/mavlink/pymavlink/generator/C/test/windows/targetver.h

                                  /home/rohan/mavlink/pymavlink/generator/C/test/windows/stdafx.h

                                  /home/rohan/mavlink/pymavlink/generator/C/include_v2.0/mavlink_types.h

                                  /home/rohan/mavlink/pymavlink/generator/C/include_v2.0/checksum.h

                                  /home/rohan/mavlink/pymavlink/generator/C/include_v2.0/mavlink_sha256.h

                                  /home/rohan/mavlink/pymavlink/generator/C/include_v2.0/mavlink_conversions.h

                                  /home/rohan/mavlink/pymavlink/generator/C/include_v2.0/mavlink_get_info.h

                                  /home/rohan/mavlink/pymavlink/generator/C/include_v2.0/mavlink_helpers.h

                                  /home/rohan/mavlink/pymavlink/generator/C/include_v2.0/protocol.h

                                  /home/rohan/mavlink/pymavlink/generator/C/include_v1.0/mavlink_types.h

                                  /home/rohan/mavlink/pymavlink/generator/C/include_v1.0/test/test.h

                                  /home/rohan/mavlink/pymavlink/generator/C/include_v1.0/test/version.h

                                  /home/rohan/mavlink/pymavlink/generator/C/include_v1.0/test/testsuite.h

                                  /home/rohan/mavlink/pymavlink/generator/C/include_v1.0/test/mavlink.h

                                  /home/rohan/mavlink/pymavlink/generator/C/include_v1.0/test/mavlink_msg_test_types.h

                                  /home/rohan/mavlink/pymavlink/generator/C/include_v1.0/checksum.h

                                  /home/rohan/mavlink/pymavlink/generator/C/include_v1.0/mavlink_conversions.h

                                  /home/rohan/mavlink/pymavlink/generator/C/include_v1.0/mavlink_helpers.h

                                  /home/rohan/mavlink/pymavlink/generator/C/include_v1.0/protocol.h

                                  /home/rohan/mavlink/pymavlink/mavnative/mavlink_defaults.h

                                   

                                  Are these the generated header files I am suppose to use in my application ?

                                   

                                   

                                  Thanks

                                  Rohan

                                  • 14. Re: Issue during MAVLink installation
                                    rohanK23

                                    I noticed that pip install future is referring to the 3.5 python version.

                                     

                                    So I did a sudo pip2 install future and it installed future

                                    rohan@penguin:~/mavlink$ sudo pip2 install future

                                    The directory '/home/rohan/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

                                    The directory '/home/rohan/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

                                    Collecting future

                                    Installing collected packages: future

                                    Successfully installed future-0.16.0

                                     

                                    But then I ran the command

                                    rohan@penguin:~/mavlink$ python -m pymavlink.tools.mavgen

                                    usage: mavgen.py [-h] [-o OUTPUT]

                                                     [--lang {C,CS,JavaScript,Python,WLua,ObjC,Swift,Java,C++11}]

                                                     [--wire-protocol {0.9,1.0,2.0}] [--no-validate]

                                                     [--error-limit ERROR_LIMIT]

                                                     XML [XML ...]

                                    mavgen.py: error: too few arguments

                                    1 2 Previous Next