Skip to content

Commit

Permalink
ArdupilotManager: add navigator64 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Williangalvani committed Sep 30, 2024
1 parent 08f7e38 commit 1e5062d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
6 changes: 6 additions & 0 deletions core/services/ardupilot_manager/ArduPilotManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,12 @@ async def start_linux_board(self, board: LinuxFlightController) -> None:
pathlib.Path("/root/blueos-files/ardupilot-manager/default/ardupilot_navigator"),
board,
)
# TODO: enable once available at ardupilot manifest
# elif board.platform == Platform.Navigator64:
# self.firmware_manager.install_firmware_from_file(
# pathlib.Path("/root/blueos-files/ardupilot-manager/default/ardupilot_navigator64"),
# board,
# )
else:
raise NoDefaultFirmwareAvailable(
f"No firmware installed for '{board.platform}' and no default firmware available. Please install the firmware manually."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import platform
from typing import List

from commonwealth.utils.commands import load_file
Expand All @@ -7,9 +8,15 @@


class Navigator(LinuxFlightController):
name = "Navigator"
manufacturer = "Blue Robotics"
platform = Platform.Navigator

def __init__(self) -> None:
super().__init__()
if platform.machine() == "aarch64":
self.name = "Navigator64"
self.platform = Platform.Navigator64
self.name = "Navigator"
self.platform = Platform.Navigator

def is_pi5(self) -> bool:
with open("/proc/cpuinfo", "r", encoding="utf-8") as f:
Expand Down
5 changes: 5 additions & 0 deletions core/services/ardupilot_manager/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
"ardupilot_navigator",
"https://firmware.ardupilot.org/Sub/stable-4.1.2/navigator/ardusub",
),
# StaticFile(
# defaults_folder,
# "ardupilot_navigator",
# "https://firmware.ardupilot.org/Sub/stable-4.1.2/navigator64/ardusub",
# ),
StaticFile(defaults_folder, "ardupilot_pixhawk1", "https://firmware.ardupilot.org/Sub/latest/Pixhawk1/ardusub.apj"),
StaticFile(defaults_folder, "ardupilot_pixhawk4", "https://firmware.ardupilot.org/Sub/latest/Pixhawk4/ardusub.apj"),
]
Expand Down
2 changes: 2 additions & 0 deletions core/services/ardupilot_manager/typedefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ class Platform(str, Enum):
CubeOrange = "CubeOrange"
GenericSerial = "GenericSerial"
Navigator = "navigator"
Navigator64 = "navigator64"
Argonot = "argonot"
SITL = get_sitl_platform_name(machine())

Expand All @@ -123,6 +124,7 @@ def type(self) -> PlatformType:
Platform.CubeOrange: PlatformType.Serial,
Platform.GenericSerial: PlatformType.Serial,
Platform.Navigator: PlatformType.Linux,
Platform.Navigator64: PlatformType.Linux,
Platform.Argonot: PlatformType.Linux,
Platform.SITL: PlatformType.SITL,
}
Expand Down

0 comments on commit 1e5062d

Please sign in to comment.