Skip to content

Create new "Unmanaged" board for allowing external (Ethernet at first) boards #3065

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Williangalvani
Copy link
Member

@Williangalvani Williangalvani commented Jan 16, 2025

This can be tested by switching to the Unmanaged board and launching sim_vehicle with an endpoint to blueos:

sim_vehicle.py -v ArduSub -L RATBeach --frame=vectored_6dof --out=udp:192.168.2.2:14550

Summary by Sourcery

Add support for an "Unmanaged" board type to allow external (Ethernet) boards to be connected and configured through the system

New Features:

  • Introduce a new 'Unmanaged' board platform that allows connecting external boards via configurable network endpoints
  • Add a Master Endpoint Manager UI component for configuring network connections for unmanaged boards

Enhancements:

  • Extend flight controller detection to include an Unmanaged board option
  • Modify autopilot manager to support starting and configuring unmanaged boards
  • Add conditional rendering for start/stop buttons based on board type

Chores:

  • Update type definitions to include Unmanaged platform
  • Add API endpoints for managing unmanaged board master endpoints

@Williangalvani Williangalvani force-pushed the unmananged branch 2 times, most recently from 5f52998 to c1c27b0 Compare January 16, 2025 00:55
@patrickelectric
Copy link
Member

Can we move this after 1.4 release ?

@Williangalvani
Copy link
Member Author

Can we move this after 1.4 release ?

sure, no rush on this one

@Williangalvani Williangalvani added the merge-after-stable Should be merged only after next stable release label Jan 16, 2025
@Williangalvani Williangalvani marked this pull request as ready for review April 17, 2025 19:35
Copy link

sourcery-ai bot commented Apr 17, 2025

Reviewer's Guide by Sourcery

This pull request introduces an 'Unmanaged' board option to the autopilot system, enabling the use of external boards, primarily connected via Ethernet. It includes changes to the frontend to allow configuration of the master endpoint for the unmanaged board, as well as backend changes to handle the new board type and manage its master endpoint.

Sequence diagram for starting an Unmanaged board

sequenceDiagram
    participant Frontend
    participant AutopilotManager
    participant BoardDetector
    participant MavlinkManager

    Frontend->>AutopilotManager: start_ardupilot()
    AutopilotManager->>AutopilotManager: start_unmanaged_board(flight_controller)
    AutopilotManager->>AutopilotManager: get_unmanaged_board_master_endpoint()
    AutopilotManager->>MavlinkManager: start_mavlink_manager(master_endpoint)
    MavlinkManager-->>AutopilotManager: 
    AutopilotManager-->>Frontend:
Loading

Updated class diagram for Platform and PlatformType

classDiagram
    class Platform {
        +Unmanaged
    }
    class PlatformType {
        +Unmanaged
    }
    Platform -- PlatformType : has a
Loading

File-Level Changes

Change Details Files
Introduces an 'Unmanaged' board option, primarily for external boards connected via Ethernet.
  • Adds 'Unmanaged' to the list of detectable flight controllers.
  • Adds 'Unmanaged' to the platform enum.
  • Modifies the autopilot startup logic to handle the 'Unmanaged' board type.
  • Adds API endpoints for managing the master endpoint of the 'Unmanaged' board.
  • Adds a new frontend component for configuring the master endpoint.
  • Conditionally renders the master endpoint configuration panel based on the selected board.
core/frontend/src/views/Autopilot.vue
core/services/ardupilot_manager/autopilot_manager.py
core/services/ardupilot_manager/api/v1/routers/endpoints.py
core/services/ardupilot_manager/flight_controller_detector/Detector.py
core/services/ardupilot_manager/typedefs.py
core/frontend/src/components/autopilot/MasterEndpointManager.vue
Modifies the visibility of the 'Start autopilot' and 'Stop autopilot' buttons based on the selected board.
  • Hides the 'Start autopilot' and 'Stop autopilot' buttons when the 'Unmanaged' board is selected.
core/frontend/src/views/Autopilot.vue

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Williangalvani - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider adding a Platform.Unmanaged case to the Platform.type property to avoid the need for a dictionary lookup.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@mirkix
Copy link

mirkix commented Apr 25, 2025

@Williangalvani Can connect my IP based autopilot now, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-after-stable Should be merged only after next stable release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants