Skip to content
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

HAL_QURT: revived QURT HAL #27091

Merged
merged 9 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
163 changes: 163 additions & 0 deletions .github/workflows/qurt_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
name: QURT Build

on:
push:
paths-ignore:
# remove other vehicles
- 'AntennaTracker/**'
- 'Blimp/**'
# remove non SITL HAL
- 'libraries/AP_HAL_ChibiOS/**'
- 'libraries/AP_HAL_ESP32/**'
# remove non SITL directories
- 'Tools/AP_Bootloader/**'
- 'Tools/AP_Periph/**'
- 'Tools/CHDK-Script/**'
- 'Tools/CPUInfo/**'
- 'Tools/CodeStyle/**'
- 'Tools/FilterTestTool/**'
- 'Tools/Frame_params/**'
- 'Tools/GIT_Test/**'
- 'Tools/Hello/**'
- 'Tools/IO_Firmware/**'
- 'Tools/Linux_HAL_Essentials/**'
- 'Tools/LogAnalyzer/**'
- 'Tools/Pozyx/**'
- 'Tools/PrintVersion.py'
- 'Tools/Replay/**'
- 'Tools/UDP_Proxy/**'
- 'Tools/Vicon/**'
- 'Tools/bootloaders/**'
- 'Tools/completion/**'
- 'Tools/debug/**'
- 'Tools/environment_install/**'
- 'Tools/geotag/**'
- 'Tools/gittools/**'
- 'Tools/mavproxy_modules/**'
- 'Tools/simulink/**'
- 'Tools/vagrant/**'
# Discard python file from Tools/scripts as not used
- 'Tools/scripts/**.py'
- 'Tools/scripts/build_sizes/**'
- 'Tools/scripts/build_tests/**'
- 'Tools/scripts/CAN/**'
- 'Tools/scripts/signing/**'
# Remove autotest
- 'Tools/autotest/**'
# Remove markdown files as irrelevant
- '**.md'
# Remove dotfile at root directory
- './.dir-locals.el'
- './.dockerignore'
- './.editorconfig'
- './.flake8'
- './.gitattributes'
- './.github'
- './.gitignore'
- './.pre-commit-config.yaml'
- './.pydevproject'
- './.valgrind-suppressions'
- './.valgrindrc'
- 'Dockerfile'
- 'Vagrantfile'
- 'Makefile'
# Remove some directories check
- '.vscode/**'
- '.github/ISSUE_TEMPLATE/**'
# Remove change on other workflows
- '.github/workflows/test_environment.yml'

pull_request:
paths-ignore:
# remove other vehicles
- 'AntennaTracker/**'
- 'Blimp/**'
# remove non SITL HAL
- 'libraries/AP_HAL_ChibiOS/**'
- 'libraries/AP_HAL_ESP32/**'
# remove non SITL directories
- 'Tools/AP_Bootloader/**'
- 'Tools/AP_Periph/**'
- 'Tools/bootloaders/**'
- 'Tools/CHDK-Script/**'
- 'Tools/CodeStyle/**'
- 'Tools/completion/**'
- 'Tools/CPUInfo/**'
- 'Tools/debug/**'
- 'Tools/environment_install/**'
- 'Tools/FilterTestTool/**'
- 'Tools/Frame_params/**'
- 'Tools/geotag/**'
- 'Tools/GIT_Test/**'
- 'Tools/gittools/**'
- 'Tools/Hello/**'
- 'Tools/IO_Firmware/**'
- 'Tools/Linux_HAL_Essentials/**'
- 'Tools/LogAnalyzer/**'
- 'Tools/mavproxy_modules/**'
- 'Tools/Pozyx/**'
- 'Tools/PrintVersion.py'
- 'Tools/Replay/**'
- 'Tools/simulink/**'
- 'Tools/UDP_Proxy/**'
- 'Tools/vagrant/**'
- 'Tools/Vicon/**'
# Discard python file from Tools/scripts as not used
- 'Tools/scripts/**.py'
- 'Tools/scripts/build_sizes/**'
- 'Tools/scripts/build_tests/**'
- 'Tools/scripts/CAN/**'
- 'Tools/scripts/signing/**'
# Remove autotest
- 'Tools/autotest/**'
# Remove markdown files as irrelevant
- '**.md'
# Remove dotfile at root directory
- './.dir-locals.el'
- './.dockerignore'
- './.editorconfig'
- './.flake8'
- './.gitattributes'
- './.github'
- './.gitignore'
- './.pre-commit-config.yaml'
- './.pydevproject'
- './.valgrind-suppressions'
- './.valgrindrc'
- 'Dockerfile'
- 'Vagrantfile'
- 'Makefile'
# Remove some directories check
- '.vscode/**'
- '.github/ISSUE_TEMPLATE/**'
# Remove change on other workflows
- '.github/workflows/test_environment.yml'

workflow_dispatch:

concurrency:
group: ci-${{github.workflow}}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: 'ardupilot-qurt'

steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: Build QURT
run: |
./waf configure --board QURT
./waf copter

- name: Archive build
uses: actions/upload-artifact@v3
with:
name: qurt-binaries
path: |
build/QURT/ap_host
build/QURT/bin/arducopter
retention-days: 7
80 changes: 80 additions & 0 deletions Tools/Frame_params/ModalAI/AutonomyDevKit.parm
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# parameters for the autonomy dev kit
Copy link
Contributor

Choose a reason for hiding this comment

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

MP's parameter loader apparently can't see files below the "Frame_params" directory so perhaps we should move this up and add a prefix. E.g. "ModalAI_AutonomyDevKit.parm"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

as discussed on the call, once merged I will do a MissionPlanner PR to support this directory, like I did for quadplanes

# https://www.modalai.com/products/px4-autonomy-developer-kit

# flight modes
FLTMODE1 5
FLTMODE4 2
FLTMODE_CH 6

# enable PID logging
LOG_BITMASK 65535

# mag field varies quite a lot between batteries
ARMING_MAGTHRESH 200

# filtering
INS_GYRO_FILTER 40
INS_HNTCH_ENABLE 1
INS_HNTCH_FREQ 100
INS_HNTCH_BW 50
INS_HNTCH_HMNCS 7
INS_HNTCH_REF 1
INS_HNTCH_MODE 3
INS_HNTCH_OPTS 2

# run IMU at 2kHz
INS_GYRO_RATE 1

# a bit more agressive loiter
PILOT_SPEED_UP 500
LOIT_BRK_ACCEL 500
LOIT_BRK_JERK 1000
LOIT_BRK_DELAY 0.200000

# tuning from autotune
ATC_ACCEL_Y_MAX 46813.816406
ATC_ACCEL_R_MAX 218565.890625
ATC_ACCEL_P_MAX 220962
ATC_ANG_RLL_P 15.120497
ATC_ANG_PIT_P 15.393054
ATC_ANG_YAW_P 7.636879
ATC_RAT_RLL_P 0.038459
ATC_RAT_RLL_I 0.038459
ATC_RAT_RLL_D 0.000927
ATC_RAT_PIT_P 0.043496
ATC_RAT_PIT_I 0.043496
ATC_RAT_PIT_D 0.000934
ATC_RAT_YAW_P 0.376548
ATC_RAT_YAW_I 0.037655
ATC_RAT_YAW_FLTE 2.090602

# battery setup
BATT_LOW_VOLT 7
tridge marked this conversation as resolved.
Show resolved Hide resolved
BATT_OPTIONS 64
BATT_VOLT_PIN 1
BATT_CURR_PIN 2
BATT_VOLT_MULT 1
BATT_AMP_PERVLT 1

# 2S battery range
MOT_BAT_VOLT_MAX 8.400000
MOT_BAT_VOLT_MIN 6.600000

# quad-X
FRAME_CLASS 1

# tweak R/C inputs
RC1_MIN 1000
RC1_MAX 2000
RC1_DZ 40
RC2_MIN 1000
RC2_MAX 2000
RC2_REVERSED 1
RC3_MIN 1000
RC3_MAX 2000
RC4_MIN 1000
RC4_MAX 2000
RC4_DZ 40

# add arming on right switch
RC7_OPTION 153
9 changes: 5 additions & 4 deletions Tools/Replay/Replay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,14 +297,15 @@ bool Replay::parse_param_line(char *line, char **vname, float &value)
*/
void Replay::load_param_file(const char *pfilename)
{
FILE *f = fopen(pfilename, "r");
if (f == NULL) {
auto &fs = AP::FS();
int fd = fs.open(pfilename, O_RDONLY, true);
if (fd == -1) {
printf("Failed to open parameter file: %s\n", pfilename);
exit(1);
}
char line[100];

while (fgets(line, sizeof(line)-1, f)) {
while (fs.fgets(line, sizeof(line)-1, fd)) {
char *pname;
float value;
if (!parse_param_line(line, &pname, value)) {
Expand All @@ -316,7 +317,7 @@ void Replay::load_param_file(const char *pfilename)
u->next = user_parameters;
user_parameters = u;
}
fclose(f);
fs.close(fd);
}

Replay replay(replayvehicle);
Expand Down
18 changes: 9 additions & 9 deletions Tools/ardupilotwaf/ardupilotwaf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@
'*.cpp',
]

COMMON_VEHICLE_DEPENDENT_CAN_LIBRARIES = [
'AP_CANManager',
'AP_KDECAN',
'AP_PiccoloCAN',
'AP_PiccoloCAN/piccolo_protocol',
]

COMMON_VEHICLE_DEPENDENT_LIBRARIES = [
'AP_Airspeed',
'AP_AccelCal',
Expand All @@ -27,15 +34,13 @@
'AP_BattMonitor',
'AP_BoardConfig',
'AP_Camera',
'AP_CANManager',
'AP_Common',
'AP_Compass',
'AP_Declination',
'AP_GPS',
'AP_HAL',
'AP_HAL_Empty',
'AP_InertialSensor',
'AP_KDECAN',
'AP_Math',
'AP_Mission',
'AP_DAL',
Expand Down Expand Up @@ -74,8 +79,6 @@
'AP_SBusOut',
'AP_IOMCU',
'AP_Parachute',
'AP_PiccoloCAN',
'AP_PiccoloCAN/piccolo_protocol',
'AP_RAMTRON',
'AP_RCProtocol',
'AP_Radio',
Expand Down Expand Up @@ -249,11 +252,8 @@ def ap_get_all_libraries(bld):
def ap_common_vehicle_libraries(bld):
libraries = COMMON_VEHICLE_DEPENDENT_LIBRARIES

if bld.env.DEST_BINFMT == 'pe':
libraries += [
'AC_Fence',
'AC_AttitudeControl',
]
if bld.env.with_can or bld.env.HAL_NUM_CAN_IFACES:
libraries.extend(COMMON_VEHICLE_DEPENDENT_CAN_LIBRARIES)

return libraries

Expand Down
Loading
Loading