193 Add multi-waypoint path API via shared memory#194
Open
gdoffe wants to merge 10 commits into
Open
Conversation
c199ca9 to
389e334
Compare
7136002 to
9d5cdb3
Compare
2447b7b to
31c97d5
Compare
The ControllerEnum was outdated with old values (ANGULAR_SPEED_TEST, LINEAR_SPEED_TEST, LINEAR_POSE_DISABLED) that no longer match the firmware's PB_Controller.proto. Update to match the current protobuf definition: QUADPID_TRACKER, TRACKER_SPEED_TUNING, ADAPTIVE_PURE_PURSUIT. Signed-off-by: Gilles DOFFE <g.doffe@gmail.com>
The firmware merged the two separate speed test chains (ANGULAR_SPEED_TEST, LINEAR_SPEED_TEST) into a single unified TRACKER_SPEED_TUNING chain that handles both axes. Update the default_controller property to use the new enum value for both PID speed test strategies.
Replace single-pose sending with a path API that sends all waypoints to the firmware at once (reset, add points, start). The copilot's new_path_event_loop() reads the path from shared memory (written by the planner) and sends CAN messages to the firmware. Add CAN UUIDs for the path protocol (path_reset, path_add_point, path_start, path_complete). Signed-off-by: Gilles DOFFE <g.doffe@gmail.com>
31c97d5 to
8f53ff8
Compare
Add path_reset(), path_add_point() and path_start() methods to build a multi-waypoint path. The path is written to shared memory and post_update() signals the copilot to read it and send CAN messages to the firmware. A _sending_path flag prevents spurious pose_reached signals while the path is being configured.
The set_controller command was sent via SIO (planner → server → copilot) while path data was sent via shared memory (planner → copilot). Since these are two independent async channels, the firmware could receive path_start before set_controller, causing the first waypoint to be skipped: the old controller chain would set pose_reached=reached on the first engine cycle before the new controller was installed. Move set_controller to shared memory, using the same AvoidancePath lock as path data. Both commands are processed by a single sequential event loop in the copilot, which guarantees that set_controller CAN messages are always sent before path_start. Using separate locks would create two independent event loops with no ordering guarantee between them. The SIO emit is kept for server/dashboard state tracking but CAN ordering now relies solely on shared memory. Signed-off-by: Gilles DOFFE <g.doffe@gmail.com>
Complete the migration of planner-to-copilot communication from SIO to shared memory. The previous commit moved set_controller; this one adds pose_start using the same AvoidancePath lock, guaranteeing CAN message ordering (set_controller → pose_start → path_start) on the firmware. The SIO handlers for pose_start and set_controller no longer send CAN messages and only serve as info relays for the server/dashboard. Signed-off-by: Gilles DOFFE <g.doffe@gmail.com>
The copilot event loop could wake up multiple times for a single path sequence because set_controller, set_pose_start and path_start each called post_update independently. This caused the path to be sent multiple times or with partial data (1 waypoint instead of 4). Consume shared memory data after reading (reset controller_id to -1, clear path after sending) so stale values are not re-sent on subsequent wake-ups. Add a notify parameter to set_controller and set_pose_start so they can suppress post_update when called as part of a path sequence, letting only path_start trigger the single notification. Signed-off-by: Gilles DOFFE <g.doffe@gmail.com>
Replace deprecated pattern of inheriting from both str and Enum with the modern StrEnum class available in Python 3.11+. Fixes ruff UP042 lint error.
eaabaa5 to
dea6710
Compare
Update mcu-firmware submodule to include the lift emergency stop fixes, anti-blocking detection, and path multi-waypoint CAN support.
12c7ec3 to
8b85b7a
Compare
qmllint could not resolve custom QML components like DoubleSpinBox because they were only found implicitly by the QML engine at runtime. Add a qmldir file declaring all custom components in the monitor module, and add explicit import "." in ConfigWindow.qml, Wizard.qml and main.qml so qmllint resolves types from the same directory. Also pin PySide6 to 6.10.0 in CI to match the project dependency and avoid qmlformat differences between versions.
8b85b7a to
8fb9f16
Compare
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
Add a multi-waypoint path API that sends all waypoints to the firmware at once via shared memory (planner -> copilot -> CAN).
Changes
Design
The existing set_target_pose flow (SIO -> avoidance -> firmware) is unchanged. The new path API is an alternative for actions that need to send multiple waypoints at once.
The shared memory migration for set_controller and pose_start improves reliability by guaranteeing CAN message ordering through a single sequential event loop in the copilot.