dronekit-python: SITL test is failing: copter mode stuck on STABILIZE
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 to GUIDED: the vehicle remains stuck on STABILIZE. 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?
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 6
- Comments: 21 (5 by maintainers)
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
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
and then reinstall the older version with
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.
Found the problematic commit: https://github.com/ArduPilot/pymavlink/commit/1fa59ff0bbc0999353b30feac3afe5cfd67c08a9
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 “<string>”, line 2, in <module> File “<pip-setuptools-caller>”, line 34, in <module> File “/private/tmp/pip-install-qkyxr4il/pymavlink_7b139926334f4849b671942012c96389/setup.py”, line 109, in <module> setup (name = ‘pymavlink’, File “/opt/homebrew/lib/python3.9/site-packages/setuptools/init.py”, line 87, in setup return distutils.core.setup(**attrs) File “/opt/homebrew/lib/python3.9/site-packages/setuptools/_distutils/core.py”, line 148, in setup return run_commands(dist) File “/opt/homebrew/lib/python3.9/site-packages/setuptools/_distutils/core.py”, line 163, in run_commands dist.run_commands() File “/opt/homebrew/lib/python3.9/site-packages/setuptools/_distutils/dist.py”, line 967, in run_commands self.run_command(cmd) File “/opt/homebrew/lib/python3.9/site-packages/setuptools/dist.py”, line 1229, in run_command super().run_command(command) File “/opt/homebrew/lib/python3.9/site-packages/setuptools/_distutils/dist.py”, line 986, in run_command cmd_obj.run() File “/opt/homebrew/lib/python3.9/site-packages/wheel/bdist_wheel.py”, line 299, in run self.run_command(‘build’) File “/opt/homebrew/lib/python3.9/site-packages/setuptools/_distutils/cmd.py”, line 313, in run_command self.distribution.run_command(command) File “/opt/homebrew/lib/python3.9/site-packages/setuptools/dist.py”, line 1229, in run_command super().run_command(command) File “/opt/homebrew/lib/python3.9/site-packages/setuptools/_distutils/dist.py”, line 986, in run_command cmd_obj.run() File “/opt/homebrew/lib/python3.9/site-packages/setuptools/_distutils/command/build.py”, line 136, in run self.run_command(cmd_name) File “/opt/homebrew/lib/python3.9/site-packages/setuptools/_distutils/cmd.py”, line 313, in run_command self.distribution.run_command(command) File “/opt/homebrew/lib/python3.9/site-packages/setuptools/dist.py”, line 1229, in run_command super().run_command(command) File “/opt/homebrew/lib/python3.9/site-packages/setuptools/_distutils/dist.py”, line 986, in run_command cmd_obj.run() File “/private/tmp/pip-install-qkyxr4il/pymavlink_7b139926334f4849b671942012c96389/setup.py”, line 103, in run generate_content() File “/private/tmp/pip-install-qkyxr4il/pymavlink_7b139926334f4849b671942012c96389/setup.py”, line 64, in generate_content if not mavgen.mavgen_python_dialect(dialect, mavparse.PROTOCOL_1_0): File “/private/tmp/pip-install-qkyxr4il/pymavlink_7b139926334f4849b671942012c96389/generator/mavgen.py”, line 247, in mavgen_python_dialect if not mavgen(opts, [xml]): File “/private/tmp/pip-install-qkyxr4il/pymavlink_7b139926334f4849b671942012c96389/generator/mavgen.py”, line 142, in mavgen xml.append(mavparse.MAVXML(fname, opts.wire_protocol)) File “/private/tmp/pip-install-qkyxr4il/pymavlink_7b139926334f4849b671942012c96389/generator/mavparse.py”, line 420, in init m.crc_extra = message_checksum(m) File “/private/tmp/pip-install-qkyxr4il/pymavlink_7b139926334f4849b671942012c96389/generator/mavparse.py”, line 447, in message_checksum crc.accumulate_str(msg.name + ’ ') File “/private/tmp/pip-install-qkyxr4il/pymavlink_7b139926334f4849b671942012c96389/generator/mavcrc.py”, line 34, in accumulate_str bytes.fromstring(buf) AttributeError: ‘array.array’ object has no attribute ‘fromstring’ [end of output]
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 “<string>”, line 2, in <module> File “<pip-setuptools-caller>”, line 34, in <module> File “/private/tmp/pip-install-qkyxr4il/pymavlink_7b139926334f4849b671942012c96389/setup.py”, line 109, in <module> setup (name = ‘pymavlink’, File “/opt/homebrew/lib/python3.9/site-packages/setuptools/init.py”, line 87, in setup return distutils.core.setup(**attrs) File “/opt/homebrew/lib/python3.9/site-packages/setuptools/_distutils/core.py”, line 148, in setup return run_commands(dist) File “/opt/homebrew/lib/python3.9/site-packages/setuptools/_distutils/core.py”, line 163, in run_commands dist.run_commands() File “/opt/homebrew/lib/python3.9/site-packages/setuptools/_distutils/dist.py”, line 967, in run_commands self.run_command(cmd) File “/opt/homebrew/lib/python3.9/site-packages/setuptools/dist.py”, line 1229, in run_command super().run_command(command) File “/opt/homebrew/lib/python3.9/site-packages/setuptools/_distutils/dist.py”, line 986, in run_command cmd_obj.run() File “/opt/homebrew/lib/python3.9/site-packages/setuptools/command/install.py”, line 68, in run return orig.install.run(self) File “/opt/homebrew/lib/python3.9/site-packages/setuptools/_distutils/command/install.py”, line 670, in run self.run_command(‘build’) File “/opt/homebrew/lib/python3.9/site-packages/setuptools/_distutils/cmd.py”, line 313, in run_command self.distribution.run_command(command) File “/opt/homebrew/lib/python3.9/site-packages/setuptools/dist.py”, line 1229, in run_command super().run_command(command) File “/opt/homebrew/lib/python3.9/site-packages/setuptools/_distutils/dist.py”, line 986, in run_command cmd_obj.run() File “/opt/homebrew/lib/python3.9/site-packages/setuptools/_distutils/command/build.py”, line 136, in run self.run_command(cmd_name) File “/opt/homebrew/lib/python3.9/site-packages/setuptools/_distutils/cmd.py”, line 313, in run_command self.distribution.run_command(command) File “/opt/homebrew/lib/python3.9/site-packages/setuptools/dist.py”, line 1229, in run_command super().run_command(command) File “/opt/homebrew/lib/python3.9/site-packages/setuptools/_distutils/dist.py”, line 986, in run_command cmd_obj.run() File “/private/tmp/pip-install-qkyxr4il/pymavlink_7b139926334f4849b671942012c96389/setup.py”, line 103, in run generate_content() File “/private/tmp/pip-install-qkyxr4il/pymavlink_7b139926334f4849b671942012c96389/setup.py”, line 64, in generate_content if not mavgen.mavgen_python_dialect(dialect, mavparse.PROTOCOL_1_0): File “/private/tmp/pip-install-qkyxr4il/pymavlink_7b139926334f4849b671942012c96389/generator/mavgen.py”, line 247, in mavgen_python_dialect if not mavgen(opts, [xml]): File “/private/tmp/pip-install-qkyxr4il/pymavlink_7b139926334f4849b671942012c96389/generator/mavgen.py”, line 142, in mavgen xml.append(mavparse.MAVXML(fname, opts.wire_protocol)) File “/private/tmp/pip-install-qkyxr4il/pymavlink_7b139926334f4849b671942012c96389/generator/mavparse.py”, line 420, in init m.crc_extra = message_checksum(m) File “/private/tmp/pip-install-qkyxr4il/pymavlink_7b139926334f4849b671942012c96389/generator/mavparse.py”, line 447, in message_checksum crc.accumulate_str(msg.name + ’ ') File “/private/tmp/pip-install-qkyxr4il/pymavlink_7b139926334f4849b671942012c96389/generator/mavcrc.py”, line 34, in accumulate_str bytes.fromstring(buf) AttributeError: ‘array.array’ object has no attribute ‘fromstring’ [end of output]
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.