Open pietrodn opened 4 years ago
The problem is in pymavlink
. The latest passing tests use pymavlink 2.4.0, and with that version the test still passes.
I ran a bisect and pymavlink is OK until 2.4.8: the 2.4.9 release broke something.
Found the problematic commit: https://github.com/ArduPilot/pymavlink/commit/1fa59ff0bbc0999353b30feac3afe5cfd67c08a9
On Sat, 4 Jul 2020, Pietro De Nicolao wrote:
Found the problematic commit: ArduPilot/pymavlink@1fa59ff
Looks like my bad. What version of ardupilot's being run in SITL by default?!
I tend to run master ArduPilot when I'm using dronekit-python.
Fix here is probably to have dronekit-sitl pull a binary from ArduPilot's firmware.ardupilot.org; I have a branch here which does that.
Peter
By default dronekit-sitl runs ArduPilot Copter v3.3. Probably itβs better to test against an updated firmware version as you said π
On Sun, 5 Jul 2020, Pietro De Nicolao wrote:
By default dronekit-sitl runs ArduPilot Copter v3.3. Probably itβs better to test against an updated firmware version as you said π
https://github.com/dronekit/dronekit-sitl/pull/145
So that kinda-sorta works. At least far enough for the simple_goto.py dronekit-python example to work with no extra arguments.
Really not happy with the parameters stuff, obviously.
Hi, in the meantime should we revert to using 2.9.1? (I noticed there's a 2 year gap on pypi)
Nevermind. I was able to uninstall pymavlink with
pip3 uninstall pymavlink
and then reinstall the older version with
pip3 install pymavlink==2.4.8
Hi, in the meantime should we revert to using 2.9.1? (I noticed there's a 2 year gap on pypi)
Nevermind. I was able to uninstall pymavlink with
pip3 uninstall pymavlink
and then reinstall the older version with
pip3 install pymavlink==2.4.8
Did this work for you by just reinstalling an old version of pymavlink? It wasnβt working for me.
Hi, in the meantime should we revert to using 2.9.1? (I noticed there's a 2 year gap on pypi) Nevermind. I was able to uninstall pymavlink with
pip3 uninstall pymavlink
and then reinstall the older version with
pip3 install pymavlink==2.4.8
Did this work for you by just reinstalling an old version of pymavlink? It wasnβt working for me.
Yeah reverting pymavlink to 2.4.8 did the trick for me. If you are having trouble in general I would suggest running the dronekit-python/examples/vehicle_state/vehicle_state.py to check if there is a bug in your code.
Hi, in the meantime should we revert to using 2.9.1? (I noticed there's a 2 year gap on pypi) Nevermind. I was able to uninstall pymavlink with
pip3 uninstall pymavlink
and then reinstall the older version with
pip3 install pymavlink==2.4.8
Did this work for you by just reinstalling an old version of pymavlink? It wasnβt working for me.
Yeah reverting pymavlink to 2.4.8 did the trick for me. If you are having trouble in general I would suggest running the dronekit-python/examples/vehicle_state/vehicle_state.py to check if there is a bug in your code.
yes this reverting back to older version of pymavlink worked for me, i was having trouble in DO_SET_MODE change while executing the python script as it was stuck at stabalize, even now i can't change the mode in mavproxy but it works when i run the script
i was having pymavlink 2.4.12 and reverted back to pymavkink 2.4.8 for now at least im able to run the script and need to find the issue with mavproxy
pymavlink 2.4.14 is junk also ... reverting to 2.4.8 fixed it
the fix doesnt work at this point, just ends up spitting a bunch of horse crap on my screen.
'''
AttributeError: 'MAVLink_vibration_message' object has no attribute '_instance_field' ERROR:dronekit.mavlink:Exception in MAVLink input loop Traceback (most recent call last): File "C:\ProgramData\Anaconda3\lib\site-packages\dronekit\mavlink.py", line 211, in mavlink_thread_in fn(self) File "C:\ProgramData\Anaconda3\lib\site-packages\dronekit__init.py", line 1370, in listener raise APIException('No heartbeat in %s seconds, aborting.' % dronekit.APIException: No heartbeat in 30 seconds, aborting. ERROR:dronekit.mavlink:Exception while receiving message: Traceback (most recent call last): File "C:\ProgramData\Anaconda3\lib\site-packages\dronekit\mavlink.py", line 218, in mavlink_thread_in msg = self.master.recv_msg() File "C:\ProgramData\Anaconda3\lib\site-packages\pymavlink\mavutil.py", line 456, in recv_msg return None File "C:\ProgramData\Anaconda3\lib\site-packages\pymavlink\mavutil.py", line 372, in post_message File "C:\ProgramData\Anaconda3\lib\site-packages\pymavlink\mavutil.py", line 83, in add_message ''' AttributeError: 'MAVLink_heartbeat_message' object has no attribute '_instance_field' ERROR:dronekit.mavlink:Exception while receiving message: Traceback (most recent call last): File "C:\ProgramData\Anaconda3\lib\site-packages\dronekit\mavlink.py", line 218, in mavlink_thread_in msg = self.master.recv_msg() File "C:\ProgramData\Anaconda3\lib\site-packages\pymavlink\mavutil.py", line 456, in recv_msg return None File "C:\ProgramData\Anaconda3\lib\site-packages\pymavlink\mavutil.py", line 372, in post_message File "C:\ProgramData\Anaconda3\lib\site-packages\pymavlink\mavutil.py", line 83, in add_message ''' AttributeError: 'MAVLink_heartbeat_message' object has no attribute '_instance_field' ERROR:dronekit.mavlink:Exception in MAVLink input loop Traceback (most recent call last): File "C:\ProgramData\Anaconda3\lib\site-packages\dronekit\mavlink.py", line 211, in mavlink_thread_in fn(self) File "C:\ProgramData\Anaconda3\lib\site-packages\dronekit\init__.py", line 1370, in listener raise APIException('No heartbeat in %s seconds, aborting.' % dronekit.APIException: No heartbeat in 30 seconds, aborting.
By default dronekit-sitl runs ArduPilot Copter v3.3. Probably itβs better to test against an updated firmware version as you said π
how to run dronekit-sitl with updated firmware version? thanks
Downgrading pymavlink didn't work for me on windows 11 as per #1169. It gave me the following error message:
`AttributeError: 'array.array' object has no attribute 'fromstring'
`
One fix is utilizing Ubuntu on your windows system. After setting up Ubuntu i downgraded pymavlink to 2.4.8 and mav_proxy to 1.7.1
sudo pip uninstall mavproxy
sudo pip install pymavlink==2.4.8
sudo pip install mavproxy==1.7.1
I will continue my analysis on #1169 and see if i can find a solution for windows.
I've been experiencing the same issue of telling my SITL to enter GUIDED mode, but it gets stuck in the loop waiting for the mode to change. I tried to downgrade to pymavlink==2.4.8, but I'm getting a legacy-install-failure. Has anyone experienced this? I'm on a Mac with an M1 chip, if that helps. I've also noticed that downgrading about anything via pip usually ends in an error, but not necessarily the same error.
alexsharper@dhcp-10-105-11-95 ~ % sudo pip3 install pymavlink==2.4.8 WARNING: The directory '/Users/alexsharper/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag. DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621 Collecting pymavlink==2.4.8 Downloading pymavlink-2.4.8.tar.gz (3.6 MB) ββββββββββββββββββββββββββββββββββββββββ 3.6/3.6 MB 28.4 MB/s eta 0:00:00 Preparing metadata (setup.py) ... done Requirement already satisfied: future in /opt/homebrew/lib/python3.9/site-packages (from pymavlink==2.4.8) (0.18.3) Requirement already satisfied: lxml in /opt/homebrew/lib/python3.9/site-packages (from pymavlink==2.4.8) (4.9.2) Building wheels for collected packages: pymavlink Building wheel for pymavlink (setup.py) ... error error: subprocess-exited-with-error
Γ python setup.py bdist_wheel did not run successfully.
β exit code: 1
β°β> [54 lines of output]
running bdist_wheel
running build
running build_py
Using message definitions from /private/tmp/pip-install-qkyxr4il/pymavlink_7b139926334f4849b671942012c96389/message_definitions
Building /private/tmp/pip-install-qkyxr4il/pymavlink_7b139926334f4849b671942012c96389/message_definitions/v1.0/python_array_test.xml for protocol 1.0
WARNING: Unable to load XML validator libraries. XML validation will not be performed
Traceback (most recent call last):
File "
note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for pymavlink Running setup.py clean for pymavlink Failed to build pymavlink Installing collected packages: pymavlink DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621 Running setup.py install for pymavlink ... error error: subprocess-exited-with-error
Γ Running setup.py install for pymavlink did not run successfully.
β exit code: 1
β°β> [58 lines of output]
running install
/opt/homebrew/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
Using message definitions from /private/tmp/pip-install-qkyxr4il/pymavlink_7b139926334f4849b671942012c96389/message_definitions
Building /private/tmp/pip-install-qkyxr4il/pymavlink_7b139926334f4849b671942012c96389/message_definitions/v1.0/python_array_test.xml for protocol 1.0
WARNING: Unable to load XML validator libraries. XML validation will not be performed
Traceback (most recent call last):
File "
note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure
Γ Encountered error while trying to install package. β°β> pymavlink
note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure.
Have you been able to find a solution to this? thank you!
I am also getting the same as above legacy-install-failure as above with Python3. I am on Windows 10. The installation works fine for python2.
i am having trouble on multiple systems. cant seem to figure out how to get it to work on ubuntu or my local windows machine which had it working a year ago but now its caput and im tooo scared to test it on my drone because i need to demo it for my senior project. Adam Dabdoub Software Developer c: 513.886.0301
On Tue, Apr 4, 2023 at 6:55β―PM Mujtaba @.***> wrote:
I am also getting the same as above legacy-install-failure as above with Python3. I am on Windows 10. The installation works fine for python2.
β Reply to this email directly, view it on GitHub https://github.com/dronekit/dronekit-python/issues/1041#issuecomment-1496699633, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHJKTGIN2VUEMMXXCISAJGTW7SRHJANCNFSM4OQPXHGA . You are receiving this because you commented.Message ID: @.***>
i am having trouble on multiple systems. cant seem to figure out how to get it to work on ubuntu or my local windows machine which had it working a year ago but now its caput and im tooo scared to test it on my drone because i need to demo it for my senior project. Adam Dabdoub Software Developer c: 513.886.0301 β¦ On Tue, Apr 4, 2023 at 6:55β―PM Mujtaba @.> wrote: I am also getting the same as above legacy-install-failure as above with Python3. I am on Windows 10. The installation works fine for python2. β Reply to this email directly, view it on GitHub <#1041 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHJKTGIN2VUEMMXXCISAJGTW7SRHJANCNFSM4OQPXHGA . You are receiving this because you commented.Message ID: @.>
It works on Ubuntu for me, perhaps set up an associated Docker Image which uses Ubuntu and run your code on there?
Otherwise I can set up one and I'll link it in this chat.
I think it would be nice to have an official docker image that we can use as a base so there less hiccups in getting into development because as it stands, the tutorial is out of date if legacy users are having issues just getting back into the code base. Adam Dabdoub Software Developer c: 513.886.0301
On Wed, Apr 5, 2023 at 8:48β―AM Sarinle @.***> wrote:
i am having trouble on multiple systems. cant seem to figure out how to get it to work on ubuntu or my local windows machine which had it working a year ago but now its caput and im tooo scared to test it on my drone because i need to demo it for my senior project. Adam Dabdoub Software Developer c: 513.886.0301 β¦ <#m4898225133774497299> On Tue, Apr 4, 2023 at 6:55β―PM Mujtaba @.> wrote: I am also getting the same as above legacy-install-failure as above with Python3. I am on Windows 10. The installation works fine for python2. β Reply to this email directly, view it on GitHub <#1041 (comment) https://github.com/dronekit/dronekit-python/issues/1041#issuecomment-1496699633>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHJKTGIN2VUEMMXXCISAJGTW7SRHJANCNFSM4OQPXHGA https://github.com/notifications/unsubscribe-auth/AHJKTGIN2VUEMMXXCISAJGTW7SRHJANCNFSM4OQPXHGA . You are receiving this because you commented.Message ID: @.>
It works on Ubuntu for me, perhaps set up an associated Docker Image which uses Ubuntu and run your code on there?
Otherwise I can set up one and I'll link it in this chat.
β Reply to this email directly, view it on GitHub https://github.com/dronekit/dronekit-python/issues/1041#issuecomment-1497431706, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHJKTGLOW3ZTUZHVMR4NE5TW7VS3JANCNFSM4OQPXHGA . You are receiving this because you commented.Message ID: @.***>
The installation works fine for python2
Can you tell me how to install the desired version of pymavlink for python2, since pip is no longer supported for python2. Thank you !
After pymavlink version==2.4.8, the set_mode_apm function in pymavlik.mavutil.py changed, which cause failure on ardupilot MODE CHANGE. In order to use new version like pymavlink version==2.4.41, you just need to comment the code on "mav.command_long_send" and change it back to old "mav.set_mode_send". Reboot your IDE, Then the problem solved!
After pymavlink version==2.4.8, the set_mode_apm function in pymavlik.mavutil.py changed, which cause failure on ardupilot MODE CHANGE. In order to use new version like pymavlink version==2.4.41, you just need to comment the code on "mav.command_long_send" and change it back to old "mav.set_mode_send". Reboot your IDE, Then the problem solved!
Yeah, that works. I guess, this is a good way to make it run on latest python versions that do not support pymavlink version 2.4.8
Previously, I used to use either python 3.6 or python 2.7 which were compatible with pymavlink==2.4.8
The SITL tests are currently failing on the master branch, both for Python 2 and Python 3. The cause is a SITL test that's not passing: test_goto.py.
The apparent reason of the error is that the test times out when setting the mode to
GUIDED
. I managed to run the unit test locally, and I can't get the SITL to switch toGUIDED
: the vehicle remains stuck onSTABILIZE
. The GPS and the global location seem to be ok. The Vehicle is periodically receiving heartbeat updates containing the mode flag, so it's not a reception problem.My hypothesis is that some update on the ArduPilot side, or in some dependencies, made the tests fail. From the commit history it's easy to see that the previous commits (that worked) are identical to the latest ones, which were simple documentation changes.
Any hints?