Draft
Conversation
Reviewer's GuideIntroduces a new Zenoh-powered "odometer" microservice (with HTTP API, persistence, and FastAPI versioning) and wires it into BlueOS via nginx, frontend dev proxy, and helper port configuration. Sequence diagram for odometer HTTP state retrievalsequenceDiagram
actor User
participant Browser
participant Nginx
participant OdometerAPI as Odometer_FastAPI
participant OdometerService
User->>Browser: Request_/odometer/
Browser->>Nginx: HTTP_GET_/odometer/
Nginx->>OdometerAPI: Proxy_GET_/odometer/
OdometerAPI->>OdometerService: get_state()
OdometerService-->>OdometerAPI: OdometerState
OdometerAPI-->>Nginx: 200_OK_JSON_OdometerState
Nginx-->>Browser: 200_OK_JSON_OdometerState
Browser-->>User: Render_total_distance_and_metadata
Sequence diagram for odometer Zenoh sample processingsequenceDiagram
participant ArduPilot
participant ZenohRouter as Zenoh_router
participant OdometerSession as zenoh_Session
participant OdometerService
participant StateFile as odometer_json_state
ArduPilot->>ZenohRouter: Publish_GLOBAL_POSITION_INT
ZenohRouter->>OdometerSession: Forward_SAMPLE_for_key_expr
OdometerSession->>OdometerService: _on_sample(sample)
OdometerService->>OdometerService: Parse_payload_to_Position
OdometerService->>OdometerService: update_position(position)
Note over OdometerService: Update_total_distance_m_last_position_sample_count
loop Periodic_persistence
OdometerService->>StateFile: persist_state()
end
Class diagram for the new odometer service domain modelclassDiagram
class Position {
float lat_deg
float lon_deg
float alt_m
int time_boot_ms
}
class OdometerState {
float total_distance_m
Position last_position
int sample_count
datetime updated_at
}
class _RawState {
float total_distance_m
dict~string_Any~ last_position
int sample_count
string updated_at
}
class ResetResponse {
string status
OdometerState state
}
class OdometerService {
+Path state_path
+string key_expr
+Path zenoh_config_path
+float persist_interval_seconds
-OdometerState _state
-Lock _lock
-zenoh_Session _session
-zenoh_Subscriber _subscriber
-Task _persist_task
-AbstractEventLoop _loop
+OdometerService(state_path, key_expr, zenoh_config_path, persist_interval_seconds)
+start()
+stop()
-_open_session() zenoh_Session
-_load_state() OdometerState
-_on_sample(sample)
+update_position(position) OdometerState
+get_state() OdometerState
+reset() OdometerState
-_serialize_state() _RawState
+persist_state()
-_write_state(serialized)
-_persist_state_periodically()
}
Position <.. OdometerState : uses
Position <.. OdometerService : uses
OdometerState <.. OdometerService : manages
_RawState <.. OdometerService : serialization
OdometerState <.. ResetResponse : contains
OdometerService <.. get_odometer_service : provided_by
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Summary by Sourcery
Introduce a new Zenoh-powered odometer microservice and expose it through the HTTP/API gateway.
New Features:
Build: