Skip to content

Conversation

Yomihao
Copy link

@Yomihao Yomihao commented Sep 14, 2025

No description provided.

Yomihao and others added 30 commits September 14, 2025 20:37
normalise_servo_input() returns -1 to 1, the old code got -500 to 500
nice modem with good CAT-M support
Let's fix the GitHub Action workflow macos_build that is failing consistently.

* https://github.com/ArduPilot/ardupilot/actions/workflows/macos_build.yml

Upgrade pyenv and Python 3.10 in Tools/environment_install/install-prereqs-mac.sh

Questions:
* Why install and configure pyenv by hand instead of doing `brew install pyenv`?
* Why specify the micro version Python 3.10.4 instead of 3.10?
* Why not use `brew install uv && uv python install 3.10` instead of pyenv?
It is impossible to install due to the dependency on fastcrc, which
requires Rust, which cannot be built in Cygwin.

Fortunately, waf sets up its own local copy and a slower alternative is
used if fastcrc is not available, so we can simply avoid trying to
install it.

This setup script otherwise works and properly installs an environment
which can at least build and run SITL.
Some of these are macros on cygwin, so redefining them causes a warning.
Weak symbols have problems on cygwin. These are only defined and used in
SITL so no point having an empty definition here, which would cause a
redefinition error if not weak.

Keeping the declaration in AP_HAL itself is not the best, but it works
and avoids significant surgery to AP_HAL_SITL to move their declarations
and usages into a better place.
Cygwin cannot properly support weak symbols. If a weak symbol is weakly
referenced, the linker never patches up the call, leaving a garbage call
instruction that jumps into unmapped memory and immediately segfaults.

This apparently has never worked, as various weak symbols (including
`panic` and `millis16`) had hacks added to address this over the years.
The recent introduction of `mem_realloc` in PR ArduPilot#30572 completely broke
ArduPilot SITL builds for cygwin as this function is called during
arming through ExpandingString preparing information for logging.
Therefore, arming always crashed.

Fix this problem for good by never making a weak symbol on cygwin.
Fortunately this is rare in ArduPilot so no symbol conflicts are caused.
These symbols are now never weakened in the first place.
[`Tools/ros2/ardupilot_dds_tests/test/test_pep257.py`](https://github.com/ArduPilot/ardupilot/blob/master/Tools/ros2/ardupilot_dds_tests/test/test_pep257.py) ensures [PEP 257 – Docstring Conventions](https://peps.python.org/pep-0257) compliance for all Python files in Tools/ros2.

Partially addresses the concern at
* ArduPilot#30426 (comment)

Here are two solutions (we should pick just one) that replicate this functionality in pre-commit.
1. Use `flake8` plus `flake8-docstring` to run the 'ament-style` rules on Tools/ros2.
2. Run [`ament_pep257`](https://pypi.org/project/ament-lint-pep257) on Tools/ros2.

Quick equivalent commands:
```
uv tool run --with=flake8-docstrings flake8 --select=D \
    --ignore=D100,D101,D102,D103,D104,D105,D106,D107,D203,D212,D404 Tools/ros2

uv tool run --from=ament-lint-pep257 ament_pep257 Tools/ros2  > /dev/null
```
How was this tested?
1. Run both equivalent commands to ensure no errors.
2. `pre-commit run flake8 --all-files` to ensure no errors.
3. `pre-commit run ament-pep257 --all-files` to ensure no errors.

Edit `Tools/ros2/ardupilot_sitl/src/ardupilot_sitl/utilities.py` and add a leading or trailing space inside the docstring, and save the file.

Rerun the four commands to ensure that each raises a `D210: No whitespaces allowed surrounding docstring text` error.
peterbarker and others added 26 commits September 14, 2025 22:05
the device only actually has a single IMU.  Three was forced to ensure that the move to being entirely hwdef.dat-based was binary-output-identical
Ensure that ppp install succeeded and the binary executes directly after
install, instead of failing deep in the test suite.
AP_Periph has a lot of trouble sending various messages... so guard more of them.
Past this we don't get the "sending unknown message ID messages over MAVLink
@Ryanf55
Copy link
Contributor

Ryanf55 commented Sep 14, 2025

Hi, thanks for trying to contribute. Please give this page a re-read and rebase your branch.
https://ardupilot.org/dev/docs/git-rebase.html

@Yomihao Yomihao closed this Sep 14, 2025
@Yomihao Yomihao deleted the ardupilot_with_FAST-LIO branch September 14, 2025 15:17
@Yomihao
Copy link
Author

Yomihao commented Sep 14, 2025

Sorry to bother you. I key the wrong command on my machine. Please ignore any push request of mine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.