Repository navigation
Journal Bluetooth bench motor state changes - #59
Merged
Merged
Conversation
The motor controller now journals connect, commanded speed/direction changes, stop requests (with reason: request, command_expired, disconnect), completed stops, disconnects and Bluetooth errors as linkhub.motor diagnostics, so they share the MAVLink timeline and land in experiment mavlog.json files. Lease renewals that keep the same target are not journaled.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Bluetooth bench motor bypassed the journal, so motor activity was missing from experiment
mavlog.jsonfiles and fromlinkhub query. The motor controller now journals its own state changes as diagnostics (sourcelinkhub.motor, categorymotor) on the same timeline as MAVLink traffic.Events:
motor.connected:device,device_idmotor.command:device_id,speed_percent,direction,timeout_ms. Only when a command starts the motor or changes its target or direction; lease renewals that keep the same target are not journaled, to avoid flooding the journal every 500 ms.motor.stop_requested:reason=request|command_expired|disconnectmotor.stopped: the ramp reached zero and the safe-stop command was writtenmotor.disconnected:device,error(warning level if the disconnect failed)motor.error: Bluetooth failure leaving motor state unconfirmed (error level)Journaling happens inside the controller rather than the HTTP routes, so it also captures stops triggered by an expired command lease (the watchdog), by a disconnect or shutdown, and by Bluetooth write failures.
This is independent of #58.
Testing: new test
journals_state_changes_but_not_lease_renewals;cargo test --workspaceandcargo fmt --checkpass. Not exercised against a physical motor.