mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-10-18 02:53:52 +08:00
colcon build/test / build-test (push) Waiting to run
Cygwin Build / build (push) Waiting to run
ESP32 Build / build (esp32buzz, 10) (push) Waiting to run
ESP32 Build / build (esp32s3empty, 10) (push) Waiting to run
Macos Build / build (CubeOrange) (push) Waiting to run
Macos Build / build (sitl) (push) Waiting to run
QURT Build / build (push) Waiting to run
test ccache / build (10, chibios) (push) Waiting to run
test chibios / build (CubeOrange-ODID, 10, chibios) (push) Waiting to run
test chibios / build (CubeOrange-PPP, 10, chibios) (push) Waiting to run
test chibios / build (CubeOrange-bootloader, 10, chibios) (push) Waiting to run
test chibios / build (CubeRed-EKF2, 10, chibios) (push) Waiting to run
test chibios / build (CubeRedPrimary-bootloader, 10, chibios) (push) Waiting to run
test chibios / build (MatekF405-Wing, 10, chibios) (push) Waiting to run
test chibios / build (Pixhawk6X-PPPGW, 10, chibios) (push) Waiting to run
test chibios / build (SOHW, 10, chibios) (push) Waiting to run
test chibios / build (build-options-defaults-test, 10, chibios) (push) Waiting to run
test chibios / build (configure-all, 10, chibios) (push) Waiting to run
test chibios / build (fmuv2-plane, 10, chibios) (push) Waiting to run
test chibios / build (fmuv3, 10, chibios) (push) Waiting to run
test chibios / build (fmuv3-bootloader, 10, chibios) (push) Waiting to run
test chibios / build (iofirmware, 10, chibios) (push) Waiting to run
test chibios / build (new-check, 10, chibios) (push) Waiting to run
test chibios / build (periph-build, 10, chibios) (push) Waiting to run
test chibios / build (revo-bootloader, 10, chibios) (push) Waiting to run
test chibios / build (revo-mini, 10, chibios) (push) Waiting to run
test chibios / build (signing, 10, chibios) (push) Waiting to run
test chibios / build (stm32f7, 10, chibios) (push) Waiting to run
test chibios / build (stm32h7, 10, chibios) (push) Waiting to run
test chibios / build (stm32h7-debug, 10, chibios) (push) Waiting to run
test dds / build (sitl) (push) Waiting to run
test dds / build (stm32h7) (push) Waiting to run
test Linux SBC / build (bbbmini, armhf) (push) Waiting to run
test Linux SBC / build (bebop, armhf) (push) Waiting to run
test Linux SBC / build (bhat, armhf) (push) Waiting to run
test Linux SBC / build (canzero, armhf) (push) Waiting to run
test Linux SBC / build (erlebrain2, armhf) (push) Waiting to run
test Linux SBC / build (linux, base) (push) Waiting to run
test Linux SBC / build (navigator, armhf-musl) (push) Waiting to run
test Linux SBC / build (navigator64, aarch64) (push) Waiting to run
test Linux SBC / build (navio, armhf) (push) Waiting to run
test Linux SBC / build (navio2, armhf) (push) Waiting to run
test Linux SBC / build (pxf, armhf) (push) Waiting to run
test Linux SBC / build (pxfmini, armhf) (push) Waiting to run
test replay / build (replay, base) (push) Waiting to run
test replay / build (replay, clang) (push) Waiting to run
test scripts / build (astyle-cleanliness) (push) Waiting to run
test scripts / build (check_autotest_options) (push) Waiting to run
test scripts / build (logger_metadata) (push) Waiting to run
test scripts / build (param_parse) (push) Waiting to run
test scripts / build (python-cleanliness) (push) Waiting to run
test scripts / build (validate_board_list) (push) Waiting to run
test blimp / build (base) (push) Waiting to run
test blimp / build (clang) (push) Waiting to run
test blimp / autotest (sitltest-blimp) (push) Blocked by required conditions
test copter / build (base) (push) Waiting to run
test copter / build (clang) (push) Waiting to run
test copter / autotest (sitltest-copter-tests1a) (push) Blocked by required conditions
test copter / autotest (sitltest-copter-tests1b) (push) Blocked by required conditions
test copter / autotest (sitltest-copter-tests1c) (push) Blocked by required conditions
test copter / autotest (sitltest-copter-tests1d) (push) Blocked by required conditions
test copter / autotest (sitltest-copter-tests1e) (push) Blocked by required conditions
test copter / autotest (sitltest-copter-tests2a) (push) Blocked by required conditions
test copter / autotest (sitltest-copter-tests2b) (push) Blocked by required conditions
test copter / build-gcc-heli (push) Waiting to run
test copter / autotest-heli (sitltest-heli) (push) Blocked by required conditions
test ap_periph / build-gcc-ap_periph (push) Waiting to run
test ap_periph / autotest-can (sitltest-can) (push) Blocked by required conditions
test plane / build (base) (push) Waiting to run
test plane / build (clang) (push) Waiting to run
test plane / autotest (sitltest-plane-tests1a) (push) Blocked by required conditions
test plane / autotest (sitltest-plane-tests1b) (push) Blocked by required conditions
test plane / autotest (sitltest-quadplane) (push) Blocked by required conditions
test rover / build (base) (push) Waiting to run
test rover / build (clang) (push) Waiting to run
test rover / autotest (sitltest-balancebot) (push) Blocked by required conditions
test rover / autotest (sitltest-rover) (push) Blocked by required conditions
test rover / autotest (sitltest-sailboat) (push) Blocked by required conditions
test sub / build (base) (push) Waiting to run
test sub / build (clang) (push) Waiting to run
test sub / autotest (sitltest-sub) (push) Blocked by required conditions
test tracker / build (base) (push) Waiting to run
test tracker / build (clang) (push) Waiting to run
test tracker / autotest (sitltest-tracker) (push) Blocked by required conditions
test unit tests and sitl building / build (sitl, base) (push) Waiting to run
test unit tests and sitl building / build (sitl, clang) (push) Waiting to run
test unit tests and sitl building / build (unit-tests, base) (push) Waiting to run
test unit tests and sitl building / build (unit-tests, clang) (push) Waiting to run
test scripting / test-scripting (push) Has been cancelled
also fix use of global variables from within the class scope
75 lines
2.6 KiB
Python
Executable File
75 lines
2.6 KiB
Python
Executable File
#!/usr/bin/env python
|
|
|
|
"""
|
|
script to automatically create a copy of a board for an OEM setup
|
|
usage example : ./Tools/scripts/create_OEM_board.py mRoPixracerPro mRoPixracerPro-MyCompany
|
|
|
|
AP_FLAKE8_CLEAN
|
|
"""
|
|
|
|
import sys
|
|
import os
|
|
import subprocess
|
|
|
|
import pathlib
|
|
|
|
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../libraries/AP_HAL_ChibiOS/hwdef/scripts'))
|
|
import chibios_hwdef # noqa
|
|
|
|
|
|
class OEMCreate:
|
|
def __init__(self, oem_board_name, board_name):
|
|
self.oem_board_name = oem_board_name
|
|
self.board_name = board_name
|
|
|
|
def run(self):
|
|
hwdef_dir = "libraries/AP_HAL_ChibiOS/hwdef"
|
|
oem_board_dirpath = f"{hwdef_dir}/{self.oem_board_name}"
|
|
|
|
if os.path.exists(oem_board_dirpath):
|
|
raise ValueError(f"{self.oem_board_dirpath} already exists") # FIXME exception type
|
|
|
|
hwdef_include_relpath = None
|
|
for extension in "dat", "inc":
|
|
tmp = f"../{self.board_name}/hwdef.{extension}"
|
|
tmp_norm = os.path.normpath(f"{oem_board_dirpath}/{tmp}")
|
|
if os.path.exists(tmp_norm):
|
|
hwdef_include_relpath = tmp
|
|
hwdef_include_normpath = tmp_norm
|
|
break
|
|
|
|
hwdef_content = f"include {hwdef_include_relpath}\n"
|
|
|
|
ch = chibios_hwdef.ChibiOSHWDef(hwdef_include_normpath)
|
|
use_bootloader_from_board = ch.get_config('USE_BOOTLOADER_FROM_BOARD', default=None, required=False)
|
|
if use_bootloader_from_board is None:
|
|
hwdef_content += "\n"
|
|
hwdef_content += f"USE_BOOTLOADER_FROM_BOARD {self.board_name}\n"
|
|
|
|
subprocess.run(["mkdir", oem_board_dirpath])
|
|
|
|
# create files and add reference to originals
|
|
new_hwdef = pathlib.Path(oem_board_dirpath, "hwdef.dat")
|
|
|
|
if hwdef_include_relpath is None:
|
|
raise ValueError(f"Could not find .inc or .dat for {self.board_name}")
|
|
|
|
new_hwdef.write_text(hwdef_content)
|
|
|
|
if os.path.exists(f"{hwdef_dir}/{self.board_name}/defaults.parm"):
|
|
path = pathlib.Path(f"{hwdef_dir}/{self.oem_board_name}/defaults.parm")
|
|
path.write_text(f"@include ../{self.board_name}/defaults.parm\n") # noqa
|
|
|
|
|
|
if __name__ == '__main__':
|
|
import argparse
|
|
|
|
parser = argparse.ArgumentParser(description='ArduPilot IMU Filter Tester Tool. Input one log file from ')
|
|
parser.add_argument('board_name', default=None, help='board to inherit from')
|
|
parser.add_argument('oem_board_name', default=None, help='new board name')
|
|
|
|
args = parser.parse_args()
|
|
|
|
oemcreate = OEMCreate(args.oem_board_name, args.board_name)
|
|
oemcreate.run()
|