Repository navigation
Make windows-arm.cmd find the carrier or say why it cannot - #59
yassinsolim wants to merge 1 commit into
Conversation
The bridge only took an official Arduino and, when it found none, the launcher gave up after saying nothing, because the bridge's own window closes with it. A clone board has its own USB-serial chip, so the bridge now also takes the only USB serial port, and says so, and never guesses between several. It writes what it says to a log file, which the launcher prints when the bridge does not start, and the launcher takes an optional port: windows-arm.cmd COM5.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
There was a problem hiding this comment.
🟡 Changes recommended
The Windows launcher passes the log-file path without literal quotes, so spaces in %TEMP% split it into multiple Python arguments, preventing startup and leaving only an unhelpful “(nothing)” message.
1 open issue
What changed in this PR
Improves the Windows real-arm launcher introduced in #57 so it can detect clone carriers and show useful diagnostics when startup fails.
Changes:
- Adds a single-USB-serial-port fallback while refusing ambiguous selections.
- Supports an explicit COM port and displays relay logs on startup failure.
- Expands detection and logging tests and updates operator instructions.
| File | Description |
|---|---|
waybionic_teleop/waybionic_teleop/carrier_relay.py |
Adds clone detection, descriptive port messages, and file logging. |
waybionic_teleop/test/test_carrier_relay.py |
Covers detection and logging; handles partial socket reads. |
scripts/windows-arm.ps1 |
Accepts a carrier port and displays relay logs on failure. |
scripts/windows-arm.cmd |
Forwards arguments to the PowerShell launcher. |
docs/operator_guide.md |
Documents automatic detection, failure diagnostics, and explicit port selection. |
Review effort: Balanced
| # The bridge also writes what it says here, so that this script can show it if the bridge fails. | ||
| $bridgeLog = Join-Path $env:TEMP 'waybionic-carrier-bridge.log' | ||
| Remove-Item $bridgeLog -ErrorAction SilentlyContinue | ||
| $bridgeArguments = @('-m', 'waybionic_teleop.carrier_relay', '--log-file', $bridgeLog) |
dda292a to
f720fbc
Compare
224a119 to
899863b
Compare

Makes
scripts\windows-arm.cmdfind the carrier by itself, or say why it cannot. Stacked on #57, which introduces the Windows launcher, so the base is that branch; when #57 is merged with a merge commit and its branch deleted, GitHub retargets this PR tomain.The problem
On a Windows laptop the launcher gave up after saying almost nothing: the bridge runs in its own window, which closes with it, so the operator saw only "The carrier bridge is not ready. Plug in only the carrier, or run python -m ...". The bridge also took only an official Arduino (by USB vendor ID). A clone board has its own USB-serial chip, which does not carry Arduino's ID, so it was never found.
The change
%TEMP%\waybionic-carrier-bridge.log(--log-file), and when it does not start the launcher prints the last lines of it, for example which COM ports Windows lists, before the error.scripts\windows-arm.cmd COM5(orWAYBIONIC_CARRIER=COM5) skips the search, for a laptop with several serial devices. The.cmdnow passes its arguments on.docs/operator_guide.mddescribes the above and no longer says "Arduinos" where USB serial devices are meant.5 files, +154 / -39. Most of it is in
carrier_relay.pyand its tests.How it was tested
test_carrier_relay.pycovers the detection rules (official board first, the only serial port as a fallback, no guessing between several, the log file), and the teleop suite passed when this was written (989 tests).test_flake8.pyandtest_pep257.pypass.Not tested, please check on a Windows laptop with the carrier
CI does not cover the
.cmd/.ps1, and this commit has not been run on Windows with a real board. The launcher before this change (96e9d77, in #57) is what has been run on a Windows laptop. Please try, in this order:windows-arm.cmd COM5should then work.The script is run by Windows PowerShell 5.1 (
powershell.exein the.cmd), not PowerShell 7, so 1 to 4 also check that nothing in it needs the newer one.